binwalk's sasquatch file - build.sh throws 2 errors when trying to run it

838 Views Asked by At

Im trying to install binwalk. I simply followed this page: https://github.com/ReFirmLabs/binwalk/blob/master/INSTALL.md

But when trying to build sasquatch, after I installed and cloned it, when using

$ (cd sasquatch && ./build.sh) - as stated in the INSTALL.md,

What happens is that I this error:

unsquashfs.c: In function ‘read_super’:
unsquashfs.c:1835:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
 1835 |     if(swap)
      |     ^~
unsquashfs.c:1841:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
 1841 |         read_fs_bytes(fd, SQUASHFS_START, sizeof(struct squashfs_super_block),
      |         ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: unsquashfs.o] Error 1

I've no idea on what's causing them, i'd be happy to here any advice. Thanks

2

There are 2 best solutions below

1
On

This worked for me, you have to download and apply an unmerged patch, until the problem is fixed upstream: https://gist.github.com/thanoskoutr/4ea24a443879aa7fc04e075ceba6f689

0
On

The github for this project has a fix for this issue, which will likely be updated in the future since it involves grabbing an un-merged patch. You can see the document here, this is a copy of that fix:

"If a compile error occurs, you have to download and apply an unmerged patch, until the problem is fixed upstream:

# From inside the sasquatch directory
$ wget https://raw.githubusercontent.com/devttys0/sasquatch/82da12efe97a37ddcd33dba53933bc96db4d7c69/patches/patch0.txt
$ mv patch0.txt patches
$ ./build.sh

The following has been tested on Kali 2022.2 (Debian 5.17.11-1kali1) with Binwalk v2.3.3 and squashfs-tools v4.3"

This works assuming you have followed the steps to install and build sasquatch already:

# Install sasquatch to extract non-standard SquashFS images
$ sudo apt-get install zlib1g-dev liblzma-dev liblzo2-dev
$ git clone https://github.com/devttys0/sasquatch
$ (cd sasquatch && ./build.sh)