2016-04-21 329 views
2
[email protected]:~/ROUTER# binwalk new-firmware.bin 

DECIMAL  HEXADECIMAL  DESCRIPTION 
-------------------------------------------------------------------------------- 
84   0x54   uImage header, header size: 64 bytes, header CRC: 0xE52A7F50, created: 2012-02-10 07:27:12, image size: 819799 bytes, Data Address: 0x80002000, Entry Point: 0x801AC9F0, data CRC: 0x6A10D412, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "Linux Kernel Image" 
148   0x94   LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2386252 bytes 
917588  0xE0054   Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 2588426 bytes, 375 inodes, blocksize: 16384 bytes, created: 2016-02-05 02:05:56 

[email protected]:~/ROUTER# dd if=new-firmware.bin of=uboot.lzma skip=148 bs=1 
3735488+0 records in 
3735488+0 records out 
3735488 bytes (3.7 MB, 3.6 MiB) copied, 4.16712 s, 896 kB/s 

[email protected]:~/ROUTER# dd if=new-firmware.bin of=kernel.squash skip=917588 bs=1 
2818048+0 records in 
2818048+0 records out 
2818048 bytes (2.8 MB, 2.7 MiB) copied, 3.46517 s, 813 kB/s 

一切看起来到目前为止已经工作,但后来我尝试以下方法:Binwalk - 压缩的数据被损坏的/压缩的数据被损坏

[email protected]:~/ROUTER# lzma -d uboot.lzma 
lzma: uboot.lzma: Compressed data is corrupt 

[email protected]:~/ROUTER# unsquashfs kernel.squash 
Parallel unsquashfs: Using 4 processors 
lzma uncompress failed with error code 0 
read_block: failed to read block @0x277af0 
read_fragment_table: failed to read fragment table index 
FATAL ERROR:failed to read fragment table 

任何想法,为什么它会是这样吗?正如提示所说,我在Kali Linux上。也让这个

[email protected]:~/Firmware$ binwalk -e new-firmware.bin 

DECIMAL  HEXADECIMAL  DESCRIPTION 
-------------------------------------------------------------------------------- 
84   0x54   uImage header, header size: 64 bytes, header CRC: 0xE52A7F50, created: 2012-02-10 07:27:12, image size: 819799 bytes, Data Address: 0x80002000, Entry Point: 0x801AC9F0, data CRC: 0x6A10D412, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "Linux Kernel Image" 
148   0x94   LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2386252 bytes 

WARNING: Extractor.execute failed to run external extractor 'sasquatch -p 1 -le -d '%%squashfs-root%%' '%e'': [Errno 2] No such file or directory 

WARNING: Extractor.execute failed to run external extractor 'sasquatch -p 1 -be -d '%%squashfs-root%%' '%e'': [Errno 2] No such file or directory 
917588  0xE0054   Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 2588426 bytes, 375 inodes, blocksize: 16384 bytes, created: 2016-02-05 02:05:56 
+0

也许提供了尺寸,而不是补偿的数字?在这种情况下,您需要使用'skip = 84'而不是'skip = 148',这样您就可以开始使用LZMA数据... – twalberg

+0

这样做并得到了:lzma:uboot.lzma:文件格式未能识别 – pee2pee

回答

0

尝试

lzma -d <uboot.lzma> uboot 

您发现该错误是由于LZMA utils的由XV工具,其中不忽略尾随垃圾已被取代。如果你将它用作流(就像我给你的那样),最后你仍然会有腐败错误消息,但是你会得到你的文件。

Source(搜索“腐败”,你会发现其他相关的评论)