Jump to content


Photo

Repacking UPDATA.APP (was New version of split_updata.pl)

* * * * * 1 votes

  • Please log in to reply
202 replies to this topic

#181
projectshadow

projectshadow

    Newbie

  • Members
  • Pip
  • 6 posts
  • Devices:NDriveS400 - GT540

Have you tried installing the original firmware for your U8510?
In case you haven't, the links can be found at the wiki: http://wiki.modaco.c..._Firmware_U8510
Within the zip file there will be a .PDF document explaining how to flash it. If it works it will restore your phone back to it's original state thereby losing any changes you've made. If it doesn't then you're screwed. Good luck.


yes i try and he say update fail, the possible problem is the "time machine"... if you read the U8650 and U8510 pdf you see compatibility models (upgradable_versions.txt i think)

file02.mbn appears to contain CRC checksums for some of the files. I'm guessing that it's not a 4096 byte checksum in this one, coz I can't find the checksum for larger files, so I just need to work out the size used... leave me on it :lol:

eg for the Time Machine rom

$ hd file02.mbn
00000000  27 91 42 fd f9 ac 26 fc  87 21 01 3e 48 9a de c9  |'.B...&..!.>H...|
00000010  d1 64 af 9f 4d 42 4f 10  04 1d 09 9d  			|.d..MBO.....|
0000001c

boot_versions.txt 2791  (bytes 1 and 2)
upgradable_versions.txt 099D (last 2 bytes)
version.txt 099D  (last 2 bytes as well... ahem)
file01.mbn 2109 
file02.mbn 7A7A (It can't contain the checksum for itself)
file04.mbn 42FD (bytes 3 and 4)
file05.mbn 01C9


Edited by projectshadow, 20 August 2011 - 05:09 PM.

  • 0
System Android
Huawei X3 (U8510-1)
Version: 2.3.3 Official
Rom: U8650 V100R001C223B826 (Malaysia General)
Need help to install the original U8510-1 V100R001C02B827 (Portugal Vodafone)
----
System Android
LG GT540 Swift
Version: 2.3.5
Rom: SwiftDroid v2.0 RC3 (based on CyanogenMod-7.1.0-RC1)
----
System Android
Samsung GT-i5510
Version: 2.2 Official

#182
U_Droid

U_Droid

    Newbie

  • Members
  • Pip
  • 12 posts
Oups !

Seems that the two links to the file download are broken

  • 0
Huawei U8230 1.5 - Upgrade failure when migrating to v2.2 !!!
Help is welcomed

#183
twrock

twrock

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,683 posts
  • Gender:Male
  • Location:Taiwan
  • Devices:Jiayu G2S & Huawei G300

Oups !

Seems that the two links to the file download are broken


The dsixda rom kitchen includes ZeBadger's scripts. Maybe that will work for you.

  • 0

#184
U_Droid

U_Droid

    Newbie

  • Members
  • Pip
  • 12 posts
THX twrock,

I'll have a look and try to extract the images from UK T-Mobile 2.1 ROM to start with.
I have upgrade problems that I try to overcome (see my other post )

  • 0
Huawei U8230 1.5 - Upgrade failure when migrating to v2.2 !!!
Help is welcomed

#185
U_Droid

U_Droid

    Newbie

  • Members
  • Pip
  • 12 posts
Hi TwRock,

I've done some tests with the Kitchen (very nice tools to create custom ROM and easy to play with)

I still miss the perl script to repack an UPDATA.APP file.

The reason for is that the last BYTEL upgrade "messed" the bootloader (below the boot & recovery image, the one that has the u-boot if I'm correct).
Upgrade from UPDATA can upgrade the bootload (I've check the output folder of the unpack and found the file but cannot flash it with fastboot).
Therefore the only possibility left is to modified a previous original UPDATA.APP file by adding the last BYTEL version in the list of ROM (boot_versions.txt & upgradable_versions.txt) and to start a standard upgrade.

THX for your helping to find the repack perl scripts.

  • 0
Huawei U8230 1.5 - Upgrade failure when migrating to v2.2 !!!
Help is welcomed

#186
twrock

twrock

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,683 posts
  • Gender:Male
  • Location:Taiwan
  • Devices:Jiayu G2S & Huawei G300

Hi TwRock,

I've done some tests with the Kitchen (very nice tools to create custom ROM and easy to play with)

I still miss the perl script to repack an UPDATA.APP file.

The reason for is that the last BYTEL upgrade "messed" the bootloader (below the boot & recovery image, the one that has the u-boot if I'm correct).
Upgrade from UPDATA can upgrade the bootload (I've check the output folder of the unpack and found the file but cannot flash it with fastboot).
Therefore the only possibility left is to modified a previous original UPDATA.APP file by adding the last BYTEL version in the list of ROM (boot_versions.txt & upgradable_versions.txt) and to start a standard upgrade.

THX for your helping to find the repack perl scripts.

Even thought the first post mentions repacking, I am unaware that anyone ever was successful in doing it. I do not have anything more than the split scripts.

  • 0

#187
ZeBadger

ZeBadger

    Regular

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

Oups !

Seems that the two links to the file download are broken


Whoops, zebadger.com dns messed up somehow. Sorted now.
I haven't got any time to look at this at the moment... I bought a HTC Desire a while back too, so interest has waned a little!

  • 0

#188
PaulMilbank

PaulMilbank

    Regular

  • Members
  • PipPip
  • 146 posts
Hi Zebadger, how did you determine the locations for the files referenced in the updata.app file? I am wanting to modify your script to pull the correct files out of a u8800 update.app and make a flashable zip for CWM. Any help would be appreciated.

*edit* heh, looks like I am not the only one, guess this is more complicated than I thought it would be.

Edited by PaulMilbank, 20 January 2012 - 08:53 PM.

  • 0

#189
ZeBadger

ZeBadger

    Regular

  • Members
  • PipPip
  • 90 posts
  • Gender:Male
  • Devices:Nexus 4
Yeah, I'm gonna look at producing something for the u8800 next week... Stay tuned!

  • 0

#190
PaulMilbank

PaulMilbank

    Regular

  • Members
  • PipPip
  • 146 posts

Yeah, I'm gonna look at producing something for the u8800 next week... Stay tuned!

That would be amazing if you could get it working, so keen to start getting the kitchen working for this phone.



  • 0

#191
ZeBadger

ZeBadger

    Regular

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

That would be amazing if you could get it working, so keen to start getting the kitchen working for this phone.


Looks easy enough, but I'm not sure what you'll do with it once the files are split out.

  • 0

#192
ZeBadger

ZeBadger

    Regular

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

Looks easy enough, but I'm not sure what you'll do with it once the files are split out.


I have run the code as-is... and it extracts okay. Maybe some of the files aren't named correctly, but they do extract.

  • 0

#193
pier11

pier11

    Addict

  • Members
  • PipPipPipPipPip
  • 883 posts
  • Gender:Male
  • Location:New York, USA
  • Devices:T-Mobile Pulse U8220
Hi ZeBadger,
cool to have you around.

It looks like official roms (UPDATA.APP) are able to somehow repartition ROM memory.
We are installing UK Pulse rom from year 2010 only to obtain 100MB system partition to somehow fit our ever increasing in size custom roms.

Question: may be you have an idea which part of UPDATA.APP is responsible for repartitioning and if it possible to use that part separately from the other rom components. Like flash something with fast boot for example...

Ideally we would want to control partitions sizes ourselves (looks G1 people can do that...) In short we need bigger system partition in expense of data partition for our future roms, as sd card is used for app storage anyway...

What are your thoughts?

  • 0

#194
PaulMilbank

PaulMilbank

    Regular

  • Members
  • PipPip
  • 146 posts

I have run the code as-is... and it extracts okay. Maybe some of the files aren't named correctly, but they do extract.


I have run the script too on the b522 update.app and have a semi working system.img as well as a couple of user/appdata files that extract. It is not pulling the correct boot.img out. I am getting four unknown files named unknown_file.0-3. they dont seem to come from the file name/hash list and I think one of them is the boot.img, but I dont know how to tell if one of them it is.

I have looked at the system.img and oddly it does not have odex files for the apk's so I am wondering if there is another file for the odex information?

If we could get this update.app extracted, we could make use of the good huawei enhancements for existing GB roms and hopefully speed up development of new roms. I would also like to have this to begin testing .35 kernels on GB.

Thanks again


  • 0

#195
ZeBadger

ZeBadger

    Regular

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

Question: may be you have an idea which part of UPDATA.APP is responsible for repartitioning and if it possible to use that part separately from the other rom components. Like flash something with fast boot for example...


I'm afraid I have no idea. I have never looked at what each file is or what it does. I was just up for the challenge of splitting them out effectively (and repacking them, but I failed on that one :( )

I have run the script too on the b522 update.app and have a semi working system.img as well as a couple of user/appdata files that extract. It is not pulling the correct boot.img out. I am getting four unknown files named unknown_file.0-3. they dont seem to come from the file name/hash list and I think one of them is the boot.img, but I dont know how to tell if one of them it is.

I have looked at the system.img and oddly it does not have odex files for the apk's so I am wondering if there is another file for the odex information?


I don't know either I'm afraid, you'll have to work it out based on the content of the files extracted. I think you're best just treating the filenames as file1.bin file2.bin file3.bin etc and working it out from scratch.

I also don't know what an odex is.

  • 0

#196
llogar

llogar

    Newbie

  • Members
  • Pip
  • 2 posts
Hi,

I have extracted the following files from the U8800Pro UPDATE.APP:

0xf3000000 (MD5_RSA)
0xf4000000 (crc.mbn)
0xf6000000 (dbl.ver)
0xa0000000 (dbl.mbn)
0xe0000000 (osbl.mbn)
0xf5000000 (osbl.ver)
0x60000000 (adsp.mbn)
0x80000000 (modem_st1.mbn)
0x90000000 (modem_st2.mbn)
0x40000000 (system.img.ext3)
0x00000000 (userdata.img.ext3)
0x20000000 (splash_5x480x595.rgb565)
0xf7000000 (?)
0xb0000000 (fat.mbn)
0xf9000000 (?)

The names in parentheses are the file names I have found parsing the osbl.mbn (0xe0000000) file.
I think that the upgrade more or less just copies the following files to emmc partitions:

0xa0000000 (dbl.mbn) to /dev/block/mmcblk0p2
0xe0000000 (osbl.mbn) to /dev/block/mmcblk0p3
0x60000000 (adsp.mbn) to /dev/block/mmcblk0p9
0x80000000 (modem_st1.mbn) to /dev/block/mmcblk0p10
0x90000000 (modem_st2.mbn) to /dev/block/mmcblk0p11
0x40000000 (system.img.ext3) to /dev/block/mmcblk0p12
0x00000000 (userdata.img.ext3) to /dev/block/mmcblk0p13

0xb0000000 (fat.mbn) file isn't an image of a fat partition, but rather a custom archive. It is unpacked and its contents (/image directory) written to fat partition /dev/block/mmcblk0p1.

The boot process (as I have found elsewhere on the net) looks something like this:

The boot code in rom first loads dbl (Device Boot Loader) from /dev/block/mmcblk0p2, the dbl then loads osbl (OS Boot Loader) from /dev/block/mmcblk0p3. osbl checks if there is dload folder on the sdcard and if found, does the upgrade. Otherwise it mounts /dev/block/mmcblk0p1, loop mounts /image/boot.img, loads zImage and android takes off...
Upgrade itself (as you have already found out) first verifies crc.mbn against MD5_RSA and then uses crc.mbn to verify each file as it gets extracted and processed...

  • 0

#197
pier11

pier11

    Addict

  • Members
  • PipPipPipPipPip
  • 883 posts
  • Gender:Male
  • Location:New York, USA
  • Devices:T-Mobile Pulse U8220
@llogar,

can you assemble back the update? I mean a modified version.

I'd like to change for example splash screen, to begin with... May be switch bootloaders between roms, to achieve different partition sizes...

  • 0

#198
llogar

llogar

    Newbie

  • Members
  • Pip
  • 2 posts

@llogar,

can you assemble back the update? I mean a modified version.

I'd like to change for example splash screen, to begin with... May be switch bootloaders between roms, to achieve different partition sizes...


No, UPDATE.APP si digitally signed with a private key only Huawei has.
What could probably be done, is patch osbl to ignore signature verification and save it to /dev/block/mmcblk0p3
Then it would be possible to do an upgrade from a non huawei UPGRADE.APP...

  • 1

#199
jgilalonso

jgilalonso

    Regular

  • Members
  • PipPip
  • 58 posts
  • Devices:U8220

No, UPDATE.APP si digitally signed with a private key only Huawei has.
What could probably be done, is patch osbl to ignore signature verification and save it to /dev/block/mmcblk0p3
Then it would be possible to do an upgrade from a non huawei UPGRADE.APP...


Hi,


I tried to use 3 downgrade time machine files and UK, Hungarian 2.1 stok rom but none of them worked.
I still have the same error log on my SD Card :
**** SD download log ****
Failure: MD5_RSA verify failure.
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!


@llogar, is possible generate a UPDATA.APP without MD5_RSA verification?
I only want install a ROM.
At this moment I can't access with fastboot, either.

Thanks





  • 0

#200
terrex

terrex

    Newbie

  • Members
  • Pip
  • 1 posts
  • Devices:n/a
Hey man! I'm trying to make a packer, firstly based on your unpacker. It is at https://github.com/terrex/unupdatapp
I will appreciate any help you can lead to me, i. ex., source code for your crc program, to be included itself in the packer/unpacker.
At this moment, I have finished the unpacker side; I will start with the packer soon.

Thanks to you very much.

I've been working on examining UPDATA.APP and have pretty much got most of the file format identified.

I've modified the original split_updata.pl to extract the correct filenames out every time (based on McSpoon's filenames) and also CRC check the extracted file.

Script is here EDIT: I have had to move it to here as my crazy new hosting tries to execute the perl script.
It needs this crc checking binary to be in the same directory (linux only, until I get time to convert the c code to perl)
...




  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users