~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
blob: 92ba08205eef6cbeeb4531031951f53e869bb126 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# ACSBaby

*Parse Amlogic ACS settings*

## Usage

	$ acsbaby [-f c|readable] [-t acs|bl2|u-boot] [-o offset] file

### Options

**-f fmt**

* Sets the format to be used to either `c` or `readable`.
  When set to `c` it generates C files, while when it's set to 
  `readable` it prints out data parsed from the ACS binary in a 
  human-readable way.

**-t type**

* Sets the image type. Can be either `acs`, `bl2`, or `u-boot`.
  When unset ACSBaby will try to detect which type to use.

**-o offset**

* Sets the offset where the ACS footer is to be found. Mainly useful 
  when dealing with signed U-Boot binaries. A small script is provided too 
  for finding the offset to use.

### Examples

Parse an ACS binary embedded in a signed U-Boot binary

	$ utils/find_acs_offset.sh u-boot.bin # find ACS footer offset
	ACS footer found at offset 0x0000a4e0
	$ acsbaby -o 0x0000a4e0 u-boot.bin

Parse a standalone ACS binary

	$ acsbaby acs.bin

Parse an ACS binary embedded in a BL2 binary

	$ acsbaby bl2.bin

## Compile

Modify `Makefile` to fit your needs, then run:

	$ make

## TODO

* Support other ACS versions
* Parse ACS structures (`ddrt_`, `ddrs_`, `pll__`)

## Known issues

* **Endianness**: Little endian byte order is assumed in the code, thus running 
  on big endian hosts may cause unpredictable misbehaviour.

* **Usefulness**: While it should work (with a little bit of effort) on any 
  ACS binary, this is only really useful on Amlogic S905 ACS binaries, 
  because, unlike other SoCs, BL2 isn't encrypted, and so it is possible to 
  parse ACS binaries found on eMMC backups of consumer set-top boxes, for 
  example.