Ambarella command line tools

Tobi@s

Well-Known Member
App Developer
Joined
Nov 12, 2013
Messages
1,380
Reaction score
846
Location
Remote
Country
Germany
Dash Cam
none
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:
Added a7_ptsm.exe for splitting/merging partition header and payload
Description & DL in first post
 
Unpack elf easy.
It is much more difficult to do from a bin elf
 
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
 
You want to make the converter ElfToBin ?
 
All information about elf file.
Only the header.
Rename file elf.txt in elf.exe
The server blocks.
 

Attachments

  • Elf.txt
    924.9 KB · Views: 23
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!
 
Arm Elf ...
This is something that most fully reveals the chip.
ARM Architecture.
 

Attachments

  • ARMELFA06.pdf
    194.2 KB · Views: 25
Back
Top