Quantcast
Viewing latest article 1
Browse Latest Browse All 2

Answer by Gilles for How can I mount this .img file and browse its contents?

The first 3856080 bytes of this file is a kernel image. After that, there is a filesystem image. The filesystem is at offset 3932160 (3856080 rounded up to the next multiple of 128kB); I found it by inspection, I don't know where the information is stored in the image (it may be related to the erase size on the intended device). The filesystem is JFFS2, which is common on such devices.

JFFS2 filesystems cannot be mounted directly on Linux, because the filesystem driver requires the filesystem to be on top of an MTD device. You can use a fake MTD device in RAM to work around this limitation. You need to extract the JFFS2 image from the boot image; it has to be an integer number of erase blocks. In a nutshell:

modprobe mtdram total_size=32768 erase_size=128
modprobe mtdblock
<FW_WRT1900AC_1.1.8.164461_prod.img tail -c +3932161 | head -c 22413312 >/dev/mtdblock0
mount -t jffs2 /dev/mtdblock0 /mnt

Alternatively, you can use the programs jffs2dump and jffs2reader from the MTD utilities.

<FW_WRT1900AC_1.1.8.164461_prod.img tail -c +3932161 | head -c 22413312 >|FW_WRT1900AC_1.1.8.164461_prod.jffs2
jffs2reader FW_WRT1900AC_1.1.8.164461_prod.jffs2 >FW_WRT1900AC_1.1.8.164461_prod.contents
jffs2reader FW_WRT1900AC_1.1.8.164461_prod.jffs2 -d /
jffs2reader FW_WRT1900AC_1.1.8.164461_prod.jffs2 -f /etc/version

Viewing latest article 1
Browse Latest Browse All 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>