Announcement

Collapse
No announcement yet.

ResTool - tool for RK3288 resource.img un/packing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ResTool - tool for RK3288 resource.img un/packing

    Hi everyone.

    This is my first app contribution to this forum...

    Since I didn't find any windows port of a resource_tool for Rockchip resource images, and since I already develop Windows apps for a living, I decided to code the app myself.

    I also didn't find any source code for the linux version, so I based the code strictly on my observations inside a hex editor (lol). Most of the resource file structure is meaningful to me, but there are still some parts of the resource file for which I don't know why they appear like they do, and why they have values still unexplainable to me.

    Anyways, I tried to repack a few of my RK3288 resource images, and the end result was, if not exactly the same, then almost the same (like 99%) as the original resource file. There are still some testing to be done, but currently for my needs it works perfectly and without errors. I use it for overclocking CPU/GPU/RAM for my Nagrace HPH tv-box based on RK3288 platform.

    For now, the app works best if only DTB and bitmap files are inside a resource file, or only these two files are to be repacked. I still check if there are more files inside a resource file and extract them too, but it's not tested as I don't know how resource file with more than two files would look like.

    If you have any info on RK3288's resource file structure, I would be greatful.
    Also if you notice some bugs, crashes, or weird stuff going on, please report them here.
    The app is coded in .NET 2.0 as a console app. The source code is also included.

    Download links: MediaFire OR Mega
    Last edited by Burs; 03-09-2015, 06:25. Reason: Links updated!

    #2
    Originally posted by Burs View Post
    :
    source code for the linux version
    :
    https://github.com/linux-rockchip/u-...t-rk3288/tools
    (https://github.com/linux-rockchip/u-.../resource_tool)
    => https://github.com/linux-rockchip/u-boot-rockchip
    ==> https://github.com/linux-rockchip/u-...oot-rk3288.zip
    RK3288 Devices
    - Overview BOX (LINK !)
    - Overview STICK (Dongle) (LINK !)

    MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
    UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
    Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
    Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

    RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
    Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

    Comment


      #3
      Thanks for the source code links.
      I will adapt my code and post a new version soon.

      Comment


        #4
        Down below you can find new links for my ResTool v2.

        There has been a major overhaul thanks to original linux source code no_spam_for_me provided.

        Bugfixes, new internal feats, more testing done, adjustment with Rockchip's image structure, etc etc.

        The app still isn't ported 1:1, but it works perfect for packing and unpacking multiple files.

        It works for me, but if it doesn't work for you, report here what's wrong, and I'll take a look at it.

        Download links: MediaFire OR Mega

        Usage:
        ResTool.exe [-unpack resource.img] [-pack <file1 file2 fileN>]
        Example unpack: ResTool.exe -unpack resource.img
        Example pack: ResTool.exe -pack rk-kernel.dtb logo.bmp

        Enjoy!

        Comment


          #5
          Only FYI with an older 7zip (4.65) I can unpack it but with e.g. winrar 4.20 I get errors...

          BTW: do you also have the "dtc" exe for windows and how to use it at windows (maybe a link)?
          RK3288 Devices
          - Overview BOX (LINK !)
          - Overview STICK (Dongle) (LINK !)

          MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
          UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
          Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
          Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

          RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
          Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

          Comment


            #6
            Originally posted by no_spam_for_me View Post
            Only FYI with an older 7zip (4.65) I can unpack it but with e.g. winrar 4.20 I get errors...

            BTW: do you also have the "dtc" exe for windows and how to use it at windows (maybe a link)?
            WinRAR v4.20 is ancient. Please use some of the newer versions. There are tons of changes inbetween (and incompatibilities). I always pack my stuff with 7-Zip, but I release my archives in .zip format, so people can extract it without additional tools (WinXP and newer).

            Regarding Windows port of DTC command - for the life of me I can't find anywhere on the internet. I've been searching for it for the past half an hour, and I clearly remember I also had much trouble finding it the first time.

            Download links for DTC.exe: MediaFire or Mega

            Two batch scripts are included, one for compiling and one for decompiling. Just make sure your input file is named devicetree.dtb and devicetree.dts.

            For those needing to extract and repack resource.img into boot.img, I recommend to download Android Image Kitchen from XDA thread. I've tried a few of other repacking tools, and every single of them resulted in a soft-brick, even without changing a thing (just extract and immediate repack).

            Any other questions, shoot here...

            Comment


              #7
              THX
              RK3288 Devices
              - Overview BOX (LINK !)
              - Overview STICK (Dongle) (LINK !)

              MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
              UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
              Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
              Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

              RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
              Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

              Comment


                #8
                Tried the tool here and i get the following error :


                C:\>restool -unpack image.img

                ResTool v1.0 by Burs

                Analyzing 'image.img'...
                Resource file header mismatch! Not a resource file?

                Comment


                  #9
                  Originally posted by Biomecanoid View Post
                  Resource file header mismatch! Not a resource file?
                  Well... Are you sure it really is a resource file?
                  Probably not. But if you're still sure it is, send me the file, and I'll take a look at it.

                  Comment


                    #10
                    Great work here!!!!!

                    As you get more familiar with doing work with the extracted files, please keep us updated.

                    The resource.img is still new to me...and if there's something I can offer in my RK3288 ROM's that can only be done in the resource.img....I'm game to try.
                    Randy
                    Freaktab Developer, Product Reviewer, Moderator and "Flashaholic".
                    Read my BIO Here
                    Be sure to donate to support Freaktab.com. If any of my development work makes a positive difference for you, please make a donation to support future RileyROM's.
                    Donate here

                    Comment


                      #11
                      Hello,

                      Here is my image file which i used on my QPro and worked:

                      https://www.sendspace.com/file/mrv2vb

                      I was trying to fix the very slow LAN issue as suggested by mo123

                      quote:
                      "
                      Unpack and repack your resource.img with Restool to get the dts file
                      http://freaktab.com/forum/developmen...mg-un-packing=
                      Then change rx_delay = &lt;0x10&gt;; from 0x10 to 0x20 and repack everything.
                      Then flash the new resource.img to enable 1000mb/s lan.
                      "

                      Are you aware of what needs to be done in-order to fix the very slow wired Ethernet LAN ? WiFi is much faster
                      hmm maybe you can modify the firmware for me and upload it

                      Thanks

                      Comment


                        #12
                        The "image file" behind the link you provided is the whole firmware for your device.
                        If you're trying to unpack that file with ResTool, then it won't work, hence the error message.
                        Sorry but I can't download 500+ MB from that link, because of my internet data plan.
                        Either extract resource.img from that zip file and use my ResTool with it'
                        Or upload just resource.img file (~115KB) and I will edit it for you.

                        Comment


                          #13
                          There was no resource.img is the ZIP file the file contains the firmware the drivers for the computers and the instructions

                          Comment


                            #14
                            Then check the firmware folder and see if you have boot.img file. In that case the file should have the size of around 6-7MB.
                            Boot.img can also contain resources, but changing its content is a bit more complex than if it was outside the boot file.

                            Comment


                              #15
                              I will check and let you know, I just found out that the Ethernet changes mac address at every reboot how can i fix this behavior ??

                              Comment

                              Working...
                              X