mirror of
https://github.com/jclehner/bcm2-utils.git
synced 2025-01-30 18:41:23 +00:00
88 lines
2.9 KiB
Plaintext
88 lines
2.9 KiB
Plaintext
# Since there's no fixed magic value, and due to particularities in binwalk's handling
|
|
# of magic files, using the NUL byte at offset 67 is the most reliable way to detect
|
|
# a ProgramStore header.
|
|
|
|
67 byte 0 BCM33xx ProgramStore image,
|
|
# `padding` must be 0
|
|
>68 ubequad !0 {invalid}
|
|
>0 ubeshort x signature: 0x%04x,
|
|
>2 byte 0 dual: no,
|
|
# in single images, `size2` must be 0
|
|
>>80 ubelong !0 {invalid},
|
|
>2 byte 1 dual: yes,
|
|
>2 byte >1 dual: 0x%02x {invalid}
|
|
>3 byte 0 compression: none,
|
|
>3 byte 1 compression: LZ,
|
|
>3 byte 2 compression: LZO,
|
|
>3 byte 3 compression: reserved,
|
|
>3 byte 4 compression: NRV2B,
|
|
>3 byte 5 compression: LZMA,
|
|
>3 byte >5 compression: 0x%02x {invalid}
|
|
>4 ubeshort x version: %d.
|
|
>6 ubeshort x \b%d,
|
|
>8 bedate x build time: %s,
|
|
# reject build times before initial release of eCos (1998-09-01)
|
|
>8 bedate <904608000 {invalid}
|
|
>12 ubelong+92 x size: %d b
|
|
>12 ubelong+92 x {size:%d}
|
|
>12 ubelong 0 {invalid}
|
|
# check for dual image
|
|
>2 byte&0x01 1
|
|
>>76 ubelong x \b (image1: %d b,
|
|
>>80 ubelong x image2: %d b)
|
|
# require addresses to be 4-byte aligned, and >= 0x80000000 (MIPS)
|
|
>16 ubelong !0
|
|
>>16 ubelong <0x80000000 {invalid}
|
|
>>16 ubelong&0x3 !0 {invalid}
|
|
>16 ubelong x \b, load address: 0x%08x,
|
|
# `name` must be NUL-delimited
|
|
>67 byte !0 {invalid}
|
|
# require first character of `name` to be [a-zA-Z]
|
|
>20 byte <0x41 {invalid}
|
|
>20 byte >0x5a
|
|
>>20 byte <0x61 {invalid}
|
|
>>20 byte >0x7a {invalid}
|
|
>20 string x filename: %.48s,
|
|
>20 string x {name:%.48s}
|
|
>84 ubeshort x HCS: 0x%04x,
|
|
>84 ubeshort 0 {invalid}
|
|
# `reserved` must be 0
|
|
>86 ubeshort !0 {invalid}
|
|
>88 ubelong x CRC: 0x%08x
|
|
>88 ubelong 0 {invalid}
|
|
|
|
0 string MONO BCM33xx monolithic image,
|
|
>4 ubeshort x signature: 0x%04x,
|
|
>4 ubeshort <0x3300 {invalid}
|
|
>4 ubeshort >0x3399 {invalid}
|
|
>6 byte x version: %d.
|
|
>7 byte x \b%d,
|
|
>8 ubelong x size: %d bytes,
|
|
>8 ubelong x {size:%d}
|
|
>4 ubeshort <0x3390 contents: [
|
|
>>12 ubelong &0x01 bootloader
|
|
>>12 ubelong &0x02 image1
|
|
>>12 ubelong &0x04 image2
|
|
>>12 ubelong &0x08 linux
|
|
>>12 ubelong &0x10 linuxapps
|
|
>>12 ubelong &0x20 permnv
|
|
>>12 ubelong &0x40 dhtml
|
|
>>12 ubelong &0x80 dynnv
|
|
>>12 ubelong &0x100 linuxkfs
|
|
>>12 ubelong&0xfe00 !0 0x%04x
|
|
>>&0 ubyte x ]
|
|
>4 ubeshort >0x3389 contents: [
|
|
>>12 ubelong &0x01 BOOTL
|
|
>>12 ubelong &0x02 DOCSIS
|
|
>>12 ubelong &0x04 CM
|
|
>>12 ubelong &0x08 RG
|
|
>>12 ubelong &0x10 STB
|
|
>>12 ubelong &0x20 APPS
|
|
>>12 ubelong &0x40 BOLT
|
|
>>12 ubelong &0x80 DEVTREE
|
|
>>12 ubelong &0x100 HYP
|
|
>>12 ubelong &0x200 KERNEL
|
|
>>12 ubelong &0x400 PCI
|
|
>>12 ubelong&0xf800 !0 0x%04x
|
|
>>&0 ubyte x ]
|