Basic tips

Finding ELF format

readelf -h hotplug 

└─$ xxd -c 1 -l 6 hotplug
00000000: 7f  .
00000001: 45  E
00000002: 4c  L
00000003: 46  F
00000004: 01  .
00000005: 01  .

If the last line (the sixed byte) is 01, according to ELF format, 01 is little endian and 02 is big endian.

Create file image with rootFS from scratch

dd if=/dev/zero of=myimage.img bs=1M count=500
mkdir -p MountPoint
mkfs.ext2 myimage.img
mount -t ext2 -o loop myimage.img MountPoint

cp rootfs.tar MountPoint
cd MountPoint
tar -xvf rootfs.tar
df -h

umount MountPoint
dd if=myimage.img bs=1k | gzip -v9 > rootfs.gz

DD

To cut the "Linux kernel version 2.6.36" we need to do:

  • Get the skip offset: 3163712

  • Get the count size: 3226456 - 3163712 = 62.744

cpio unpacking

OverlayFS

sasquatch

Since file doesn't recognize it, the vendor probably used a custom SquashFS magic signature. I expect that unsquashfs is also giving you an error about not being able to find a valid superblock.

Give sasquatch a try; it's a modified version of unsquashfs that attempts to support such vendor hacks.

GDB server

Trace apps with qemu-mipsel-static

Mips binaries

Last updated

Was this helpful?