summaryrefslogtreecommitdiffstats
path: root/magic/Magdir/rpi
blob: 0d213b5357e7b4f9177635241b5100a0f32440c0 (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
#------------------------------------------------------------------------------
# $File: rpi,v 1.3 2022/04/02 14:39:34 christos Exp $
# rpi:  file(1) magic for Raspberry Pi images
-44		lelong	0
>4		lelong	0
>>8		lelong	1
>>12		lelong	4
>>>16		string	283x
>>>>20		lelong	1
>>>>>24		lelong	4
>>>>>>28	string	DTOK
>>>>>>>32	lelong	44
>>>>>>>>36	lelong	4
>>>>>>>>>40	string	RPTL		Raspberry PI kernel image

-56		lelong	0
>4		lelong	0
>>8		lelong	1
>>12		lelong	4
>>>16		string	283x
>>>>20		lelong	1
>>>>>24		lelong	4
>>>>>>28	string	DTOK
>>>>>>>32	lelong	1
>>>>>>>>36	lelong	4
>>>>>>>>>40	string	DDTK8
>>>>>>>>>>48	lelong	4
>>>>>>>>>>>52	string	RPTL		Raspberry PI kernel image

# From: 	Joerg Jenderek
# URL:		https://www.raspberrypi.com/documentation/computers/raspberry-pi.html
#		#raspberry-pi-4-boot-eeprom
# Reference:	https://github.com/raspberrypi/rpi-eeprom/blob/master/rpi-eeprom-config
# Note:		start with same magic as for BIOS (ia32) ROM Extension handled by ./intel
# masked with MAGIC_MASK and then compared with MAGIC
0	belong&0xFFffF00F	0x55aaF00F	Raspberry PI EEPROM
#!:mime	application/octet-stream
!:mime	application/x-raspberry-eeprom
# like: pieeprom-2020-09-03.bin
!:ext	bin
# a 32 bit offset to the next section like: 000184d4 000184c8 00018534 ... 0000bb84 0000bbd4 0000bbd4
>4	ubelong			x		\b, offset %8.8x
#>(4.L)	ubelong			x		NEXT=%8.8x
# self.length
>8	ubelong			!0		\b, length %x
# self.filename
>12	string			>0		\b, "%s"
# length is zero
>8	ubelong			=0
# if length is zero then 2nd section magic here can be zero; this means sections parsing done
>>8	ubelong			!0		\b, 2nd MAGIC=%8.8x