I managed to unpack the filesystem contents of a TP-Link router .bin file using binwalk, dd and unsquashfs. The squash FS was at the end of the bin file, the part before having a relatively large lzma archive.

Now I would like to make changes to the filesystem and repack the firmware file back. How can I achieve this? How do I know whether I need to attach a checksum or similar?

This question is different from How can I put a Binwalk extracted firmware back into a .bin binary file? in that it's vendor specific, firmware-mod-kit is a not preferred option (unless it's the only one...) and it contains an extra question

  • "a TP-Link router" is not being very specific for a supposedly device-specific question. In general terms, read up on how to pack a squashfs (don't forget that the permissions need to come out right). As for a checksum, you could try without and see what happens. Hopefully you've done a flash dump before starting. Sometimes physically replacing the chip is worth the few minutes it takes. Oct 21, 2019 at 6:32
  • @ChrisStratton flash dump is for in case I mess up or what? I don't have a second chip to it with in the first place apparently. Oct 21, 2019 at 16:42


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.