xref: /freebsd/contrib/file/magic/Magdir/linux (revision ae316d1d1cffd71ab7751f94e10118777a88e027)
1b6cee71dSXin LI
2b6cee71dSXin LI#------------------------------------------------------------------------------
3*ae316d1dSXin LI# $File: linux,v 1.91 2024/11/09 21:15:48 christos Exp $
4b6cee71dSXin LI# linux:  file(1) magic for Linux files
5b6cee71dSXin LI#
6b6cee71dSXin LI# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
7b6cee71dSXin LI# The following basic Linux magic is useful for reference, but using
8b6cee71dSXin LI# "long" magic is a better practice in order to avoid collisions.
9b6cee71dSXin LI#
10b6cee71dSXin LI# 2	leshort		100		Linux/i386
11b6cee71dSXin LI# >0	leshort		0407		impure executable (OMAGIC)
12b6cee71dSXin LI# >0	leshort		0410		pure executable (NMAGIC)
13b6cee71dSXin LI# >0	leshort		0413		demand-paged executable (ZMAGIC)
14b6cee71dSXin LI# >0	leshort		0314		demand-paged executable (QMAGIC)
15b6cee71dSXin LI#
16b6cee71dSXin LI0	lelong		0x00640107	Linux/i386 impure executable (OMAGIC)
17b6cee71dSXin LI>16	lelong		0		\b, stripped
18b6cee71dSXin LI0	lelong		0x00640108	Linux/i386 pure executable (NMAGIC)
19b6cee71dSXin LI>16	lelong		0		\b, stripped
20b6cee71dSXin LI0	lelong		0x0064010b	Linux/i386 demand-paged executable (ZMAGIC)
21b6cee71dSXin LI>16	lelong		0		\b, stripped
22b6cee71dSXin LI0	lelong		0x006400cc	Linux/i386 demand-paged executable (QMAGIC)
23b6cee71dSXin LI>16	lelong		0		\b, stripped
24b6cee71dSXin LI#
25b6cee71dSXin LI0	string		\007\001\000	Linux/i386 object file
26b6cee71dSXin LI>20	lelong		>0x1020		\b, DLL library
27b6cee71dSXin LI# Linux-8086 stuff:
28b6cee71dSXin LI0	string		\01\03\020\04	Linux-8086 impure executable
29b6cee71dSXin LI>28	long		!0		not stripped
30b6cee71dSXin LI0	string		\01\03\040\04	Linux-8086 executable
31b6cee71dSXin LI>28	long		!0		not stripped
32b6cee71dSXin LI#
33b6cee71dSXin LI0	string		\243\206\001\0	Linux-8086 object file
34b6cee71dSXin LI#
35b6cee71dSXin LI0	string		\01\03\020\20	Minix-386 impure executable
36b6cee71dSXin LI>28	long		!0		not stripped
37b6cee71dSXin LI0	string		\01\03\040\20	Minix-386 executable
38b6cee71dSXin LI>28	long		!0		not stripped
39b6cee71dSXin LI0	string		\01\03\04\20	Minix-386 NSYM/GNU executable
40b6cee71dSXin LI>28	long		!0		not stripped
41b6cee71dSXin LI# core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
42b6cee71dSXin LI216	lelong		0421		Linux/i386 core file
43b6cee71dSXin LI!:strength / 2
44b6cee71dSXin LI>220	string		>\0		of '%s'
45b6cee71dSXin LI>200	lelong		>0		(signal %d)
46b6cee71dSXin LI#
47b6cee71dSXin LI# LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
48b6cee71dSXin LI# this can be overridden by the DOS executable (COM) entry
49b6cee71dSXin LI2	string		LILO		Linux/i386 LILO boot/chain loader
50b6cee71dSXin LI#
51b6cee71dSXin LI# Linux make config build file, from Ole Aamot <oka@oka.no>
52b6cee71dSXin LI# Updated by Ken Sharp
53b6cee71dSXin LI28	string		make\ config		Linux make config build file (old)
54b6cee71dSXin LI49	search/70	Kernel\ Configuration	Linux make config build file
55b6cee71dSXin LI
56b6cee71dSXin LI#
57b6cee71dSXin LI# PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
58b6cee71dSXin LI# Updated by Adam Buchbinder <adam.buchbinder@gmail.com>
5948c779cdSXin LI# See: https://www.win.tue.nl/~aeb/linux/kbd/font-formats-1.html
60b6cee71dSXin LI0	leshort		0x0436		Linux/i386 PC Screen Font v1 data,
61b6cee71dSXin LI>2	byte&0x01	0		256 characters,
62b6cee71dSXin LI>2	byte&0x01	!0		512 characters,
63b6cee71dSXin LI>2	byte&0x02	0		no directory,
64b6cee71dSXin LI>2	byte&0x02	!0		Unicode directory,
65b6cee71dSXin LI>3	byte		>0		8x%d
66b6cee71dSXin LI0	string		\x72\xb5\x4a\x86\x00\x00 Linux/i386 PC Screen Font v2 data,
67b6cee71dSXin LI>16	lelong		x		%d characters,
68b6cee71dSXin LI>12	lelong&0x01	0		no directory,
69b6cee71dSXin LI>12	lelong&0x01	!0		Unicode directory,
70898496eeSXin LI>28	lelong		x		%d
71898496eeSXin LI>24	lelong		x		\bx%d
72b6cee71dSXin LI
732726a701SXin LI# Linux swap and hibernate files
742726a701SXin LI# Linux kernel: include/linux/swap.h
752726a701SXin LI# util-linux: libblkid/src/superblocks/swap.c
762726a701SXin LI
772726a701SXin LI# format v0, unsupported since 2002
782726a701SXin LI0xff6	string		SWAP-SPACE	Linux old swap file, 4k page size
792726a701SXin LI0x1ff6	string		SWAP-SPACE	Linux old swap file, 8k page size
802726a701SXin LI0x3ff6	string		SWAP-SPACE	Linux old swap file, 16k page size
812726a701SXin LI0x7ff6	string		SWAP-SPACE	Linux old swap file, 32k page size
822726a701SXin LI0xfff6	string		SWAP-SPACE	Linux old swap file, 64k page size
832726a701SXin LI
842726a701SXin LI# format v1, supported since 1998
852726a701SXin LI0		name	linux-swap
862726a701SXin LI>0x400	lelong		1	little endian, version %u,
872726a701SXin LI>>0x404	lelong		x	size %u pages,
882726a701SXin LI>>0x408	lelong		x	%u bad pages,
892726a701SXin LI>0x400	belong		1	big endian, version %u,
902726a701SXin LI>>0x404	belong		x	size %u pages,
912726a701SXin LI>>0x408	belong		x	%u bad pages,
922726a701SXin LI>0x41c	string		\0	no label,
932726a701SXin LI>0x41c	string		>\0	LABEL=%s,
9443a5ec4eSXin LI>0x40c	ubelong		x	UUID=%08x
9543a5ec4eSXin LI>0x410	ubeshort	x	\b-%04x
9643a5ec4eSXin LI>0x412	ubeshort	x	\b-%04x
9743a5ec4eSXin LI>0x414	ubeshort	x	\b-%04x
9843a5ec4eSXin LI>0x416	ubelong		x	\b-%08x
9943a5ec4eSXin LI>0x41a	ubeshort	x	\b%04x
1002726a701SXin LI
1012726a701SXin LI0xff6	string		SWAPSPACE2	Linux swap file, 4k page size,
1022726a701SXin LI>0		use			linux-swap
1032726a701SXin LI0x1ff6	string		SWAPSPACE2	Linux swap file, 8k page size,
1042726a701SXin LI>0		use			linux-swap
1052726a701SXin LI0x3ff6	string		SWAPSPACE2	Linux swap file, 16k page size,
1062726a701SXin LI>0		use			linux-swap
1072726a701SXin LI0x7ff6	string		SWAPSPACE2	Linux swap file, 32k page size,
1082726a701SXin LI>0		use			linux-swap
1092726a701SXin LI0xfff6	string		SWAPSPACE2	Linux swap file, 64k page size,
1102726a701SXin LI>0		use			linux-swap
1112726a701SXin LI
1122726a701SXin LI0	name	linux-hibernate
1132726a701SXin LI>0	string	S1SUSPEND	\b, with SWSUSP1 image
1142726a701SXin LI>0	string	S2SUSPEND	\b, with SWSUSP2 image
1152726a701SXin LI>0	string	ULSUSPEND	\b, with uswsusp image
1162726a701SXin LI>0	string	LINHIB0001	\b, with compressed hibernate image
1172726a701SXin LI>0	string	\xed\xc3\x02\xe9\x98\x56\xe5\x0c	\b, with tuxonice image
1182726a701SXin LI>0	default	x			\b, with unknown hibernate image
1192726a701SXin LI
1202726a701SXin LI0xfec	string		SWAPSPACE2	Linux swap file, 4k page size,
1212726a701SXin LI>0		use			linux-swap
1222726a701SXin LI>0xff6	use			linux-hibernate
1232726a701SXin LI0x1fec	string		SWAPSPACE2	Linux swap file, 8k page size,
1242726a701SXin LI>0		use			linux-swap
1252726a701SXin LI>0x1ff6	use			linux-hibernate
1262726a701SXin LI0x3fec	string		SWAPSPACE2	Linux swap file, 16k page size,
1272726a701SXin LI>0		use			linux-swap
1282726a701SXin LI>0x3ff6	use			linux-hibernate
1292726a701SXin LI0x7fec	string		SWAPSPACE2	Linux swap file, 32k page size,
1302726a701SXin LI>0		use			linux-swap
1312726a701SXin LI>0x7ff6	use			linux-hibernate
1322726a701SXin LI0xffec	string		SWAPSPACE2	Linux swap file, 64k page size,
1332726a701SXin LI>0		use			linux-swap
1342726a701SXin LI>0xfff6	use			linux-hibernate
1352726a701SXin LI
136b6cee71dSXin LI#
137b6cee71dSXin LI# Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu>
138b6cee71dSXin LI# and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
139b6cee71dSXin LI# and Nicolas Lichtmaier <nick@debian.org>
140*ae316d1dSXin LI# and Joerg Jenderek [unifying + more kernel info]
141*ae316d1dSXin LI# many start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
142*ae316d1dSXin LI# by assembler instructions like: movw $0x07c0,%ax; movw %ax,%ds; movw $0x9000,%ax; movw %ax,%es; movw $0x0001,%cx; subw %si,%si; subw
143b6cee71dSXin LI# Linux kernel boot images (i386 arch) (Wolfram Kleff)
14448c779cdSXin LI# URL: https://www.kernel.org/doc/Documentation/x86/boot.txt
145b6cee71dSXin LI514	string		HdrS		Linux kernel
146*ae316d1dSXin LI# to display Linux kernel (strength=125=70+55) after VBR boot sector (130=70+60) but before DOS/MBR IPL (115=50+65), MBR boot sector (105=40+65) via ./filesystem
147*ae316d1dSXin LI# before MZ PE32 executable (EFI application) (strength=50) and before DOS executable (COM) (strength=40) with start instruction 0xe9 via ./msdos
148b6cee71dSXin LI!:strength + 55
14948c779cdSXin LI# often no extension like in linux, vmlinuz, bzimage or memdisk but sometimes
15048c779cdSXin LI# Acronis Recovery kernel64.dat and Plop Boot Manager plpbtrom.bin
15148c779cdSXin LI# DamnSmallLinux 1.5 damnsmll.lnx
152*ae316d1dSXin LI#!:mime	application/octet-stream
153*ae316d1dSXin LI!:mime	application/x-linux-kernel
15448c779cdSXin LI!:ext	/dat/bin/lnx
155*ae316d1dSXin LI# GRR: does there exist here samples without 55AA boot signature? I believe NO (Joerg Jenderek)
156b6cee71dSXin LI>510	leshort		0xAA55		x86 boot executable
157*ae316d1dSXin LI>>0		use	kernel-info
158*ae316d1dSXin LI# show information about Linux kernel (root, swap device, vga modus, boot protocol, setup size, init_size, EFI entry point)
159*ae316d1dSXin LI0		name	kernel-info
160*ae316d1dSXin LI# like: plpbtrom.bin
161*ae316d1dSXin LI# After 16 bit jump instruction Hi, are you searching something? This is the Plop Boot Manager written by Elmar Hanlhofer http?://www.plop.at
162*ae316d1dSXin LI>48	string		Plop\040Boot\040Manager		from PLOP Boot Manager
163*ae316d1dSXin LI# dummy test below 512 limit (for LILO 24.2 bootsect.b) to get same magic indention level like in v 1.85
164*ae316d1dSXin LI# and display comma before zImage/bzImage or version
165*ae316d1dSXin LI>498	leshort		x		\b,
166*ae316d1dSXin LI# boot protocol option flags valid since boot protocol >= 2.00
167b6cee71dSXin LI>>518	leshort		>0x1ff
168*ae316d1dSXin LI# loadflags bit 0 (read); LOADED_HIGH; if 0, the protected-mode code is loaded at 0x10000
169*ae316d1dSXin LI>>>529	ubyte&0x01	0		zImage,
170*ae316d1dSXin LI# loadflags bit 0 (read); LOADED_HIGH; if 1, the protected-mode code is loaded at 0x100000; that implies is_bzImage
171*ae316d1dSXin LI>>>529	ubyte&0x01	1		bzImage,
172*ae316d1dSXin LI# kernel_version; since protocol 2.00 if not zero 2 byte pointer to kernel version string -200h; should be < 200h*setup_sects
173*ae316d1dSXin LI# 0h (ldntldr.bin plpbtrom.bin) 260h (memtest32.bin memtest64.bin) 3b0h (memdisk16.bin) 890h (damnsmll.lnx) 3400h (linux64) 3640h (linux)
174*ae316d1dSXin LI#>>>526	uleshort	x		kernel_version=%#4.4x
175*ae316d1dSXin LI>>>526	uleshort	>0
176*ae316d1dSXin LI# GRR: \353fHdrS\003\002 wrong shown if kernel_version=0 like in ldntldr.bin (GRUB for DOS)
177b6cee71dSXin LI>>>>(526.s+0x200) string	>\0	version %s,
178*ae316d1dSXin LI# 498 MasterBootRecord 4th partition entry partition type (0~empty 1~FAT12) done by ./filesystems
179*ae316d1dSXin LI# 499 MasterBootRecord 4th partition entry end heads done by ./filesystems
180*ae316d1dSXin LI# root_flags; if set (=1), the root is mounted readonly; deprecated, use the "ro" or "rw" option on the command line instead
181*ae316d1dSXin LI#>>498	uleshort	>1		root_flags=%u
182b6cee71dSXin LI>>498	leshort		1		RO-rootFS,
183b6cee71dSXin LI>>498	leshort		0		RW-rootFS,
184*ae316d1dSXin LI# root_dev; default root device number like 0 301h (/dev/hda1 damnsmll.lnx) 380h (/dev/hd?? linux-elks); deprecated and replaced by command line option root=
18543a5ec4eSXin LI>>508	leshort		>0		root_dev %#X,
186*ae316d1dSXin LI# since protocol 2.04 the 2 upper bytes of long syssize and not swap_dev any more
187*ae316d1dSXin LI>>518	uleshort	<0x204
188*ae316d1dSXin LI# 502-505 MasterBootRecord 4th partition entry 1st LBA sector done by ./filesystems
189*ae316d1dSXin LI>>>502	leshort		>0		swap_dev %#X,
190b6cee71dSXin LI>>504	leshort		>0		RAMdisksize %u KB,
191*ae316d1dSXin LI# 506-509 MasterBootRecord 4th partition entry sectors in partition done by ./filesystems
192b6cee71dSXin LI>>506	leshort		0xFFFF		Normal VGA
193b6cee71dSXin LI>>506	leshort		0xFFFE		Extended VGA
194b6cee71dSXin LI>>506	leshort		0xFFFD		Prompt for Videomode
195b6cee71dSXin LI>>506	leshort		>0		Video mode %d
196*ae316d1dSXin LI# more kernel information added by Joerg Jenderek 2023
197*ae316d1dSXin LI# if needed display comma after video mode and before setup_sects
198*ae316d1dSXin LI>>506	leshort		>-4
199*ae316d1dSXin LI>>>506	leshort		!0		\b,
200*ae316d1dSXin LI# setup_sects; if field contains 0, the real value is 4; size of the setup in sectors like:
201*ae316d1dSXin LI# 0 (memdisk16.bin) 1 (ldntldr.bin) 2 (memtest32.bin memtest64.bin) 4 (plpbtrom.bin linux-elks) 8 (bootsect.b) 10 (damnsmll.lnx) 25 27 (linux64) 29 30 31 33 (linux)
202*ae316d1dSXin LI# MasterBootRecord 4th partition entry start cylinder bits 0-7 done by ./filesystems
203*ae316d1dSXin LI>>497	ubyte		!0		setup size 512*%u
204*ae316d1dSXin LI>>497	ubyte		=0		setup size 512*4 (not 0)
205*ae316d1dSXin LI# 500 MasterBootRecord 4th partition entry end sectors+cylinder bits 8-9 done by ./filesystems
206*ae316d1dSXin LI# 501 MasterBootRecord 4th partition entry end cylinder bits 0-7 done by ./filesystems
207*ae316d1dSXin LI# syssize; 32-bit code size in 16-byte paragraphs; since protocol 2.04 long before unreliable short
208*ae316d1dSXin LI>>518	uleshort	<0x204		\b,
209*ae316d1dSXin LI# 0 (ldntldr.bin) 0 (memdisk16.bin) f180h (damnsmll.lnx)
210*ae316d1dSXin LI>>>500	uleshort	x		syssize %#x
211*ae316d1dSXin LI>>518	uleshort	>0x203		\b,
212*ae316d1dSXin LI# 0 (plpbtrom.bin) 1270h (linux-elks) 217eh (memtest32.bin) 22deh (memtest64.bin) 2c01h (memtest86+.bin) 459c6h (linux misinterpreted as swap_dev 0X4) 70c32h (linux64 misinterpreted as swap_dev 0X7)
213*ae316d1dSXin LI>>>500	ulelong		x		syssize %#x
214*ae316d1dSXin LI# jump; jump instruction relative to byte 0x202
215*ae316d1dSXin LI>>512	ubyte		=0xEB		\b, jump
216*ae316d1dSXin LI# jump adress like: 0x230 (damnsmll.lnx) 0x240 (memdisk16.bin) 0x268 (memtest32.bin memtest64.bin ldntldr.bin linux AFTER handover offset) 0x26c (linux64)
217*ae316d1dSXin LI>>>513	byte+2		x		0x2%2.2x
218*ae316d1dSXin LI# next instruction like:
219*ae316d1dSXin LI# b800088ec00fb60e	mov ax,0x0800; mov es,ax; movzx cx,byte []					memdisk16.bin
220*ae316d1dSXin LI# 8cc88ed88ec0e88b00	movw %cs,%ax; movw %ax,%ds; movw %ax,%es; call get_mem_info			memtest32.bin
221*ae316d1dSXin LI# 8cc88ed88ec0e88b00	movw %cs,%ax; movw %ax,%ds; movw %ax,%es; call get_mem_info			memtest64.bin
222*ae316d1dSXin LI>>>(513.b+514)		ubequad		x	%#16.16llx instruction
223*ae316d1dSXin LI# without jump instruction like: 0 (bootsect-lilo-24.2.b EOF!) 0xb8 (mov linux-elks) 0xfa (cli memtest86+.bin)
224*ae316d1dSXin LI>>512	ubyte		!0xEB		\b, at 0x200 %#x instruction
225*ae316d1dSXin LI# boot protocol version field valid since version >= 2.00 which is indicated by HdrS magic
226*ae316d1dSXin LI# so skip memtest86+.bin with misinterpreted protocol 144.0 (0x9000)
227*ae316d1dSXin LI>>514	string		HdrS		\b,
228*ae316d1dSXin LI# Boot protocol version; 2.3 (ldntldr.bin damnsmll.lnx) 2.6 (plpbtrom.bin) 2.10 2.11 (linux) 2.12 (memtest32.bin) 2.13 2.15 (linux64)
229*ae316d1dSXin LI>>>519	ubyte		x		protocol %u
230*ae316d1dSXin LI>>>518	ubyte		x		\b.%u
231*ae316d1dSXin LI# boot protocol in hexadecimal needed for addtional tests
232*ae316d1dSXin LI#>>>518	uleshort	x		(%#4.4x)
233*ae316d1dSXin LI# type_of_loader; Boot loader identifier; filled out by the bootloader
234*ae316d1dSXin LI>>>528		ubyte		>0	\b, loader %#x
235*ae316d1dSXin LI# loadflags; boot protocol option flags
236*ae316d1dSXin LI#>>>529	ubyte		x		loadflags=%#x
237*ae316d1dSXin LI# loadflags bit 1 (kernel internal); KASLR_FLAG KASLR status to kernel
238*ae316d1dSXin LI>>>529	ubyte&0x02	!0		\b, KASLR enabled
239*ae316d1dSXin LI# loadflags bit 5 (write); QUIET_FLAG
240*ae316d1dSXin LI>>>529	ubyte&0x20	!0		\b, quiet
241*ae316d1dSXin LI# loadflags bit 6 (write) since boot protocal version >= 2.07; KEEP_SEGMENTS
242*ae316d1dSXin LI>>>518	uleshort	>0x206
243*ae316d1dSXin LI>>>>529	ubyte&0x40	!0		\b, keep segments
244*ae316d1dSXin LI# loadflags bit 7 (write); CAN_USE_HEAP
245*ae316d1dSXin LI>>>529	ubyte&0x80	!0		\b, can use heap
246*ae316d1dSXin LI# payload_offset; since boot protocol 2.08 if non-zero contains offset of the protected-mode code to the payload like: cdh (linux) 40dh (linux64)
247*ae316d1dSXin LI>>>518	uleshort	>0x207
248*ae316d1dSXin LI>>>>584	ulelong		>0		\b, from protected-mode code at offset %#x
249*ae316d1dSXin LI# payload_length; since boot protocol 2.08 the length of the payload like: 452c41h (linux) 6fb644h (linux64)
250*ae316d1dSXin LI>>>>>588 ulelong	x		%#x bytes
251*ae316d1dSXin LI# jump setup size sectors a 512 bytes from kernel beginning
252*ae316d1dSXin LI>>>>>(497.b*512)	ubequad	x
253*ae316d1dSXin LI#>>>>>(497.b*512)	ubequad	x	512BYTES_BEFORE_PROTECTED-MODE_CODE=%#16.16llx
254*ae316d1dSXin LI# jump payload_offset bytes + 512 bytes (for boot sector) - 8 (ubequad length) to payload start
255*ae316d1dSXin LI#>>>>>>&(584.l+504) ubeshort	x	PAYLOAD=%#4.4x
256*ae316d1dSXin LI# supported compression formats are gzip (magic numbers 1F8B or 1F9E linux) bzip2 (425A), LZMA (5D00 linux64), XZ (FD37) LZ4 (0221) ZST v0.8+ (28B5)
257*ae316d1dSXin LI>>>>>>&(584.l+504) ubeshort	=0x1F8B	gzip compressed
258*ae316d1dSXin LI>>>>>>&(584.l+504) ubeshort	=0x1F9E	gzip compressed
259*ae316d1dSXin LI>>>>>>&(584.l+504) ubeshort	=0x425A	bzip2 compressed
260*ae316d1dSXin LI>>>>>>&(584.l+504) ubeshort	=0x5D00	LZMA compressed
261*ae316d1dSXin LI>>>>>>&(584.l+504) ubeshort	=0xFD37	XZ compressed
262*ae316d1dSXin LI>>>>>>&(584.l+504) ubeshort	=0x0221	LZ4 compressed
263*ae316d1dSXin LI>>>>>>&(584.l+504) ubeshort	=0x28B5	ZST compressed
264*ae316d1dSXin LI# TODO: handle compressed data by ./compress; difficulties with leading space and duplicate gzip compressed
265*ae316d1dSXin LI#>>>>>>&(584.l+504) indirect	x	COMPRESS_NOT_WORKING
266*ae316d1dSXin LI# setup_move_size; for protocol 2.00-2.01; bytes starting with the beginning of the boot sector
267*ae316d1dSXin LI# like: 0 (ldntldr.bin memdisk16.bin memtest32.bin memtest64.bin plpbtrom.bin) 8000h (damnsmll.lnx linux linux64)
268*ae316d1dSXin LI>>>518	uleshort	<0x202
269*ae316d1dSXin LI>>>>518	uleshort	>0x1FF
270*ae316d1dSXin LI>>>>530	uleshort	x		\b, setup_move_size %#4.4x
271*ae316d1dSXin LI# code32_start; address to jump to in protected mode like: 100000h (linux linux64 memtest32.bin memtest64.bin)
272*ae316d1dSXin LI#>>>>532	ulelong		>0		\b, code32_start %#x
273*ae316d1dSXin LI# kernel_alignment; since boot protocol 2.05 alignment unit required by the kernel (if relocatable_kernel is true) like: 0 (plptrom.bin) 1000h (memtest32.bin memtest64.bin) 200000h (linux) 1000000h (linux64)
274*ae316d1dSXin LI#>>>518	uleshort	>0x204
275*ae316d1dSXin LI#>>>>560	ulelong		x		\b, kernel_alignment %#x
276*ae316d1dSXin LI# relocatable_kernel; since boot protocol 2.05 the protected-mode part of the kernel can be loaded at any address if this field is nonzero
277*ae316d1dSXin LI>>>518	uleshort	>0x204
278*ae316d1dSXin LI>>>>564	ubyte		=1		\b, relocatable
279*ae316d1dSXin LI#>>>>564	ubyte		x		\b, relocatable_kernel=%u
280*ae316d1dSXin LI# min_alignment; since boot protocol 2.10 if nonzero, indicates as a power of two the minimum alignment required like: 12 (4 KB memtest32.bin memtest64.bin) 13 (8 KB linux) 21 (2 MB linux64)
281*ae316d1dSXin LI#>>>518	uleshort	>0x209
282*ae316d1dSXin LI#>>>>565	ubyte		>0		\b, min_alignment %u
283*ae316d1dSXin LI# xloadflags; since boot protocol 2.12 like: 3fh (linux64 unexpected value) 4h(memtest32.bin) 9h(memtest64.bin)
284*ae316d1dSXin LI>>>518	uleshort	>0x20B
285*ae316d1dSXin LI#>>>>566	uleshort	x		\b, xloadflags=%#4.4x
286*ae316d1dSXin LI# handover_offset; offset from beginning of kernel image to EFI handover protocol entry point like:
287*ae316d1dSXin LI# 0 (damnsmll.lnx ldntldr.bin) 10h (memtest32.bin memtest64.bin) 30h (linux) 190h (linux64) 8e9000b8h (plpbtrom.bin INVALID!)
288*ae316d1dSXin LI# this value makes only sense when 32 or 64-bit EFI handoff entry point
289*ae316d1dSXin LI>>>>566	uleshort&0x000C	!0		\b, handover offset
290*ae316d1dSXin LI>>>>>612 ulelong	x		%#x
291*ae316d1dSXin LI# Bit 0 XLF_KERNEL_64; if 1, this kernel has the legacy 64-bit entry point at 0x200
292*ae316d1dSXin LI>>>>566	uleshort&0x0001	!0		\b, legacy 64-bit entry point
293*ae316d1dSXin LI# Bit 1 XLF_CAN_BE_LOADED_ABOVE_4G; if 1, kernel/boot_params/cmdline/ramdisk can be above 4G
294*ae316d1dSXin LI>>>>566	uleshort&0x0002	!0		\b, can be above 4G
295*ae316d1dSXin LI# Bit 2 XLF_EFI_HANDOVER_32; if 1, the kernel supports the 32-bit EFI handoff entry point
296*ae316d1dSXin LI>>>>566	uleshort&0x0004	!0		\b, 32-bit EFI handoff entry point
297*ae316d1dSXin LI# Bit 3 XLF_EFI_HANDOVER_64; if 1, the kernel supports the 64-bit EFI handoff entry point
298*ae316d1dSXin LI>>>>566	uleshort&0x0008	!0		\b, 64-bit EFI handoff entry point
299*ae316d1dSXin LI# Bit 4 EFI_KEXEC; if 1, the kernel supports kexec EFI boot with EFI runtime support
300*ae316d1dSXin LI>>>>566	uleshort&0x0010	!0		\b, EFI kexec boot support
301*ae316d1dSXin LI# GRR: What does bit 5 mean?
302*ae316d1dSXin LI>>>>566	uleshort&0x0020	!0		\b, xloadflags bit 5
303*ae316d1dSXin LI# cmdline_size; since boot protocol 2.06 maximum size of the kernel command line like: 255 (memtest32.bin memtest64.bin) 2047 (linux linux64 plpbtrom); version <= 2.06 maximum was 255
304*ae316d1dSXin LI>>>518	uleshort	>0x205
305*ae316d1dSXin LI>>>>568	ulelong		x		\b, max cmdline size %u
306*ae316d1dSXin LI# hardware_subarch; since boot protocol 2.07 hardware subarchtecture like: 0~default x86 1~lguest 2~Xen 3~Moorestown 4~CE4100 TV
307*ae316d1dSXin LI>>>518	uleshort	>0x206
308*ae316d1dSXin LI>>>>572	ulelong		>0		\b, hardware_subarch %u
309*ae316d1dSXin LI# hardware_subarch_data; since boot protocol 2.07 pointer to data specific for hardware subarch; unused for default x86
310*ae316d1dSXin LI>>>>>576 ulequad	>0		\b, hardware_subarch_data %#llx
311*ae316d1dSXin LI# setup_data; since boot protocol 2.09 64-bit physical pointer to NULL terminated single linked list of struct setup_data
312*ae316d1dSXin LI>>>518	uleshort	>0x208
313*ae316d1dSXin LI>>>>592	ulequad		>0		\b, setup_data %16.16llx
314*ae316d1dSXin LI# pref_address; since boot protocol 2.10 if nonzero preferred load address for kernel like: 100000h (memtest32.bin memtest64.bin) 200000h (linux) 1000000h (linux64)
315*ae316d1dSXin LI#>>>518	uleshort	>0x209
316*ae316d1dSXin LI#>>>>600	ulequad		>0		\b, pref_address %#llx
317*ae316d1dSXin LI# init_size; since boot protocol 2.10 indicates amount of contiguous memory kernel needs before it is capable of examining its memory map
318*ae316d1dSXin LI# like: 0h (damnsmll.lnx) 687f8h (memtest32.bin) 6acf8h (memtest64.bin) aa3000h (linux) 2514000h (linux64) 67ea0000h (memdisk16.bin INVALID) a4f3f2ffh (plpbtrom.bin INVALID) ffffff80h (ldntldr.bin INVALID)
319*ae316d1dSXin LI>>>518	uleshort	>0x209
320*ae316d1dSXin LI>>>>608	ulelong		x		\b, init_size %#x
321b6cee71dSXin LI# This also matches new kernels, which were caught above by "HdrS".
322*ae316d1dSXin LI# but also few samples without "HdrS" magic like: bootsect-lilo-24.2.b linux-elks memtest86+.bin
323*ae316d1dSXin LI# URL:		https://tldp.org/HOWTO/Linux-i386-Boot-Code-HOWTO/bootsect.html
324*ae316d1dSXin LI#0		belong	0xb8c0078e	Linux kernel
325*ae316d1dSXin LI0		belong	0xb8c0078e
326*ae316d1dSXin LI# to display Linux x86 kernel or Linux ELKS Kernel (strength=70=70+0) after VBR boot sector (130=70+60) DOS/MBR IPL (115=50+65), MBR boot sector (105=40+65) via ./filesystem
327*ae316d1dSXin LI#!:strength +0
328*ae316d1dSXin LI# "newer" kernel (with HdrS magic) already done before
329*ae316d1dSXin LI>514	string		HdrS
330*ae316d1dSXin LI# so handle "old" kernel variant (without HdrS magic)
331*ae316d1dSXin LI>514	default	x			Linux
332*ae316d1dSXin LI#!:mime	application/octet-stream
333*ae316d1dSXin LI!:mime	application/x-linux-kernel
334*ae316d1dSXin LI# GRR: in file 5.45 remaining default clause not working for samples with size = 512 like LILO 24.2 bootsect.b
335*ae316d1dSXin LI>>0	belong	x
336*ae316d1dSXin LI# ELKS kernel variant is now unified with other "old" kernel variant (without HdrS magic)
337*ae316d1dSXin LI>>0x1e6		belong		=0x454c4b53	ELKS Kernel
338*ae316d1dSXin LI!:ext	/
339*ae316d1dSXin LI# "old" kernel variant and not ELKS
340*ae316d1dSXin LI>>0x1e6		belong		!0x454c4b53	x86 kernel
341*ae316d1dSXin LI!:ext	/b/bin
342*ae316d1dSXin LI# show kernel version information based on "Loading" message offset
343*ae316d1dSXin LI>>0		use	kernel-version-old1
344*ae316d1dSXin LI# unified "old" variant with start instruction \xb8\xc0\x07\x8e\xd8\xb8\x00\x90
345*ae316d1dSXin LI>>4		string		\xd8\xb8\x00\x90
346*ae316d1dSXin LI# show kernel version information part 2 for "old" kernel variant (without HdrS magic) based on new HdrS field
347*ae316d1dSXin LI>>>0		use	kernel-version-old2
348*ae316d1dSXin LI# show kernel version information part 3 for "old" kernel variant (without HdrS magic) based on new HdrS field
349*ae316d1dSXin LI>>>0		use	kernel-version-old3
350*ae316d1dSXin LI# show common kernel information
351*ae316d1dSXin LI>>0		use	kernel-info
352*ae316d1dSXin LI# show kernel version information part 1 for "old" kernel variant (without HdrS magic) based on "Loading" message offset
353*ae316d1dSXin LI0		name	kernel-version-old1
354b6cee71dSXin LI>0x1e3		string	Loading		version 1.3.79 or older
355b6cee71dSXin LI>0x1e9		string	Loading		from prehistoric times
356*ae316d1dSXin LI# LILO 24.2-5.1 bootsect.b
357*ae316d1dSXin LI>0x1c5		string	Loading			from LILO 24.2
358*ae316d1dSXin LI# Memtest86 5.31b memtest86+.bin
359*ae316d1dSXin LI>0x1d2		string	Loading			from Memtest86 5.31b
360*ae316d1dSXin LI# DamnSmallLinux kernel version 2.4.26 damnsmll.lnx not needed because done by kernel_version pointer
361*ae316d1dSXin LI#>0x1cb		string	Loading			damnsmll.lnx 2.4.26~
362*ae316d1dSXin LI# Memtest86+ v6.20 memtest32.bin not needed because done by kernel_version pointer
363*ae316d1dSXin LI#>0x1c6		string	Loading\040Memtest86+	from Memtest86+ v6.20
364b6cee71dSXin LI
365b6cee71dSXin LI# System.map files - Nicolas Lichtmaier <nick@debian.org>
366b6cee71dSXin LI8	search/1	\ A\ _text	Linux kernel symbol map text
367b6cee71dSXin LI
368b6cee71dSXin LI# LSM entries - Nicolas Lichtmaier <nick@debian.org>
369b6cee71dSXin LI0	search/1	Begin3	Linux Software Map entry text
370b6cee71dSXin LI0	search/1	Begin4	Linux Software Map entry text (new format)
371b6cee71dSXin LI
372b6cee71dSXin LI# From Matt Zimmerman, enhanced for v3 by Matthew Palmer
373b6cee71dSXin LI0	belong	0x4f4f4f4d	User-mode Linux COW file
374b6cee71dSXin LI>4	belong	<3		\b, version %d
375b6cee71dSXin LI>>8	string	>\0		\b, backing file %s
376b6cee71dSXin LI>4	belong	>2		\b, version %d
377b6cee71dSXin LI>>32	string	>\0		\b, backing file %s
378b6cee71dSXin LI
379b6cee71dSXin LI############################################################################
380b6cee71dSXin LI# Linux kernel versions
381b6cee71dSXin LI
382*ae316d1dSXin LI# apply only to "old" kernel variant (without HdrS magic) like damnsmll.lnx memtest86+.bin
383*ae316d1dSXin LI# wrong (497 setup_sects 498 root_flags) and now already done by 1st unified "old" kernel variant
384*ae316d1dSXin LI#0		string		\xb8\xc0\x07\x8e\xd8\xb8\x00\x90	Linux
385*ae316d1dSXin LI0		string		\xb8\xc0\x07\x8e\xd8\xb8\x00\x90foo	OLD_VARIANT Linux
386b6cee71dSXin LI>497		leshort		0		x86 boot sector
387*ae316d1dSXin LI>>0		use	kernel-version-old2
388*ae316d1dSXin LI>497		leshort		!0		x86 kernel
389*ae316d1dSXin LI# not needed any more because information is now shown by common kernel-info with other phrases
390*ae316d1dSXin LI>>0		use	kernel-info-old
391*ae316d1dSXin LI# kernel version information part 3 for "old" kernel variant (without HdrS magic) based on HdrS field
392*ae316d1dSXin LI>>0		use	kernel-version-old3
393*ae316d1dSXin LI>>0		use	kernel-version-4
394*ae316d1dSXin LI# version information part 2 for "old" kernel variant (without HdrS magic) based on new HdrS field
395*ae316d1dSXin LI0		name	kernel-version-old2
396*ae316d1dSXin LI# dummy test to get same magic indention level like in v 1.85
397*ae316d1dSXin LI>518		leshort		x
398b6cee71dSXin LI>>514		belong		0x8e	of a kernel from the dawn of time!
399b6cee71dSXin LI>>514		belong		0x908ed8b4	version 0.99-1.1.42
400b6cee71dSXin LI>>514		belong		0x908ed8b8	for memtest86
401*ae316d1dSXin LI# dummy test function to get same magic indention level like in v 1.85
402*ae316d1dSXin LI0		name	kernel-version-dummy
403b6cee71dSXin LI>497		leshort		!0		x86 kernel
404*ae316d1dSXin LI# not needed any more because information is now shown by kernel-info
405*ae316d1dSXin LI#>0		use	kernel-info-old
406*ae316d1dSXin LI>>0		use	kernel-info
407*ae316d1dSXin LI# kernel version information part 3 for "old" kernel variant (without HdrS magic) based on HdrS field
408*ae316d1dSXin LI>0		use	kernel-version-old3
409*ae316d1dSXin LI# deprecated because same information is shown by kernel-info with other phrases
410*ae316d1dSXin LI0		name	kernel-info-old
411*ae316d1dSXin LI# dummy test to get same magic indention level like in v 1.85
412*ae316d1dSXin LI>504		leshort		x
413b6cee71dSXin LI>>504		leshort		>0		RAMdisksize=%u KB
41443a5ec4eSXin LI>>502		leshort		>0		swap=%#X
41543a5ec4eSXin LI>>508		leshort		>0		root=%#X
416b6cee71dSXin LI>>>498		leshort		1		\b-ro
417b6cee71dSXin LI>>>498		leshort		0		\b-rw
418b6cee71dSXin LI>>506		leshort		0xFFFF		vga=normal
419b6cee71dSXin LI>>506		leshort		0xFFFE		vga=extended
420b6cee71dSXin LI>>506		leshort		0xFFFD		vga=ask
421b6cee71dSXin LI>>506		leshort		>0		vga=%d
422*ae316d1dSXin LI# kernel version information part 3 for "old" kernel variant (without HdrS magic) based on HdrS field
423*ae316d1dSXin LI0		name	kernel-version-old3
424*ae316d1dSXin LI# dummy test to get same magic indention level like in v 1.85
425*ae316d1dSXin LI>514		belong		x
426b6cee71dSXin LI>>514		belong		0x908ed881	version 1.1.43-1.1.45
427b6cee71dSXin LI>>514		belong		0x15b281cd
428b6cee71dSXin LI>>>0xa8e	belong		0x55AA5a5a	version 1.1.46-1.2.13,1.3.0
429b6cee71dSXin LI>>>0xa99	belong		0x55AA5a5a	version 1.3.1,2
430b6cee71dSXin LI>>>0xaa3	belong		0x55AA5a5a	version 1.3.3-1.3.30
431b6cee71dSXin LI>>>0xaa6	belong		0x55AA5a5a	version 1.3.31-1.3.41
432b6cee71dSXin LI>>>0xb2b	belong		0x55AA5a5a	version 1.3.42-1.3.45
433b6cee71dSXin LI>>>0xaf7	belong		0x55AA5a5a	version 1.3.46-1.3.72
434*ae316d1dSXin LI# show kernel version information part 4 for kernel variant (with HdrS magic) based on "HdrS" field
435*ae316d1dSXin LI# not needed any more because information is now shown by common kernel-info
436*ae316d1dSXin LI0		name	kernel-version-4
437*ae316d1dSXin LI# dummy test to get same magic indention level like in v 1.85
438*ae316d1dSXin LI>518		leshort		x
439b6cee71dSXin LI>>514		string		HdrS
440b6cee71dSXin LI>>>518		leshort		>0x1FF
441b6cee71dSXin LI>>>>529		byte		0		\b, zImage
442b6cee71dSXin LI>>>>529		byte		1		\b, bzImage
443*ae316d1dSXin LI# GRR: Not valid if kernel_version=0
444b6cee71dSXin LI>>>>(526.s+0x200) string 	>\0		\b, version %s
445b6cee71dSXin LI
446b6cee71dSXin LI# Linux boot sector thefts.
447*ae316d1dSXin LI# ELKS kernel variant is now unified with above "old" kernel variant (without HdrS magic)
448*ae316d1dSXin LI#0		belong		0xb8c0078e	Linux
449*ae316d1dSXin LI# display "Linux ELKS Kernel" or "Linux style boot sector" (strength=70) after DOS/MBR IPL (115=50+65) and MBR boot sector (105=40+65) via ./filesystem
450*ae316d1dSXin LI#!:strength +0
451*ae316d1dSXin LI# https://en.wikipedia.org/wiki/Embeddable_Linux_Kernel_Subset
452*ae316d1dSXin LI# https://github.com/jbruchon/elks/releases/download/v0.6.0/fd2880-fat.img/linux
453*ae316d1dSXin LI#>0x1e6		belong		0x454c4b53	ELKS Kernel
454*ae316d1dSXin LI#>0x1e6		belong		!0x454c4b53	style boot sector
455b6cee71dSXin LI
456b6cee71dSXin LI############################################################################
457b6cee71dSXin LI# Linux S390 kernel image
458b6cee71dSXin LI# Created by: Jan Kaluza <jkaluza@redhat.com>
459b6cee71dSXin LI8 string \x02\x00\x00\x18\x60\x00\x00\x50\x02\x00\x00\x68\x60\x00\x00\x50\x40\x40\x40\x40\x40\x40\x40\x40 Linux S390
460b6cee71dSXin LI>0x00010000 search/b/4096 \x00\x0a\x00\x00\x8b\xad\xcc\xcc
461b6cee71dSXin LI# 64bit
462b6cee71dSXin LI>>&0 string \xc1\x00\xef\xe3\xf0\x68\x00\x00 Z10 64bit kernel
463b6cee71dSXin LI>>&0 string \xc1\x00\xef\xc3\x00\x00\x00\x00 Z9-109 64bit kernel
464b6cee71dSXin LI>>&0 string \xc0\x00\x20\x00\x00\x00\x00\x00 Z990 64bit kernel
465b6cee71dSXin LI>>&0 string \x00\x00\x00\x00\x00\x00\x00\x00 Z900 64bit kernel
466b6cee71dSXin LI# 32bit
467b6cee71dSXin LI>>&0 string \x81\x00\xc8\x80\x00\x00\x00\x00 Z10 32bit kernel
468b6cee71dSXin LI>>&0 string \x81\x00\xc8\x80\x00\x00\x00\x00 Z9-109 32bit kernel
469b6cee71dSXin LI>>&0 string \x80\x00\x20\x00\x00\x00\x00\x00 Z990 32bit kernel
470b6cee71dSXin LI>>&0 string \x80\x00\x00\x00\x00\x00\x00\x00 Z900 32bit kernel
471b6cee71dSXin LI
4722726a701SXin LI############################################################################
473b6cee71dSXin LI# Linux ARM compressed kernel image
474b6cee71dSXin LI# From: Kevin Cernekee <cernekee@gmail.com>
47548c779cdSXin LI# Update: Joerg Jenderek
476*ae316d1dSXin LI# Update: Luke T. Shumaker
477*ae316d1dSXin LI0	name	arm-zimage
478*ae316d1dSXin LI# Version indicators
479*ae316d1dSXin LI>0x34	lelong	0x45454545	(kernel >=v4.15)
480*ae316d1dSXin LI>0x34	lelong	!0x45454545
481*ae316d1dSXin LI>>0x30	clear	x
482*ae316d1dSXin LI>>0x30	belong	0x04030201	(kernel >=v3.17, <v4.15)
483*ae316d1dSXin LI>>0x30	lelong	0x04030201	(kernel >=v3.17, <v4.15)
484*ae316d1dSXin LI>>0x30	default x	(kernel <v3.17)
485*ae316d1dSXin LI# Endianness indicators
486*ae316d1dSXin LI#
487*ae316d1dSXin LI# The kernel has 3 endianness modes: little-endian, and 2 variants of
488*ae316d1dSXin LI# big-endian: BE-32 (ARMv5) and BE-8 (ARMv6+).
489*ae316d1dSXin LI#
490*ae316d1dSXin LI# In kernels <v3.17:
491*ae316d1dSXin LI#  - the 0x016f2818 @ 0x24 magic number indicates big-endian or
492*ae316d1dSXin LI#    little-endian (can't distinguish between BE-8 and BE-32)
493*ae316d1dSXin LI# In kernels >=v3.17:
494*ae316d1dSXin LI#  - a new 0x04030201 @ 0x30 magic number indicates big-endian or
495*ae316d1dSXin LI#    little-endian, but doesn't distinguish between BE-8 and BE-32
496*ae316d1dSXin LI#  - the old 0x016f2818 @ 0x24 magic number is little-endian for
497*ae316d1dSXin LI#    LE *and* BE-8, or big-endian for BE-32
498*ae316d1dSXin LI#
499*ae316d1dSXin LI# >=v3.17
500*ae316d1dSXin LI>0x30	clear	x
501*ae316d1dSXin LI>0x30	belong	0x04030201	(big-endian,
502*ae316d1dSXin LI>>0x24	belong	0x016f2818	BE-32, ARMv5)
503*ae316d1dSXin LI>>0x24	lelong	0x016f2818	BE-8, ARMv6+)
504*ae316d1dSXin LI>0x30	lelong	0x04030201	(little-endian)
505*ae316d1dSXin LI# <v3.17
506*ae316d1dSXin LI>0x30	default x
507*ae316d1dSXin LI>>0x24	lelong	0x016f2818	(little-endian)
508*ae316d1dSXin LI>>0x24	belong	0x016f2818	(big-endian)
509*ae316d1dSXin LI
5102726a701SXin LI0x24	lelong	0x016f2818	Linux kernel ARM boot executable zImage
511*ae316d1dSXin LI>0	use	arm-zimage
512*ae316d1dSXin LI0x24	belong	0x016f2818	Linux kernel ARM boot executable zImage
513*ae316d1dSXin LI>0	use	arm-zimage
5142726a701SXin LI
5152726a701SXin LI############################################################################
5162726a701SXin LI# Linux AARCH64 kernel image
5172726a701SXin LI0x38    lelong  0x644d5241  Linux kernel ARM64 boot executable Image
5182726a701SXin LI>0x18   lelong  ^1          \b, little-endian
5192726a701SXin LI>0x18   lelong  &1          \b, big-endian
5202726a701SXin LI>0x18   lelong  &2          \b, 4K pages
5212726a701SXin LI>0x18   lelong  &4          \b, 16K pages
5222726a701SXin LI>0x18   lelong  &6          \b, 32K pages
523b6cee71dSXin LI
524b6cee71dSXin LI############################################################################
525*ae316d1dSXin LI# Linux RISC-V kernel image
526*ae316d1dSXin LI0x38	string	RSC\05		Linux kernel RISC-V boot executable Image
527*ae316d1dSXin LI>0x18	lelong	^1		\b, little-endian
528*ae316d1dSXin LI>0x18	lelong	&1		\b, big-endian
529*ae316d1dSXin LI
530*ae316d1dSXin LI############################################################################
531b6cee71dSXin LI# Linux 8086 executable
532b6cee71dSXin LI0	lelong&0xFF0000FF 0xC30000E9	Linux-Dev86 executable, headerless
533b6cee71dSXin LI>5	string		.
534b6cee71dSXin LI>>4	string		>\0		\b, libc version %s
535b6cee71dSXin LI
536b6cee71dSXin LI0	lelong&0xFF00FFFF 0x4000301	Linux-8086 executable
537b6cee71dSXin LI>2	byte&0x01	!0		\b, unmapped zero page
538b6cee71dSXin LI>2	byte&0x20	0		\b, impure
539b6cee71dSXin LI>2	byte&0x20	!0
540b6cee71dSXin LI>>2	byte&0x10	!0		\b, A_EXEC
541b6cee71dSXin LI>2	byte&0x02	!0		\b, A_PAL
542b6cee71dSXin LI>2	byte&0x04	!0		\b, A_NSYM
543b6cee71dSXin LI>2	byte&0x08	!0		\b, A_STAND
544b6cee71dSXin LI>2	byte&0x40	!0		\b, A_PURE
545b6cee71dSXin LI>2	byte&0x80	!0		\b, A_TOVLY
546b6cee71dSXin LI>28     long            !0              \b, not stripped
547b6cee71dSXin LI>37	string		.
548b6cee71dSXin LI>>36	string		>\0		\b, libc version %s
549b6cee71dSXin LI
550b6cee71dSXin LI# 0	lelong&0xFF00FFFF 0x10000301	ld86 I80386 executable
551b6cee71dSXin LI# 0	lelong&0xFF00FFFF 0xB000301	ld86 M68K executable
552b6cee71dSXin LI# 0	lelong&0xFF00FFFF 0xC000301	ld86 NS16K executable
553b6cee71dSXin LI# 0	lelong&0xFF00FFFF 0x17000301	ld86 SPARC executable
554b6cee71dSXin LI
555b6cee71dSXin LI# SYSLINUX boot logo files (from 'ppmtolss16' sources)
55648c779cdSXin LI# https://www.syslinux.org/wiki/index.php/SYSLINUX#Display_graphic_from_filename:
557b6cee71dSXin LI# file extension .lss .16
558b6cee71dSXin LI0	lelong	=0x1413f33d		SYSLINUX' LSS16 image data
559b6cee71dSXin LI# syslinux-4.05/mime/image/x-lss16.xml
560b6cee71dSXin LI!:mime image/x-lss16
561b6cee71dSXin LI>4	leshort	x			\b, width %d
562b6cee71dSXin LI>6	leshort	x			\b, height %d
563b6cee71dSXin LI
564b6cee71dSXin LI0	string	OOOM			User-Mode-Linux's Copy-On-Write disk image
565b6cee71dSXin LI>4	belong	x			version %d
566b6cee71dSXin LI
567b6cee71dSXin LI# SE Linux policy database
568b6cee71dSXin LI# From: Mike Frysinger <vapier@gentoo.org>
569b6cee71dSXin LI0	lelong	0xf97cff8c		SE Linux policy
570b6cee71dSXin LI>16	lelong	x			v%d
571b6cee71dSXin LI>20	lelong	1			MLS
572b6cee71dSXin LI>24	lelong	x			%d symbols
573b6cee71dSXin LI>28	lelong	x			%d ocons
574b6cee71dSXin LI
575b6cee71dSXin LI# Linux Logical Volume Manager (LVM)
576b6cee71dSXin LI# Emmanuel VARAGNAT <emmanuel.varagnat@guzu.net>
577b6cee71dSXin LI#
578b6cee71dSXin LI# System ID, UUID and volume group name are 128 bytes long
579b6cee71dSXin LI# but they should never be full and initialized with zeros...
580b6cee71dSXin LI#
581b6cee71dSXin LI# LVM1
582b6cee71dSXin LI#
5832726a701SXin LI0x0	string/b	HM\001		LVM1 (Linux Logical Volume Manager), version 1
5842726a701SXin LI>0x12c	string/b	>\0		, System ID: %s
585b6cee71dSXin LI
5862726a701SXin LI0x0	string/b	HM\002		LVM1 (Linux Logical Volume Manager), version 2
5872726a701SXin LI>0x12c	string/b	>\0		, System ID: %s
588b6cee71dSXin LI
589b6cee71dSXin LI#  LVM2
590b6cee71dSXin LI#
591b6cee71dSXin LI# It seems that the label header can be in one the four first sector
592b6cee71dSXin LI# of the disk... (from _find_labeller in lib/label/label.c of LVM2)
593b6cee71dSXin LI#
594b6cee71dSXin LI# 0x200 seems to be the common case
5952726a701SXin LI0		name	lvm2
5962726a701SXin LI# display UUID in LVM format + display all 32 bytes (instead of max string length: 31)
5972726a701SXin LI>0x0          string  >\x2f          \b, UUID: %.6s
5982726a701SXin LI>0x6          string  >\x2f          \b-%.4s
5992726a701SXin LI>0xa          string  >\x2f          \b-%.4s
6002726a701SXin LI>0xe          string  >\x2f          \b-%.4s
6012726a701SXin LI>0x12         string  >\x2f          \b-%.4s
6022726a701SXin LI>0x16         string  >\x2f          \b-%.4s
6032726a701SXin LI>0x1a         string  >\x2f          \b-%.6s
6042726a701SXin LI>0x20         lequad  x              \b, size: %lld
605b6cee71dSXin LI
6062726a701SXin LI
607b6cee71dSXin LI# read the offset to add to the start of the header, and the header
608b6cee71dSXin LI# start in 0x200
6092726a701SXin LI0x218           string/b  LVM2\ 001      LVM2 PV (Linux Logical Volume Manager)
6102726a701SXin LI>&(&-12.l-0x20) use	lvm2
611b6cee71dSXin LI
6122726a701SXin LI0x018           string/b  LVM2\ 001      LVM2 PV (Linux Logical Volume Manager)
6132726a701SXin LI>&(&-12.l-0x20) use	lvm2
614b6cee71dSXin LI
6152726a701SXin LI0x418           string/b  LVM2\ 001      LVM2 PV (Linux Logical Volume Manager)
6162726a701SXin LI>&(&-12.l-0x20) use	lvm2
617b6cee71dSXin LI
6182726a701SXin LI0x618           string/b  LVM2\ 001      LVM2 PV (Linux Logical Volume Manager)
6192726a701SXin LI>&(&-12.l-0x20) use	lvm2
620b6cee71dSXin LI
621b6cee71dSXin LI# LVM snapshot
622b6cee71dSXin LI# from Jason Farrel
623b6cee71dSXin LI0	string	SnAp	LVM Snapshot (CopyOnWrite store)
624b6cee71dSXin LI>4	lelong	!0	- valid,
625b6cee71dSXin LI>4	lelong	0	- invalid,
626b6cee71dSXin LI>8	lelong	x	version %d,
627b6cee71dSXin LI>12	lelong	x	chunk_size %d
628b6cee71dSXin LI
629b6cee71dSXin LI# Summary: Xen saved domain file
630b6cee71dSXin LI# Created by: Radek Vokal <rvokal@redhat.com>
631b6cee71dSXin LI0	string		LinuxGuestRecord	Xen saved domain
632b6cee71dSXin LI>20	search/256	(name
633b6cee71dSXin LI>>&1	string		x			(name %s)
634b6cee71dSXin LI
635b6cee71dSXin LI# Systemd journald files
63648c779cdSXin LI# See https://www.freedesktop.org/wiki/Software/systemd/journal-files/.
637b6cee71dSXin LI# From: Zbigniew Jedrzejewski-Szmek <zbyszek@in.waw.pl>
638898496eeSXin LI# Update: 	Joerg Jenderek
639898496eeSXin LI# URL:		https://systemd.io/JOURNAL_FILE_FORMAT/
640898496eeSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/j/journal-sysd.trid.xml
641898496eeSXin LI# Note:		called "systemd journal" by TrID
642898496eeSXin LI#		verified by `journalctl --file=user-1000.journal`
643898496eeSXin LI# check magic signature[8]
644b6cee71dSXin LI0	string	LPKSHHRH
645b6cee71dSXin LI# check that state is one of known values
646898496eeSXin LI# STATE_OFFLINE~0 STATE_ONLINE~1 STATE_ARCHIVED~2
647b6cee71dSXin LI>16		ubyte&252	0
648b6cee71dSXin LI# check that each half of three unique id128s is non-zero
649898496eeSXin LI# file_id
650b6cee71dSXin LI>>24		ubequad		>0
651b6cee71dSXin LI>>>32		ubequad		>0
652898496eeSXin LI# machine_id
653b6cee71dSXin LI>>>>40		ubequad		>0
654b6cee71dSXin LI>>>>>48		ubequad		>0
655898496eeSXin LI# boot_id; last writer
656b6cee71dSXin LI>>>>>>56	ubequad		>0
657b6cee71dSXin LI>>>>>>>64	ubequad		>0	Journal file
658898496eeSXin LI#!:mime application/octet-stream
659898496eeSXin LI!:mime application/x-linux-journal
660b6cee71dSXin LI# provide more info
661898496eeSXin LI# head_entry_realtime; contains a POSIX timestamp stored in microseconds
662898496eeSXin LI>>>>>>>>184	leqdate/1000000	!0	\b, %s
663b6cee71dSXin LI>>>>>>>>184	leqdate		0	empty
664898496eeSXin LI# If a file is closed after writing the state field should be set to STATE_OFFLINE
665898496eeSXin LI>>>>>>>>16	ubyte		0	\b,
666898496eeSXin LI# for offline and empty only journal~ extension found
667898496eeSXin LI>>>>>>>>>184	leqdate		0	offline
668898496eeSXin LI# https://man7.org/linux/man-pages/man8/systemd-journald.service.8.html
669898496eeSXin LI# GRR: add char ~ inside parse_ext in ../../src/apprentice.c to avoid in file version 5.44 error like:
670898496eeSXin LI# Magdir/linux, 463: Warning: EXTENSION type `		journal~' has bad char '~'
671898496eeSXin LI!:ext		journal~
672898496eeSXin LI# for offline and non empty often *.journal~ but also user-1001.journal
673898496eeSXin LI>>>>>>>>>184	leqdate		!0	offline
674898496eeSXin LI!:ext		journal/journal~
675898496eeSXin LI# if a file is opened for writing the state field should be set to STATE_ONLINE
676898496eeSXin LI>>>>>>>>16	ubyte		1	\b,
677898496eeSXin LI# for online and empty only journal~ extension found
678898496eeSXin LI>>>>>>>>>184	leqdate		0	online
679898496eeSXin LI# system@0005febee06e2ff2-f7ea54d10e4346ff.journal~
680898496eeSXin LI!:ext		journal~
681898496eeSXin LI# for online and non empty only journal extension found
682898496eeSXin LI>>>>>>>>>184	leqdate		!0	online
683898496eeSXin LI# system.journal user-1000.journal
684898496eeSXin LI!:ext		journal
685898496eeSXin LI# after a file has been rotated it should be set to STATE_ARCHIVED
686b6cee71dSXin LI>>>>>>>>16	ubyte		2	\b, archived
687898496eeSXin LI!:ext		journal
688898496eeSXin LI# no *.journal~ found
689898496eeSXin LI#!:ext		journal/journal~
690898496eeSXin LI# compatible_flags
691b6cee71dSXin LI>>>>>>>>8	ulelong&1	1	\b, sealed
692898496eeSXin LI# incompatible_flags; COMPRESSED_XZ~1 COMPRESSED_LZ4~2 KEYED_HASH~4 COMPRESSED_ZSTD~8 COMPACT~16
693898496eeSXin LI#>>>>>>>>12	ulelong		x	FLAGS=%#x
694b6cee71dSXin LI>>>>>>>>12	ulelong&1	1	\b, compressed
695898496eeSXin LI>>>>>>>>12	ulelong&2	!0	\b, compressed lz4
696898496eeSXin LI>>>>>>>>12	ulelong&4	!0	\b, keyed hash siphash24
697898496eeSXin LI>>>>>>>>12	ulelong&8	!0	\b, compressed zstd
698898496eeSXin LI>>>>>>>>12	ulelong&16	!0	\b, compact
699898496eeSXin LI# uint8_t reserved[7]; apparently nil
700898496eeSXin LI#>>17		long		!0	\b, reserved %#8.8x
701898496eeSXin LI# seqnum_id; like: 0 e623691afec94b5aa968ae2d726c49cc f98b2af481924b29 8d6816ca3639edc6
702898496eeSXin LI#>>>>>>>>72	ubequad		x	\b, seqnum_id %#16.16llx
703898496eeSXin LI#>>>>>>>>80	ubequad		x	b%16.16llx
704898496eeSXin LI# header_size like: 100h
705898496eeSXin LI>>>>>>>>88	ulequad		!0x100h	\b, header size %#llx
706898496eeSXin LI# arena_size  like: 0 7fff00h ffff00h 17fff00h
707898496eeSXin LI#>>>>>>>>96	ulequad		>0	\b, arena size %#llx
708898496eeSXin LI# data_hash_table_offset like: 0 15f0h 15f0h
709898496eeSXin LI#>>>>>>>>104	ulequad		>0	\b, hash table offset %#llx
710898496eeSXin LI# data_hash_table_size like: 0 38e380h
711898496eeSXin LI#>>>>>>>>112	ulequad		>0	\b, hash table size %#llx
712898496eeSXin LI# field_hash_table_offset like: 0 110h
713898496eeSXin LI#>>>>>>>>120	ulequad		>0	\b, field hash table offset %#llx
714898496eeSXin LI# field_hash_table_size like: 0 14d0h
715898496eeSXin LI#>>>>>>>>128	ulequad		>0	\b, field hash table size %#llx
716898496eeSXin LI# tail_object_offset like: 0 43edd8h 511278h c68968h d487d0h efaa98h
717898496eeSXin LI#>>>>>>>>136	ulequad		>0	\b, tail object offset %#llx
718898496eeSXin LI# n_objects like: 0 1032h 5a2eh 92bdh a8b5h aa75h 112adh 40c23h 4714eh
719898496eeSXin LI#>>>>>>>>144	ulequad		>0	\b, objects %#llx
720898496eeSXin LI# n_entries like: 0 3aeh 235ah 2dc4h 3125h 16129h 187a1h
721898496eeSXin LI>>>>>>>>152	ulequad		>0	\b, entries %#llx
722898496eeSXin LI# tail_entry_seqnum like: 0 1988h 16249h 24c12h 24c12h 41e64h 9fefdh
723898496eeSXin LI#>>>>>>>>160	ulequad		>0	\b, tail entry seqnum %#llx
724898496eeSXin LI# head_entry_seqnum like: 0 1h 15dbh 6552h 213bfh 213bfh 3e672h 9a28ah
725898496eeSXin LI#>>>>>>>>168	ulequad		>0	\b, head entry seqnum %#llx
726898496eeSXin LI# entry_array_offset like: 0 390058h 3909d8h 3909e0h
727898496eeSXin LI#>>>>>>>>176	ulequad		>0	\b, entry array offset %#llx
728b6cee71dSXin LI
729b6cee71dSXin LI# BCache backing and cache devices
730b6cee71dSXin LI# From: Gabriel de Perthuis <g2p.code@gmail.com>
731b6cee71dSXin LI0x1008		lequad		8
732b6cee71dSXin LI>0x1018		string		\xc6\x85\x73\xf6\x4e\x1a\x45\xca\x82\x65\xf5\x7f\x48\xba\x6d\x81	BCache
733b6cee71dSXin LI>>0x1010	ulequad		0	cache device
734b6cee71dSXin LI>>0x1010	ulequad		1	backing device
735b6cee71dSXin LI>>0x1010	ulequad		3	cache device
736b6cee71dSXin LI>>0x1010	ulequad		4	backing device
737b6cee71dSXin LI>>0x1048	string		>0	\b, label "%.32s"
738b6cee71dSXin LI>>0x1028	ubelong		x	\b, uuid %08x
739b6cee71dSXin LI>>0x102c	ubeshort	x	\b-%04x
740b6cee71dSXin LI>>0x102e	ubeshort	x	\b-%04x
741b6cee71dSXin LI>>0x1030	ubeshort	x	\b-%04x
742b6cee71dSXin LI>>0x1032	ubelong		x	\b-%08x
743b6cee71dSXin LI>>0x1036	ubeshort	x	\b%04x
744b6cee71dSXin LI>>0x1038	ubelong		x	\b, set uuid %08x
745b6cee71dSXin LI>>0x103c	ubeshort	x	\b-%04x
746b6cee71dSXin LI>>0x103e	ubeshort	x	\b-%04x
747b6cee71dSXin LI>>0x1040	ubeshort	x	\b-%04x
748b6cee71dSXin LI>>0x1042	ubelong		x	\b-%08x
749b6cee71dSXin LI>>0x1046	ubeshort	x	\b%04x
750b6cee71dSXin LI
751b6cee71dSXin LI# Linux device tree:
752b6cee71dSXin LI# File format description can be found in the Linux kernel sources at
753b6cee71dSXin LI# Documentation/devicetree/booting-without-of.txt
754b6cee71dSXin LI# From Christoph Biedl
755b6cee71dSXin LI0		belong		0xd00dfeed
75643a5ec4eSXin LI# structure must be within blob, strings are omitted to handle devicetrees > 1M
757b6cee71dSXin LI>&(8.L)		byte		x
75843a5ec4eSXin LI>>20		belong		>1	Device Tree Blob version %d
75943a5ec4eSXin LI>>>4		belong		x	\b, size=%d
76043a5ec4eSXin LI>>>20		belong		>1
76143a5ec4eSXin LI>>>>28		belong		x	\b, boot CPU=%d
76243a5ec4eSXin LI>>>20		belong		>2
76343a5ec4eSXin LI>>>>32		belong		x	\b, string block size=%d
76443a5ec4eSXin LI>>>20		belong		>16
76543a5ec4eSXin LI>>>>36		belong		x	\b, DT structure block size=%d
766b6cee71dSXin LI
767c2931133SXin LI# glibc locale archive as defined in glibc locale/locarchive.h
768c2931133SXin LI0		lelong		0xde020109	locale archive
769c2931133SXin LI>24		lelong		x		%d strings
770c2931133SXin LI
7719ce06829SXin LI# Linux Software RAID (mdadm)
7729ce06829SXin LI# Russell Coker <russell@coker.com.au>
7739ce06829SXin LI0	name	linuxraid
7749ce06829SXin LI>16	belong	x		UUID=%8x:
7759ce06829SXin LI>20	belong	x		\b%8x:
7769ce06829SXin LI>24	belong	x		\b%8x:
7779ce06829SXin LI>28	belong	x		\b%8x
7789ce06829SXin LI>32	string	x		name=%s
7799ce06829SXin LI>72	lelong	x		level=%d
7809ce06829SXin LI>92	lelong	x		disks=%d
7819ce06829SXin LI
7829ce06829SXin LI4096	lelong	0xa92b4efc	Linux Software RAID
7839ce06829SXin LI>4100	lelong	x		version 1.2 (%d)
7849ce06829SXin LI>4096	use	linuxraid
7859ce06829SXin LI
7869ce06829SXin LI0	lelong	0xa92b4efc	Linux Software RAID
7879ce06829SXin LI>4	lelong	x		version 1.1 (%d)
7889ce06829SXin LI>0	use	linuxraid
7899ce06829SXin LI
790c2931133SXin LI# Summary:     Database file for mlocate
791c2931133SXin LI# Description: A database file as used by mlocate, a fast implementation
792c2931133SXin LI#              of locate/updatedb. It uses merging to reuse the existing
793c2931133SXin LI#              database and avoid rereading most of the filesystem. It's
794c2931133SXin LI#              the default version of locate on Arch Linux (and others).
795c2931133SXin LI# File path:   /var/lib/mlocate/mlocate.db by default (but configurable)
796c2931133SXin LI# Site:        https://fedorahosted.org/mlocate/
79748c779cdSXin LI# Format docs: https://linux.die.net/man/5/mlocate.db
798c2931133SXin LI# Type: mlocate database file
799*ae316d1dSXin LI# URL:		https://en.wikipedia.org/wiki/Locate_(Unix)
800c2931133SXin LI# URL:  https://fedorahosted.org/mlocate/
801c2931133SXin LI# From: Wander Nauta <info@wandernauta.nl>
802*ae316d1dSXin LI# Update:	Joerg Jenderek
803c2931133SXin LI0		string		\0mlocate	mlocate database
804*ae316d1dSXin LI#!:mime	application/octet-stream
805*ae316d1dSXin LI!:mime	application/x-mlocate
806*ae316d1dSXin LI# default mlocate.db if not overriden with --output option of updatedb
807*ae316d1dSXin LI!:ext	db
808*ae316d1dSXin LI# at the moment value is 0; a higher version will probably not occur, because mlocate is now often replaced by plocate
809*ae316d1dSXin LI>12		byte		!0		\b, version %d
810*ae316d1dSXin LI# configured with -l option of updatedb
811c2931133SXin LI>13		byte		1		\b, require visibility
812*ae316d1dSXin LI# 2 byte pad for 32-bit total alignment
813*ae316d1dSXin LI#>14		short		!0		\b, padding %#x
814*ae316d1dSXin LI# standard is 1 byte / if not overriden with --database-root option of updatedb
815c2931133SXin LI>16		string		x		\b, root %s
816*ae316d1dSXin LI# 1st variable name nil terminated like: prune_bind_mounts
817*ae316d1dSXin LI>>&1		string		x		\b, 1st variable %s
818*ae316d1dSXin LI# 1st variable value like: 0 1
819*ae316d1dSXin LI>>>&1		string		x		\b=%s
820*ae316d1dSXin LI# configuration block size in big endian like: 82 85 174 181 185 483 491 496 497 556 600
821*ae316d1dSXin LI>8		ubelong		x		\b, configuration size %u
822*ae316d1dSXin LI
823*ae316d1dSXin LI# URL:		https://plocate.sesse.net/
824*ae316d1dSXin LI# Reference:	https://plocate.sesse.net/download/plocate-1.1.19.tar.gz
825*ae316d1dSXin LI#		plocate-1.1.19/db.h
826*ae316d1dSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/d/db-plocate.trid.xml
827*ae316d1dSXin LI# Note:		called "plocate database" by TrID
828*ae316d1dSXin LI# magic[8]
829*ae316d1dSXin LI0		string		\0plocate	plocate database
830*ae316d1dSXin LI#!:mime		application/octet-stream
831*ae316d1dSXin LI!:mime		application/x-plocate
832*ae316d1dSXin LI# default /var/lib/plocate/plocate.db if not overriden with --output option of updatedb.plocate
833*ae316d1dSXin LI!:ext		db
834*ae316d1dSXin LI# version; 2 is the current version
835*ae316d1dSXin LI>8		ulelong    	!1		\b, version %u
836*ae316d1dSXin LI# hashtable_size; like 1 (for "empty" samples) 1b5c3h
837*ae316d1dSXin LI#>12		ulelong    	>1		\b, hash table size %#x
838*ae316d1dSXin LI# extra_ht_slots; like: 10h
839*ae316d1dSXin LI>16		ulelong    	!0x10		\b, extra_ht_slots %#x
840*ae316d1dSXin LI# num_docids; like 0 (for "empty" samples) a132h
841*ae316d1dSXin LI>20		ulelong    	>0		\b, num_docids %u
842*ae316d1dSXin LI# hash_table_offset_bytes; 78h (for "empty" samples) afdf99h
843*ae316d1dSXin LI#>24		ulequad    	!0x78		\b, hash table offset %#llx
844*ae316d1dSXin LI# filename_index_offset_bytes; 70h (for "empty" samples) aad571h
845*ae316d1dSXin LI#>32		ulequad    	!0x70		\b, filename index offset %#llx
846*ae316d1dSXin LI# version 1 and up only
847*ae316d1dSXin LI>8		ulelong    	>0
848*ae316d1dSXin LI# max_version;  nominally 1 or 2 but can be increased if more features are added in a backward-compatible way
849*ae316d1dSXin LI>>40		ulelong    	!2		\b, max version %u
850*ae316d1dSXin LI# zstd_dictionary_length_bytes; 0 (for "empty" samples) 400h
851*ae316d1dSXin LI>>44		ulelong    	!0		\b, at %#x
852*ae316d1dSXin LI# zstd_dictionary_offset_bytes; 0 (for "empty" samples) 70h
853*ae316d1dSXin LI>>48		ulequad    	>0		\b+%#llx
854*ae316d1dSXin LI# jump to beginning of zstd dictionary
855*ae316d1dSXin LI>>>(48.q)		ubequad    	x
856*ae316d1dSXin LI# jump realative zstd dictionary length bytes - 8 (quad length) forward to ZST data beginning
857*ae316d1dSXin LI#>>>>&(44.l-8)		ubelong    	x		ZST=%8.8x
858*ae316d1dSXin LI>>>>&(44.l-8)		ubelong    	x
859*ae316d1dSXin LI# print 1 space char after zstd_dictionary_offset and then handles Zstandard compressed data by ./compress
860*ae316d1dSXin LI# to get phrase like "at 0x400+0x70 Zstandard compressed data (v0.8+)"
861*ae316d1dSXin LI>>>>>&-4		indirect	x		\b
862*ae316d1dSXin LI# only if max_version >= 2 and only relevant for updatedb
863*ae316d1dSXin LI>40		ulelong    	>1
864*ae316d1dSXin LI# directory_data_length_byte
865*ae316d1dSXin LI#>>56		ulequad    	x		\b, directory data length %#llx
866*ae316d1dSXin LI# directory_data_offset_bytes;
867*ae316d1dSXin LI#>>64		ulequad    	x		offset %#llx
868*ae316d1dSXin LI# next_zstd_dictionary_length_bytes; 0 (for "empty" samples) 400h
869*ae316d1dSXin LI>>72		ulequad    	>0		\b, next zstd dictionary length %#llx
870*ae316d1dSXin LI# next_zstd_dictionary_offset_bytes; 0 (for "empty" samples) 14b9cb8h
871*ae316d1dSXin LI>>>80		ulequad    	>0		offset %#llx
872*ae316d1dSXin LI# conf_block_length_bytes like; 65 147 148 151 152 452 537 540 543
873*ae316d1dSXin LI>>88		ulequad    	x		\b, configuration size %llu
874*ae316d1dSXin LI# conf_block_offset_bytes; 1a1h (for "empty" samples) 14ba0b8h
875*ae316d1dSXin LI>>96		ulequad    	>0		\b, at %#llx 1st variable
876*ae316d1dSXin LI# 1st variable name nil terminated like: prune_bind_mounts
877*ae316d1dSXin LI>>>(96.q)	string    	x		%s
878*ae316d1dSXin LI# 1st variable value nil terminated like: 0 1
879*ae316d1dSXin LI>>>>&1		string		x		\b=%s
880*ae316d1dSXin LI# bool check_visibility; 0 or 1 configured with -l option of updatedb.plocate
881*ae316d1dSXin LI>>104		ubyte    	1		\b, require visibility
882*ae316d1dSXin LI#>>104		ubyte    	x		\b, check_visibility %#x
8835f0216bdSXin LI
8845f0216bdSXin LI# Dump files for iproute2 tool. Generated by the "ip r|a save" command. URL:
8855f0216bdSXin LI# https://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
8865f0216bdSXin LI# From: Pavel Emelyanov <xemul@parallels.com>
8875f0216bdSXin LI0		lelong		0x45311224	iproute2 routes dump
8885f0216bdSXin LI0		lelong		0x47361222	iproute2 addresses dump
8895f0216bdSXin LI
8905f0216bdSXin LI# Image and service files for CRIU tool.
89148c779cdSXin LI# URL: https://criu.org
8925f0216bdSXin LI# From: Pavel Emelyanov <xemul@parallels.com>
8935f0216bdSXin LI0		lelong		0x54564319	CRIU image file v1.1
8945f0216bdSXin LI0		lelong		0x55105940	CRIU service file
8955f0216bdSXin LI0		lelong		0x58313116	CRIU inventory
8965f0216bdSXin LI
8975f0216bdSXin LI# Kdump compressed dump files
898898496eeSXin LI# https://github.com/makedumpfile/makedumpfile/blob/master/IMPLEMENTATION
8995f0216bdSXin LI
900898496eeSXin LI0		string		KDUMP\x20\x20\x20	Kdump compressed dump
901898496eeSXin LI>0		use		kdump-compressed-dump
902898496eeSXin LI
903898496eeSXin LI0		name		kdump-compressed-dump
9045f0216bdSXin LI>8		long		x		v%d
9055f0216bdSXin LI>12		string		>\0		\b, system %s
9065f0216bdSXin LI>77		string		>\0		\b, node %s
9075f0216bdSXin LI>142		string		>\0		\b, release %s
9085f0216bdSXin LI>207		string		>\0		\b, version %s
9095f0216bdSXin LI>272		string		>\0		\b, machine %s
9105f0216bdSXin LI>337		string		>\0		\b, domain %s
911d38c30c0SXin LI
912898496eeSXin LI# Flattened format
913898496eeSXin LI0		string		makedumpfile
914898496eeSXin LI>16		bequad		1
915898496eeSXin LI>>0x1010	string		KDUMP\x20\x20\x20	Flattened kdump compressed dump
916898496eeSXin LI>>>0x1010	use		kdump-compressed-dump
917898496eeSXin LI
918d38c30c0SXin LI# Device Tree files
919d38c30c0SXin LI0		search/1024	/dts-v1/	Device Tree File (v1)
920d38c30c0SXin LI# beat c code
921d38c30c0SXin LI!:strength +14
92243a5ec4eSXin LI
92343a5ec4eSXin LI
92443a5ec4eSXin LI# e2fsck undo file
92543a5ec4eSXin LI# David Gilman <davidgilman1@gmail.com>
92643a5ec4eSXin LI0		string		E2UNDO02	e2fsck undo file, version 2
92743a5ec4eSXin LI>44		lelong		x		\b, undo file is
92843a5ec4eSXin LI>>44		lelong&1	0		not finished
92943a5ec4eSXin LI>>44		lelong&1	1		finished
93043a5ec4eSXin LI>48		lelong		x		\b, undo file features:
93143a5ec4eSXin LI>>48		lelong&1	0		lacks filesystem offset
93243a5ec4eSXin LI>>48		lelong&1	1		has filesystem offset
93343a5ec4eSXin LI>>>64		lequad		x		at %#llx
93443a5ec4eSXin LI
93543a5ec4eSXin LI# ansible vault (does not really belong here)
93643a5ec4eSXin LI0		string		$ANSIBLE_VAULT;	Ansible Vault
937a4d6d3b8SXin LI>&0		regex		[0-9]+\\.[0-9]+	\b, version %s
93843a5ec4eSXin LI>>&0		string		;
939a4d6d3b8SXin LI>>>&0		regex		[A-Z0-9]+	\b, encryption %s
940a2dfb722SXin LI
941a2dfb722SXin LI# From:		Joerg Jenderek
942a2dfb722SXin LI# URL:		https://www.gnu.org/software/grub
943a2dfb722SXin LI# Reference:	https://ftp.gnu.org/gnu/grub/grub-2.06.tar.gz
944a2dfb722SXin LI#		grub-2.06/include/grub/keyboard_layouts.h
945a2dfb722SXin LI#		grub-2.06/grub-core/commands/keylayouts.c
946a2dfb722SXin LI# GRUB_KEYBOARD_LAYOUTS_FILEMAGIC
947a2dfb722SXin LI0	string		GRUBLAYO		GRUB Keyboard
948a2dfb722SXin LI!:mime			application/x-grub-keyboard
949a2dfb722SXin LI!:ext			gkb
950a2dfb722SXin LI# GRUB_KEYBOARD_LAYOUTS_VERSION like: 10
951a2dfb722SXin LI>8	ulelong		!10			\b, version %u
952a2dfb722SXin LI# 4 grub_uint32_t grub_keyboard_layout[160]
953a2dfb722SXin LI# for normal french keyboard this is letter a
954a2dfb722SXin LI>92	ubyte		!0x71
955a2dfb722SXin LI>>92	ubyte		>0x40			\b, english q is %c
956a2dfb722SXin LI#>732	ubyte		x			\b, english Q is %c
957a2dfb722SXin LI# for normal german keyboard this is letter z
958a2dfb722SXin LI>124	ubyte		!0x79
959a2dfb722SXin LI>>124	ubyte		>0x40			\b, english y is %c
960a2dfb722SXin LI#>764	ubyte		x			\b, english Y is %c
961*ae316d1dSXin LI
962*ae316d1dSXin LI
963*ae316d1dSXin LI# From: Ben Dooks <ben.dooks@codethink.co.uk>
964*ae316d1dSXin LI# URL: https://github.com/torvalds/linux/blob/master/tools/perf/util/header.c
965*ae316d1dSXin LI# perf files for v1 and v2
966*ae316d1dSXin LI0	string		PERFFILE		Linux perf recording, version 1
967*ae316d1dSXin LI
968*ae316d1dSXin LI0	lequad		0x32454c4946524550	Linux perf recording, version 2. little endian
969*ae316d1dSXin LI
970*ae316d1dSXin LI0	bequad		0x32454c4946524550	Linux perf recording, version 2. big endian
971