I've got a DVR and forgot its password. Tried to telnet it, got credentials from internet (I guess they are the same for many resellers since the manufacturer is probably the same), JTR'd password. But this has awaken my curiosity, and now I just want to mess with firmware for the fun of it. I've tried to put a custom logo since it's a really stupid one, and possibly change languages of menus so other people from my family can also operate it.

Firmware comes as a binary file. Unzipped it to 4 .img files.

  • custom-x.cramfs.img
  • logo-x.cramfs.img
  • romfs-x.cramfs.img
  • user-x.cramfs.img

I couldn't get to mount them since there was some header bytes added to those images by mkimage, as I was told by some blog posts.

file command output of one of these images (logo):

logo-x.cramfs.img: u-boot legacy uImage, linux, Linux/ARM, Standalone Program (gzip), 40960 bytes, Fri Jul  4 06:04:30 2014, Load Address: 0x00770000, Entry Point: 0x00780000, Header CRC: 0xBC5511F0, Data CRC: 0xC6BFF7D1

After stripping the 64 bytes of data with dd I can get to mount it, and access files. Stuck trying to add some garbage files just to generate a different image file. How would I proceed about repacking the mounted img after doing changes/adding files? And how should I re-add the 64 bytes of data I've stripped?

Any helpful thoughts are appreciated.


I assume you want to create squashfs images for SPI flash. First create squashfs image from your directory that want:

mksquashfs yourdir romfs.squashfs -b 64K -comp xz

Then add the header with correct start and entry points:

mkimage -A arm -O linux -C gzip -T kernel -a 0x50000 -e 0x430000 -n 'linux' -d romfs.squashfs romfs.squashfs.img 
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.