devttys0 / sasquatch

501 stars 155 forks source link

Address issue #36 #46

Open mzpqnxow opened 2 years ago

mzpqnxow commented 2 years ago

This is a tiny patch that fixes #36 with a code change

I understand that it's possible to use CFLAGS to make newer versions of gcc accept the code "as-is" but in my opinion it's better to address it this way by moving the declaration of verbose into a single .c and accessing it as an extern elsewhere.

Because verbose is only accessed directly in unsquash.c (by the command-line flag parsing code) I put it there, it seemed the most logical

For whatever reason I wasn't able to create a clean patch to your patch, so rather than replace the entire patch0.txt with the changes, I added a patch1.txt. I assume you'll want to coalesce these into one if you decide to accept this

I didn't do extensive testing on the change but it builds and functions as expected both with and without the -trace flag. I tested by building (obviously), extracting a few squashfs filesystems I had laying around and making sure the trace output showed up and there weren't any runtime symbol resolution errors

Thanks for all your work on binwalk and embedded RE in general!

mzpqnxow commented 2 years ago

Hello @devttys0 would you like to merge this or should I close it out? It's been discussed elsewhere in this repository (#36) and in binwalk (https://github.com/ReFirmLabs/binwalk/issues/588) and a few people have pasted fixes into the issues, but there hasn't been a PR or fix committed

Thanks!