Windows scripts to backup/restore partitions in EDL mode (locked bootloader too)

emuzychenko

Senior Member
Mar 31, 2016
51
193
0
52
Novosibirsk
I have created a set of Windows scripts (.cmd files) to backup/restore selected partitions via emmcdl utility (a part of android-host-knife project).

Tested on RN3P but may be used with other Qualcomm-based devices.

emmcdl uses "firehose" module to interact with device's eMMC in 9008/EDL mode. With prog_emmc_firehose_8976_ddr.mbn from the "fastboot" firmware, can read/write partition table and any partition (including non-volatile ones, like modemst1/2, fsg etc.).

With this selected partition list, successfully restored phone's IMEI, MAC addresses and bootloader unlock status after accidental damaging the memory.

Can be used to create rawprogram0.xml file to flash images via MiFlash (recommended) or another Qualcomm utility.

!!! Not for beginners! If you don't know what is a "partition", "image" etc., please don't use this toolset until learning about that.
 

Attachments

Last edited:

avercros

Senior Member
Jan 4, 2012
552
109
73
29
Armenia
I'm just trying to restore all partitions on my kate variant, i wiped every partition described in this thread:

https://forum.xda-developers.com/redmi-note-3/how-to/partition-layout-snapdragon-t3530412

It was an atempt to solve a weird bug after tons of flashes, i wiped them again and tried to flash the firmware using miflash in edl mode and nothing happens, it says flash successful but the phone is stuck booting in the MI logo part with the 3 dots.

My phone has locked bootloader, also i wiped those partitions performing an unofficial unlock.

I have the qcn file for the IMEIs.

The question... how to use the file from the OP's post?

If anybody can help me it will be appreciated.

Thank you for your time.
 

pabloa2

Senior Member
Oct 19, 2016
381
325
0
I'm just trying to restore all partitions on my kate variant, i wiped every partition described in this thread:

https://forum.xda-developers.com/redmi-note-3/how-to/partition-layout-snapdragon-t3530412

It was an atempt to solve a weird bug after tons of flashes, i wiped them again and tried to flash the firmware using miflash in edl mode and nothing happens, it says flash successful but the phone is stuck booting in the MI logo part with the 3 dots.

My phone has locked bootloader, also i wiped those partitions performing an unofficial unlock.

I have the qcn file for the IMEIs.

The question... how to use the file from the OP's post?

If anybody can help me it will be appreciated.

Thank you for your time.
It can take 10-15 minutes on first boot from miflash. if the dots are animated just go make some food and wait.

also make sure you do it like this : flash global stable FASTBOOT rom in edl mode with miflash, make sure you replace bootloader before you flash with unlocked one (emmc_appsboot.mbn) then reboot to fastboot when you see "successful" msg(hold vol down and power until you see fastboot), then "fastboot flash recovery recovery_zcx.img" then "fastboot boot recovery_zcx.img" i recommend zcx because it will automatically patch dm-verity... when zcx recovery boots, reboot to system. after you boot once into miui you can flash whatever recovery you want through twrp

the names are generic make sure to name your recovery image properly...

fastboot-edl to enter edl from fastboot mode - https://drive.google.com/open?id=0B2w-p-CP_G3FM1pCcG1JT0lfRUk
fastboot rom list - http://en.miui.com/a-234.html
zcx 917 - https://drive.google.com/file/d/0B2w-p-CP_G3FcHJRVTZHSjlNU3M/view?usp=drivesdk
unlocked emmc_appsboot.mbn - https://drive.google.com/file/d/0B2w-p-CP_G3FaXVFdWp1ODJOQm8/view?usp=drivesdk
miflash 64 bit with miphone drivers - https://drive.google.com/open?id=0B2w-p-CP_G3FRHR5UEp5TUMwemM
 
Last edited:
  • Like
Reactions: avercros

avercros

Senior Member
Jan 4, 2012
552
109
73
29
Armenia
It can take 10-15 minutes on first boot from miflash. if the dots are animated just go make some food and wait.

also make sure you do it like this : flash global stable FASTBOOT rom in edl mode with miflash, make sure you replace bootloader before you flash with unlocked one (emmc_appsboot.mbn) then reboot to fastboot when you see "successful" msg(hold vol down and power until you see fastboot), then "fastboot flash recovery recovery_zcx.img" then "fastboot boot recovery_zcx.img" i recommend zcx because it will automatically patch dm-verity... when zcx recovery boots, reboot to system. after you boot once into miui you can flash whatever recovery you want through twrp

fastboot rom list - http://en.miui.com/a-234.html
zcx 917 - https://drive.google.com/file/d/0B2w-p-CP_G3FcHJRVTZHSjlNU3M/view?usp=drivesdk
unlocked emmc_appsboot.mbn - https://drive.google.com/file/d/0B2w-p-CP_G3FaXVFdWp1ODJOQm8/view?usp=drivesdk
I tried this and the phone keeps stuck in booting.

I think that the last hope for this is a full partition repair or sell it for spare parts :/
 

pabloa2

Senior Member
Oct 19, 2016
381
325
0
I tried this and the phone keeps stuck in booting.

I think that the last hope for this is a full partition repair or sell it for spare parts :/
one final thing even though i mentioned it already, you must make sure your phone has dm-verity patched before you boot if you plan on using custom recovery. if you don't use zcx to automatically patch it then you need to install something like lazy patcher before you boot miui the first time. make sure you follow directions carefully. if your phone still isnt booting after 15 minutes (yes it can take that long) then you're out of luck, but i have a strong suspicion that your phone is not bricked.... a hard bricked phone will show no signs of life whatsoever, no leds, no screen, nothing. you must use testpoint method to enter qdloader mode at that point but your phone is not hard-bricked.
 
Last edited:

avercros

Senior Member
Jan 4, 2012
552
109
73
29
Armenia
one final thing even though i mentioned it already, you must make sure your phone has dm-verity patched before you boot if you plan on using custom recovery. if you don't use zcx to automatically patch it then you need to install something like lazy patcher before you boot miui the first time. make sure you follow directions carefully. if your phone still isnt booting after 15 minutes (yes it can take that long) then you're out of luck, but i have a strong suspicion that your phone is not bricked.... a hard bricked phone will show no signs of life whatsoever, no leds, no screen, nothing. you must use testpoint method to enter qdloader mode at that point but your phone is not hard-bricked.
Not working, i've done everything following your post, my phone only shows the MI logo and now it's blinking, it does not boot.
 

ardian1899

Senior Member
Oct 26, 2012
232
20
18
I have created a set of Windows scripts (.cmd files) to backup/restore selected partitions via emmcdl utility (a part of android-host-knife project).

Tested on RN3P but may be used with other Qualcomm-based devices.

emmcdl uses "firehose" module to interact with device's eMMC in 9008/EDL mode. With prog_emmc_firehose_8976_ddr.mbn from the "fastboot" firmware, can read/write partition table and any partition (including non-volatile ones, like modemst1/2, fsg etc.).

With this selected partition list, successfully restored phone's IMEI, MAC addresses and bootloader unlock status after accidental damaging the memory.

Can be used to create rawprogram0.xml file to flash images via MiFlash (recommended) or another Qualcomm utility.

!!! Not for beginners! If you don't know what is a "partition", "image" etc., please don't use this toolset until learning about that.
Thanks for the thread..
Is there some insight to create "rawprogram0.xml" from this tool? I've try to execute it to see if there's any command list but only have "parttable.txt not found" message.
 

jineshpatel30

Senior Member
Nov 8, 2012
1,569
1,175
143
I have created a set of Windows scripts (.cmd files) to backup/restore selected partitions via emmcdl utility (a part of android-host-knife project).

Tested on RN3P but may be used with other Qualcomm-based devices.

emmcdl uses "firehose" module to interact with device's eMMC in 9008/EDL mode. With prog_emmc_firehose_8976_ddr.mbn from the "fastboot" firmware, can read/write partition table and any partition (including non-volatile ones, like modemst1/2, fsg etc.).

With this selected partition list, successfully restored phone's IMEI, MAC addresses and bootloader unlock status after accidental damaging the memory.

Can be used to create rawprogram0.xml file to flash images via MiFlash (recommended) or another Qualcomm utility.

!!! Not for beginners! If you don't know what is a "partition", "image" etc., please don't use this toolset until learning about that.
Thanks man !

This tool was a big help for my other device (LYF) based on qualcomm.

it's one of a kind..couldn't find anything similar & easy on internet.

don't know why this thread is not popular given that lot of people want the things this tool can easily do, may be they are reluctant to go over edge and try on own.

Anyway thanks a lot again & Keep good work :)
 
  • Like
Reactions: ilichva

Dbdbsss

New member
Feb 18, 2019
2
0
0
Qullcomm device

Hello sir I have erased perist on my device accidentally and my device is Redmi 4x I have tried to restore my persist partion on my device via emmcdl utility when I enter first command emmcdl -1
It's show my device port com 5 and when I entered second command
emmcdl -p COM5 -f prog_emmc_firehose_8937_ddr.mbn -e persist -o persist.img it's showing error failed to write hello response back to device and didn't receive Sahara hello packet from the device and some thing like that. the error also show when I disconnected my device from pc. Please anyone help me.thankyou
 

Black_Stark

Senior Member
Sep 24, 2012
3,481
1,010
0
GOA
Hello sir I have erased perist on my device accidentally and my device is Redmi 4x I have tried to restore my persist partion on my device via emmcdl utility when I enter first command emmcdl -1
It's show my device port com 5 and when I entered second command
emmcdl -p COM5 -f prog_emmc_firehose_8937_ddr.mbn -e persist -o persist.img it's showing error failed to write hello response back to device and didn't receive Sahara hello packet from the device and some thing like that. the error also show when I disconnected my device from pc. Please anyone help me.thankyou
Have u unlocked ur bootloader.
If yes then
Put phone in fastboot mode.
Flash persist img using fastboot command

fastboot flash persist persist.img



Or use advance twrp and flash persist.img in persist partition.
 

samtech387

New member
Aug 16, 2016
3
0
0
rawprogram0.xml

how to create a rawprogram0.xml which contains all partitions?
i am much willing to learn more about this,
feel free to message me in fb
facebook.com/samuel.tajuda