Ambarella command line tools

Tobi@s

Well-Known Member
App Developer
Joined
Nov 12, 2013
Messages
1,372
Reaction score
839
Location
Bavaria
Country
Germany
Dash Cam
some
Hello again,
it's been some time since I posted something like this but thats cause I was busy with studying. But I wasn't completely lazy during that time. As a kind of programming practice I started to develop some Ambarella command line tools using C. My goal is to develop all the features from Java based AFT using C as command line tools and maybe even more (if time doesnt restrict me again).

At the moment there are only these few tools: a7_fwunpacker, a7_ptupdater, a7_fwpacker but I'm working on more right now.

There is one special thing you can do with these tools: "Convert" e2b/elf firmwares to firmware.bin since the unpacker doesnt rely on the static global firmware header at 0x00
Could be useful for devices that only have elfs/e2bs available (like gopro 4 session)

----
a7_fwunpacker:
fwunpacker.png

Unpacks Ambarella A7 .bin/.elf/.e2b binaries. It searches for all partitions and the global firmware header using magic constants and exports them to separate files.
Exported file structures:
fw_header: 2048 byte global firmware header
partition_X: 256 byte partition header + payload
Usage: a7_fwunpacker <firmware file>
DL: http://dc.p-mc.eu/acmd_tools/a7_fwunpacker.exe

a7_ptupdater:
ptupdater.png

Updates the partition header based on partition payload.
Usage: a7_ptupdater <partition file>
DL: http://dc.p-mc.eu/acmd_tools/a7_ptupdater.exe

a7_ptsm:
ptsm.png

Mode -s: Splits specified partition_X file to header_X and payload_X at 0x100 to allow easier editing without partition header
Mode -m: Merges header_X and payload_X into specified partition_X.
Usage: a7_ptsm -s/-m <partition file>
DL: http://dc.p-mc.eu/acmd_tools/a7_ptsm.exe

a7_fwpacker:
fwpacker.png

Packs the fw_header and partition files from a7_fwunpacker into a flashable firmware binary
Needs to be run in directory with fw_header and partition_X files
Usage: a7_fwpacker <output file>
DL: http://dc.p-mc.eu/acmd_tools/a7_fwpacker.exe
----

Warning:
These tools are very experimental and could easily output files that may brick your device. Only use them if you are able to recover a bricked device!

Source code:
I'm planning to publish the source code but don't know where to put it, yet. But: I'm not planning to release the code under an open source license.

Project page:
http://dc.p-mc.eu/tools/ambacmd
 
Last edited:
OP
Tobi@s

Tobi@s

Well-Known Member
App Developer
Joined
Nov 12, 2013
Messages
1,372
Reaction score
839
Location
Bavaria
Country
Germany
Dash Cam
some
Added a7_ptsm.exe for splitting/merging partition header and payload
Description & DL in first post
 

z768

Member
Joined
Aug 18, 2014
Messages
79
Reaction score
71
Country
Belarus
Unpack elf easy.
It is much more difficult to do from a bin elf
 
OP
Tobi@s

Tobi@s

Well-Known Member
App Developer
Joined
Nov 12, 2013
Messages
1,372
Reaction score
839
Location
Bavaria
Country
Germany
Dash Cam
some
Hi Tobi@s!
This is probably what you are looking for?
https://yadi.sk/d/kHrO0affrZuvJ
:)
Good luck.
Do you want to say that you unpacked it using the elf header?
My algorithm looks for the magic constant of the ambarella firmware header which is present in e2b, elf and .bin files
 

z768

Member
Joined
Aug 18, 2014
Messages
79
Reaction score
71
Country
Belarus
You want to make the converter ElfToBin ?
 

z768

Member
Joined
Aug 18, 2014
Messages
79
Reaction score
71
Country
Belarus
All information about elf file.
Only the header.
Rename file elf.txt in elf.exe
The server blocks.
 

Attachments

OP
Tobi@s

Tobi@s

Well-Known Member
App Developer
Joined
Nov 12, 2013
Messages
1,372
Reaction score
839
Location
Bavaria
Country
Germany
Dash Cam
some
You want to make the converter ElfToBin ?
It's already working since the tool finds the partitions in .elf files as well but not by using the elf header.
Thanks for your elf documentation, will see what I can do with it!
 

Similar threads


Top