Does anyone know what filetype or filesystem a router firmware file (one downloaded from manufacturer's site) is usually saved in? Is there a tool (we're not talking about archive tool like zip/7z/rar here) that I could use to unpack/properly repack the firmware file? Reason I'm asking is because I want to fiddle around with the default dyndns services in the firmware, probably add some changes to them and have my router flushed with the modified firmware. The router doesn't support custom and fancy 3rd party firmwares, hence the reason I need to mod the manufacturer's stock firmware.

EDIT -- When I posted this question, I thought the dyndns updater in the router firmware was just a simple bash script and I figured I could do some quick edit on the script but turns out that it's actually a binary app when I checked all the processes running in the router, so this question is not relevant anymore

  • 1
    There isn't really a (de facto) standard for this. Could you provide the manufacturer or, better, the model? – Bob Apr 8 '12 at 8:38
  • What's the file signature? Check with $ file downloaded_firmware.bin? – user16115 Apr 10 '12 at 22:13

What Bob said.

Also zip, 7-zip and friends may help here, because often the image file itself is compresses and sometimes format used by the image may be opened by one of the usual compression utilities.

The standard procedure to actually modify the firmware is to get all the tools needed to build the firmware, get the firmware source, change options and build the firmware yourself. This may or may not be impossible depending on the router itself. Routers often use GNU/Linux operating system and because of licensing used for it, they need to make sources for some parts of the firmware publicly available. They are often burred somewhere on manufacturer's site, although it isn't uncommon for manufacturers to violate the license and not post the sources they modified.

The exact situation depends on your router manufacturer and the model of the router.

You (often) can't simply change a value in the binary file because it's difficult to find exactly where is the value you need to change and because firmwares usually have some sort of protection system that will stop the firmware from being used if it's been modified. The main reason for that is to prevent flashing of firmwares damaged by network transit to routers and stop them from being bricked.

| improve this answer | |

The router firmware is very likely a compiled binary file - there's nothing to unpack unless you disassemble the firmware, tweak it (pretty much at assembly level) and recompile it.

If its a router with source available - for example, the WRT54GL, then its a matter of finding the source and compiling it.

I'd note though, its relatively trivial to run dynamic dns clients or write a quick and dirty dynamic dns script client side, which would be a MUCH simpler way to get what you want.

| improve this answer | |
  • At Zone Edit, where you get two zones for free, you can update an A record for a dynamic IP address using curl. You can also get the script to check for a changed public IP address by using curl icanhazip.com. – paradroid Apr 8 '12 at 9:28
  • I use a particularly hackish method, getting the ip address off my router webpage with w3m (which has the neatest web output of any cli client, grep and cut to extract the ip address, and periodically updating with wget. Its still simpler and safert that futzing with firmware ;) – Journeyman Geek Apr 8 '12 at 9:44

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.