Installing sasquatch on OSX Mojave.

Installing binwalk on OSX comes with the disadvantage that it does not include sasquatch, a modified version of squashfs-tools, that supports odd firmwares structures and file magics.

any way. i had to compile from source squashfs-tools, and patch it to generate teh sasquatch binary.

here are the instructions to pull it off:


1. install prerequisites

brew install build-essential liblzma-dev liblzo2-dev zlib1g-dev


2. download the patch to generate sasquatch:
git clone https://github.com/devttys0/sasquatch

3. Enter the directory created by the git clone:
cd sasquatch

4. get swaushfs v4.3:
wget https://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.3/squashfs4.3.tar.gz

5. extract squashfs4.3.tar.gz
tar xvzf squashfs4.3.tar.gz

6. change dir to the extracted files
cd squashfs4.3

7. download the patch to compile squashfs on OSX:
wget https://raw.githubusercontent.com/Homebrew/formula-patches/05ae0eb1/squashfs/squashfs-osx-bundle.diff

7. apply the patch for OSX
patch -p1 < ./squashfs-osx-bundle.diff

8. apply the patch to generate sasquatch
patch -p0 < ../patches/patch0.txt

9. cd squashfs-tools/

10. modify MakeFile
find the line:
CFLAGS += $(EXTRA_CFLAGS) $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 \
        -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"$(COMP_DEFAULT)\" \
        -Wall -Werror #-DSQUASHFS_TRACE
and add the flag -Wno-self-assign
it should be:
CFLAGS += $(EXTRA_CFLAGS) $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 \
        -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"$(COMP_DEFAULT)\" \
        -Wall -Werror -Wno-self-assign #-DSQUASHFS_TRACE

11. copy the file lzmalt.h from /usr/local/include to ./sasquatch/squashfs4.3/squashfs-tools/LZMA/lzmalt

12. make

13. make install


enjoy.




Comentarios