Asus ABI Decompiler+Compiler (Updated 20090622)

Search This thread

starkwong

Senior Member
Feb 9, 2007
568
0
This tool can be used to either decompile or compile ROMs for various Asus devices that used the ABI firmware format (Can also be used in O2 XDA Zest ). The current version can support P835 unencrypted ABI, and even encrypted ABI from updater EXE! Current finding is this tool also supports unreleased Garmin-Asus ROMs!

Thanks (Especially:D )Harshal and Leon in AsusPda for testing.

Usage:
- Decompiling ROM
1. p835abisplit2 <abi/exe file>
2. os.nb0 and extrom.img released (Only for Pre-P835 devices), os.nb0 cab be processed by imgfsfromnb or osnbtool, extrom.img can be processed by WinImage.

- Compiling ROM
1. First rename the new os.nb0 to os-new.nb0, and rename extrom.img to extrom-new.img (If the new files do not exist, then the compiler will use the parts from original ROM)
2. p835abisplit2 /b <abi/exe file>
3. out.abi releases, which can be used to flash directly (Only for Pre-P835 devices or Post-P835 devices with unencrypted ROM).
4. If you input the updater EXE to p835abisplit2, it will also produce out.exe with region locked patched which can be used to flash your new ROM directly on devices with any region!

- Note when building ROM
1. If you need to modify XIP, make sure the modded XIP is the same size as the original one before merging back to nb0, otherwise booting will fail
2. For Pre-P835 devices, current version can create big-storage ROMs with variable size of imgfs. If the new OS is smaller than the original one, the freed space will be allocated to user space (The left part as shown in Memory setting) after flashing. However the user space display will only reflect the change on second flash.
3. For Post-P835 devices, all partitions must be exactly same size with the original one (i.e. you need to pad the partition before putting it back), otherwise the device won't boot.
4. For Pre-P835 devices, you can modify ExtROM as you like, but not remove or rebuild the image file, otherwise you may get a brick! (Not able to enter bootloader)

Final Warning: Customizing a ROM always has risks, I won't be responsible for any damages lead to your custom ROM!

Release Notes:
v2.40:
- Added support for M930

v2.32:
- Support extraction of encrypted ABI file resource from P835 updater exe
- Support reconstruction of P835 updater exe
- When rebuild to exe, the produced out.exe is patched to install in devices of any region.

V2.20:
- Support extration and rebuilding of P835 ABI file (Note that not for ABI inside EXE)
- When rebuild with exe, OUT.EXE will be produced for direct flashing
 

Attachments

  • p835abisplit2.zip
    44.3 KB · Views: 1,008
Last edited:

hdubli

Senior Member
Dec 31, 2004
1,134
12
This tool can be used to either decompile or compile ROMs for various Asus devices that used the ABI firmware format (Can also be used in O2 XDA Zest ).

Thanks Harshal and Leon in AsusPda for testing.

Usage:
- Decompiling ROM
1. p565abisplit2 <abi/exe file>
2. os.nb0 and extrom.img released, os.nb0 cab be processed by imgfsfromnb or osnbtool, extrom.img can be processed by WinImage.

- Compiling ROM
1. First rename the new os.nb0 to os-new.nb0, and rename extrom.img to extrom-new.img (If the new files do not exist, then the compiler will use the parts from original ROM)
2. p565abisplit2 /b <abi/exe file>
3. out.abi releases, which can be used to flash directly.

- Note when building ROM
1. If you need to modify XIP, make sure the modded XIP is the same size as the original one before merging back to nb0, otherwise booting will fail
2. OS part doesn't need to be the same size as the original. If the new OS is smaller than the original one, the freed space will be allocated to user space (The left part as shown in Memory setting) after flashing. However the user space display will only reflect the change on second flash.

3. You can modify ExtROM as you like, but not remove or rebuild the image file, otherwise you may get a brick! (Not able to enter bootloader)

Final Warning: Customizing a ROM always has risks, I won't be responsible for any damages lead to your custom ROM!. Moreover, don't use it in P835 abi, it won't work :)


Nice :) we all waiting for it
 

rishi2504

Senior Member
May 18, 2006
196
10
Nothing Phone 1
Many Congrats for successfully ripping through the ROM !!

Partition offsets and checksums reported by the tool are :
Part #0002 sz:0003e000=>0003e000 cs:625f94b2=>625f94b2 of:000003a0=>000003a0
Part #0004 sz:00100000=>00100000 cs:ffe5f731=>ffe5f731 of:0003e3a0=>0003e3a0
Part #0103 sz:00452a8c=>00452a8c cs:99f65978=>99f65978 of:0013e3a0=>0013e3a0
Part #0104 sz:000fffc0=>000fffc0 cs:5e03943f=>5e03943f of:00590e2c=>00590e2c
Part #0005 sz:07e00000=>07e00000 cs:674f4072=>674f4072 of:00690dec=>00690dec
Part #0013 sz:00a00000=>00a00000 cs:56994bf9=>56994bf9 of:08490dec=>08490dec

I am a little scared to use this tool for following reasons :
1. Actually, the IMGFS & ExtROM offsets are '00690dfc' & '08490dfc' respectively.
2. Checksums( 674f4072, 56994bf9....) can not be located in the Header.
3. The Adler32 checksum for the ExtROM is '5ff94bfa', while your tool reports '56994bf9'.

Any clues ?
 
Last edited:

hdubli

Senior Member
Dec 31, 2004
1,134
12
Many Congrats for successfully ripping through the ROM !!

Partition offsets and checksums reported by the tool are :
Part #0002 sz:0003e000=>0003e000 cs:625f94b2=>625f94b2 of:000003a0=>000003a0
Part #0004 sz:00100000=>00100000 cs:ffe5f731=>ffe5f731 of:0003e3a0=>0003e3a0
Part #0103 sz:00452a8c=>00452a8c cs:99f65978=>99f65978 of:0013e3a0=>0013e3a0
Part #0104 sz:000fffc0=>000fffc0 cs:5e03943f=>5e03943f of:00590e2c=>00590e2c
Part #0005 sz:07e00000=>07e00000 cs:674f4072=>674f4072 of:00690dec=>00690dec
Part #0013 sz:00a00000=>00a00000 cs:56994bf9=>56994bf9 of:08490dec=>08490dec

I am a little scared to use this tool for following reasons :
1. Actually, the IMGFS & ExtROM offsets are '00690dfc' & '08490dfc' respectively.
2. Checksums( 674f4072, 56994bf9....) can not be located in the Header.
3. The Adler32 checksum for the ExtROM is '5ff94bfa', while your tool reports '56994bf9'.

Any clues ?


Tool works properrly.No harm is trying :)
 

starkwong

Senior Member
Feb 9, 2007
568
0
New version posted.

rishi2504:
The image checksum is not calculated by plain Adler32, actually is uses the same formula as older Asus ROMs, however it is not a one-time calculation.

Checksums are inside header, given you decoded it correctly.
 

ginkage

Retired Senior Recognized Developer
Jun 19, 2005
83
24
39
London
starkwong, here's what I get when trying to decompile a ROM:

Code:
v2.40 (Jun 16 2009 19:56:06)

ExtractABI(): Trying to load G5_ALL_V4.11.0_V3.6.12.P2_Ship_WWE_app_MYS00_V2.3.6.exe...
        Module loaded, searching for BIN resource...
        Found matching resource at BIN #211!

GetPartitions(): Getting Partition Information...
        *** Encrypted ABI detected
        ABI Version 0x00030012
        Project Name: G5
        Partition Type: 000f 000001d0@000005f0
        Partition Type: 000e 00000af4@000007c0
        Partition Type: 000e 0000e324@000012b4
        Partition Type: 0004 00000028@0000f5d8
        Partition Type: 0004 00084000@0000f600
        Partition Type: 000f 00000028@00093600
        Partition Type: 000f 00031334@00093628
        Partition Type: 0102 damage 01288014@000c495c
        Partition Type: 0005 UnKnown 06fb1dd3@0134c970
        Partition Type: 0002 00000cfc@082fe743
        Partition Type: 0003 00000cfc@082ff43f
ProcessABI(): Writing OS data...
        * BIN(P835) Image Detected
        Warning: OS.nb0/flash.bin is not a NB image, not modifying MSFLSH50 headers
ProcessABI(): No ExtROM partition found.
OK!

So it seems that partitions are not detected correctly, there's no os.nb0 at the output, and the flash.bin apperars to be of no use. Even when I found imgfs partition inside of it, there's still something wrong with it, e.g. bad start block offset, and everything else is also broken.

Can you help me with this?
 

starkwong

Senior Member
Feb 9, 2007
568
0
In fact it is correct, as Asus uses B000FF image on P835, not a plain NB0 image.
You need to use osnbtool to get a nb0 with extra bytes, then use nbsplit -data 2048 -extra 8 to get a nb0 with sector size 0x800.
 

hdubli

Senior Member
Dec 31, 2004
1,134
12
starkwong, here's what I get when trying to decompile a ROM:

Code:
v2.40 (Jun 16 2009 19:56:06)

ExtractABI(): Trying to load G5_ALL_V4.11.0_V3.6.12.P2_Ship_WWE_app_MYS00_V2.3.6.exe...
        Module loaded, searching for BIN resource...
        Found matching resource at BIN #211!

GetPartitions(): Getting Partition Information...
        *** Encrypted ABI detected
        ABI Version 0x00030012
        Project Name: G5
        Partition Type: 000f 000001d0@000005f0
        Partition Type: 000e 00000af4@000007c0
        Partition Type: 000e 0000e324@000012b4
        Partition Type: 0004 00000028@0000f5d8
        Partition Type: 0004 00084000@0000f600
        Partition Type: 000f 00000028@00093600
        Partition Type: 000f 00031334@00093628
        Partition Type: 0102 damage 01288014@000c495c
        Partition Type: 0005 UnKnown 06fb1dd3@0134c970
        Partition Type: 0002 00000cfc@082fe743
        Partition Type: 0003 00000cfc@082ff43f
ProcessABI(): Writing OS data...
        * BIN(P835) Image Detected
        Warning: OS.nb0/flash.bin is not a NB image, not modifying MSFLSH50 headers
ProcessABI(): No ExtROM partition found.
OK!

So it seems that partitions are not detected correctly, there's no os.nb0 at the output, and the flash.bin apperars to be of no use. Even when I found imgfs partition inside of it, there's still something wrong with it, e.g. bad start block offset, and everything else is also broken.

Can you help me with this?

B000FF image cannot be modified without osnbtool or viewbin or cvrtbin tool..For Ext ROM there is no partition in the abi file which can b read as .nb0 Ext ROM is inside the OS and is not as a partition.So what the output u get from the tool is correct.Whatever ROMs u saw mine are from using the same tool :)
I hope this clarifies.
 

jumangi

New member
May 8, 2006
2
0
Can't use this tool on my Asus M530w. Getting this message:

Copyright(C) 2009 Studio KUMA(starkwong). All rights reserved

v2.40 (Jun 16 2009 19:56:06)

ExtractABI(): Trying to load nk.abi...
Failed loading as module (193). Perhaps ABI?

Trying as ABI directly...
Creating file mapping...
GetPartitions(): Getting Partition Information...
Error: AES Key not suitable for this ROM
 

pitp

Member
Sep 25, 2007
12
0
unencrypted vers encrypted

There is little bit mess in description.
If you will use unecrypted rom + p835abisplit2 you will get os.nb0.
With encrypted rom + p835abisplit2 you will get flash.bin.
 
Last edited:

walletless

Senior Member
Sep 14, 2007
355
67
San Jose, CA
Is there anyway I can extract the flash.bin file from a .abi file using this tool?
My P835 is unable to upgrade from the SD card with the .abi file on it.. so I wanted to extract the flash.bin and see if I can use the QPST tool to update the image with flash.bin file..
 

eqcons

New member
Sep 3, 2009
1
0
Sorry if I'm being stupid here (not unusual!). I'm trying to use this tool to get a .abi file out of O2's "Xda_Zest Firmware Update_V7.7.0S.WWE20.00_M4.6.5.P7_V2.1.4 GBR20.exe" so I can stick it on the SD card and flash the ROM, but of course I'm only ending up with the two files you mention, os.nb0 and extrom.img, no .ABI file. I can look in the extrom.img file with winrar, but the file only contains FINDMA~1.000 (300 bytes), 000dummy.001 (0 bytes) and _setup.xml (1205 bytes).

Plainly I'm thick - where am I going wrong, and how do I get the .ABI file? :confused: