• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

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

Search This thread

RedScorpioXDA

Senior Member
Apr 6, 2012
377
251
If I want to unpack a file which is an image of the an entire eMMC module is this possible?
Men can unpack everything that is packed by another person. But this utility is for unpacking firmware files of a certain formats.
If this is a copy of eMMC, then you just need to "slice" the partitions. The utility is not designed for this
 

chinhhut

New member
Aug 25, 2019
1
0
@RedScorpioXDA thank you for great tool.
By the way, I've tried to unpack X96 x6 RK3566 under windows 10 and got the following error. Could you give me the suggestion?

mintty screen dump
$ ./imgRePackerRK.exe '/f/Rockchip tools/X96_X6_20210804-1052/X96_X6_20210804-10
52.img'

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
Ini-file created
==========================[ START ]==========================

--- Firmware unpacking ---

"RKFW" image file detected

Batch image header from "F:/Rockchip tools/X96_X6_20210804-1052/X96_X6_2
0210804-1052.img" was read
Image properties:
Type RockChip batch image ("RKFW")
Version 11.0.0
Date 2021.08.04
Time 11:12:22
ChipID 0x33353638
Code(?) 0x01060005
RKFWtype 0x00000001
Unknown_1 0x00000000

Unsupported ChipID
 

dieselnutjob

Senior Member
Jul 13, 2012
60
0
Men can unpack everything that is packed by another person. But this utility is for unpacking firmware files of a certain formats.
If this is a copy of eMMC, then you just need to "slice" the partitions. The utility is not designed for this

I tried the imgrepackerrk on Manjaro linux and with the /cid option it unpacked an RK3566 firmware file just great. Thanks!

My understanding is that the individual img files that imgrepackerrk produces are then further packed and there is a RockChip tool called afptool to pack/unpack them.

The version of afptool that I have is not able to unpack these img files.

The firmware that I am experimenting with is here


Can you comment or advise please? thanks
 

dieselnutjob

Senior Member
Jul 13, 2012
60
0
I tried the imgrepackerrk on Manjaro linux and with the /cid option it unpacked an RK3566 firmware file just great. Thanks!

My understanding is that the individual img files that imgrepackerrk produces are then further packed and there is a RockChip tool called afptool to pack/unpack them.

The version of afptool that I have is not able to unpack these img files.

The firmware that I am experimenting with is here


Can you comment or advise please? thanks

I have compared some of the .img files that imgrepackerrk extracted from the factory firmware file, with images that I made myself using dd to dump partitions from a running system to an SDcard.

Most of them appear to be the same. So they are aren't "packed". I honestly don't know what the afptool is for.

I am trying to figure out how to create a firmware image from a running system for a device for which the manufacturer has not supplied a firmware image. I would like to be able to revert it back if I ever brick it.
 

RedScorpioXDA

Senior Member
Apr 6, 2012
377
251
I am trying to figure out how to create a firmware image from a running system for a device for which the manufacturer has not supplied a firmware image. I would like to be able to revert it back if I ever brick it.
1. Extract the modified partitions from the configured device
2. Unpack the proprietary firmware (*.img)
3. Replace the necessary parts with the extracted ones (in paragraph 1)
4. Pack the firmware
 

dieselnutjob

Senior Member
Jul 13, 2012
60
0
If I open this firmware https://files.pine64.org/os/Quartz6...el-A_20210604_stock_android11_emmcboot.img.gz with rkimagerepackerrk then I get the following image files:-

MiniLoaderAll.bin
uboot.img
misc.img
dtbo.img
vbmeta.img
boot.img
recovery.img
baseparameter.img
super.img


and it gives this parameter.txt
Code:
FIRMWARE_VER: 11.0
MACHINE_MODEL: rk3566_rgo
MACHINE_ID: 007
MANUFACTURER: rockchip
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: rk3566_rgo
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
TYPE: GPT
CMDLINE:mtdparts=rk29xxnand:
[email protected](security),
[email protected](uboot),
[email protected](trust),
[email protected](misc),
[email protected](dtbo),
[email protected](vbmeta),
[email protected](boot),
[email protected](recovery),
[email protected](backup),
[email protected](cache),
[email protected](metadata),
[email protected](baseparameter),
[email protected](super),[email protected](userdata:grow)

If I burn this firmware onto a Quartz64 using RKDevTool v2.84 and then boot it up, and then reboot to Loader mode, in RKDevTool if I hit the "Dev Partition" button I get this
PHP:
Partition is gpt
NO    LBA            Size        Name
01    0x00002000    0x00002000    security
02    0x00004000    0x00002000    uboot
03    0x00006000    0x00002000    trust
04    0x00008000    0x00002000    misc
05    0x0000a000    0x00002000    dtbo
06    0x0000c000    0x00000800    vbmeta
07    0x0000c800    0x00014000    boot
08    0x00020800    0x00030000    recovery
09    0x00050800    0x000c0000    backup
10    0x00110800    0x000c0000    cache
11    0x001d0800    0x00000800    metadata
12    0x001d8800    0x00000800    baseparameter
13    0x001d9000    0x004b0000    super
14    0x00689000    0x06df2fc0    userdata

So my question is... if security, trust, backup, cache, metadata, userdata are not in the firmware, then how do they end up on the device after the firmware is applied?

If partitions are labelled in the parameter.txt file but there is no image for a partition does RKDevTool just create a new empty, formatted partition? which would make sense for userdata, cache etc.
 

Top Liked Posts