pr0v3rbs / FirmAE

Towards Large-Scale Emulation of IoT Firmware for Dynamic Analysis
MIT License
603 stars 117 forks source link

broken binwalk dependencies #47

Closed rawsample closed 1 year ago

rawsample commented 1 year ago

Hi,

The download URL of unstuff changes, it's abinwalk dependencies in 2.3.3. binwalk chose to remove it at commit 2129463a2953574542ef09495d2750e1c1e390af but FirmAE uses 2.3.3. Therefore during install.sh, binwalk's installation silently fails.

It's possible to either wait for a new binwalk release or fix the URL in install.sh with the following patch:

diff --git a/install.sh b/install.sh
index 029c768..3be3f37 100755
--- a/install.sh
+++ b/install.sh
@@ -26,6 +26,7 @@ sudo apt-get install -y busybox-static bash-static fakeroot dmsetup kpartx netca
 wget https://github.com/ReFirmLabs/binwalk/archive/refs/tags/v2.3.3.tar.gz && \
   tar -xf v2.3.3.tar.gz && \
   cd binwalk-2.3.3 && \
+  sed -i 's/sdtraces/sdtraces\/BottinHTML/g' deps.sh && \
   echo y | ./deps.sh && \
   sudo python3 setup.py install
 sudo apt-get install -y mtd-utils gzip bzip2 tar arj lhasa p7zip p7zip-full cabextract fusecram cramfsswap squashfs-tools sleuthkit default-jdk cpio lzop lzma srecord zlib1g-dev liblzma-dev liblzo2-dev unzip

It would also be nice to add support for catching errors in install.sh.

pr0v3rbs commented 1 year ago

Sorry for the lateness.

Thank you for your information!

Looks like downloading unstuff binary from an external link has a potential danger.

So static unstuff binary needs to be role-back.

Thank you.

killjoyzd commented 1 year ago

hi, I recompiled libnvram.so with mips-linux-gnu-gcc, but get error such as "Error relocating /firmadyne/libnvram_ioctl.so: __fprintf_chk: symbol not found" during emulation. How could I recompiled the library???ThankU