Jump to content


Photo

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

- - - - -

  • Please log in to reply
23 replies to this topic

#1
McSpoon

McSpoon

    Enthusiast

  • PipPipPip
  • 280 posts
  • Gender:Male
  • Location:England
  • Devices:Galaxy Tab 10.1
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.

Attached File  split_updata.pl.txt   3.39KB   1692 downloads 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, 16 August 2010 - 10:15 PM.

  • 0

#2
_Sebastian_

_Sebastian_

    Regular

  • Members
  • PipPip
  • 62 posts
  • Devices:Pulse
I've started to write a script yesterday night too - So i don't need to finish it thanks McSpoon :)

Edit:
Maybe the links will help to clarify some questions:

http://translate.goo...y...sl=de&tl=en

http://androidenea.b...m-power-on.html

Edited by _Sebastian_, 25 December 2009 - 05:31 AM.

  • 0

#3
Timmmm

Timmmm

    Regular

  • Members
  • PipPip
  • 122 posts
  • Devices:T-Mobile Pulse (Huawei 8220)
How did you find the format of this file? Guesswork?

  • 0

#4
McSpoon

McSpoon

    Enthusiast

  • PipPipPip
  • 280 posts
  • Gender:Male
  • Location:England
  • Devices:Galaxy Tab 10.1

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. :)

  • 0

#5
Basher52

Basher52

    Regular

  • Members
  • PipPip
  • 132 posts
  • Devices:T-Mobile Pulse
do i have to run it as a simple command in command line?

Got the lastest Rom somebody founds on huawei, but dont know how to use your script :)


Do both files have to be in the same folder?

Edited by Basher52, 18 March 2010 - 12:36 PM.

  • 0
Huawei 8220 aka T-Mobile Pulse @ 2.1 selfmade Rom, 8GB microSD Class 6, O2 Internetflat.

#6
mlove2

mlove2

    Newbie

  • Members
  • Pip
  • 1 posts
  • Devices:no
  • Twitter:@12

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.

Attached File  split_updata.pl.txt   3.39KB   1692 downloads 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?

  • 0

#7
TheNano

TheNano

    Newbie

  • Members
  • Pip
  • 36 posts
  • Devices:Acer Liquid
Thanks man

  • 0

#8
ZeBadger

ZeBadger

    Regular

  • Members
  • PipPip
  • 90 posts
  • Gender:Male
  • Devices:Nexus 4
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.

  • 0

#9
ZeBadger

ZeBadger

    Regular

  • Members
  • PipPip
  • 90 posts
  • Gender:Male
  • Devices:Nexus 4

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, 06 June 2010 - 11:12 PM.

  • 0

#10
ZeBadger

ZeBadger

    Regular

  • Members
  • PipPip
  • 90 posts
  • Gender:Male
  • Devices:Nexus 4

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!

  • 0

#11
sreeramu

sreeramu

    Newbie

  • Members
  • Pip
  • 42 posts
  • Devices:TMobile Puls & HTC touch 3g
Hi,
This script is not working correctly to me, is there is any other tool to extract UPDATE.APP...

Thanks in Advance....:D

  • 0

#12
DanWilson

DanWilson

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,821 posts
  • Gender:Male
  • Location:Glasgow
  • Interests:Trololololololololol
  • Devices:HTC Desire Z // HP Touchpad
  • Twitter:@PARTAYDan

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...

  • 0
HTC Desire Z - Something CM9 ish - giffgaff
HP Touchpad - AOKP? I dunno (ICS) // webOS // Debian - 30MB Interwebz

I should still be a mod. #JustSayin.

#13
sreeramu

sreeramu

    Newbie

  • Members
  • Pip
  • 42 posts
  • Devices:TMobile Puls & HTC touch 3g

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

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

Edited by sreeramu, 14 August 2010 - 12:19 PM.

  • 0

#14
DanWilson

DanWilson

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,821 posts
  • Gender:Male
  • Location:Glasgow
  • Interests:Trololololololololol
  • Devices:HTC Desire Z // HP Touchpad
  • Twitter:@PARTAYDan

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.

  • 0
HTC Desire Z - Something CM9 ish - giffgaff
HP Touchpad - AOKP? I dunno (ICS) // webOS // Debian - 30MB Interwebz

I should still be a mod. #JustSayin.

#15
Speckles

Speckles

    Diehard

  • Members
  • PipPipPipPip
  • 340 posts
  • Devices:Galaxy S, Pulse, SPV 500 :)
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.

  • 0

#16
sreeramu

sreeramu

    Newbie

  • Members
  • Pip
  • 42 posts
  • Devices:TMobile Puls & HTC touch 3g

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....

  • 0

#17
ZeBadger

ZeBadger

    Regular

  • Members
  • PipPip
  • 90 posts
  • Gender:Male
  • Devices:Nexus 4

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?

  • 0

#18
Speckles

Speckles

    Diehard

  • Members
  • PipPipPipPip
  • 340 posts
  • Devices:Galaxy S, Pulse, SPV 500 :)

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.

  • 0

#19
sreeramu

sreeramu

    Newbie

  • Members
  • Pip
  • 42 posts
  • Devices:TMobile Puls & HTC touch 3g
Thanks For All your replays , i used ubuntu and extracted the UPDATE.APP with latest perl script...thanks once again....

  • 0

#20
Tomas.S

Tomas.S

    Newbie

  • Members
  • Pip
  • 6 posts
  • Location:Cordoba, AR
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!

  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users