BadException / firmware-mod-kit

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

Unable to unsquashfs "failed to read data block" #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Download firmware for Huawei HG553 Vodafone modified 
http://atencionalcliente.vodafone.es/ayuda/descargas/descarga/particulares/es/AI
_VA_DD_HG553V100R001C03B038SP01.bin.html

2. Check with binwalk signatures and extract the squashfs file with "dd"

3. unsquashfs with version squashfs-2.1-r2 and the you get
.
.
.
write_file: failed to read data block 0x6b6c3c                                  

zlib::uncompress failed, unknown error -3                                       

write_file: failed to read data block 0x6b70fe                                  

zlib::uncompress failed, unknown error -3                                       

write_file: failed to read data block 0x6b715e                                  

zlib::uncompress failed, unknown error -3                                       

write_file: failed to read data block 0x6b719c                                  

zlib::uncompress failed, unknown error -3                                       

write_file: failed to read data block 0x6b71dc                                  

zlib::uncompress failed, unknown error -3                                       

write_file: failed to read data block 0x6b8109                                  

zlib::uncompress failed, unknown error -3                                       

write_file: failed to read data block 0x6b8167                                  

zlib::uncompress failed, unknown error -3                                       

write_file: failed to read data block 0x6b81f4                                  

zlib::uncompress failed, unknown error -3                                       

write_file: failed to read data block 0x6b8c75                                  

zlib::uncompress failed, unknown error -3                                       

write_file: failed to read data block 0x6b8d0b                                  

zlib::uncompress failed, unknown error -3                                       

write_file: failed to read data block 0x6b916b                                  

zlib::uncompress failed, unknown error -3                                       

write_file: failed to read data block 0x6b9456                                  

.
.
.
etc

What is the expected output? What do you see instead?

The filesystem is created but the files are empty.

What version of the product are you using? On what operating system?

I have tried with the automated scripts extract-ng.sh with the *.bin file or 
unsquashfs_all.sh *squashfs file, the don't give any error, the filesystem is 
created but is empty

Please provide any additional information below.

If you tried to unsquashfs with linux-distribution squashfs-tools the output is
.
.
.
gzip uncompress failed with error code -3                                       

Failed to write squashfs-root/etc/upnp/upnpdev.xml, skipping 
.
.
etc

I suppose its using an unknown compression, as this exceeds my knowledge I hope 
you guys can investigate and add the option to extract this kind of firmwares 
to your kit.

Best Regards

Original issue reported on code.google.com by gorilla....@gmail.com on 9 Sep 2011 at 2:23

GoogleCodeExporter commented 9 years ago
This looks like it's using some tweaked broadcom version of lzma. If I can find 
source code, I'll add it in; found a few sources, but nothing that seems to 
work properly with this firmware.

Original comment by heffne...@gmail.com on 9 Sep 2011 at 6:57

GoogleCodeExporter commented 9 years ago
Well it seems definitely this tweaked lzma compression exists not only int this 
HG553 model.

http://huaweihg612hacking.wordpress.com/2011/08/31/the-hg612-squashfs-file-syste
m/

Original comment by gorilla....@gmail.com on 10 Sep 2011 at 2:21

GoogleCodeExporter commented 9 years ago
Yes, I saw that site, but unfortunately the utilities linked to there didn't 
work on the image you posted here.

Original comment by heffne...@gmail.com on 10 Sep 2011 at 4:27

GoogleCodeExporter commented 9 years ago
Hi,

Paul, the guy who runs the blog below managed to obtain the source code for the 
HG553 toolchain.  That includes x86 binaries for mksquashfs and unsquashfs. 

http://www.sbrk.co.uk/hw553/huawei/gpl.html

Paul has promised to publish what Huawei has sent him...

Cheers

Original comment by Ballymun...@gmail.com on 18 Sep 2011 at 9:42

GoogleCodeExporter commented 9 years ago
The sources mentioned in the blog are available here:

http://forum.huawei.com/jive4/thread.jspa?threadID=324322&messageID=408081

Unfortunately there is only a compiled version of the mksquashfs tool, so 
without the sources is not gonna be easy to spot if they are using a tweaked 
lzma compression.

Original comment by gorilla....@gmail.com on 23 Sep 2011 at 2:20

GoogleCodeExporter commented 9 years ago
Pulled down the source provided on Paul's blog, unfortunately only a binary 
version of mksquashfs was included and no unsquashfs utility was present. 

Leaving this issue open in case we get more info later (may also be related to 
issue #27).

Original comment by heffne...@gmail.com on 9 Oct 2011 at 2:57

GoogleCodeExporter commented 9 years ago
Hi,

Accidentally I have stumbled upon this unsquashfs executable that is capable of 
decompressing the vodafone's firmware.

http://es.sourceforge.jp/projects/sfnet_hg55x/downloads/tools/unsquashfs/

Hope it helps.

Original comment by gorilla....@gmail.com on 3 May 2012 at 11:08

GoogleCodeExporter commented 9 years ago
Thanks! Took a look at the binary, appears legitimate and does successfully 
extract the squashfs image. Added to the FMK.

Original comment by heffne...@gmail.com on 4 May 2012 at 2:25

GoogleCodeExporter commented 9 years ago
We'll have to add some safeties if we have a binary, if you didn't already. 
Specifically for platforms on which it isn't built for. The changes are likely 
minimal, perhaps it can be recreated if anyone finds the time or impetus.

Original comment by jeremy.collake@gmail.com on 4 May 2012 at 1:47

GoogleCodeExporter commented 9 years ago
It's 32bit x86 Linux, so should run on most Linux systems. Any mac/bsd users 
will be out of luck for this one though.

The changes may be related to the wnr1000 squashfs code I also checked in; both 
the unsquashfs tools appear to be the same version (1.3), but the wnr1000 uses 
a non-standard squashfs magic.

Original comment by heffne...@gmail.com on 5 May 2012 at 12:37

GoogleCodeExporter commented 9 years ago
I was more concerned about x64 platforms and even embedded systems running ARM. 
If I take the time, I could figure this out, but given my responsibilities, 
it'd be stupid of me.

Original comment by jeremy.collake@gmail.com on 6 May 2012 at 7:55