Read a tomato backup config file

Discussion in 'Tomato Firmware' started by scrupul0us, Feb 14, 2011.

  1. scrupul0us

    scrupul0us Network Guru Member

    I'm in the process of recovering one of my routers using jtag and its been suggested that my config backup may be somewhat 'corrupted' and unusable

    Is there a way to open the file to see/retrieve settings?

    I have a vague idea how the router was configured but wireless MAC's and other settings are somewhat forgotten

    The file appears to be in a off-flavor binary format... Maybe its question better asked directly to Tomatos developer and creator?
  2. Toastman

    Toastman Super Moderator Staff Member Member

    Administration/Configuration/Download NVRAM dump will show you most of the settings. Save it - it will be a text file. The backup config file will respond to being treated as a zip file.
  3. ringer004

    ringer004 LI Guru Member

    The config file in Tomato is a gzip'ed file.

    Rename the .cfg file to a .cfg.gz file

    uncompress with gunzip (or gzip -d)

    What you have now is almost an ASCII file. In the original, the end-of-line character (0x0A) was replaced with a NULL (0x00). If you have a hex file editor you can replace the NULLs with an end-of-line char (0x0A). Once you do this, you'll be able to see all your settings with any text editor.

    I would assume the original EOL characters were replace since a real EOL character needed to be preserved (for example, in any multi-line script).
  4. scrupul0us

    scrupul0us Network Guru Member

    good looking out ringer! i was able to check the file and see where the corruption may lie; a bad init script that nuked the router to begin with

    pfew at least i have a good idea of the settings now =)
  5. ringer004

    ringer004 LI Guru Member

    Glad that seemed to work.

    Here's another suggestion. *If* you get your router running again, reset the NVRAM to the default state. Then dump the .cfg again. Do the same processing on the default setup. Compare the two files. Then the only differences will be what you need to re-configure the router.

    When I did this, the actual settings in NVRAM were not alphabetical. So I piped the config to 'sort' first for easier comparison.
  6. scrupul0us

    scrupul0us Network Guru Member

    sounds like a task np++ can handle
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice