Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,809,198 Members 48,066 Now Online
XDA Developers Android and Mobile Development Forum

Asus ABI Decompiler+Compiler (Updated 20090622)

Tip us?
 
starkwong
Old
(Last edited by starkwong; 22nd June 2009 at 12:56 PM.) Reason: Version Update
#1  
starkwong's Avatar
Senior Member - OP
Thanks Meter 0
Posts: 566
Join Date: Feb 2007
Default Asus ABI Decompiler+Compiler (Updated 20090622)

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 )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
Attached Files
File Type: zip p835abisplit2.zip - [Click for QR Code] (44.3 KB, 936 views)
Acer Liquid Black Edition/ eViL Eclair 1.6
Asus P750 Hong Kong Edition/ KumaROM 6.0

Asus/Acer/Pharos ROM Tools
Traditional Chinese Support for WM5/WM6 (WM5/WM6 繁體中文顯示/輸入支援)
 
hdubli
Old
#2  
Senior Member
Thanks Meter 11
Posts: 1,134
Join Date: Dec 2004
Quote:
Originally Posted by starkwong View Post
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
Just too many devices, can"t list them here now
twitter : http://twitter.com/hdubli
 
rishi2504
Old
(Last edited by rishi2504; 3rd May 2009 at 06:04 AM.)
#3  
Senior Member
Thanks Meter 3
Posts: 163
Join Date: May 2006
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 ?
 
hdubli
Old
#4  
Senior Member
Thanks Meter 11
Posts: 1,134
Join Date: Dec 2004
Quote:
Originally Posted by rishi2504 View Post
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
Just too many devices, can"t list them here now
twitter : http://twitter.com/hdubli
 
ginkage
Old
#5  
Retired Senior RD
Thanks Meter 20
Posts: 69
Join Date: Jun 2005
Location: Moscow
starkwong, is there any tool to decompile P835's ROM in the same way?
 
starkwong
Old
#6  
starkwong's Avatar
Senior Member - OP
Thanks Meter 0
Posts: 566
Join Date: Feb 2007
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.
Acer Liquid Black Edition/ eViL Eclair 1.6
Asus P750 Hong Kong Edition/ KumaROM 6.0

Asus/Acer/Pharos ROM Tools
Traditional Chinese Support for WM5/WM6 (WM5/WM6 繁體中文顯示/輸入支援)
 
ginkage
Old
#7  
Retired Senior RD
Thanks Meter 20
Posts: 69
Join Date: Jun 2005
Location: Moscow
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
Old
#8  
starkwong's Avatar
Senior Member - OP
Thanks Meter 0
Posts: 566
Join Date: Feb 2007
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.
Acer Liquid Black Edition/ eViL Eclair 1.6
Asus P750 Hong Kong Edition/ KumaROM 6.0

Asus/Acer/Pharos ROM Tools
Traditional Chinese Support for WM5/WM6 (WM5/WM6 繁體中文顯示/輸入支援)
 
hdubli
Old
#9  
Senior Member
Thanks Meter 11
Posts: 1,134
Join Date: Dec 2004
Quote:
Originally Posted by ginkage View Post
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.
Just too many devices, can"t list them here now
twitter : http://twitter.com/hdubli
 
ginkage
Old
#10  
Retired Senior RD
Thanks Meter 20
Posts: 69
Join Date: Jun 2005
Location: Moscow
starkwong, Thank you so much, it worked perfectly!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


MultiROM Makes Its Way to the LG G2

Over the last few weeks, we’ve seen quite a fewflagship (and former flagship) devicesget to … more

Jair Player with a Major Update–Here’s What’s New!

Back in May, we talked a bit aboutJair Player, a nice looking music … more

Paid Android App Developers Will Soon Have to Provide Physical Address

Google has now changed its policies regarding paid app developers. … more