timewall / firmware-mod-kit

Automatically exported from code.google.com/p/firmware-mod-kit
0 stars 0 forks source link

The output firmware rebuilt by the firmware-mod-kit is different from the original firmware #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. First, I used the firmware modification tool (version 0.63) to extract the 
binary of "dir600b-revb-ddwrt-webflash.bin" which was downloaded from the 
DD-WRT router database and could be correctly burn into the router model of 
D-Link DIR-600 B1/B2. The size of this binary "dir600b-revb-ddwrt-webflash.bin" 
is 3.49 MB (3,661,852 bytes)
2. Then I simply tried to use another command to rebuild the firmware of 
"dir600b-revb-ddwrt-webflash.bin" which had been extracted by the previous 
step, although the command was executed correctly and the output binary could 
be successfully generated, but the output firmware which name is 
"output-firmware.bin" was significantly different from the original firmware, 
the size of "output-firmware.bin" is 3.62 MB (3,805,240 bytes) and this output 
firmware can not be downloaded to the router of D-Link DIR-600.
3. I found that the size of "output-firmware.bin" is bigger than the original 
firmware of "dir600b-revb-ddwrt-webflash.bin", and the content of both binaries 
are totally different.

What is the expected output? What do you see instead?
[root@node 63]# ./extract_firmware.sh /v1/dir600b-revb-ddwrt-webflash.bin 
/v1/10 
 Firmware Mod Kit (extract) v0.63 beta, (c)2010 Jeremy Collake
 http://www.bitsum.com
 Checking for updates ...
./check_for_upgrade.sh: line 19: [: too many arguments
  You have the latest version of this kit.
 LINUX system detected. Compatibility ok.
 Testing file system of /v1/10 ...
 Building tools ...
 Build seems successful.
 Preparing working directory ...
 Removing any previous files ...
 Creating directories ...
 Extracting firmware
! untrx failed, trying splitter3
 Attempting squashfs 3.0 lzma ...
 Trying 'damn small' variant - used by DD-WRT v24 ...
 Firmware appears extracted correctly!
 Now make changes and run build_firmware.sh.

 [root@node 63]# ./build_firmware.sh /v1/20 /v1/10
 Firmware Mod Kit (build) v0.63, (c)2010 Jeremy Collake
 http://www.bitsum.com
 Checking for updates ...
./check_for_upgrade.sh: line 19: [: too many arguments
  You have the latest version of this kit.
 LINUX system detected. Compatibility ok.
 Testing file system of /v1/10 ...
 Building tools ...
 Build seems successful.
 Preparing output directory /v1/20 ...
 Detected linux raw type firmware.
 Building firmware from directory /v1/10 ...
 Building squashfs-lzma file system (big endian) ...
 !!! WARNING: This raw embedded linux image type is UNTESTED - added Nov 6 2010
 !!! DO NOT FLASH UNLESS YOU ARE PREPARED TO RECOVER FROM A BRICKED ROUTER
 !!! YOU HAVE BEEN WARNED AND ASSUME LIABILITY FOR DAMAGES IF YOU DO FLASH IT
 Building RAW IMAGE TYPE 3
 Firmware images built.
总计 3724
-rw-r--r-- 1 root root 3805240 02-28 16:08 output-firmware.bin
 All done!

What version of the product are you using? On what operating system?
The version of firmware downloaded from the router database is 
"dir600b-revb-ddwrt-webflash.bin"
The operating system is "Red Hat Enterprise Linux Server release 5.4 (Tikanga)"
"Linux node.com 2.6.18-164.e15"

Please provide any additional information below.

Original issue reported on code.google.com by limingge...@gmail.com on 2 Mar 2011 at 9:41

Attachments:

GoogleCodeExporter commented 9 years ago
The new extract-ng/build-ng scripts properly extract and re-build this 
firmware. However, THIS FIRMWARE IS UNTESTED, USE AT YOUR OWN RISK. More 
testing is forthcoming, but consider it very beta at this point.

Also, don't expect the re-built firmware images to be binary duplicates of the 
original. The re-built file system will likely differ (due to different flags, 
optimizations, etc), which will also cause firmware header fields to change as 
well.

Original comment by heffne...@gmail.com on 5 Sep 2011 at 4:29