[Android Software/Hacking General [Developers Only]] Ricky Divjakovski:
So, upon looking for an executable that can unpack amlogic firmware, i was disappointed to find none.

Upon research i found some useful information and decided to make my own.

The structure of Amlogic firmware

----------------------------
| image header, file size, |
| image layout & locations |
----------------------------
| File 1 |
----------------------------
| SHA1 for file 1 |
----------------------------
| File 2 |
----------------------------
| SHA1 for file 2 |
----------------------------
| File 3 |
----------------------------
| SHA1 for file 3 |

And so on..

So, Now you know the structure, but where do we split it?

Well, every amlogic firmware's header(contains all the needed info) is the same size.

We will call that the header.

With a hex editor, open the amlogic firmware

Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F

00000000 7C D2 E1 BC 01 00 00 00 56 19 B5 27 14 A4 A5 1E |Òá¼ V µ' ¤¥
00000010 00 00 00 00 04 00 00 00 11 00 00 00 00 00 00 00
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000050 C0 08 00 00 00 00 00 00 94 5E 00 00 00 00 00 00 À ”^
00000060 55 53 42 00 00 00 00 00 00 00 00 00 00 00 00 00 USB
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000080 44 44 52 00 00 00 00 00 00 00 00 00 00 00 00 00 DDR
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000000A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000000B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000000C0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000000D0 54 67 00 00 00 00 00 00 D5 FB 04 00 00 00 00 00 Tg Õû
000000E0 55 53 42 00 00 00 00 00 00 00 00 00 00 00 00 00 USB
000000F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000100 55 42 4F 4F 54 5F 43 4F 4D 50 00 00 00 00 00 00 UBOOT_COMP
00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000140 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000150 2C 63 05 00 00 00 00 00 74 00 00 00 00 00 00 00 ,c t
00000160 63 6F 6E 66 00 00 00 00 00 00 00 00 00 00 00 00 conf
00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000180 70 6C 61 74 66 6F 72 6D 00 00 00 00 00 00 00 00 platform
00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000001A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000001B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000001C0 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000001D0 A0 63 05 00 00 00 00 00 70 02 00 00 00 00 00 00 c p
000001E0 69 6E 69 00 00 00 00 00 00 00 00 00 00 00 00 00 ini
000001F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000200 61 6D 6C 5F 73 64 63 5F 62 75 72 6E 00 00 00 00 aml_sdc_burn
00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000240 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000250 10 66 05 00 00 00 00 00 C6 F4 00 00 00 00 00 00 f Æô
00000260 64 74 64 00 00 00 00 00 00 00 00 00 00 00 00 00 dtd
00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000280 6D 65 73 6F 6E 5F 74 61 72 67 65 74 00 00 00 00 meson_target
00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000002A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000002B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000002C0 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000002D0 D8 5A 06 00 00 00 00 00 6A 0D 02 00 00 00 00 00 ØZ j
000002E0 64 74 64 00 00 00 00 00 00 00 00 00 00 00 00 00 dtd
000002F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000300 6D 65 73 6F 6E 00 00 00 00 00 00 00 00 00 00 00 meson
00000310 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000330 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000340 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000350 44 68 08 00 00 00 00 00 B9 52 00 00 00 00 00 00 Dh ¹R
00000360 64 74 62 00 00 00 00 00 00 00 00 00 00 00 00 00 dtb
00000370 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000380 6D 65 73 6F 6E 00 00 00 00 00 00 00 00 00 00 00 meson
00000390 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000003A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000003B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000003C0 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000003D0 00 BB 08 00 00 00 00 00 C0 B5 11 00 00 00 00 00 » Àµ
000003E0 50 41 52 54 49 54 49 4F 4E 00 00 00 00 00 00 00 PARTITION
000003F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000400 6C 6F 67 6F 00 00 00 00 00 00 00 00 00 00 00 00 logo
00000410 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000420 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000430 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000440 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000450 C0 70 1A 00 00 00 00 00 30 00 00 00 00 00 00 00 Àp 0
00000460 56 45 52 49 46 59 00 00 00 00 00 00 00 00 00 00 VERIFY
00000470 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000480 6C 6F 67 6F 00 00 00 00 00 00 00 00 00 00 00 00 logo
00000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000004A0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000004B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000004C0 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000004D0 F0 70 1A 00 00 00 00 00 20 A3 65 00 00 00 00 00 ðp £e
000004E0 50 41 52 54 49 54 49 4F 4E 00 00 00 00 00 00 00 PARTITION
000004F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000500 62 6F 6F 74 00 00 00 00 00 00 00 00 00 00 00 00 boot
00000510 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000520 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000540 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000550 10 14 80 00 00 00 00 00 30 00 00 00 00 00 00 00 € 0
00000560 56 45 52 49 46 59 00 00 00 00 00 00 00 00 00 00 VERIFY
00000570 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000580 62 6F 6F 74 00 00 00 00 00 00 00 00 00 00 00 00 boot

Extremely odd but extremely simple when it comes down to it.

Lets split the boot partition.

This is all thats needed

Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F

000004D0 F0 70 1A 00 00 00 00 00 20 A3 65 00 00 00 00 00 ðp £e
000004E0 50 41 52 54 49 54 49 4F 4E 00 00 00 00 00 00 00 PARTITION
000004F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000500 62 6F 6F 74 00 00 00 00 00 00 00 00 00 00 00 00 boot
00000510 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000520 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000540 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000550 10 14 80 00 00 00 00 00 30 00 00 00 00 00 00 00 € 0
00000560 56 45 52 49 46 59 00 00 00 00 00 00 00 00 00 00 VERIFY
00000570 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000580 62 6F 6F 74 00 00 00 00 00 00 00 00 00 00 00 00 boot

Basic understanding -

000004D0 - 000004D2 is the start address of the image file in reverse(in this case the start address is 1A 70 F0(Notice how they are reversed?))

000004D8 - 000004DA is the length of the file also in reverse

line 000004F0 just specifies its a partition(also the file extension CustomizationTool unpacks it as)

line 00000500 is the name of the partition

Thats all thats really needed but if you wanna go further they also generously included the files SHA1 sum for verification

line 00000550 same method as partition

line 00000560 specifies its for verification(sha1)

line 00000580 the file the sha1 sum is for

Time to calculate and split

Use a hex calculator to calculate the end address(start address + size)

in this case 1A70F0 + 65A320 = 801410 (hex value, not decimal)

name : boot

extension : PARTITION(.img)

start address : 1A70F0

end address : 801410

Go ahead and copy from start address to end address to a new file with the hex editor

in this case i copy from 1A70F0 to 801410 and save the file as boot.img

THATS ALL!

To automate this process i made a C#(.net) class and a portable executable

Check out the source code and prebuilt binaries here

Alot of useful information was also found here