如何解压缩或挂载固件映像



我想提取我的路由器固件,并修改它。所以我使用了bitsum的固件mod工具包。似乎没有错误。我可以得到image_parts目录也有rootfs。Img(压缩图像)文件。但问题是我既不会骑,也不会解壁球。

这是提取输出:

# ./extract-ng.sh AirTies_Air5021RU_FW_1.2.0.16_FullImage.bin
Firmware Mod Kit (extract-ng) 0.69 beta, (c)2011 Craig Heffner, Jeremy Collake
http://www.bitsum.com
Scanning firmware...
DECIMAL    HEX          DESCRIPTION
-------------------------------------------------------------------------------------------------------
65228      0xFECC       Squashfs filesystem, big endian, version 2.0, size: 1369418 bytes, 382 inodes, blocksize: 65536 bytes, created: Tue May  3 13:44:22 2011
Extracting 65228 bytes of  header image at offset 0
Extracting squashfs file system at offset 65228
Extracting 160 byte footer from offset 1972107
Extracting squashfs files...
Firmware extraction successful!
Firmware parts can be found in 'fmk/*'

Mount尝试输出:

fmk# ls
image_parts  logs  rootfs
fmk# cd image_parts/
fmk/image_parts# ls
footer.img  header.img  rootfs.img
fmk/image_parts# file rootfs.img 
rootfs.img: Squashfs filesystem, big endian, version 2.0, 1369418 bytes, 382 inodes, blocksize: 65536 bytes, created: Tue May  3 13:44:22 2011
fmk/image_parts# mount rootfs.img /mnt/rootfs/ -o loop -t squashfs
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
fmk/image_parts# dmesg | tail -n 1
[24799.284066] SQUASHFS error: Can't find a SQUASHFS superblock on loop0

unsquashfs尝试输出:

fmk/image_parts# unsquashfs rootfs.img 
Reading a different endian SQUASHFS filesystem on rootfs.img
Parallel unsquashfs: Using 1 processor
336 inodes (377 blocks) to write
[=============================|                                                                                  ]  99/377  26%
gzip uncompress failed with error code -3
Failed to write squashfs-root/lib/libqueue.so, skipping
[=============================|                                                                                  ] 100/377  26%
gzip uncompress failed with error code -3
gzip uncompress failed with error code -3
gzip uncompress failed with error code -3
...

Failed to write squashfs-root/lib/modules/2.6.8.1/extra/blaa_dd.ko, skipping
[====================================|                                                                           ] 123/377  32%
gzip uncompress failed with error code -3
gzip uncompress failed with error code -3
...
Failed to write squashfs-root/webs/management/ui_password.html, skipping
[========================================================|                                                       ] 191/377  50%
gzip uncompress failed with error code -3
Failed to write squashfs-root/webs/index.html, skipping
[========================================================|                                                       ] 192/377  50%
gzip uncompress failed with error code -3
...

Failed to write squashfs-root/usr/sbin/brctl, skipping
[===============================================================================================================|] 377/377 100%
created 188 files
created 46 directories
created 52 symlinks
created 95 devices
created 1 fifos

我搜索"错误代码-3",它是Z_DATA_ERROR(数据损坏或不完整)。现在我该怎么办?

谢谢

Bcm63xx固件映像具有特殊的格式,如squashfs-lzma。我有一些工具来提取名为BCM工具的固件映像(brfwmod.exe)。它有一个名为lzma-unsquash的命令。我成功地用这些工具把它清除了。

相关内容

  • 没有找到相关文章

最新更新