Popular Posts

Friday, October 26, 2012

How to – Extract and Identify Recovery Images from (Most) Huawei Firmware

You will need -

 Install ActivePerl (Download above)


1. Double click on  ActivePerl-5.16.1.1601-MSWin32-x86-296175.msi and then ‘Run’ on the security warning (XP)



2. You should now get a ‘Preparing to install’ notification window (if your using Vista or 7 you may need to right click and run as administator)



3. After that you should see the ActivePerl welcome screen



4. Click Next and then accept the license agreement



5. You will now see the component selection screen. I don’t install the ‘Examples’ and ‘Documentation’ features but feel free to install them if you wish.




6. The next screen is for other options. Make sure that ‘Add Perl to the PATH environment variable’ and ‘Create Perl file extension association’ are both selected



7. Finally, click install.



8. If all goes well you should see the installing screen



9. Once done, click finish




Install HxD (Download above)

1. Extract the zip file to a subfolder and run setup.exe



2. Click Next



3. Accept the agreement, click next.



4. Leave the install location as default, click next.



5. Leave Start Menu folder as default, click next.



6. It’s up to you if you want to install Quicklaunch or Desktop shortcuts, click next.



7. Click install and wait until its done.



8. Optionally read the release notes and launch HxD.



Using Split Updata script (Download above)

1.  Extract JoeyJiao-split_updata.pl-a4c58db.zip to a folder on your desktop (I use JoetJiao’s version because it is customised to Huawei so will give names etc to some firmware)





2. Now with Windows XP (or at least with mine) you have to edit the split_updata.pl file or it will not work so open the file in Notepad (or Notepad 2 if you chose to install it) and edit the following -

# If a filename wasn’t specified on the commmand line then
# assume the file to be unpacked is under current directory.
my $FILENAME = undef;
if (@ARGV) {
$FILENAME = $ARGV[0];
}
else {
my @files = `ls`;
$FILENAME = $ARGV[0];
foreach (@files){
if(/updata.app/i){
$FILENAME=$_;
}
}
}




Change it to -

# If a filename wasn’t specified on the commmand line then
# assume the file to be unpacked is called “UPDATA.APP”.
my $FILENAME = undef;
if ($#ARGV == -1) {
$FILENAME = “UPDATA.APP”;
}
else {
$FILENAME = $ARGV[0];
}



3. Save and close split_updata.pl


Splitting the firmware and identifying the recovery.img

Finally we are ready to start splitting the firmware and identifying the recovery.img to flash to the phone.

1. Select the firmware archive you have downloaded, for this tutorial I’m going to use some U9200 (Ascend P1) firmware since that particular model has a problem updating to stock firmware if a custom recovery has been flashed.




2. Navigate to the ‘dload’ folder and extract the ‘UPDATE.APP’ file to the same folder you have extracted split updata to.


3. Once extracted, rename ‘UPDATE.APP’ to ‘UPDATA.APP’



4. Double click the ‘split_updata.pl’ file and you should have a command window open, like so


(with the U9200 firmware all the files will likely be labelled as unknown_file.01,02 etc. Don’t worry this is normal. With other firmware you may have some labelled as boot.img, system.img etc)

5.  Once the script has finished you will find a folder called ‘Output’ in the split_updata folder which will contain all the extracted files.




6. Look for files between 4 and 6 megabytes (4,000 – 6,000 KB approx) as these ones are likely to be the boot.img or recovery.img (there will be two) for this firmware the first two I see are ‘unknown_file.11′ and ‘unknown_file.12′ so I’ll open them with HxD like this -

Select file and right click, select Open.



Next check ‘Select program from list’



Finally choose HxD (You may need to browse and navigate to Program Files > HxD > HxD.exe) and uncheck the ‘Always use the select program box.



7. The file needs to have something like the following at the top once its opened with HxD

ANDROID!¼ÜF..€.€
8…………ð€
…€…………
omap4………..
console=ttyGS2,1
15200n8 mem=1G v
malloc=768M omap
_wdt.timer_margi
n=30 mmcparts=mm
cblk0:p15(splash
)



As you can see ‘unknown_file.11′ has it so its either the boot.img or recovery.img. Now lets check ‘unknown_file.12′



So ‘unknown_file.12′ also has the values we are looking for as luck would have it (You may need to look through more files to find them both) so 11 and 12 are the boot and recovery images.

8. Now all that’s left is to work out which is which. Luckily this is the easy part :) Just look at the file sizes ‘unknown_file.11′ is 5,514Kb and ‘unknown_file.12′ is 4,710Kb.



9. The smaller file is the boot.img and the larger or the two is the recovery.img, so just rename them.




10. You can now take the recovery.img and flash it to your phone using the tutorial here – How to – Manually flash a recovery image via ADB


1 comment:

Unknown said...

So it just flashes and goes away. The command doesn't stay open and no output folder is created.