Jump to content

Perl script for unpacking the 'updata.app' files.


Guest McSpoon

Recommended Posts

Guest McSpoon

I've created a simple Perl script to unpack the contents of the UPDATA.APP files. So far all of the updates that T-Mobile and Huawei have produced for the Pulse are in the form of an UPDATA.APP file and this script will extract the boot, recovery and system images from that package. This is only useful if you wish to use parts of an update to cook your own customised rom.

split_updata.pl.txt The webserver wouldn't allow me to upload a .pl script so I've given it a .txt file extension. You'll have to rename it to just split_updata.pl

Useage: perl split_updata.pl updata.app

It will extract 25 files. Some of them are obvious, like the boot and system images, but there are many I don't recognise. For the time-being I've used a .mbn file extension for the unknown files because I think they might be appsboot.mbn, oemspl.mbn, amss.mbn and such-like. If you compile the CodeAurora AOSP code you'll notice it produces appsboot.mbn and appsboothd.mbn alongside the boot and system images. I don't know what they are but they have similarities with some of the files in the UPDATA.APP package.

I don't often use Perl so I'm sure there are better ways to script this. You are more than welcome to make improvements. And it would be great if we can identify what each file does.

Note: This script will only unpack the file. Repackaging it would be very tricky because it contains checksums that would have to match.

*** UPDATE ***

There is now a much improved version of this script over in this thread. Please use that version as it's far more stable and robust. Full kudos to ZeBadger and all those involved in enhancing it.

Edited by McSpoon
Link to comment
Share on other sites

Guest McSpoon
How did you find the format of this file? Guesswork?

Yep, just guesswork from looking at it in a hex editor. I noticed many recurrences of a "HWU8220" string. Each occurrence is surrounded by 92 bytes that are almost identical except a few bytes change each time. The bytes that differ turn out to be the offset to the where an embedded file starts, and it's length. From that we can extract the files.

Each section goes like this...

Offset	Length	Description

0x00	4	Always the same identifier 0x55AA5AA5.

0x04	4	The length of this data section.

0x08	4	Always 1.

0x0C	8	The string "HWU8220" followed by 0xFF.

0x14	4	The file length.

...By this stage, we already know the length of the data section (so we can skip the rest of it and go straight to the part where the file starts) and the file length.  I haven't bothered to dissect the rest of the section.  It mostly seems to be strings containing the date, the version number, the word "INPUT" and a random length of data which I'm guessing is a checksum.

I'm certain that checksums exist because, within the file is the T-Mobile splash image you see at boot-up, and I tried changing that to a different one (as it will always be 307200 bytes in length) but it wouldn't install the update. It knew the file was inconsistent and rejected it. So we're stuck with the T-Mobile logo for now. :)

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
Guest mlove2
I've created a simple Perl script to unpack the contents of the UPDATA.APP files. So far all of the updates that T-Mobile and Huawei have produced for the Pulse are in the form of an UPDATA.APP file and this script will extract the boot, recovery and system images from that package. This is only useful if you wish to use parts of an update to cook your own customised rom.

split_updata.pl.txt The webserver wouldn't allow me to upload a .pl script so I've given it a .txt file extension. You'll have to rename it to just split_updata.pl

Useage: perl split_updata.pl updata.app

It will extract 25 files. Some of them are obvious, like the boot and system images, but there are many I don't recognise. For the time-being I've used a .mbn file extension for the unknown files because I think they might be appsboot.mbn, oemspl.mbn, amss.mbn and such-like. If you compile the CodeAurora AOSP code you'll notice it produces appsboot.mbn and appsboothd.mbn alongside the boot and system images. I don't know what they are but they have similarities with some of the files in the UPDATA.APP package.

I don't often use Perl so I'm sure there are better ways to script this. You are more than welcome to make improvements. And it would be great if we can identify what each file does.

Note: This script will only unpack the file. Repackaging it would be very tricky because it contains checksums that would have to match.

man do you have CHT8000 rom?

Link to comment
Share on other sites

  • 5 weeks later...
Guest ZeBadger

Has there been any progress on working out where the checksums are? I'm thinking of having a bash, but if anyone has any more information then that would be appreciated.

Link to comment
Share on other sites

Guest ZeBadger
Has there been any progress on working out where the checksums are? I'm thinking of having a bash, but if anyone has any more information then that would be appreciated.

Okay... I have no idea how far people have gone with all this, so I've just started from scratch.

I've dumped the december update using this script.

boot.img contains a ROMFS file and a CPIO image of the filesystem.

recovery.img contains an identical ROMFS file and a CPIO image of the filesystem with a few more bits and bobs.

I have found the checksums for these files in the UPDATA.APP file. eg "18 89 db e0" is the boot CPIO image checksum (reversed) and is at offset 0145c38A

Is this of any use to anyone? Got to go to bed, but I can work on adding more to the file format tomorrow. I'm guessing that we can remove that horrible pink t-mobile logo :)

ZeBadger

PS Checksum of the dumped splash image is : 69FD5EC9 (C9 5E FD 69 reversed), in both the UPDATA.APP files I've looked at, but I can't find it in the UPDATA.APP file :)

Edited by ZeBadger
Link to comment
Share on other sites

Guest ZeBadger
I have found the checksums for these files in the UPDATA.APP file. eg "18 89 db e0" is the boot CPIO image checksum (reversed) and is at offset 0145c38A

Okay, while getting ready for work this morning I've realised that these CRCs are part of the gzip in the img files and not part of the UPDATA.APP file. I'll keep working on it!

Link to comment
Share on other sites

  • 2 months later...
Guest DanWilson
Hi,

This script is not working correctly to me, is there is any other tool to extract UPDATE.APP...

Thanks in Advance....:D

Yes, the new script. It's in the "Repacking UPDATA.APP" thread...

Link to comment
Share on other sites

Guest sreeramu
Yes, the new script. It's in the "Repacking UPDATA.APP" thread...

Thanks for your replay......i will check that post......

Edited by sreeramu
Link to comment
Share on other sites

Guest DanWilson
Thanks for your replay......i will check that post......

Wait - do you have a Pulse or an HTC Touch 3G (whatever that is)?

This only works for T-Mobile Pulse UPDATA.APP's.

Link to comment
Share on other sites

Guest sreeramu
I've also produced a windows program which will extract the contents of UPDATA.APPs, but it has the same restrictions as the perl script.

Can i Know the Restriction ... in the latest perl script we need linux system ....

what is the restriction you are telling about....

Link to comment
Share on other sites

Guest ZeBadger
Can i Know the Restriction ... in the latest perl script we need linux system ....

what is the restriction you are telling about....

Won't it work with ActivePerl for Windows?

Link to comment
Share on other sites

Guest Speckles
Can i Know the Restriction ... in the latest perl script we need linux system ....

what is the restriction you are telling about....

As stated above - It will only work for T-Mobile Pulse UPDATA.APP's.
Link to comment
Share on other sites

Guest Tomas.S

Hello there! I'm looking for the boot.img of my phone, bacause I'va flashed the boot image with a wrong one (I have U8220-6), so what I did is download my rom and unzip it.

Inside there was the UPDATA.APP so I used your script. I have extracted the files successfully. But the problem is here: The boot.img is only 40 B. I tried to flash it but it is too small (it should be around 1 MB).

Maybe one of the other files is the boot image. Do you know something?

Thanks!

Link to comment
Share on other sites

Guest ZeBadger
Hello there! I'm looking for the boot.img of my phone, bacause I'va flashed the boot image with a wrong one (I have U8220-6), so what I did is download my rom and unzip it.

Inside there was the UPDATA.APP so I used your script. I have extracted the files successfully. But the problem is here: The boot.img is only 40 B. I tried to flash it but it is too small (it should be around 1 MB).

Maybe one of the other files is the boot image. Do you know something?

Thanks!

The script linked to in the first post on this topic unpacks the correct filenames... you also need the crc binary downloaded to the same location. It only works on Linux... if you remove the crc checking it'll work on anything running perl.

Edited by ZeBadger
Link to comment
Share on other sites

  • 9 months later...
Guest James Kei

**** SD download log ****

Failure: OEMSBL version unmatched.

Failure: operation did not succeed.

Failure: operation did not succeed.

Failure: operation did not succeed.

Failure: operation did not succeed.

Failure: operation did not succeed.

dload_sd_ram_data_proc->(retry >= DLOAD_RETRY) failed!

YES.

Using the Perl script method, as work around to flash with CWM recovery works.

But however, my U8220 was 1.5 ROM partition size, still have small /system ~85mb and large /data ~105mb, which UK 2.1 stock ROM changed size.

this still do not resolve all my issues.

James

Edited by James Kei
Link to comment
Share on other sites

  • 1 year later...
  • 5 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.