PartitioningTool.py fails on 1 kb partition - Android Q&A, Help & Troubleshooting

This is my partition table as generated by gdisk
Logical sector size: 512 bytes
Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20
Partition table holds up to 32 entries
First usable sector is 34, last usable sector is 15269854
Partitions will be aligned on 2-sector boundaries
Total free space is 313196 sectors (152.9 MiB)
Code:
# Name Start (sector) End (sector) Size Size (Sectors) Partition GUID Code
1 modem 131072 262143 64 MB 131072 EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
2 sbl1 262144 263167 512KiB 1024 DEA0BA2C-CBDD-4805-B4F9-F428251C3E98
3 sbl1bak 263168 264191 512KiB 1024 DEA0BA2C-CBDD-4805-B4F9-F428251C3E98
4 aboot 264192 266239 1024KiB 2048 400FFDCD-22E0-47E7-9A23-F16ED9382388
5 abootbak 266240 268287 1024KiB 2048 400FFDCD-22E0-47E7-9A23-F16ED9382388
6 rpm 268288 269311 512KiB 1024 098DF793-D712-413D-9D4E-89D711772228
7 rpmbak 269312 270335 512KiB 1024 098DF793-D712-413D-9D4E-89D711772228
8 tz 270336 271871 768KiB 1536 A053AA7F-40B8-4B1C-BA08-2F68AC71A4F4
9 tzbak 271872 273407 768KiB 1536 A053AA7F-40B8-4B1C-BA08-2F68AC71A4F4
10 pad 273408 275455 1024KiB 2048 EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
11 modemst1 275456 278527 1.5MiB 3072 EBBEADAF-22C9-E33B-8F5D-0E81686A68CB
12 modemst2 278528 281599 1.5MiB 3072 0A288B1F-22C9-E33B-8F5D-0E81686A68CB
13 misc 281600 283647 1024KiB 2048 82ACC91F-357C-4A68-9C8F-689E1B1A23A1
14 fsc 283648 283649 1024Bytes 2 57B90A16-22C9-E33B-8F5D-0E81686A68CB
15 ssd 283650 283665 8KiB 16 2C86E742-745E-4FDD-BFD8-B6A7AC638772
16 splash 283666 304145 10MiB 20480 20117F86-E985-4357-B9EE-374BC1D8487D
17 DDR 393216 393279 32KiB 64 20A0C19C-286A-42FA-9CE7-F64C3226A794
18 fsg 393280 396351 1.5MiB 3072 638FF8E2-22C9-E33B-8F5D-0E81686A68CB
19 sec 396352 396383 16KiB 32 303E6AC3-AF15-4C54-9E9B-D9A8FBECF401
20 boot 396384 461919 32MiB 65536 20117F86-E985-4357-B9EE-374BC1D8487D
21 system 461920 4557919 2GB 4096000 97D7B011-54DA-4835-B3C4-917AD6E73D74
22 persist 4557920 4623455 32MiB 65536 6C95E238-E343-4BA8-B489-8681ED22AD0B
23 apedata 4623456 4688991 32MiB 65536 6C95E238-E343-4BA8-B489-8681ED22AD0B
24 cache 4688992 5213279 256MiB 524288 5594C694-C871-4B5F-90B1-690A6F68E0F7
25 recovery 5213280 5278815 32MiB 65536 9D72D4E4-9958-42DA-AC26-BEA7A90B0434
26 devinfo 5278816 5280863 1024KiB 2048 1B81E7E6-F50D-419B-A739-2AEEF8DA3335
27 keystore 5373952 5374975 512KiB 1024 DE7D4029-0F5B-41C8-AE7E-F6C023A02B33
28 oem 5374976 5506047 64MiB 131072 7DB6AC55-ECB5-4E02-80DA-4D335B973332
29 config 5506048 5507071 512KiB 1024 91B72D4D-71E0-4CBF-9B8E-236381CFF17A
30 userdata 5507072 15269854 4.7GiB 9762783 1B81E7E6-F50D-419B-A739-2AEEF8DA3335
My version of the tool is this
Code:
!/usr/bin/python
#===========================================================================
# This script parses "partition.xml" and creates numerous output files
# specifically, partition.bin, rawprogram.xml
# REFERENCES
# $Header: //source/qcom/qct/core/pkg/bootloaders/rel/1.2/boot_images/core/storage/tools/jsdcc/partition_load_pt/PartitioningTool.py#2 $
# $DateTime: 2012/01/12 16:00:13 $
# $Author: coresvc $
# when who what, where, why
# -------- --- -------------------------------------------------------
# 2011-03-22 ah rawprogram for GPT for 'grow' partition, since mjsdload.cmm couldn't handle big number
# 2011-03-22 ah Corrected final disk size patch (off by 1 sector), corrected GPT labels (uni-code)
# 2011-03-18 ah Fixed default bug for DISK_SIGNATURE, align_wpb -> align
# 2011-03-16 ah New DISK_SIGNATURE tag added for MBR partitions, Split partition0.bin into
# MBR0.bin and EBR0.bin, Corrected bug in backup GPT DISK patching
# 2011-03-10 ah Removes loadpt.cmm, splits partition0.bin to MBR0.bin, EBR0.bin
# 2011-03-09 ah Much more error checking, cleaner, adds "align_wpb" tag
# 2011-02-14 ah Added patching of DISK for GPT
# 2011-02-02 ah Allow MBR Type to be specified as "4C" or "0x4C"
# 2011-25-01 ah Outputs "patch.xml" as well, allows more optimal partition alignment
# 2010-12-01 ah Matching QPST, all EXT partitions 64MB aligned (configurable actually)
# More error checking, Removed CHS option, GPT output is 2 files (primary and backup)
# 2010-10-26 ah better error checking, corrected typo on physical_partition for > 0
# 2010-10-25 ah adds GPT, CFILE output, various other features
# 2010-10-08 ah released to remove compile errors of missing PERL script modules
I am purposely trying to keep my fsc partition to 1kb. I can make the change in my xml file to 2kb and the tool will continue. If I leave it at 1kb it will error out. Anyone else have this issue?

Should have held off asking. Once I found a newer version of the tool that issue is solved. Case closed.

Related

[Q] partition errors - CyberNav tablet

I'm looking for some experienced eyes to scan through the partition info of a CyberNav tablet that I've mucked up by being very stupid. The CyberNav is a cheap Chinese GPS/Android tablet. It works great, or rather worked great until I very stupidly left it attached to my computer after downloading a track of my latest dirtbiking exploits. Later that evening I decided to make another Ubuntu USB startup disk... well, you can guess the rest.
At this point, the tablet will not mount the internal "sdcard" memory. It still boots, everything works, not bricked yet. When connected to USB, it will share out this external storage just fine. It just won't mount it within Android. It reports "Preparing memory device, checking for errors." Never gets past that point. I do have a backup of the original internal sdcard contents (made that when I first got the device) and anything that was important to me. Yes, I make backups, been burned too many times. I've also managed to find a factory ROM for it and I've successfully flashed that to the device. It made no difference with the problem. I've also got a root prompt via ADB shell using psneuter.
I have a copy of parted and gdisk, though I've not tried to run them yet. In other words, it's time to start figuring out what to fix in the partition tables.
I think the problem is here:
# busybox fdisk -l /dev/block/mmcblk2p6
... Device Boot Start End Blocks Id System
/dev/block/mmcblk2p6p1 1 1017 3436381 5 Extended <<<<< HERE
/dev/block/mmcblk2p6p5 1 1017 3436379 b Win95 FAT32
Does that seem right? Am I in any danger of bricking this device if I blow away the mmcblk2p6p1 partition and/or the entire mmcblk2p6? How bad do things generally have to get in these partitions before the device bricks?
What is the best/safest way to remove this partition and if I have to blow the whole mmcblk2p6 partition away will I have to manually recreate it before rebooting?
Any advice appreciated,
David...
P.S. Here is all the hopefully relevant information I've so far managed to locate:
Cybernav Mini: CPU: IMAPX200 ARM11 800MHz, also known as YFPi08, now flashed to Android 2.2-104.
# cat /proc/partitions
Code:
major minor #blocks name
179 16 3878912 mmcblk2
179 17 4096 mmcblk2p1
179 18 8192 mmcblk2p2
179 19 153600 mmcblk2p3
179 20 1 mmcblk2p4
179 21 277760 mmcblk2p5
179 22 3435072 mmcblk2p6
# busybox fdisk -l /dev/block/mmcblk2
Code:
Disk /dev/block/mmcblk2: 3972 MB, 3972005888 bytes
1 heads, 16 sectors/track, 484864 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk2p1 9 520 4096 30 Unknown
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk2p2 521 1544 8192 31 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk2p3 1545 20744 153600 83 Linux
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk2p4 20745 484864 3712960 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk2p5 20753 55472 277760 83 Linux
/dev/block/mmcblk2p6 55481 484864 3435072 b Win95 FAT32
# busybox fdisk -l /dev/block/mmcblk2p6
Code:
Disk /dev/block/mmcblk2p6: 3517 MB, 3517513728 bytes
109 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 6758 * 512 = 3460096 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk2p6p1 1 1017 3436381 5 Extended
/dev/block/mmcblk2p6p5 1 1017 3436379 b Win95 FAT32
# cat /proc/kmsg
Code:
...
<3>[ 2.295000] imapx200_iic imapx200_iic.0: iic thread TX_ABORT occur
<3>[ 2.295000] imapx200_iic imapx200_iic.0: source is 1
<3>[ 2.295000] imapx200_iic imapx200_iic.0: slave address is 1a
<4>[ 2.300000] mmc_request bus 2 cmd 5 error -110
<4>[ 2.300000] mmc_request bus 2 cmd 5 error -110
<4>[ 2.300000] set info,open device error -939392608
<4>[ 2.305000] mmc_request bus 2 cmd 5 error -110
<3>[ 2.305000] imapx200_iic imapx200_iic.0: iic thread TX_ABORT occur
<3>[ 2.305000] imapx200_iic imapx200_iic.0: source is 1
<3>[ 2.305000] imapx200_iic imapx200_iic.0: slave address is 1a
<4>[ 2.305000] mmc_request bus 2 cmd 5 error -110
<6>[ 2.330000] mmc2: new high speed SDHC card at address 0002
<6>[ 2.330000] mmcblk2: mmc2:0002 3.69 GiB
<6>[ 2.335000] mmcblk2: p1 p2 p3 p4 < p5 p6 >
<4>[ 2.400000] custom info start sector 8182
<4>[ 2.430000] i2c-imapx200 transfer timeout
...
<6>[ 4.095000] EXT4-fs (mmcblk2p3): mounted filesystem with ordered data mode
<6>[ 4.635000] EXT4-fs (mmcblk2p5): recovery complete
<6>[ 4.645000] EXT4-fs (mmcblk2p5): mounted filesystem with ordered data mode
...
<3>[ 26.285000] FAT: invalid media value (0xa5)
<6>[ 26.285000] VFS: Can't find a valid FAT filesystem on dev mmcblk2p6.
... x3 above spaced to end of log.
dmesg:
Code:
...
<6>[ 0.295000] Imap Framebuffer Driver Initialization OK!
<4>[ 0.340000] set info,open device error -939392608
<4>[ 0.440000] set info,open device error -939392608
<4>[ 0.540000] set info,open device error -939392608
<4>[ 0.640000] set info,open device error -939392608
<4>[ 0.740000] set info,open device error -939392608
<4>[ 0.845000] set info,open device error -939392608
<6>[ 0.925000] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
...
<3>[ 96.180000] FAT: invalid media value (0xa5)
<6>[ 96.180000] VFS: Can't find a valid FAT filesystem on dev mmcblk2p6.
... x2 above
adding a little info
# /data/local/tmp/parted /dev/block/mmcblk2
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk2
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print all
print all
Model: SD (sd/mmc)
Disk /dev/block/mmcblk2: 3972MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 65.5kB 4260kB 4194kB primary
2 4260kB 12.6MB 8389kB primary
3 12.6MB 170MB 157MB primary ext4
4 170MB 3972MB 3802MB extended
5 170MB 454MB 284MB logical ext4
6 454MB 3972MB 3518MB logical
But,
# /data/local/tmp/parted /dev/block/mmcblk2p6
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk2p6
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print all
print all
Error: Can't have a partition outside the disk!
(parted)
Every command I try just reports: "Error: Can't have a partition outside the disk!"
Okay, Okay, I get it. No how do I get rid of said partition?
Back at: # /data/local/tmp/parted /dev/block/mmcblk2
(parted) check 6
check 6
Error: Could not detect file system.
(parted)
dare I go: rm 6
If I just reboot at that point, what are the odds of the bootloader just recreating this partition for me? Should I recreate the partition via parted first? Something like: mkpart logical fat32 454 3972 and then format it by Windows Computer via USB mode, or (man for parted says this is discouraged) mkpartfs logical fat32 454 3972 to let it format right away?
I guess what I'm really asking is: what are the odds of bricking it if I blow this partition away? Seem low, what with it not working properly now, but I figure I should at least make an attempt at asking before I suck it up and hit the button.
Anyone?
David...
fixed:
rm 6 and mkpartfs logical fat32 454 3972 then a reboot did the trick. I've copied all the data back and set the tablet back to where it was. All done
Only took 2 weeks of head-banging, trying to figure out the Android way. Not an easy thing, what with all the fragmentation, and it pushed my Linux skills to their limit as well. By the hour, this $100 tablet is now worth an order of magnitude more but those skills should be worth it, even if the tablet isn't.
David...

S3 LTE Partition Resizing?

I dont know about anyone else but the partition layout on the S3 LTE really bother's me it just wastes so much
has any work been done on seeing if resizing causes any problems
as im tempted to resize cache,system,hidden to pull back 1971mb of space wasted by samsung
then make a custom full odin package with the new partition sizes and flash
clearly i wouldnt be able to use standard samsung packages anymore and would have to make my own
which isnt a problem
All sizes are in true Megabyte/Gigabyte what is called Mib/Gib by people of late
to try and differentiate from the stupid ass rounding hd manufacturers started
TOMBSTONES = 256mb
CACHE = 1024mb
SYSTEM = 1536mb
HIDDEN = 560mb
Leaving 10.8GB for userdata
Im unsure what the tombstones dir is used for so i would be inclined to leave it
but cache can be dropped to 100mb if not using ota updates which i dont
system i could drop to 1024mb and be fine
i dont think hidden is used on the s3 lte
so i could pull back around 1971mb of wasted space
for userdatea with partitions like below
CACHE = 100mb
SYSTEM = 1024mb
HIDDEN = 1mb
Here's the current layout
Note it isnt even 16 fake GB
Model: MMC MAG4FB (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 4194kB 8389kB 4194kB BOTA0
2 8389kB 12.6MB 4194kB BOTA1
3 12.6MB 33.6MB 21.0MB ext4 EFS
4 33.6MB 37.7MB 4194kB m9kefs1
5 37.7MB 41.9MB 4194kB m9kefs2
6 41.9MB 46.1MB 4194kB m9kefs3
7 46.1MB 54.5MB 8389kB PARAM
8 54.5MB 62.9MB 8389kB BOOT
9 62.9MB 71.3MB 8389kB RECOVERY
10 71.3MB 164MB 92.3MB fat16 RADIO
11 164MB 432MB 268MB ext4 TOMBSTONES
12 432MB 1506MB 1074MB ext4 CACHE
13 1506MB 3116MB 1611MB ext4 SYSTEM
14 3116MB 3704MB 587MB ext4 HIDDEN
15 3704MB 3712MB 8389kB OTA
16 3712MB 15.8GB 12.0GB ext4 USERDATA
ShonkUK said:
I dont know about anyone else but the partition layout on the S3 LTE really bother's me it just wastes so much
has any work been done on seeing if resizing causes any problems
as im tempted to resize cache,system,hidden to pull back 1971mb of space wasted by samsung
then make a custom full odin package with the new partition sizes and flash
clearly i wouldnt be able to use standard samsung packages anymore and would have to make my own
which isnt a problem
All sizes are in true Megabyte/Gigabyte what is called Mib/Gib by people of late
to try and differentiate from the stupid ass rounding hd manufacturers started
TOMBSTONES = 256mb
CACHE = 1024mb
SYSTEM = 1536mb
HIDDEN = 560mb
Leaving 10.8GB for userdata
Im unsure what the tombstones dir is used for so i would be inclined to leave it
but cache can be dropped to 100mb if not using ota updates which i dont
system i could drop to 1024mb and be fine
i dont think hidden is used on the s3 lte
so i could pull back around 1971mb of wasted space
for userdatea with partitions like below
CACHE = 100mb
SYSTEM = 1024mb
HIDDEN = 1mb
Click to expand...
Click to collapse
You can do it with PIT Magic i did this before for S2 I'd like to do the same thing with s3 but i don't have the PIT file for the international version (My Phone )

cant modify ANY parttions - I want to totally ZAP the flash

I have a NOOK tablet 16GB that is somehow locked from modifying partitions
I have tried
the repart image , which has worked many times for me in the past
the AdamOutler Ubuntu Disk
formatting / wiping options in various versions of CWM and TWRP
fastboot erases
fastboot formats
dd'ing /zero to various partitions
parted
sgdisk
a zillion scripts
something at a low level is preventing modifications to the partitions
Im wasting far too much time on this , but I hate being beat (-:
I have a backup of rom and factory , and dd images of stock parttions so I am 100% comfortable with something that
will COMPLETELY ZAP the device
if I boot a known good CM10 image from SD card, it fails to boot , I was assuming if I could get a running android from the card, I'd have access to lots of tools... , but it just fails to tun CM10
any help appreciated.
Thanks
To completely zap the device, erase the partition table. That will leave you one, giant, unallocated space.
From there, you need to recreate all partitions from scratch.
You will not be able to boot without a bootable CWM SD, so have that handy.
sagirfahmid3 said:
To completely zap the device, erase the partition table. That will leave you one, giant, unallocated space.
From there, you need to recreate all partitions from scratch.
You will not be able to boot without a bootable CWM SD, so have that handy.
Click to expand...
Click to collapse
Thanks for responding, Yes, I have tried multiple ways to to zap the table and it doesnt stick.
sgdisk -Z, sgdisk -z parted,
no matter what I do the partitions remain untouched.
I reboot and it still boots into an old stock OS that has a FC shortly after startup, and the internal recovery (factory) , which I can not overwrite, gives the please restart and try again message.
hmm,
I WAS able to get a CM7 SD card image to boot and run
appears to work "normally" , but Internal storage shows as "not available" in settings
mikeataol said:
hmm,
I WAS able to get a CM7 SD card image to boot and run
appears to work "normally" , but Internal storage shows as "not available" in settings
Click to expand...
Click to collapse
You're supposed to do:
# gdisk
# o
# w
# q
That will for sure give you an empty partition table. You probably forgot to write the changes before exiting.
sagirfahmid3 said:
You're supposed to do:
# gdisk
# o
# w
# q
That will for sure give you an empty partition table. You probably forgot to write the changes before exiting.
Click to expand...
Click to collapse
Hi, no, I didnt forget to "write" after the "o"
/tmp # ./gdisk /dev/block/mmcblk0
./gdisk /dev/block/mmcblk0
GPT fdisk (gdisk) version 0.8.4
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.
Warning! Main and backup partition tables differ! Use the 'c' and 'e' options
on the recovery & transformation menu to examine the two tables.
Warning! One or more CRCs don't match. You should repair the disk!
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: damaged
****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
Command (? for help): o
o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y
y
Command (? for help): w
w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
y
OK; writing new GUID partition table (GPT) to /dev/block/mmcblk0.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
/tmp # q
/tmp #
after reboot
Command (? for help): p
p
Disk /dev/block/mmcblk0: 31105024 sectors, 14.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): CE21388C-B927-4A5C-91CE-DBD1DE4AB3BC
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 30535678
Partitions will be aligned on 256-sector boundaries
Total free space is 1285 sectors (642.5 KiB)
Number Start (sector) End (sector) Size Code Name
1 256 511 128.0 KiB 8300 xloader
2 512 1023 256.0 KiB 8300 bootloader
3 1024 31743 15.0 MiB 8300 recovery
4 32768 65535 16.0 MiB 8300 boot
5 65536 163839 48.0 MiB 8300 rom
6 163840 262143 48.0 MiB 8300 bootdata
7 262144 1019903 370.0 MiB 8300 factory
8 1019904 2273279 612.0 MiB 8300 system
9 2273280 3145727 426.0 MiB 8300 cache
10 3145728 5242879 1024.0 MiB 8300 media
11 5242880 30535639 12.1 GiB 8300 userdata
Humm...wow, that's pretty crazy. Try writing zeroes to your emmc and then retrying.
# dd if=/dev/zero of=/dev/block/mmcblk0

[Q] Extract partition / img using Qualcomm EDL mode?

Are there any tools / is it possible to download partitions (img files) from a Qualcomm device using emergency download mode? Simply boot_a / boot_b as I assume user will be encrypted.
I know there is QPST, but from hours of trying and what I have read, it seems to only support older MSM devices not newer Snapdragon? Am I wrong?
Well, if you have the firehose file for that particular soc and the rawprogram0.xml, you can. Usually the firehose file get leaked after the phone is released.
What model are you trying to work on?
HTC U19e
Snapdragon 710
outrage_uk said:
HTC U19e
Snapdragon 710
Click to expand...
Click to collapse
I found a link to a list of programmers. If you see your phone here, which I didn't (but try ctrl-f the processor, that should be in the filename, it's a good bet you'll be able to find it. As far as I know, my phone's MSM8998 does not have a leaked programmer. It's not as universally applicable as a lot of guides make it seem. If you do have the programmer and correct patches, they allow arbitrary read/write to a phone in edl mode. It's a major security backdoor, but very useful for users like us too. However, neither users like us, nor malicious agents are thought very highly of by American phone manufacturers.
Here's how to access partitions without rawprogram0.xml or patch0.xml
Hi,
If you have the correct prog_emmc_firehose_xxxx.mbn file for your QualComm SoC, you can extract the partition table and all partitions without having access to any rawprogram0.xml or patch0.xml.
The basics are in the excellent guide at https://forum.xda-developers.com/android/general/guide-how-to-dump-write-storage-t3949588
Summary:
- trigger EDL mode, which you have if your phone shows up as USB vendor 05c6, product 9008. Make sure you have "Qualcomm HS-USB QDLoader 9008" as the active driver, giving you a virtual COM port.
- use QFIL to load the prog_emmc_firehose_xxx.mbn file - chose Flat Build
- use QPST's fh_loader.exe to talk to the firehose to read or write the emmc at arbitrary sector offsets
With all that working, you can start by reading the GPT partition table, 34 sectors starting from sector 0:
"C:\Program Files (x86)\Qualcomm\QPST\bin\fh_loader.exe" --port=\\.\COM8 --search_path=C:\my\extract\path --convertprogram2read --sendimage=gpt.bin --start_sector=0 --lun=0 --num_sectors=34 --noprompt --showpercentagecomplete --zlpawarehost=1 --memoryname=emmc
Replace COM8 with whatever COM port that Qualcomm HS-USB driver providers according to Windows Device Manager, and ensure that whatever you choose as C:\my\extract\path exists.
When the tool is done, you'll have a C:\my\extract\path\gpt.bin that you can examine to get the sector offsets and counts for each of your partitions. I used Linux' gdisk for that:
$ gdisk -l gpt.bin
...
Number Start (sector) End (sector) Size Code Name
1 131072 294911 80.0 MiB 0700 modem
2 294912 296959 1024.0 KiB FFFF bluetooth
3 296960 297215 128.0 KiB A01E pmic
4 297216 297471 128.0 KiB A01E pmicbak
5 297472 297473 1024 bytes A040 limits
6 297474 299521 1024.0 KiB A01A DDR
7 299522 299777 128.0 KiB A01D sec
8 393216 393727 256.0 KiB A022 apdp
9 393728 394239 256.0 KiB A023 msadp
10 394240 394241 1024 bytes A024 dpo
11 524288 527359 1.5 MiB A02A fsg
12 655360 655361 1024 bytes A029 fsc
13 655362 655377 8.0 KiB A02C ssd
14 655378 658449 1.5 MiB A027 modemst1
15 658450 661521 1.5 MiB A028 modemst2
16 661522 663569 1024.0 KiB A012 sbl1
17 663570 665617 1024.0 KiB A012 sbl1bak
18 665618 665809 96.0 KiB A019 sdi
19 665810 667857 1024.0 KiB A016 tz
20 667858 669905 1024.0 KiB A016 tzbak
21 669906 670905 500.0 KiB A018 rpm
22 670906 671905 500.0 KiB A018 rpmbak
23 671906 672929 512.0 KiB A017 hyp
24 672930 673953 512.0 KiB A017 hypbak
25 673954 740801 32.6 MiB FFFF splash
26 786432 796671 5.0 MiB A015 aboot
27 796672 806911 5.0 MiB A015 abootbak
28 806912 937983 64.0 MiB A036 boot
29 937984 1069055 64.0 MiB A025 recovery
30 1069056 7360511 3.0 GiB A038 system
31 7471104 10616831 1.5 GiB A039 cache
32 10616832 10682367 32.0 MiB A026 persist
33 10682368 10684415 1024.0 KiB A01F misc
34 10684416 10685439 512.0 KiB A02D keystore
35 10747904 10747905 1024 bytes A021 devinfo
36 10878976 10879999 512.0 KiB FFFF config
37 10880000 61071326 23.9 GiB A03A userdata
From there, you have enough information to back up each of your partitions, write a custom recovery, etcetera.
In my case, a Gigaset ME, both the system and userdata partitions were normal, unencrypted ext4 partitions with ample opportunities for forensics and data recovery.
Needless to say, there was no need to unlock bootloaders, install custom recovery, root the phone, or whatever.

About extract HUAWEI Emui10 super. img

I read the super block from the UFS memory chip on a Huawei P30
Code:
Welcome to Medusa Pro Software version 2.1.0.
Started.
Reader #0: Generic EMV Smartcard Reader 0
Loading firmware. Please wait... Done.
Selected UFS interface.
Selected PIN - CONNECTOR socket.
Please use USB3.0 for better speed.
Connected. Reading information.
Manufacturer name: SAMSUNG
Product name: KLUDG4U1EA-B0C1
Serial Number: 365c76002705
OEM ID: SAMSUNG_OEM_ID
Page size : 4096 B
Block size : 4096 B
Block count : 31246336
Size : 119.20 GB (122056.00 MB)
AttrRefClkFreeq = 0
MaxDataInSize = 32768
MaxDataOutSize = 32768
Connect successful.
---------------------------------------------------------------
Physical partition number: 0
Block count : 1024 (0x400)
Size : 4.00 MB
Physical partition number: 1
Block count : 1024 (0x400)
Size : 4.00 MB
Physical partition number: 2
Block count : 2048 (0x800)
Size : 8.00 MB
P00: GPT (00000000, 00000080) 512 KB
P01: frp (00000080, 00000080) 512 KB
P02: persist (00000100, 00000600) 6 MB
P03: reserved1 (00000700, 00000100) 1024 KB
Physical partition number: 3
Block count : 31234048 (0x1DC9800)
Size : 119.15 GB (122008.00 MB)
P00: GPT (00000000, 00000080) 512 KB
P01: vrl (00000080, 00000080) 512 KB
P02: vrl_backup (00000100, 00000080) 512 KB
P03: modem_secure (00000180, 00000880) 8.5 MB
P04: nvme (00000A00, 00000500) 5 MB
P05: certification (00000F00, 00000100) 1024 KB
P06: oeminfo (00001000, 00006000) 96 MB
P07: secure_storage (00007000, 00002000) 32 MB
P08: modemnvm_factory (00009000, 00001000) 16 MB
P09: modemnvm_backup (0000A000, 00001000) 16 MB
P10: modemnvm_img (0000B000, 00002200) 34 MB
P11: hisee_encos (0000D200, 00000400) 4 MB
P12: veritykey (0000D600, 00000100) 1024 KB
P13: ddr_para (0000D700, 00000100) 1024 KB
P14: lowpower_para (0000D800, 00000100) 1024 KB
P15: batt_tp_para (0000D900, 00000100) 1024 KB
P16: reserved2 (0000DA00, 00001900) 25 MB
P17: splash2 (0000F300, 00005000) 80 MB
P18: bootfail_info (00014300, 00000200) 2048 KB
P19: misc (00014500, 00000200) 2048 KB
P20: dfx (00014700, 00001000) 16 MB
P21: rrecord (00015700, 00001000) 16 MB
P22: cache (00016700, 00006800) 104 MB
P23: fw_lpm3 (0001CF00, 00000100) 1024 KB
P24: reserved3 (0001D000, 00000600) 6 MB
P25: ivp (0001D600, 00000300) 3072 KB
P26: hdcp (0001D900, 00000100) 1024 KB
P27: hisee_img (0001DA00, 00000400) 4 MB
P28: hhee (0001DE00, 00000400) 4 MB
P29: hisee_fs (0001E200, 00000800) 8 MB
P30: fastboot (0001EA00, 00000C00) 12 MB
P31: vector (0001F600, 00000400) 4 MB
P32: isp_boot (0001FA00, 00000200) 2048 KB
P33: isp_firmware (0001FC00, 00000E00) 14 MB
P34: fw_hifi (00020A00, 00000C00) 12 MB
P35: teeos (00021600, 00000800) 8 MB
P36: sensorhub (00021E00, 00001000) 16 MB
P37: erecovery_kernel (00022E00, 00001800) 24 MB
P38: erecovery_ramdisk (00024600, 00002000) 32 MB
P39: erecovery_vendor (00026600, 00001000) 16 MB
P40: kernel (00027600, 00001800) 24 MB
P41: eng_system (00028E00, 00000C00) 12 MB
P42: recovery_ramdisk (00029A00, 00002000) 32 MB
P43: recovery_vendor (0002BA00, 00001000) 16 MB
P44: dts (0002CA00, 00000100) 1024 KB
P45: dto (0002CB00, 00001400) 20 MB
P46: trustfirmware (0002DF00, 00000200) 2048 KB
P47: modem_fw (0002E100, 00003800) 56 MB
P48: eng_vendor (00031900, 00000C00) 12 MB
P49: modem_patch_nv (00032500, 00000400) 4 MB
P50: modem_driver (00032900, 00001400) 20 MB
P51: reserved4 (00033D00, 00000C00) 12 MB
P52: ramdisk (00034900, 00000200) 2048 KB
P53: vbmeta_system (00034B00, 00000100) 1024 KB
P54: vbmeta_vendor (00034C00, 00000100) 1024 KB
P55: vbmeta_odm (00034D00, 00000100) 1024 KB
P56: vbmeta_cust (00034E00, 00000100) 1024 KB
P57: vbmeta_hw_product (00034F00, 00000100) 1024 KB
P58: recovery_vbmeta (00035000, 00000200) 2048 KB
P59: erecovery_vbmeta (00035200, 00000200) 2048 KB
P60: vbmeta (00035400, 00000400) 4 MB
P61: modemnvm_update (00035800, 00001000) 16 MB
P62: modemnvm_cust (00036800, 00001000) 16 MB
P63: patch (00037800, 00002000) 32 MB
P64: preas (00039800, 00012800) 296 MB
P65: preavs (0004C000, 00002000) 32 MB
[B][COLOR="Red"]P66: super (0004E000, 00160000) 5.5 GB[/COLOR][/B]
P67: version (001AE000, 00024000) 576 MB
P68: preload (001D2000, 00047800) 1144 MB
P69: userdata (00219800, 01BB0000) 110.8 GB
Backuping nvme partition...
Opening C:/Program Files/Medusa Pro Software/Backups/SAMSUNG_KLUDG4U1EA-B0C1_nvme_0xa00_0x500_11_06_2020_17_48_51.bin file...
Reading. Please wait... Done.
Elapsed time 00:00:00
SW: 2.1.0; FW: 1.00.
Backuping oeminfo partition...
Opening C:/Program Files/Medusa Pro Software/Backups/SAMSUNG_KLUDG4U1EA-B0C1_oeminfo_0x1000_0x6000_11_06_2020_17_48_51.bin file...
Reading. Please wait... Done.
Elapsed time 00:00:05
SW: 2.1.0; FW: 1.00.
---------------------------------------------------------------Searching Android build info...
Not found
---------------------------------------------------------------RPMB: Counter of the successful data write requests = 196.
Partition table has been found on device.
RPMB: Counter of the successful data write requests = 196.
Save to E:/tmp file...
Reading partition super... Done.
Reading is finished.
SW: 2.1.0; FW: 1.00.
Then I used the tool "lpunpack" to unpack super. Img, and got this
Code:
cust.img
hw_product.img
odm.img
system.img
vendor.img
Oddly, though, none of these files are in ext4 or Android Sparse:
Code:
λ file *
cust.img: data
hw_product.img: data
odm.img: data
system.img: data
vendor.img: data
I tried using the command mount under ubuntu18, but unfortunately it failed
Code:
[email protected]:~/Desktop/tmp$ sudo mount -t erofs -o loop system.img /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/loop9, missing codepage or helper program, or other error.
I've extracted using: imjtool.
http://newandroidbook.com/tools/imjtool.html
VD171 said:
I've extracted using: imjtool.
http://newandroidbook.com/tools/imjtool.html
Click to expand...
Click to collapse
I tried, and the result is the same
They are erofs partitions.

Categories

Resources