Your forum username:
Do you already have an account?
Forgot your password?
  • Log in or Sign up


    Welcome to Sky User - The Unofficial Support Forum for everything Sky! - Proudly helping over 63k members.


    Advertisement

    Results 1 to 10 of 10

    Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers

    This is a discussion on Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers within the Technical discussion forums, part of the Broadband Technical Help category; I have made a small tool for editing firmware images for broadcom based routers (including images for the original Netgear ...

    1. #1
      mrmt32's Avatar
      mrmt32 is offline Sky User Member
      Exchange: West Malling
      Broadband ISP: Sky Max/Unlimited
      Router: Sagem F@ST 2504n
      Sky TV: Sky+ HD
      Join Date
      Jan 2007
      Posts
      277
      Thanks
      1
      Thanked 79 Times in 48 Posts

      Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers

      I have made a small tool for editing firmware images for broadcom based routers (including images for the original Netgear and the Sagem provided by sky).

      Code:
      ############################################
      #                                          #
      #    Broadcom Firmware Tool V1.0 Beta 1    #
      #      by mrmt32 (mrmt32@gmail.com)        #
      #         http://www.ph-mb.com             #
      #                                          #
      ############################################
      
      ======
      Disclamer
      ======
      Only use this tool if you know what you are doing! 
      By making the wrong changes to a firmware you can cause your router
      to stop booting and in some cases the only way to restore it would be to use JTAG! 
      If you do not know how to recover your router do not attempt to use this tool!
      
      =====
      What this tool can do
      =====
      @ Extract and replace the bootloader, filesystem and kernel from router firmwares.
      @ Extract the root filesystem from a firmware image to a folder on your computer.
      @ Convert between various firmware image types.
      @ Change various firmware image parameters (including the target router, allowing you to flash images not originaly 
        intended for your router.
      @ Allows you to flash a standard netgear firmware to a Sky branded DG834GT using the web interface.
        
      =====
      What this tool can't do
      =====
      @ Recompress a folder into a SquashFS filesystem image (there doesn't seem to be a reliable way of doing this in windows).
        You can however create the image in linux and insert this into a firmware.
      
      =====
      Supported Routers / Firmware types
      =====
      @ Broadcom-based Netgear router images (.img files for DG834GT, DG834PN etc.)
      @ Broadcom-based Sagem F@ST images (including images for the Sky branded Sagem F@ST)
      @ 'Standard' broadcom images (as accepted by the Broadcom CFE)
      
      =====
      How to flash a standard Netgear firmware to a sky branded DG834GT using the web interface
      =====
      1. Open the firmware in Broadcom Firmware Tool
      2. Click on the "Netgear/Sercomm" tab
      3. Edit the "Target Platform" box so it reads "DG834GT-1SKUKS" (without quotes)
      4. Edit the "Version ID" box so it reads "5713" (without quotes)
      5. Click "Save As"
      6. Select "Netgear Firmware Image (*.img)" as the save as type and save the file somewhere
      7. Use the netgear web interface to upgrade using the firmware image you just saved;
         you should no longer get an error telling you it is the wrong firmware.
         
      =====
      Credits
      =====
      @ SquashFS filesystem extraction is provided by a ported version of a linux tool I found, the source was taken from
        http://svn.gna.org/svn/openbox4/trunk/tools/nb4-unsquash/.
      @ Cygwin was used to port the above tool to windows
      Screenshot
      Download
      Attached Thumbnails Attached Thumbnails Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers-screenshot.jpg  
      Last edited by mrmt32; 21-09-09 at 10:47 PM.

    2. The Following User Says Thank You to mrmt32 For This Useful Post:

      bulanula (15-04-12)


    3. Advertisement
    4. #2
      Isitme's Avatar
      Isitme is offline Sky User Moderator
      Exchange: Bannockburn
      Broadband ISP: Sky Broadband Unlimited
      Router: Sky Hub SR102
      Sky TV: Sky+ HD
      Join Date
      Dec 2006
      Location
      Central Scotland
      Posts
      31,957
      Thanks
      50
      Thanked 1,499 Times in 1,465 Posts

      Re: Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers

      Nicely done! Maybe you would like to edit your post to indicate in large red letters that this is not for beginners and that you will not supply support to anyone who bricks their router. Unless you want to of course.

      TomD


      Please note the views and recommendations in my posts are my own and in no way reflect the views of SkyUser.


      Useful Utilites

      Inssider / TCPOptimiser /Test Socket





    5. #3
      mrmt32's Avatar
      mrmt32 is offline Sky User Member
      Exchange: West Malling
      Broadband ISP: Sky Max/Unlimited
      Router: Sagem F@ST 2504n
      Sky TV: Sky+ HD
      Join Date
      Jan 2007
      Posts
      277
      Thanks
      1
      Thanked 79 Times in 48 Posts

      Re: Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers

      Good idea, large, red lettered disclaimer added .

    6. The Following User Says Thank You to mrmt32 For This Useful Post:

      bulanula (15-04-12)

    7. #4
      bulanula's Avatar
      bulanula is offline Sky User Member
      Exchange:
      Broadband ISP: Sky Broadband Everyday Lite
      Router: Netgear V1 DG834GT
      Sky TV: Sky Basic
      Join Date
      Apr 2012
      Posts
      2
      Thanks
      3
      Thanked 0 Times in 0 Posts

      Re: Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers

      Sorry to revive this old thread but I think it would be really good if we could have the Linux program.

      I don't have a Windows machine and don't want to bother with Wine when I understand that this tool is a port of a Linux tool anyway.

      Thank you very much !

    8. #5
      mrmt32's Avatar
      mrmt32 is offline Sky User Member
      Exchange: West Malling
      Broadband ISP: Sky Max/Unlimited
      Router: Sagem F@ST 2504n
      Sky TV: Sky+ HD
      Join Date
      Jan 2007
      Posts
      277
      Thanks
      1
      Thanked 79 Times in 48 Posts

      Re: Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers

      It wasn't a port of a Linux tool (it includes a tool to extract the file system which was ported from linux, but the rest isn't). There isn't anything windows-specific in it though, so it should work for the most part in linux (you will need to download mono to run it if you don't have it already). I tried running it in ubuntu and it mostly worked (there where some graphical glitches and file system extraction doesn't work, it is easy enough to download a squashfs extractor though). Changing the target platform and version ID works fine.

    9. #6
      bulanula's Avatar
      bulanula is offline Sky User Member
      Exchange:
      Broadband ISP: Sky Broadband Everyday Lite
      Router: Netgear V1 DG834GT
      Sky TV: Sky Basic
      Join Date
      Apr 2012
      Posts
      2
      Thanks
      3
      Thanked 0 Times in 0 Posts

      Re: Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers

      Quote Originally Posted by mrmt32 View Post
      It wasn't a port of a Linux tool (it includes a tool to extract the file system which was ported from linux, but the rest isn't). There isn't anything windows-specific in it though, so it should work for the most part in linux (you will need to download mono to run it if you don't have it already). I tried running it in ubuntu and it mostly worked (there where some graphical glitches and file system extraction doesn't work, it is easy enough to download a squashfs extractor though). Changing the target platform and version ID works fine.
      Thank you for this valuable information.

      All I am interested in is the feature "
      How to flash a standard Netgear firmware to a sky branded DG834GT using the web interface". Maybe there is a simpler way of doing that in Linux ?
      Do I still need to run WINE with mono as .NET replacement ?

      Thank you !

    10. #7
      mrmt32's Avatar
      mrmt32 is offline Sky User Member
      Exchange: West Malling
      Broadband ISP: Sky Max/Unlimited
      Router: Sagem F@ST 2504n
      Sky TV: Sky+ HD
      Join Date
      Jan 2007
      Posts
      277
      Thanks
      1
      Thanked 79 Times in 48 Posts

      Re: Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers

      You don't need WINE, just mono. CLI applications are a bit like Java, they are compiled into an intermediate language, not machine code. The intermediate code is compiled at run time (on windows usually by .NET, other platforms use mono). While the .NET framework was the first implementation, it is an open format, hence mono being created. What this means is any .NET application can be used on any platform as long as it only uses the functions supported by the runtime being used (and mono supports most of them). Mono is fairly easy to install if you have a supported distro, on ubuntu all it involved was selecting it in the package manager.

      I am not sure of other ways, there are definitely linux tools around for dealing with the formats used by this router (the openwrt website would be a good place to look), but they will all be command line only and will probably require you to extract and recreate the image.

    11. The Following User Says Thank You to mrmt32 For This Useful Post:

      bulanula (17-04-12)

    12. #8
      DeclanTM's Avatar
      DeclanTM is offline Sky User Member
      Exchange: WSARD
      Broadband ISP: Sky Broadband Unlimited
      Router: Netgear DG834PN
      Sky TV: Sky+ HD 1TB
      Join Date
      Dec 2007
      Location
      Stevenston
      Posts
      39
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers

      Just noticed this handy little tool.

      I am looking to edit files in the file system of Netgear firmware. I have managed to obtain the RootFS file named rootfs.sqs.sfs.

      I am really looking for some assistance how to unpack this file, change the files I need to change and then repackage it back into a RootFS file then add it back to the GUI tool provided here and then create a new .img file to flash to the router.

      I have an installation of Ubuntu however upon looking on Google I am struggling to find how to perform this task, I am pretty good at advanced stuff but have little Linux experience.

      I look forward to any replies.

      Thanks,
      Declan
      Sky+ HD, Sky Broadband Max LLU, Netgear DG834PN

    13. #9
      mrmt32's Avatar
      mrmt32 is offline Sky User Member
      Exchange: West Malling
      Broadband ISP: Sky Max/Unlimited
      Router: Sagem F@ST 2504n
      Sky TV: Sky+ HD
      Join Date
      Jan 2007
      Posts
      277
      Thanks
      1
      Thanked 79 Times in 48 Posts

      Re: Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers

      If you just want to edit the files from a stock netgear image, it might be listed on their GPL page (GPL Open Source Code for Programmers). This includes everything you need to build images (including the linux kernel source code, so you can recompile that will different options if you wanted). The packages all need linux, but using them is fairly simple (it does require using the terminal though). Extract the package somewhere and do something like:

      sudo -s
      cd path_to_folder
      tar jxf target.tar.bz2

      // The root file system will now be in a folder called target, and can be altered before doing the next step

      ./build.sh "DG834GT_V1.03.23.img" target newimage.img
      If the version you want is not listed on that site, you can use my tool to get the root file system out. Copy the root file system image over to your ubuntu install, and use nb4-unsquashfs (you can get the source code from openbox4 - Revision 274: /trunk/tools/nb4-unsquash). To compile and get the tool you will want to do somthing like (in terminal):

      svn checkout openbox4 - Revision 274: /trunk/tools/nb4-unsquash nb4-unsquash
      cd nb4-unsquash
      make
      This will create an new folder, download the source code and compile it. The image can then be extracted by doing:
      ./nb4-unsquash path_to_rootfs_img
      This will create a folder called squashfs-root containing all of the files which then can be edited. To recreate the image after, the best bet is to try and find one of the source packages mentioned previously (it does not have to be for the same firmware version necessarily), and take the "mksquashfs" application from the tools directory. The command you need to use may depend on what router you have, for the DG834GT it is:

      ./mksquashfs path_to_extracted_fs fs.bin -noappend -be -lzma -no-fragments -noI
      The command will be listed in the build.sh file of the source code package (it can be opened in a text editor). This will create a file system image called fs.bin which can be put back into the firmware image using my tool.


      It goes without saying, that if you try this there is a good chance of bricking your router if you are not careful (there are ways of recovering them, but depending on what is wrong they can be quite difficult). As long as the bootloader (CFE) is still intact (which it should be as you are only modifying the file system) you can recover it using either a serial port (Recovering a severly bricked DG834GT / Adding a serial port) or the netgear firmware recovery tool (this is horrendously buggy, but I think there may be some alternatives if you look around). If somehow the CFE did become corrupted then the only way to recover would be JTAG (if your router has a JTAG connection, the DG834GT does but I have thankfully never had to use it).

    14. #10
      DeclanTM's Avatar
      DeclanTM is offline Sky User Member
      Exchange: WSARD
      Broadband ISP: Sky Broadband Unlimited
      Router: Netgear DG834PN
      Sky TV: Sky+ HD 1TB
      Join Date
      Dec 2007
      Location
      Stevenston
      Posts
      39
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: Firmware image editing tool for the DG834GT / Sagem F@ST / Broadcom-based routers

      Thanks, that's great.

      Managed to edit the files I needed and it's all flashed and working!

      Cheers again for the help!
      Sky+ HD, Sky Broadband Max LLU, Netgear DG834PN

     

     

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    SkyUser - Copyright © 2006-2014. SatDish and NewsreadeR | SkyUser is in no way affiliated with Sky Broadband / BSkyB
    RIPA NOTICE: NO CONSENT IS GIVEN FOR INTERCEPTION OF PAGE TRANSMISSION | SEO by vBSEO