yashsingh1/xdaforums huggingface dataset:
[Upgrading, Modifying and Unlocking] snam11:
if your device is supported you can do it pretty easily.

i suppose you have device drivers and a working version of androidtool.

with that tool you can retrieve the partitions address/size of them.

run the androidtool soft and connect the device (loader or maskrom mode should not matter), in advanced function menu, put 0 in start tab, 2 in count tab and press exportimage button, is gonna export in the output folder the parameter file (you can make a copy and rename it to txt).

let's say you have something like this in the parameter file:

...

0x00002000@0x00002000(uboot),

0x00004000@0x00004000(trust),

0x00002000@0x00008000(misc),

...

0x00400000@0x00098000(system),

-@0x00498000(userdata)

if you want to rip the system image you put 0x00098000 in start tab, 0x00400000 in count tab and you press again exportimage button,

once saved, rename the file to system.img.

from there you can edit the image as i told you before.

to flash back the modded partition image you can use the downoad image menu (mind you need the proper loader bin file, and the parameter file you've extracted before).

simply select the loader, the parameter, and the partitions you want to flash, than click on run button.
[Upgrading, Modifying and Unlocking] blakegriplingph:
I tried unpacking a uboot.img from an RK3326 tablet and I end up with this:

I've attached the image in question just in case.
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
Please try

https://1drv.ms/u/s!Ap…GVy-Dy2EkN7Sa?e=phz2gQ
[Upgrading, Modifying and Unlocking] blakegriplingph:
OK it worked but what do I need to do to repack just that uboot image?View attachment 6076398
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
What do you want? This is a packaged binary file
[Upgrading, Modifying and Unlocking] blakegriplingph:
I see. So you're telling me there's no need to unpack or repack it then?
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
It wasn't me who unpacked the file. Maybe it's necessary for something - I don't know
[Upgrading, Modifying and Unlocking] blakegriplingph:
I see,
[Upgrading, Modifying and Unlocking] blakegriplingph:
OK, I am getting the following error whenever I try to repack uboot using the test version you sent me:

View attachment 6078772

The current release version was able to build the uboot image but it had the "Unknown RKUboot_Hdr.SHAsize = 32. Please send mail with link..." kind of warning and as such I don't want to risk flashing that to my tablet.

The stock uboot.img has two uboot.bin files embedded twice yet if I repack it using the release version only one of them is in the img. So yea we need to get it packed properly somehow.
[Upgrading, Modifying and Unlocking] blakegriplingph:
@RedScorpioXDA Hope you don't mind if I ask, but have you taken a look at the uboot file I attached? I was able to unpack it but the latest test build only extracts one uboot.bin instance instead of two as indicated in the log. I believe there should be two uboot files within the image as with the stock uboot.img.

If you unpack the attached uboot and repack it without changing anything else, the resulting uboot img has only one uboot.bin instance; the tablet I am using needs to have the new uboot built in much the same way as the stock one.

If it helps, this one is from an RK3326 tablet.
[Upgrading, Modifying and Unlocking] fedessgl:
Hello @RedScorpioXDA I have managed to dump the uboot.img file from my RK3528 device and I'm trying to unpack it using imgRePackerRK.exe, I tried versions v1.06, v1.07 and v1.07h_test and they all result in: unsupported format. The reason for unpacking is to do the HEX editing hack to allow a full firmware dump.

I put he uboot.img file that I got using RkDumper v1.1.2.0 and run the program:

imgRePackerRK.exe uboot.img

And I get the same error. Any help would be apprecieated. Thanks!

View attachment 6093540
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
This is a very old version of the utility. Try version imgRePackerRK 1.0.7.7
[Upgrading, Modifying and Unlocking] fedessgl:
Thanks for your reply! But it stills not working...

View attachment 6093734

Those are the files "dumped" with RKdumper:

View attachment 6093735

I notice size of uboot.img is 4.096kb, like many others files. Could this be right?

When dumped with RKdumper, there was a known format for the uboot.img. (I used driver assistant v4.3 to make it work, but the same result with other versions)

Any suggestion?

View attachment 6093736
[Upgrading, Modifying and Unlocking] blakegriplingph:
Can you send me the uboot file so I can see what's wrong with it?
[Upgrading, Modifying and Unlocking] fedessgl:
Sure, here it is. Thank you and waiting your feedback!
[Upgrading, Modifying and Unlocking] blakegriplingph:
Well here's your problem:

View attachment 6093916

It does appear to be uboot based on the presence of the hex sequence 81 00 01 8B 24 00 02 8B 9F 40 40 F1 49 01 00 54, but the header is in a format imgRePackerRK doesn't understand as it's expecting uboot images to be like this:

View attachment 6093918

You could YOLO your way through and hex-edit the image as it is, but idk if the bootloader would accept that. In my case the tablet expects uboot to be in a proper format with two uboot binaries lumped together with their respective headers; if I simply hex-edit the image without taking the header into account the tablet refuses to boot and I have to flash back the stock uboot.

Anyway, is it possible to pack the images dumped with rkDumper into a singular firmware image, e.g. something that could be flashed to an SD card using Create Upgrade Disk Tool?
[Upgrading, Modifying and Unlocking] fedessgl:
Well, this looks a little bit more complicated but not impossible... What should I expect if something goes wrong? May I brick the device?

Edit: I mean, if I flash an incompatible uboot.img is there any way to revert it to the original? (the one I uploaded) and get device working as if nothing happened?

Edit2: so the steps would be:

1.- modify header (offset line 000000 to 0001f0?) as shown in yours, of uboot.img file.

2.- Unpack the modified file with imgRePackerRK

3.- modify the bytes to remove read protection

4.- repack with imgRePackerRK

5.- modify header as in my original device and flash?

Is that right?
[Upgrading, Modifying and Unlocking] blakegriplingph:
Well assuming you do have a backup of uboot, you could revive the tablet using maskrom mode by shorting two pins near the eMMC, or through a reset pin in the case of a TV box.
[Upgrading, Modifying and Unlocking] fedessgl:
It's a TV box, and has a reset button. I'm not sure how to use it to enter loader mode or maskrom mode. I believe both can be done, or at least rkdumper sometimes recognized the device as in maskrom mode, not allowing to do the dump. I couldn't find any info about this. Do you know how does it work?
[Upgrading, Modifying and Unlocking] blakegriplingph:
IIRC you can only do a ROM dump through loader mode. Maskrom mode allows you to flash images even to an otherwise dead device.
[Upgrading, Modifying and Unlocking] flubba86:
@RedScorpioXDA I can't seem to find a link to the linux version of v1.0.7.7_test, can you please provide a mirror?

Oh I just noticed its in the same .zip as the Windows version. Sorry for the confusion.
[Upgrading, Modifying and Unlocking] flubba86:
@RedScorpioXDA

I've unpacked a newer RK3566 Firmware file, using imgRePackerRk v1.0.7.7_test, it looks like its having trouble extracting the rkCRC and image.md5 content. Possibly due to the backup (RESERVED) partition at the end of the image.

2024.04.22 14:36:37 backup (RESERVED) skipped
2024.04.22 14:36:37
2024.04.22 14:36:37 - rkCRC summ of update.img checking -
2024.04.22 14:36:37 Stored rkCRC = 0x46414b52
2024.04.22 14:36:37 Calculated rkCRC = 0xc381e2be
2024.04.22 14:36:37 .ERROR. Stored and calculated rkCRC summ are not equal
2024.04.22 14:36:37
2024.04.22 14:36:37 Configuration file for RKAndroidTool v.1.xx (8-bit) created
2024.04.22 14:36:37 Configuration file for RKAndroidTool v.2.xx (16-bit) created
2024.04.22 14:36:37
2024.04.22 14:36:37 - md5 summ checking -
2024.04.22 14:36:37 MD5 summ ("../update_nowaveform.img.dump/image.md5") saved
2024.04.22 14:36:37 Stored MD5 = ""
2024.04.22 14:36:37 Calculated MD5 = "fd7c1ec8398f74e6aa7b012d5b6d24f5"
2024.04.22 14:36:37 .ERROR. Stored and calculated MD5 summ are not equal

The contents of the .dump/image.md5 file looks like garbage with a mix of ASCII words and hex binary content.

See full debug output log here: https://pastebin.com/7GJEEvgm

Original firmware file is available here: https://mirrors.lolinet.com/firmware/lenowow/Smart_Paper/SP101FU/SP101FU_S001320_240115_ROW.zip
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
This resource is not available in Russia
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
It is possible that the rkCRC calculation algorithm I use does not match the algorithm used by the manufacturer
[Upgrading, Modifying and Unlocking] fedessgl:
Here it is uploaded to forum's server. Thanks
[Upgrading, Modifying and Unlocking] flubba86:
Perhaps, but why is the image.md5 file also filled with garbage? I think there's something slightly off with the checksum and md5 locations in this file that the imgRePackerRK tool cannot yet deal with.

Update: I ran imgRePackerRK on the .dump directory to rebuild the image. The new built image is very different than the orginal. The new file is 100MB larger than the original (the original is 3.3GB, the new is 3.4GB), looking in a hexdiff, I see the RKAF headers are slightly different, and some of the sections are in a different order?
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
This is a format that is really unknown to me

Add: In general, it looks like this is a "Device tree blob DTB" and I think you can find utilities that can work with it.
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
Unfortunately, I can't research this firmware - my old computer doesn't allow me to do this because of the small memory size
[Upgrading, Modifying and Unlocking] lost101:
I'm also working with an RK3566 device. Would really appreciate it if you could do something for such newer SoC.

Stock Kernel attached.

EDIT: I just now checked the file with a hex editor and it appears empty!
[Upgrading, Modifying and Unlocking] fedessgl:
Thank you.

Will try to look for something useful. If I can provide anything to help develop the tool to make it compatible please let me know. Device has RK3528 chip
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
Working with formats that are not directly related to firmware formats (such as ext3/ext4) was not part of my plans
[Upgrading, Modifying and Unlocking] blakegriplingph:
Especially as there's tools for ext3/4/whatever filesystems anyway.
[Upgrading, Modifying and Unlocking] blakegriplingph:
You tried using this tool?

GitHub - PabloCastellano/extract-dtb: Extract device tree blobs (dtb) from kernel images

Extract device tree blobs (dtb) from kernel images - PabloCastellano/extract-dtb

github.com
[Upgrading, Modifying and Unlocking] lost101:
I've attached the uboot.img for an RK3566 tablet. It's an 'unsupported format' (File format: device tree blob DTB (43)) in imgRepackerRK. I am however able to extract the uboot.bin using dumpimage.

Also attached are some files I hope are helpful.
[Upgrading, Modifying and Unlocking] blakegriplingph:
Hope you don't mind if I ask, but it seems like something's broken with repacking RK3326 boot images. All I did was I replaced the boot logo on this thing and nothing else, and yet when I flashed it back into the tablet it's just stuck on the logo. I doubt it was secure boot as I've patched this with Magisk and/or Permissivizer with no problems.

And yes, I am using the latest imgRePackerRK_1077_test build you linked to recently.
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
Yes, I see problems. But unfortunately, I don't have any free time right now. I promise to return to research as soon as possible
[Upgrading, Modifying and Unlocking] blakegriplingph:
Sure, I can wait. I'm not in a rush anyway.
[Upgrading, Modifying and Unlocking] fedessgl:
Yes and thank you! I managed to extract 5 files, one is 00_kernel and 4 .dtb files

What would be my next step if I want to use those dtb to compile a kernel for linux? (specifically Armbian)

View attachment 6100620
[Upgrading, Modifying and Unlocking] blakegriplingph:
That I am not sure tbh.
[Upgrading, Modifying and Unlocking] razien:
Hello all, I'm also getting "unsupported format" using imgRepackerRK(version 1.0.7.7_test windows) .

Can this be solved or because this program doesn't support RK3562 from a tablet(Doogee U10), Please help, tablet is stuck in maskrom mode, can't get to loader(maybe someone know how to boot to loader on Doogee U10 tablet or maybe there's a problem on this new device), maybe I need a working bootloader and a uboot files.

D:\Users\joan\Downloads\rockchip-files\imgRePackerRK_1077_test>imgRePackerRK.exe /cid uboot.img

imgRepackerRK (version 1.0.7.7_test windows)
Rockchip firmware batch/update images unpacker/packer

(c) RedScorpio, Moscow, 2013-2024
RedScorpio.lab@gmail.com

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

--- Firmware unpacking ---

unsupported format

D:\Users\joan\Downloads\rockchip-files\imgRePackerRK_1077_test>imgRePackerRK.exe uboot.img

imgRepackerRK (version 1.0.7.7_test windows)
Rockchip firmware batch/update images unpacker/packer

(c) RedScorpio, Moscow, 2013-2024
RedScorpio.lab@gmail.com

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

--- Firmware unpacking ---

unsupported format

Attached file(s) for help unpacking.

Another thing, can this program unpack non *.img files like a *.bin file?

TIA..
[Upgrading, Modifying and Unlocking] razien:
Was able to unpack few *.img files(boot, init_boot, resource, super only) but the rest did not success unpacking due to unsupported format. Tried from other firmware i.e. Umidigi G1 Tab official but got the same results, please check. Anyone help?, THanks

View attachment 6106322

View attachment 6107186
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
These are formats that are really unknown to me
[Upgrading, Modifying and Unlocking] razien:
Can't you or anyone help me unpack the uboot.img attached on my previous message?
[Upgrading, Modifying and Unlocking] blakegriplingph:
You could try hex-patching the uboot directly by editing the offending instructions, but I can't guarantee if this will work on your end.
[Upgrading, Modifying and Unlocking] RG89:
i am looking to insert a custom boot logo on a rk3326 device (chinese projector). with the help of this forum (being a first timer) i have unpacked the firmware provided by a supplier . but i am not able to guess the location of boot image (logo) file. can you help me on this. the rom is custom and the chinese supplier say it is not possible.
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
Raztan,

I think for a partial firmware is better to use RKAndroidTool
[Upgrading, Modifying and Unlocking] Harmc0re:
Stock Firmwares?

Hi, I'm about to get a tablet with a RockChip 2918 inside. I would like to know where I could find stock firmwares in case I mess up?

I've Googled but couldn't find anything.
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
What the name of tablet?
[Upgrading, Modifying and Unlocking] Harmc0re:
It's a DIFRNCE DIT1010.

It's not listed (anymore?) on their website (difrnce.nl),

but with Google I found this productsheet (PDF) still on that website.
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
This is one of Cube U9 GT2 clones http://www.flashmyandroid.com/forum...T2-tablet-variants&p=9307&viewfull=1#post9307
[Upgrading, Modifying and Unlocking] Harmc0re:
Awesome. Great find, thanks a lot!
[Upgrading, Modifying and Unlocking] Emileh:
I have a Cube U25GT2-W. It has a Rockchip 3026

Can I use this tool? It says Unsupported ChipID when I try it, but your OP says RK30xx

Thank you in advance for the answer and for developing this tool.

It is appreciated regardless! :)
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
1. Please send link to FW, I'll check

2. Try to use /cid (don't check ChipID) key
[Upgrading, Modifying and Unlocking] Emileh:
It seems to unpack and build just fine like that! Nice!

Rom can be found here: http://pan.baidu.com/s/1Ee2cA

Unfortunately that's the only download I could find for this tablet and its in Chinese (and server in China)

but the rom works, I have flashed it
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
I checked this FW. ChipID is fake (0x33303241)
[Upgrading, Modifying and Unlocking] Emileh:
Mm ok. Hate to ask, but what does that mean? What's the purpose of having a fake ChipID?
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
:D

I don't know. Ask vendor
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
Hmmmm, I never thought about that
[Upgrading, Modifying and Unlocking] KURT.Beadles:
Hi, I*m on a windows machine and unpacked my "update.img" successfully.

Now I get a folder named "update.img.dump".

Inside this folder I have a folder named "Image" and in here I have other .img files.

Can I unpack these also? I tried but I get the following :

==========================[ START ]==========================

--- Firmware unpacking ---

2-nd layer file unpacking

ext3 image format detected

Unsupported format (ext3 image)

==========================[ STOP ]==========================

Yes I'm a total loser when it comes to these things. But how can I go on?

EDIT1 OK. To answer my own question. I mounted the .img files with Passmark OSF Mount. So I guess I just make some changes in here and then repack the image. Is this the right way to go? :rolleyes:
[Upgrading, Modifying and Unlocking] KURT.Beadles:
Hi, I mounted it. But everytime I try to add or delete something it says the disc is write protected... any idea? :rolleyes:
[Upgrading, Modifying and Unlocking] KURT.Beadles:
No, the first thing I did was to uncheck it. So it's not the reason. I'll try to install it in XP and see what happens.
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
KURT.Beadles

It is best to use native OS for changing ext3/ext4. Install any virtual machine. For example coLinux (very "light") if you have a 32-bit Windows
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
imgRePackerRK

RockChip's firmware images (*.img) unpacker/packer

New version (1.04 Windows & Linux) ready

+ "alone" PARM-signed images unpacking/packing added;

~ "alone" KRNL-signed images unpacking improved;

+ automatic correction of image size errors for some files improved;

- key /blk deleted.
[Upgrading, Modifying and Unlocking] szomi:
Thanks for this tool. It is fantastic!

Only one thing is missing :)

Extraction of ext3 image.

Are you planning to make this feature?
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
It isn't missing. It is principal position.
[Upgrading, Modifying and Unlocking] szomi:
Ok. I have no problem with linux. I can do the extraction of course. But an all in one solution would be easier.

Planning to assemble a tool for creating flashable .img from dump, but unfortunately I can't create system.img from the dump of system partition only under linux OS.

How can I find the end of the filesystem in dump?

Any idea?
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
No problem. You can read superblock (for ext3/ext4):

struct sExt4SuperBlock {
unsigned long int	s_inodes_count;
unsigned long int	s_blocks_count_lo;
unsigned long int	s_r_blocks_count_lo;
unsigned long int	s_free_blocks_count_lo;
unsigned long int	s_free_inodes_count;
unsigned long int	s_first_data_block;
unsigned long int	s_log_block_size;
unsigned long int	s_obso_log_frag_size;
unsigned long int	s_blocks_per_group;
unsigned long int	s_obso_frags_per_group;
unsigned long int	s_inodes_per_group;
unsigned long int	s_mtime;
unsigned long int	s_wtime;
unsigned short int	s_mnt_count;
unsigned short int	s_max_mnt_count;
unsigned short int	s_magic;
unsigned short int	s_state;
unsigned short int	s_errors;
unsigned short int	s_minor_rev_level;
unsigned long int	s_lastcheck;
unsigned long int	s_checkinterval;
unsigned long int	s_creator_os;
unsigned long int	s_rev_level;
unsigned short int	s_def_resuid;
unsigned short int	s_def_resgid;

unsigned long int	s_first_ino;
unsigned short int	s_inode_size;
unsigned short int	s_block_group_nr;
unsigned long int	s_feature_compat;
unsigned long int	s_feature_incompat;
unsigned long int	s_feature_ro_compat;
unsigned char	s_uuid[16];
char	s_volume_name[16];
char	s_last_mounted[64];
unsigned long int	s_algorithm_usage_bitmap;

unsigned char	s_prealloc_blocks;
unsigned char	s_prealloc_dir_blocks;
unsigned short int	s_reserved_gdt_blocks;

unsigned char	s_journal_uuid[16];
unsigned long int	s_journal_inum;
unsigned long int	s_journal_dev;
unsigned long int	s_last_orphan;
unsigned long int	s_hash_seed[4];
unsigned char	s_def_hash_version;
unsigned char	s_reserved_char_pad;
unsigned short int	s_desc_size;
unsigned long int	s_default_mount_opts;
unsigned long int	s_first_meta_bg;
unsigned long int	s_mkfs_time;
unsigned long int	s_jnl_blocks[17];

unsigned long int	s_blocks_count_hi;
unsigned long int	s_r_blocks_count_hi;
unsigned long int	s_free_blocks_count_hi;
unsigned short int	s_min_extra_isize;
unsigned short int	s_want_extra_isize;
unsigned long int	s_flags;
unsigned short int	s_raid_stride;
unsigned short int	s_mmp_interval;
unsigned long long int	s_mmp_block;
unsigned long int	s_raid_stripe_width;
unsigned char	s_log_groups_per_flex;
unsigned char	s_reserved_char_pad2;
unsigned short int	s_reserved_pad;
unsigned long long int	s_kbytes_written;
unsigned long int	s_reserved[160];
} e4sb;

printf("Size:\t\t\t%I64u", (1024 << e4sb.s_log_block_size) * (((unsigned long long int)e4sb.s_blocks_count_hi << 32) + e4sb.s_blocks_count_lo));
[Upgrading, Modifying and Unlocking] szomi:
Thanks the information.

May you can push a "system.img size fix" function into your program as an option please.

It would be very useful for me because in this case all of the function would be available in one tool.

Thanks.

Szomi
[Upgrading, Modifying and Unlocking] trichards440:
Much needed tool,.., thnkq
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
Please describe in details your wish
[Upgrading, Modifying and Unlocking] szomi:
Ok.

imgRePackerRk is able to extract different .img files (backup.img, recovery.img) even if size of image is incorrect. It can be happen if the .img is a flash dump file.

For all dump part (kernel, recovery, backup) the program is working good except for system.img.

In case the .img recognized as ext3 image I just got a message: Unsupported format.

(It is not a problem. You said ext filesystem img should be modified under linux.)

But sometimes I don't want to modify system.img only put it into the new flash image. In this case I have to get the real system.img from the dump. (cut the end of the dump which is not part of filesystem)

I want to ask you to make this feature in you program.

Ex: When the parameter of imgRePackerRk seems to be an ext3 img it should be check the size of filesystem, and cut the unnecessary part of

file.

Thanks
[Upgrading, Modifying and Unlocking] szomi:
Ok. This is not working as I thought.

Wrote a little program based on your code, and I see the size of dump is same as I got from superblock :(
[Upgrading, Modifying and Unlocking] RedScorpioXDA:
So and what conclusions? Do I need to do something?
[Upgrading, Modifying and Unlocking] szomi:
The only solution is unpacking ext filesystem dump image, and repacking into a smaller container.

I found one tool which is able to unpack and repack ext3 image under windows, but it can't handle the dump image :(

I can do it under linux of course, but many people can't.

You don't want to make the extraction of ext3 so you don't have to do anything.

May I'm going to try it, but not found good manual for ext3 yet.