[TOOL] imgRePackerRK (RockChip's firmware images unpacker/packer)

Search This thread

Soldiaz

Senior Member
Apr 3, 2011
94
5
Wow! Really awesome....

Tested with HK1 mini Android PIE firm, have some questions:

I managed to split up into bootloader.img, vendor.img...and so on but could not alter anything

Then I unpacked using imgRePackerRK.exe /2nd which results in boot.img.dump, recovery.img.dump ...BUT none unpacked SYSTEM. Only have system.img and system.img.iso

How do I edit those?

Kind regards
 

spannernick

Senior Member
Feb 7, 2010
519
124
London
I am getting a error. "Can't open file "" for reading" when I am trying to packer the img file...?
It unpacked it OK.

Code:
C:\AA MD Flashback 2018\imgRePackerRK>imgRePackerRK.exe sega_update.img.dump

        imgRepackerRK (version 1.07h_test windows)
        Rockchip firmware batch/update images unpacker/packer

        (c) RedScorpio, Moscow, 2013-2019
            [email protected]

        Detected OS:    Windows 8 Pro [build 9200] x64
        Real OS:        Windows 10 Pro [build 19042] x64
        ==========================[ START ]==========================

        --- Firmware creating ---

        - "image.cfg"  configuration file reading -
        image.cfg was read

        - "package-file" configuration file reading -
        "package-file" was read

        - "parameter" configuration file reading -
        "parameter" was read

        - Files checking -
        parameter (parameter)   checked (file size = 0x0000027c, partition size = 0x00400000)
        emulator (emulator_scd.img)     checked (file size = 0x0062f000, partition size = 0x00800000)
        data (data_no_test_sd_on.img)   checked (file size = 0x08400000, partition size = 0xfffffc00)
        backup (RESERVED)       skipped

        -- Injecting into "sega_update.img" --
        - Image header (RKFW) injecting -
        Image properties:
                Type            RockChip batch image ("RKFW")
                Version         4.4.2
                Date            2021.04.24
                Time            01:23:20
                ChipID          0x00000060
                Code(?)         0x01050000
                RKFWtype        0x00000001
                Unknown_1       0x00000000

        Image header injected

        Can't open file "" for reading

C:\AA MD Flashback 2018\imgRePackerRK>
 
Last edited:

spannernick

Senior Member
Feb 7, 2010
519
124
London
Trying it on Lunux now.
On Linux its says now... "Can't open file ".img.dump/data_no_test_sd_on.img" for reading"

Code:
[email protected]:~/AA_MD_Flashback_2018/imgRePackerRK$ sudo /home/commodoreos/AA_MD_Flashback_2018/imgRePackerRK/imgrepackerrk / rkcrc sega_update_pico.img.dump
   
    imgrepackerrk (version 1.06 linux)
    Rockchip firmware batch/update images unpacker/packer

    (c) RedScorpio, Moscow, 2013-2017
        [email protected]

    Detected OS:
    Linux Mint 20 Ulyana \n \l
    DISTRIB_ID=LinuxMint
    DISTRIB_RELEASE=20
    DISTRIB_CODENAME=ulyana
    DISTRIB_DESCRIPTION="Linux Mint 20 Ulyana"
    NAME="Linux Mint"
    VERSION="20 (Ulyana)"
    ID=linuxmint
    ID_LIKE=ubuntu
    PRETTY_NAME="Linux Mint 20"
    VERSION_ID="20"
    HOME_URL="https://www.linuxmint.com/"
    SUPPORT_URL="https://forums.linuxmint.com/"
    BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
    PRIVACY_POLICY_URL="https://www.linuxmint.com/"
    VERSION_CODENAME=ulyana
    UBUNTU_CODENAME=focal
    ==========================[ START ]==========================
   
    --- Firmware creating ---
   
    - "image.cfg"  configuration file reading -
    image.cfg was read
   
    - "package-file" configuration file reading -
    "package-file" was read
   
    - "parameter" configuration file reading -
    "parameter" was read
   
    - Files checking -
    package-file (package-file)    checked
    parameter (parameter)    checked (file size = 0x0000027c, partition size = 0x00400000)
    emulator (emulator_scd.img)    checked (file size = 0x0062f000, partition size = 0x00800000)
    data (data_no_test_sd_on.img)    checked (file size = 0x08400000, partition size = 0xfffffc00)
    backup (RESERVED)    skipped
   
    -- Injecting into "sega_update_pico.img" --
    - Image header (RKFW) injecting -
    Image properties:
        Type        RockChip batch image ("RKFW")
        Version        4.4.2
        Date        2021.04.24
        Time        17:55:09
        ChipID        0x00000060
        Code(?)        0x01050000
        RKFWtype    0x00000001
        Unknown_1    0x00000000
   
    Image header injected
   
    Can't open file ".img.dump/data_no_test_sd_on.img" for reading
[email protected]:~/AA_MD_Flashback_2018/imgRePackerRK$
 
Last edited:

spannernick

Senior Member
Feb 7, 2010
519
124
London
I got it working on 107h_test on Windows only, I forget to put in /rkaf in the commandline,, I was able to unpack it, then pack it but not on Linux Mint 20, I was able to unpack but It crashes on Linux when you try to pack it..
On Windows 10
Code:
C:\AA-MD-Flashback-2018\imgRePackerRK>imgRePackerRK.exe /rkaf sega_update.img.dump

        imgRepackerRK (version 1.07h_test windows)
        Rockchip firmware batch/update images unpacker/packer

        (c) RedScorpio, Moscow, 2013-2019
            [email protected]

        Detected OS:    Windows 8 Pro [build 9200] x64
        Real OS:        Windows 10 Pro [build 19042] x64
        ==========================[ START ]==========================

        --- Firmware creating ---

        - "image.cfg"  configuration file reading -
        image.cfg was read

        - "package-file" configuration file reading -
        "package-file" was read

        - "parameter" configuration file reading -
        "parameter" was read

        - Files checking -
        parameter (parameter)   checked (file size = 0x0000027c, partition size = 0x00400000)
        emulator (emulator_scd.img)     checked (file size = 0x0062f000, partition size = 0x00800000)
        data (data_no_test_sd_on.img)   checked (file size = 0x08400000, partition size = 0xfffffc00)
        backup (RESERVED)       skipped

        -- Injecting into "sega_update.img" --
        - update.img header (RKAF) injecting -
        Image properties:
                Type            RockChip update image ("RKAF")
                Id              "007"
                Model           "rk30sdk"
                Manufacturer    "RK30SDK"
                Version         4.4.2

        update.img header injected

        - Files injecting -
        Image files count = 4

                "sega_update.img.dump\parameter.parm"   signed
        parameter (RockChip PARM signed file)           injected
        emulator (SquashFS image)               injected
        data (ext4 image)               injected
        backup                  skipped

        - rkCRC check summ of update.img injecting -
                rkCRC   = 0x7c0f2e5f
        rkCRC check summ injected

C:\AA-MD-Flashback-2018\imgRePackerRK>

On Linux Mint 20
Code:
[email protected]:~/AA_MD_Flashback_2018/imgRePackerRK$ /home/commodoreos/AA_MD_Flashback_2018/imgRePackerRK/imgrepackerrk /rkaf sega_update.img.dump
  
    imgrepackerrk (version 1.07h_test linux)
    Rockchip firmware batch/update images unpacker/packer

    (c) RedScorpio, Moscow, 2013-2019
        [email protected]

    Detected OS:
    Linux Mint 20 Ulyana \n \l
    DISTRIB_ID=LinuxMint
    DISTRIB_RELEASE=20
    DISTRIB_CODENAME=ulyana
    DISTRIB_DESCRIPTION="Linux Mint 20 Ulyana"
    NAME="Linux Mint"
    VERSION="20 (Ulyana)"
    ID=linuxmint
    ID_LIKE=ubuntu
    PRETTY_NAME="Linux Mint 20"
    VERSION_ID="20"
    HOME_URL="https://www.linuxmint.com/"
    SUPPORT_URL="https://forums.linuxmint.com/"
    BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
    PRIVACY_POLICY_URL="https://www.linuxmint.com/"
    VERSION_CODENAME=ulyana
    UBUNTU_CODENAME=focal
    ==========================[ START ]==========================
  
    --- Firmware creating ---
  
    - "image.cfg"  configuration file reading -
    image.cfg was read
  
    - "package-file" configuration file reading -
    "package-file" was read
  
    - "parameter" configuration file reading -
    "parameter" was read
  
    - Files checking -
    package-file (package-file)    checked
    parameter (parameter)    checked (file size = 0x0000027c, partition size = 0x00400000)
    emulator (emulator_scd.img)    checked (file size = 0x0062f000, partition size = 0x00800000)
    data (data_no_test_sd_on.img)    checked (file size = 0x08400000, partition size = 0xfffffc00)
    backup (RESERVED)    skipped
  
    -- Injecting into "sega_update.img" --
    - update.img header (RKAF) injecting -
    Image properties:
        Type        RockChip update image ("RKAF")
        Id        "007"
        Model        "rk30sdk"
        Manufacturer    "RK30SDK"
        Version        4.4.2
  
    update.img header injected
  
    - Files injecting -
    Image files count = 5
  
Segmentation fault (core dumped)
[email protected]:~/AA_MD_Flashback_2018/imgRePackerRK$

The Linux version thinks there's 5 files when there are only 4 files, the Windows version say only 4 files.
 
Last edited:

zeroprobe

Senior Member
Apr 20, 2010
1,387
1,431
@RedScorpioXDA

I've unpacked H96 Max RK3566 with modified binary to bypass chip id check. If the OP wants to include a bypass option that would be cool.

Seems to work as Boot.img was extracted fine.

Image properties:
Type RockChip batch image ("RKFW")
Version 11.0.0
Date 2021.04.21
Time 21:27:07
ChipID 0x33353638
 

Top Liked Posts

Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone