linux 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. #------------------------------------------------------------------------------
  2. # $File: linux,v 1.95 2025/07/12 14:30:14 christos Exp $
  3. # linux: file(1) magic for Linux files
  4. #
  5. # Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
  6. # The following basic Linux magic is useful for reference, but using
  7. # "long" magic is a better practice in order to avoid collisions.
  8. #
  9. # 2 leshort 100 Linux/i386
  10. # >0 leshort 0407 impure executable (OMAGIC)
  11. # >0 leshort 0410 pure executable (NMAGIC)
  12. # >0 leshort 0413 demand-paged executable (ZMAGIC)
  13. # >0 leshort 0314 demand-paged executable (QMAGIC)
  14. #
  15. 0 lelong 0x00640107 Linux/i386 impure executable (OMAGIC)
  16. >16 lelong 0 \b, stripped
  17. 0 lelong 0x00640108 Linux/i386 pure executable (NMAGIC)
  18. >16 lelong 0 \b, stripped
  19. 0 lelong 0x0064010b Linux/i386 demand-paged executable (ZMAGIC)
  20. >16 lelong 0 \b, stripped
  21. 0 lelong 0x006400cc Linux/i386 demand-paged executable (QMAGIC)
  22. >16 lelong 0 \b, stripped
  23. #
  24. 0 string \007\001\000 Linux/i386 object file
  25. >20 lelong >0x1020 \b, DLL library
  26. # Linux-8086 stuff:
  27. 0 string \01\03\020\04 Linux-8086 impure executable
  28. >28 long !0 not stripped
  29. 0 string \01\03\040\04 Linux-8086 executable
  30. >28 long !0 not stripped
  31. #
  32. 0 string \243\206\001\0 Linux-8086 object file
  33. #
  34. 0 string \01\03\020\20 Minix-386 impure executable
  35. >28 long !0 not stripped
  36. 0 string \01\03\040\20 Minix-386 executable
  37. >28 long !0 not stripped
  38. 0 string \01\03\04\20 Minix-386 NSYM/GNU executable
  39. >28 long !0 not stripped
  40. # core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
  41. 216 lelong 0421 Linux/i386 core file
  42. !:strength / 2
  43. >220 string >\0 of '%s'
  44. >200 lelong >0 (signal %d)
  45. #
  46. # LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
  47. # this can be overridden by the DOS executable (COM) entry
  48. 2 string LILO Linux/i386 LILO boot/chain loader
  49. #
  50. # Linux make config build file, from Ole Aamot <oka@oka.no>
  51. # Updated by Ken Sharp
  52. 28 string make\ config Linux make config build file (old)
  53. 49 search/70 Kernel\ Configuration Linux make config build file
  54. #
  55. # PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
  56. # Updated by Adam Buchbinder <adam.buchbinder@gmail.com>
  57. # See: https://www.win.tue.nl/~aeb/linux/kbd/font-formats-1.html
  58. 0 leshort 0x0436 Linux/i386 PC Screen Font v1 data,
  59. >2 byte&0x01 0 256 characters,
  60. >2 byte&0x01 !0 512 characters,
  61. >2 byte&0x02 0 no directory,
  62. >2 byte&0x02 !0 Unicode directory,
  63. >3 byte >0 8x%d
  64. 0 string \x72\xb5\x4a\x86\x00\x00 Linux/i386 PC Screen Font v2 data,
  65. >16 lelong x %d characters,
  66. >12 lelong&0x01 0 no directory,
  67. >12 lelong&0x01 !0 Unicode directory,
  68. >28 lelong x %d
  69. >24 lelong x \bx%d
  70. # Linux swap and hibernate files
  71. # Linux kernel: include/linux/swap.h
  72. # util-linux: libblkid/src/superblocks/swap.c
  73. # format v0, unsupported since 2002
  74. 0xff6 string SWAP-SPACE Linux old swap file, 4k page size
  75. 0x1ff6 string SWAP-SPACE Linux old swap file, 8k page size
  76. 0x3ff6 string SWAP-SPACE Linux old swap file, 16k page size
  77. 0x7ff6 string SWAP-SPACE Linux old swap file, 32k page size
  78. 0xfff6 string SWAP-SPACE Linux old swap file, 64k page size
  79. # format v1, supported since 1998
  80. 0 name linux-swap
  81. >0x400 lelong 1 little endian, version %u,
  82. >>0x404 lelong x size %u pages,
  83. >>0x408 lelong x %u bad pages,
  84. >0x400 belong 1 big endian, version %u,
  85. >>0x404 belong x size %u pages,
  86. >>0x408 belong x %u bad pages,
  87. >0x41c string \0 no label,
  88. >0x41c string >\0 LABEL=%s,
  89. >0x40c ubelong x UUID=%08x
  90. >0x410 ubeshort x \b-%04x
  91. >0x412 ubeshort x \b-%04x
  92. >0x414 ubeshort x \b-%04x
  93. >0x416 ubelong x \b-%08x
  94. >0x41a ubeshort x \b%04x
  95. 0xff6 string SWAPSPACE2 Linux swap file, 4k page size,
  96. >0 use linux-swap
  97. 0x1ff6 string SWAPSPACE2 Linux swap file, 8k page size,
  98. >0 use linux-swap
  99. 0x3ff6 string SWAPSPACE2 Linux swap file, 16k page size,
  100. >0 use linux-swap
  101. 0x7ff6 string SWAPSPACE2 Linux swap file, 32k page size,
  102. >0 use linux-swap
  103. 0xfff6 string SWAPSPACE2 Linux swap file, 64k page size,
  104. >0 use linux-swap
  105. 0 name linux-hibernate
  106. >0 string S1SUSPEND \b, with SWSUSP1 image
  107. >0 string S2SUSPEND \b, with SWSUSP2 image
  108. >0 string ULSUSPEND \b, with uswsusp image
  109. >0 string LINHIB0001 \b, with compressed hibernate image
  110. >0 string \xed\xc3\x02\xe9\x98\x56\xe5\x0c \b, with tuxonice image
  111. >0 default x \b, with unknown hibernate image
  112. 0xfec string SWAPSPACE2 Linux swap file, 4k page size,
  113. >0 use linux-swap
  114. >0xff6 use linux-hibernate
  115. 0x1fec string SWAPSPACE2 Linux swap file, 8k page size,
  116. >0 use linux-swap
  117. >0x1ff6 use linux-hibernate
  118. 0x3fec string SWAPSPACE2 Linux swap file, 16k page size,
  119. >0 use linux-swap
  120. >0x3ff6 use linux-hibernate
  121. 0x7fec string SWAPSPACE2 Linux swap file, 32k page size,
  122. >0 use linux-swap
  123. >0x7ff6 use linux-hibernate
  124. 0xffec string SWAPSPACE2 Linux swap file, 64k page size,
  125. >0 use linux-swap
  126. >0xfff6 use linux-hibernate
  127. #
  128. # Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu>
  129. # and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
  130. # and Nicolas Lichtmaier <nick@debian.org>
  131. # and Joerg Jenderek [unifying + more kernel info]
  132. # many start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
  133. # by assembler instructions like: movw $0x07c0,%ax; movw %ax,%ds; movw $0x9000,%ax; movw %ax,%es; movw $0x0001,%cx; subw %si,%si; subw
  134. # Linux kernel boot images (i386 arch) (Wolfram Kleff)
  135. # URL: https://www.kernel.org/doc/Documentation/x86/boot.txt
  136. 514 string HdrS Linux kernel
  137. # 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
  138. # before MZ PE32 executable (EFI application) (strength=50) and before DOS executable (COM) (strength=40) with start instruction 0xe9 via ./msdos
  139. !:strength + 55
  140. # often no extension like in linux, vmlinuz, bzimage or memdisk but sometimes
  141. # Acronis Recovery kernel64.dat and Plop Boot Manager plpbtrom.bin
  142. # DamnSmallLinux 1.5 damnsmll.lnx
  143. #!:mime application/octet-stream
  144. !:mime application/x-linux-kernel
  145. !:ext /dat/bin/lnx
  146. # GRR: does there exist here samples without 55AA boot signature? I believe NO (Joerg Jenderek)
  147. >510 leshort 0xAA55 x86 boot executable
  148. >>0 use kernel-info
  149. # show information about Linux kernel (root, swap device, vga modus, boot protocol, setup size, init_size, EFI entry point)
  150. 0 name kernel-info
  151. # like: plpbtrom.bin
  152. # After 16 bit jump instruction Hi, are you searching something? This is the Plop Boot Manager written by Elmar Hanlhofer http?://www.plop.at
  153. >48 string Plop\040Boot\040Manager from PLOP Boot Manager
  154. # dummy test below 512 limit (for LILO 24.2 bootsect.b) to get same magic indention level like in v 1.85
  155. # and display comma before zImage/bzImage or version
  156. >498 leshort x \b,
  157. # boot protocol option flags valid since boot protocol >= 2.00
  158. >>518 leshort >0x1ff
  159. # loadflags bit 0 (read); LOADED_HIGH; if 0, the protected-mode code is loaded at 0x10000
  160. >>>529 ubyte&0x01 0 zImage,
  161. # loadflags bit 0 (read); LOADED_HIGH; if 1, the protected-mode code is loaded at 0x100000; that implies is_bzImage
  162. >>>529 ubyte&0x01 1 bzImage,
  163. # kernel_version; since protocol 2.00 if not zero 2 byte pointer to kernel version string -200h; should be < 200h*setup_sects
  164. # 0h (ldntldr.bin plpbtrom.bin) 260h (memtest32.bin memtest64.bin) 3b0h (memdisk16.bin) 890h (damnsmll.lnx) 3400h (linux64) 3640h (linux)
  165. #>>>526 uleshort x kernel_version=%#4.4x
  166. >>>526 uleshort >0
  167. # GRR: \353fHdrS\003\002 wrong shown if kernel_version=0 like in ldntldr.bin (GRUB for DOS)
  168. >>>>(526.s+0x200) string >\0 version %s,
  169. # 498 MasterBootRecord 4th partition entry partition type (0~empty 1~FAT12) done by ./filesystems
  170. # 499 MasterBootRecord 4th partition entry end heads done by ./filesystems
  171. # root_flags; if set (=1), the root is mounted readonly; deprecated, use the "ro" or "rw" option on the command line instead
  172. #>>498 uleshort >1 root_flags=%u
  173. >>498 leshort 1 RO-rootFS,
  174. >>498 leshort 0 RW-rootFS,
  175. # 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=
  176. >>508 leshort >0 root_dev %#X,
  177. # since protocol 2.04 the 2 upper bytes of long syssize and not swap_dev any more
  178. >>518 uleshort <0x204
  179. # 502-505 MasterBootRecord 4th partition entry 1st LBA sector done by ./filesystems
  180. >>>502 leshort >0 swap_dev %#X,
  181. >>504 leshort >0 RAMdisksize %u KB,
  182. # 506-509 MasterBootRecord 4th partition entry sectors in partition done by ./filesystems
  183. >>506 leshort 0xFFFF Normal VGA
  184. >>506 leshort 0xFFFE Extended VGA
  185. >>506 leshort 0xFFFD Prompt for Videomode
  186. >>506 leshort >0 Video mode %d
  187. # more kernel information added by Joerg Jenderek 2023
  188. # if needed display comma after video mode and before setup_sects
  189. >>506 leshort >-4
  190. >>>506 leshort !0 \b,
  191. # setup_sects; if field contains 0, the real value is 4; size of the setup in sectors like:
  192. # 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)
  193. # MasterBootRecord 4th partition entry start cylinder bits 0-7 done by ./filesystems
  194. >>497 ubyte !0 setup size 512*%u
  195. >>497 ubyte =0 setup size 512*4 (not 0)
  196. # 500 MasterBootRecord 4th partition entry end sectors+cylinder bits 8-9 done by ./filesystems
  197. # 501 MasterBootRecord 4th partition entry end cylinder bits 0-7 done by ./filesystems
  198. # syssize; 32-bit code size in 16-byte paragraphs; since protocol 2.04 long before unreliable short
  199. >>518 uleshort <0x204 \b,
  200. # 0 (ldntldr.bin) 0 (memdisk16.bin) f180h (damnsmll.lnx)
  201. >>>500 uleshort x syssize %#x
  202. >>518 uleshort >0x203 \b,
  203. # 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)
  204. >>>500 ulelong x syssize %#x
  205. # jump; jump instruction relative to byte 0x202
  206. >>512 ubyte =0xEB \b, jump
  207. # jump adress like: 0x230 (damnsmll.lnx) 0x240 (memdisk16.bin) 0x268 (memtest32.bin memtest64.bin ldntldr.bin linux AFTER handover offset) 0x26c (linux64)
  208. >>>513 byte+2 x 0x2%2.2x
  209. # next instruction like:
  210. # b800088ec00fb60e mov ax,0x0800; mov es,ax; movzx cx,byte [] memdisk16.bin
  211. # 8cc88ed88ec0e88b00 movw %cs,%ax; movw %ax,%ds; movw %ax,%es; call get_mem_info memtest32.bin
  212. # 8cc88ed88ec0e88b00 movw %cs,%ax; movw %ax,%ds; movw %ax,%es; call get_mem_info memtest64.bin
  213. >>>(513.b+514) ubequad x %#16.16llx instruction
  214. # without jump instruction like: 0 (bootsect-lilo-24.2.b EOF!) 0xb8 (mov linux-elks) 0xfa (cli memtest86+.bin)
  215. >>512 ubyte !0xEB \b, at 0x200 %#x instruction
  216. # boot protocol version field valid since version >= 2.00 which is indicated by HdrS magic
  217. # so skip memtest86+.bin with misinterpreted protocol 144.0 (0x9000)
  218. >>514 string HdrS \b,
  219. # 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)
  220. >>>519 ubyte x protocol %u
  221. >>>518 ubyte x \b.%u
  222. # boot protocol in hexadecimal needed for addtional tests
  223. #>>>518 uleshort x (%#4.4x)
  224. # type_of_loader; Boot loader identifier; filled out by the bootloader
  225. >>>528 ubyte >0 \b, loader %#x
  226. # loadflags; boot protocol option flags
  227. #>>>529 ubyte x loadflags=%#x
  228. # loadflags bit 1 (kernel internal); KASLR_FLAG KASLR status to kernel
  229. >>>529 ubyte&0x02 !0 \b, KASLR enabled
  230. # loadflags bit 5 (write); QUIET_FLAG
  231. >>>529 ubyte&0x20 !0 \b, quiet
  232. # loadflags bit 6 (write) since boot protocal version >= 2.07; KEEP_SEGMENTS
  233. >>>518 uleshort >0x206
  234. >>>>529 ubyte&0x40 !0 \b, keep segments
  235. # loadflags bit 7 (write); CAN_USE_HEAP
  236. >>>529 ubyte&0x80 !0 \b, can use heap
  237. # 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)
  238. >>>518 uleshort >0x207
  239. >>>>584 ulelong >0 \b, from protected-mode code at offset %#x
  240. # payload_length; since boot protocol 2.08 the length of the payload like: 452c41h (linux) 6fb644h (linux64)
  241. >>>>>588 ulelong x %#x bytes
  242. # jump setup size sectors a 512 bytes from kernel beginning
  243. >>>>>(497.b*512) ubequad x
  244. #>>>>>(497.b*512) ubequad x 512BYTES_BEFORE_PROTECTED-MODE_CODE=%#16.16llx
  245. # jump payload_offset bytes + 512 bytes (for boot sector) - 8 (ubequad length) to payload start
  246. #>>>>>>&(584.l+504) ubeshort x PAYLOAD=%#4.4x
  247. # supported compression formats are gzip (magic numbers 1F8B or 1F9E linux) bzip2 (425A), LZMA (5D00 linux64), XZ (FD37) LZ4 (0221) ZST v0.8+ (28B5)
  248. >>>>>>&(584.l+504) ubeshort =0x1F8B gzip compressed
  249. >>>>>>&(584.l+504) ubeshort =0x1F9E gzip compressed
  250. >>>>>>&(584.l+504) ubeshort =0x425A bzip2 compressed
  251. >>>>>>&(584.l+504) ubeshort =0x5D00 LZMA compressed
  252. >>>>>>&(584.l+504) ubeshort =0xFD37 XZ compressed
  253. >>>>>>&(584.l+504) ubeshort =0x0221 LZ4 compressed
  254. >>>>>>&(584.l+504) ubeshort =0x28B5 ZST compressed
  255. # TODO: handle compressed data by ./compress; difficulties with leading space and duplicate gzip compressed
  256. #>>>>>>&(584.l+504) indirect x COMPRESS_NOT_WORKING
  257. # setup_move_size; for protocol 2.00-2.01; bytes starting with the beginning of the boot sector
  258. # like: 0 (ldntldr.bin memdisk16.bin memtest32.bin memtest64.bin plpbtrom.bin) 8000h (damnsmll.lnx linux linux64)
  259. >>>518 uleshort <0x202
  260. >>>>518 uleshort >0x1FF
  261. >>>>530 uleshort x \b, setup_move_size %#4.4x
  262. # code32_start; address to jump to in protected mode like: 100000h (linux linux64 memtest32.bin memtest64.bin)
  263. #>>>>532 ulelong >0 \b, code32_start %#x
  264. # 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)
  265. #>>>518 uleshort >0x204
  266. #>>>>560 ulelong x \b, kernel_alignment %#x
  267. # 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
  268. >>>518 uleshort >0x204
  269. >>>>564 ubyte =1 \b, relocatable
  270. #>>>>564 ubyte x \b, relocatable_kernel=%u
  271. # 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)
  272. #>>>518 uleshort >0x209
  273. #>>>>565 ubyte >0 \b, min_alignment %u
  274. # xloadflags; since boot protocol 2.12 like: 3fh (linux64 unexpected value) 4h(memtest32.bin) 9h(memtest64.bin)
  275. >>>518 uleshort >0x20B
  276. #>>>>566 uleshort x \b, xloadflags=%#4.4x
  277. # handover_offset; offset from beginning of kernel image to EFI handover protocol entry point like:
  278. # 0 (damnsmll.lnx ldntldr.bin) 10h (memtest32.bin memtest64.bin) 30h (linux) 190h (linux64) 8e9000b8h (plpbtrom.bin INVALID!)
  279. # this value makes only sense when 32 or 64-bit EFI handoff entry point
  280. >>>>566 uleshort&0x000C !0 \b, handover offset
  281. >>>>>612 ulelong x %#x
  282. # Bit 0 XLF_KERNEL_64; if 1, this kernel has the legacy 64-bit entry point at 0x200
  283. >>>>566 uleshort&0x0001 !0 \b, legacy 64-bit entry point
  284. # Bit 1 XLF_CAN_BE_LOADED_ABOVE_4G; if 1, kernel/boot_params/cmdline/ramdisk can be above 4G
  285. >>>>566 uleshort&0x0002 !0 \b, can be above 4G
  286. # Bit 2 XLF_EFI_HANDOVER_32; if 1, the kernel supports the 32-bit EFI handoff entry point
  287. >>>>566 uleshort&0x0004 !0 \b, 32-bit EFI handoff entry point
  288. # Bit 3 XLF_EFI_HANDOVER_64; if 1, the kernel supports the 64-bit EFI handoff entry point
  289. >>>>566 uleshort&0x0008 !0 \b, 64-bit EFI handoff entry point
  290. # Bit 4 EFI_KEXEC; if 1, the kernel supports kexec EFI boot with EFI runtime support
  291. >>>>566 uleshort&0x0010 !0 \b, EFI kexec boot support
  292. # GRR: What does bit 5 mean?
  293. >>>>566 uleshort&0x0020 !0 \b, xloadflags bit 5
  294. # 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
  295. >>>518 uleshort >0x205
  296. >>>>568 ulelong x \b, max cmdline size %u
  297. # hardware_subarch; since boot protocol 2.07 hardware subarchtecture like: 0~default x86 1~lguest 2~Xen 3~Moorestown 4~CE4100 TV
  298. >>>518 uleshort >0x206
  299. >>>>572 ulelong >0 \b, hardware_subarch %u
  300. # hardware_subarch_data; since boot protocol 2.07 pointer to data specific for hardware subarch; unused for default x86
  301. >>>>>576 ulequad >0 \b, hardware_subarch_data %#llx
  302. # setup_data; since boot protocol 2.09 64-bit physical pointer to NULL terminated single linked list of struct setup_data
  303. >>>518 uleshort >0x208
  304. >>>>592 ulequad >0 \b, setup_data %16.16llx
  305. # pref_address; since boot protocol 2.10 if nonzero preferred load address for kernel like: 100000h (memtest32.bin memtest64.bin) 200000h (linux) 1000000h (linux64)
  306. #>>>518 uleshort >0x209
  307. #>>>>600 ulequad >0 \b, pref_address %#llx
  308. # init_size; since boot protocol 2.10 indicates amount of contiguous memory kernel needs before it is capable of examining its memory map
  309. # 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)
  310. >>>518 uleshort >0x209
  311. >>>>608 ulelong x \b, init_size %#x
  312. # This also matches new kernels, which were caught above by "HdrS".
  313. # but also few samples without "HdrS" magic like: bootsect-lilo-24.2.b linux-elks memtest86+.bin
  314. # URL: https://tldp.org/HOWTO/Linux-i386-Boot-Code-HOWTO/bootsect.html
  315. #0 belong 0xb8c0078e Linux kernel
  316. 0 belong 0xb8c0078e
  317. # 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
  318. #!:strength +0
  319. # "newer" kernel (with HdrS magic) already done before
  320. >514 string HdrS
  321. # so handle "old" kernel variant (without HdrS magic)
  322. >514 default x Linux
  323. #!:mime application/octet-stream
  324. !:mime application/x-linux-kernel
  325. # GRR: in file 5.45 remaining default clause not working for samples with size = 512 like LILO 24.2 bootsect.b
  326. >>0 belong x
  327. # ELKS kernel variant is now unified with other "old" kernel variant (without HdrS magic)
  328. >>0x1e6 belong =0x454c4b53 ELKS Kernel
  329. !:ext /
  330. # "old" kernel variant and not ELKS
  331. >>0x1e6 belong !0x454c4b53 x86 kernel
  332. !:ext /b/bin
  333. # show kernel version information based on "Loading" message offset
  334. >>0 use kernel-version-old1
  335. # unified "old" variant with start instruction \xb8\xc0\x07\x8e\xd8\xb8\x00\x90
  336. >>4 string \xd8\xb8\x00\x90
  337. # show kernel version information part 2 for "old" kernel variant (without HdrS magic) based on new HdrS field
  338. >>>0 use kernel-version-old2
  339. # show kernel version information part 3 for "old" kernel variant (without HdrS magic) based on new HdrS field
  340. >>>0 use kernel-version-old3
  341. # show common kernel information
  342. >>0 use kernel-info
  343. # show kernel version information part 1 for "old" kernel variant (without HdrS magic) based on "Loading" message offset
  344. 0 name kernel-version-old1
  345. >0x1e3 string Loading version 1.3.79 or older
  346. >0x1e9 string Loading from prehistoric times
  347. # LILO 24.2-5.1 bootsect.b
  348. >0x1c5 string Loading from LILO 24.2
  349. # Memtest86 5.31b memtest86+.bin
  350. >0x1d2 string Loading from Memtest86 5.31b
  351. # DamnSmallLinux kernel version 2.4.26 damnsmll.lnx not needed because done by kernel_version pointer
  352. #>0x1cb string Loading damnsmll.lnx 2.4.26~
  353. # Memtest86+ v6.20 memtest32.bin not needed because done by kernel_version pointer
  354. #>0x1c6 string Loading\040Memtest86+ from Memtest86+ v6.20
  355. # System.map files - Nicolas Lichtmaier <nick@debian.org>
  356. 8 search/1 \ A\ _text Linux kernel symbol map text
  357. # LSM entries - Nicolas Lichtmaier <nick@debian.org>
  358. 0 search/1 Begin3 Linux Software Map entry text
  359. 0 search/1 Begin4 Linux Software Map entry text (new format)
  360. # From Matt Zimmerman, enhanced for v3 by Matthew Palmer
  361. 0 belong 0x4f4f4f4d User-mode Linux COW file
  362. >4 belong <3 \b, version %d
  363. >>8 string >\0 \b, backing file %s
  364. >4 belong >2 \b, version %d
  365. >>32 string >\0 \b, backing file %s
  366. ############################################################################
  367. # Linux kernel versions
  368. # apply only to "old" kernel variant (without HdrS magic) like damnsmll.lnx memtest86+.bin
  369. # wrong (497 setup_sects 498 root_flags) and now already done by 1st unified "old" kernel variant
  370. #0 string \xb8\xc0\x07\x8e\xd8\xb8\x00\x90 Linux
  371. 0 string \xb8\xc0\x07\x8e\xd8\xb8\x00\x90foo OLD_VARIANT Linux
  372. >497 leshort 0 x86 boot sector
  373. >>0 use kernel-version-old2
  374. >497 leshort !0 x86 kernel
  375. # not needed any more because information is now shown by common kernel-info with other phrases
  376. >>0 use kernel-info-old
  377. # kernel version information part 3 for "old" kernel variant (without HdrS magic) based on HdrS field
  378. >>0 use kernel-version-old3
  379. >>0 use kernel-version-4
  380. # version information part 2 for "old" kernel variant (without HdrS magic) based on new HdrS field
  381. 0 name kernel-version-old2
  382. # dummy test to get same magic indention level like in v 1.85
  383. >518 leshort x
  384. >>514 belong 0x8e of a kernel from the dawn of time!
  385. >>514 belong 0x908ed8b4 version 0.99-1.1.42
  386. >>514 belong 0x908ed8b8 for memtest86
  387. # dummy test function to get same magic indention level like in v 1.85
  388. 0 name kernel-version-dummy
  389. >497 leshort !0 x86 kernel
  390. # not needed any more because information is now shown by kernel-info
  391. #>0 use kernel-info-old
  392. >>0 use kernel-info
  393. # kernel version information part 3 for "old" kernel variant (without HdrS magic) based on HdrS field
  394. >0 use kernel-version-old3
  395. # deprecated because same information is shown by kernel-info with other phrases
  396. 0 name kernel-info-old
  397. # dummy test to get same magic indention level like in v 1.85
  398. >504 leshort x
  399. >>504 leshort >0 RAMdisksize=%u KB
  400. >>502 leshort >0 swap=%#X
  401. >>508 leshort >0 root=%#X
  402. >>>498 leshort 1 \b-ro
  403. >>>498 leshort 0 \b-rw
  404. >>506 leshort 0xFFFF vga=normal
  405. >>506 leshort 0xFFFE vga=extended
  406. >>506 leshort 0xFFFD vga=ask
  407. >>506 leshort >0 vga=%d
  408. # kernel version information part 3 for "old" kernel variant (without HdrS magic) based on HdrS field
  409. 0 name kernel-version-old3
  410. # dummy test to get same magic indention level like in v 1.85
  411. >514 belong x
  412. >>514 belong 0x908ed881 version 1.1.43-1.1.45
  413. >>514 belong 0x15b281cd
  414. >>>0xa8e belong 0x55AA5a5a version 1.1.46-1.2.13,1.3.0
  415. >>>0xa99 belong 0x55AA5a5a version 1.3.1,2
  416. >>>0xaa3 belong 0x55AA5a5a version 1.3.3-1.3.30
  417. >>>0xaa6 belong 0x55AA5a5a version 1.3.31-1.3.41
  418. >>>0xb2b belong 0x55AA5a5a version 1.3.42-1.3.45
  419. >>>0xaf7 belong 0x55AA5a5a version 1.3.46-1.3.72
  420. # show kernel version information part 4 for kernel variant (with HdrS magic) based on "HdrS" field
  421. # not needed any more because information is now shown by common kernel-info
  422. 0 name kernel-version-4
  423. # dummy test to get same magic indention level like in v 1.85
  424. >518 leshort x
  425. >>514 string HdrS
  426. >>>518 leshort >0x1FF
  427. >>>>529 byte 0 \b, zImage
  428. >>>>529 byte 1 \b, bzImage
  429. # GRR: Not valid if kernel_version=0
  430. >>>>(526.s+0x200) string >\0 \b, version %s
  431. # Linux boot sector thefts.
  432. # ELKS kernel variant is now unified with above "old" kernel variant (without HdrS magic)
  433. #0 belong 0xb8c0078e Linux
  434. # 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
  435. #!:strength +0
  436. # https://en.wikipedia.org/wiki/Embeddable_Linux_Kernel_Subset
  437. # https://github.com/jbruchon/elks/releases/download/v0.6.0/fd2880-fat.img/linux
  438. #>0x1e6 belong 0x454c4b53 ELKS Kernel
  439. #>0x1e6 belong !0x454c4b53 style boot sector
  440. ############################################################################
  441. # Linux S390 kernel image
  442. # Created by: Jan Kaluza <jkaluza@redhat.com>
  443. # Update: Jens Remus <jremus@linux.ibm.com> based on Vasily Gorbik <gor@linux.ibm.com>
  444. # Linux kernel: arch/s390/boot/head.S and arch/s390/include/asm/setup.h
  445. 8 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
  446. >0x00010000 search/b/4096 \x00\x0a\x00\x00\x8b\xad\xcc\xcc
  447. # 64bit
  448. >>&0 string \xc1\x00\xef\xe3\xf0\x68\x00\x00 Z10 64bit kernel
  449. >>&0 string \xc1\x00\xef\xc3\x00\x00\x00\x00 Z9-109 64bit kernel
  450. >>&0 string \xc0\x00\x20\x00\x00\x00\x00\x00 Z990 64bit kernel
  451. >>&0 string \x00\x00\x00\x00\x00\x00\x00\x00 Z900 64bit kernel
  452. # 32bit
  453. >>&0 string \x81\x00\xc8\x80\x00\x00\x00\x00 Z10 32bit kernel
  454. >>&0 string \x81\x00\xc8\x80\x00\x00\x00\x00 Z9-109 32bit kernel
  455. >>&0 string \x80\x00\x20\x00\x00\x00\x00\x00 Z990 32bit kernel
  456. >>&0 string \x80\x00\x00\x00\x00\x00\x00\x00 Z900 32bit kernel
  457. # Linux kernel v3.2+
  458. >0x10008 string S390EP
  459. # Linux kernel v5.3+
  460. >>0x10428 ubequad >0
  461. >>>(0x10428.Q) string >\0 \b, version %s
  462. ############################################################################
  463. # Linux ARM compressed kernel image
  464. # From: Kevin Cernekee <cernekee@gmail.com>
  465. # Update: Joerg Jenderek
  466. # Update: Luke T. Shumaker
  467. 0 name arm-zimage
  468. # Version indicators
  469. >0x34 lelong 0x45454545 (kernel >=v4.15)
  470. >0x34 lelong !0x45454545
  471. >>0x30 clear x
  472. >>0x30 belong 0x04030201 (kernel >=v3.17, <v4.15)
  473. >>0x30 lelong 0x04030201 (kernel >=v3.17, <v4.15)
  474. >>0x30 default x (kernel <v3.17)
  475. # Endianness indicators
  476. #
  477. # The kernel has 3 endianness modes: little-endian, and 2 variants of
  478. # big-endian: BE-32 (ARMv5) and BE-8 (ARMv6+).
  479. #
  480. # In kernels <v3.17:
  481. # - the 0x016f2818 @ 0x24 magic number indicates big-endian or
  482. # little-endian (can't distinguish between BE-8 and BE-32)
  483. # In kernels >=v3.17:
  484. # - a new 0x04030201 @ 0x30 magic number indicates big-endian or
  485. # little-endian, but doesn't distinguish between BE-8 and BE-32
  486. # - the old 0x016f2818 @ 0x24 magic number is little-endian for
  487. # LE *and* BE-8, or big-endian for BE-32
  488. #
  489. # >=v3.17
  490. >0x30 clear x
  491. >0x30 belong 0x04030201 (big-endian,
  492. >>0x24 belong 0x016f2818 BE-32, ARMv5)
  493. >>0x24 lelong 0x016f2818 BE-8, ARMv6+)
  494. >0x30 lelong 0x04030201 (little-endian)
  495. # <v3.17
  496. >0x30 default x
  497. >>0x24 lelong 0x016f2818 (little-endian)
  498. >>0x24 belong 0x016f2818 (big-endian)
  499. 0x24 lelong 0x016f2818 Linux kernel ARM boot executable zImage
  500. >0 use arm-zimage
  501. 0x24 belong 0x016f2818 Linux kernel ARM boot executable zImage
  502. >0 use arm-zimage
  503. ############################################################################
  504. # Linux AARCH64 kernel image
  505. 0x38 lelong 0x644d5241 Linux kernel ARM64 boot executable Image
  506. >0x18 lelong ^1 \b, little-endian
  507. >0x18 lelong &1 \b, big-endian
  508. >0x18 lelong &2 \b, 4K pages
  509. >0x18 lelong &4 \b, 16K pages
  510. >0x18 lelong &6 \b, 32K pages
  511. ############################################################################
  512. # Linux kernel (arm64/riscv/loongarch) EFI executable (zstd/gzip) compressed zboot Image
  513. # from: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/efi/libstub/zboot-header.S
  514. 0 string MZ\0\0zimg
  515. >0x40 string PE\0\0 Linux kernel
  516. >>&0 leshort 0xAA64 ARM64 EFI executable
  517. >>&0 leshort 0x5032 RISC-V32 EFI executable
  518. >>&0 leshort 0x5064 RISC-V64 EFI executable
  519. >>&0 leshort 0x6264 LoongArch64 EFI executable
  520. >>0x18 string >0 %s compressed zboot Image
  521. ############################################################################
  522. # Linux RISC-V kernel image
  523. 0x38 string RSC\05 Linux kernel RISC-V boot executable Image
  524. >0x18 lelong ^1 \b, little-endian
  525. >0x18 lelong &1 \b, big-endian
  526. ############################################################################
  527. # Linux 8086 executable
  528. 0 lelong&0xFF0000FF 0xC30000E9 Linux-Dev86 executable, headerless
  529. >5 string .
  530. >>4 string >\0 \b, libc version %s
  531. 0 lelong&0xFF00FFFF 0x4000301 Linux-8086 executable
  532. >2 byte&0x01 !0 \b, unmapped zero page
  533. >2 byte&0x20 0 \b, impure
  534. >2 byte&0x20 !0
  535. >>2 byte&0x10 !0 \b, A_EXEC
  536. >2 byte&0x02 !0 \b, A_PAL
  537. >2 byte&0x04 !0 \b, A_NSYM
  538. >2 byte&0x08 !0 \b, A_STAND
  539. >2 byte&0x40 !0 \b, A_PURE
  540. >2 byte&0x80 !0 \b, A_TOVLY
  541. >28 long !0 \b, not stripped
  542. >37 string .
  543. >>36 string >\0 \b, libc version %s
  544. # 0 lelong&0xFF00FFFF 0x10000301 ld86 I80386 executable
  545. # 0 lelong&0xFF00FFFF 0xB000301 ld86 M68K executable
  546. # 0 lelong&0xFF00FFFF 0xC000301 ld86 NS16K executable
  547. # 0 lelong&0xFF00FFFF 0x17000301 ld86 SPARC executable
  548. # SYSLINUX boot logo files (from 'ppmtolss16' sources)
  549. # https://www.syslinux.org/wiki/index.php/SYSLINUX#Display_graphic_from_filename:
  550. # file extension .lss .16
  551. 0 lelong =0x1413f33d SYSLINUX' LSS16 image data
  552. # syslinux-4.05/mime/image/x-lss16.xml
  553. !:mime image/x-lss16
  554. >4 leshort x \b, width %d
  555. >6 leshort x \b, height %d
  556. 0 string OOOM User-Mode-Linux's Copy-On-Write disk image
  557. >4 belong x version %d
  558. # SE Linux policy database
  559. # From: Mike Frysinger <vapier@gentoo.org>
  560. 0 lelong 0xf97cff8c SE Linux policy
  561. >16 lelong x v%d
  562. >20 lelong 1 MLS
  563. >24 lelong x %d symbols
  564. >28 lelong x %d ocons
  565. # Linux Logical Volume Manager (LVM)
  566. # Emmanuel VARAGNAT <emmanuel.varagnat@guzu.net>
  567. #
  568. # System ID, UUID and volume group name are 128 bytes long
  569. # but they should never be full and initialized with zeros...
  570. #
  571. # LVM1
  572. #
  573. 0x0 string/b HM\001 LVM1 (Linux Logical Volume Manager), version 1
  574. >0x12c string/b >\0 , System ID: %s
  575. 0x0 string/b HM\002 LVM1 (Linux Logical Volume Manager), version 2
  576. >0x12c string/b >\0 , System ID: %s
  577. # LVM2
  578. #
  579. # It seems that the label header can be in one the four first sector
  580. # of the disk... (from _find_labeller in lib/label/label.c of LVM2)
  581. #
  582. # 0x200 seems to be the common case
  583. 0 name lvm2
  584. # display UUID in LVM format + display all 32 bytes (instead of max string length: 31)
  585. >0x0 string >\x2f \b, UUID: %.6s
  586. >0x6 string >\x2f \b-%.4s
  587. >0xa string >\x2f \b-%.4s
  588. >0xe string >\x2f \b-%.4s
  589. >0x12 string >\x2f \b-%.4s
  590. >0x16 string >\x2f \b-%.4s
  591. >0x1a string >\x2f \b-%.6s
  592. >0x20 lequad x \b, size: %lld
  593. # read the offset to add to the start of the header, and the header
  594. # start in 0x200
  595. 0x218 string/b LVM2\ 001 LVM2 PV (Linux Logical Volume Manager)
  596. >&(&-12.l-0x20) use lvm2
  597. 0x018 string/b LVM2\ 001 LVM2 PV (Linux Logical Volume Manager)
  598. >&(&-12.l-0x20) use lvm2
  599. 0x418 string/b LVM2\ 001 LVM2 PV (Linux Logical Volume Manager)
  600. >&(&-12.l-0x20) use lvm2
  601. 0x618 string/b LVM2\ 001 LVM2 PV (Linux Logical Volume Manager)
  602. >&(&-12.l-0x20) use lvm2
  603. # LVM snapshot
  604. # from Jason Farrel
  605. 0 string SnAp LVM Snapshot (CopyOnWrite store)
  606. >4 lelong !0 - valid,
  607. >4 lelong 0 - invalid,
  608. >8 lelong x version %d,
  609. >12 lelong x chunk_size %d
  610. # Summary: Xen saved domain file
  611. # Created by: Radek Vokal <rvokal@redhat.com>
  612. 0 string LinuxGuestRecord Xen saved domain
  613. >20 search/256 (name
  614. >>&1 string x (name %s)
  615. # Systemd journald files
  616. # See https://www.freedesktop.org/wiki/Software/systemd/journal-files/.
  617. # From: Zbigniew Jedrzejewski-Szmek <zbyszek@in.waw.pl>
  618. # Update: Joerg Jenderek
  619. # URL: https://systemd.io/JOURNAL_FILE_FORMAT/
  620. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/j/journal-sysd.trid.xml
  621. # Note: called "systemd journal" by TrID
  622. # verified by `journalctl --file=user-1000.journal`
  623. # check magic signature[8]
  624. 0 string LPKSHHRH
  625. # check that state is one of known values
  626. # STATE_OFFLINE~0 STATE_ONLINE~1 STATE_ARCHIVED~2
  627. >16 ubyte&252 0
  628. # check that each half of three unique id128s is non-zero
  629. # file_id
  630. >>24 ubequad >0
  631. >>>32 ubequad >0
  632. # machine_id
  633. >>>>40 ubequad >0
  634. >>>>>48 ubequad >0
  635. # boot_id; last writer
  636. >>>>>>56 ubequad >0
  637. >>>>>>>64 ubequad >0 Journal file
  638. #!:mime application/octet-stream
  639. !:mime application/x-linux-journal
  640. # provide more info
  641. # head_entry_realtime; contains a POSIX timestamp stored in microseconds
  642. >>>>>>>>184 leqdate/1000000 !0 \b, %s
  643. >>>>>>>>184 leqdate 0 empty
  644. # If a file is closed after writing the state field should be set to STATE_OFFLINE
  645. >>>>>>>>16 ubyte 0 \b,
  646. # for offline and empty only journal~ extension found
  647. >>>>>>>>>184 leqdate 0 offline
  648. # https://man7.org/linux/man-pages/man8/systemd-journald.service.8.html
  649. # GRR: add char ~ inside parse_ext in ../../src/apprentice.c to avoid in file version 5.44 error like:
  650. # Magdir/linux, 463: Warning: EXTENSION type ` journal~' has bad char '~'
  651. !:ext journal~
  652. # for offline and non empty often *.journal~ but also user-1001.journal
  653. >>>>>>>>>184 leqdate !0 offline
  654. !:ext journal/journal~
  655. # if a file is opened for writing the state field should be set to STATE_ONLINE
  656. >>>>>>>>16 ubyte 1 \b,
  657. # for online and empty only journal~ extension found
  658. >>>>>>>>>184 leqdate 0 online
  659. # system@0005febee06e2ff2-f7ea54d10e4346ff.journal~
  660. !:ext journal~
  661. # for online and non empty only journal extension found
  662. >>>>>>>>>184 leqdate !0 online
  663. # system.journal user-1000.journal
  664. !:ext journal
  665. # after a file has been rotated it should be set to STATE_ARCHIVED
  666. >>>>>>>>16 ubyte 2 \b, archived
  667. !:ext journal
  668. # no *.journal~ found
  669. #!:ext journal/journal~
  670. # compatible_flags
  671. >>>>>>>>8 ulelong&1 1 \b, sealed
  672. # incompatible_flags; COMPRESSED_XZ~1 COMPRESSED_LZ4~2 KEYED_HASH~4 COMPRESSED_ZSTD~8 COMPACT~16
  673. #>>>>>>>>12 ulelong x FLAGS=%#x
  674. >>>>>>>>12 ulelong&1 1 \b, compressed
  675. >>>>>>>>12 ulelong&2 !0 \b, compressed lz4
  676. >>>>>>>>12 ulelong&4 !0 \b, keyed hash siphash24
  677. >>>>>>>>12 ulelong&8 !0 \b, compressed zstd
  678. >>>>>>>>12 ulelong&16 !0 \b, compact
  679. # uint8_t reserved[7]; apparently nil
  680. #>>17 long !0 \b, reserved %#8.8x
  681. # seqnum_id; like: 0 e623691afec94b5aa968ae2d726c49cc f98b2af481924b29 8d6816ca3639edc6
  682. #>>>>>>>>72 ubequad x \b, seqnum_id %#16.16llx
  683. #>>>>>>>>80 ubequad x b%16.16llx
  684. # header_size like: 100h
  685. >>>>>>>>88 ulequad !0x100h \b, header size %#llx
  686. # arena_size like: 0 7fff00h ffff00h 17fff00h
  687. #>>>>>>>>96 ulequad >0 \b, arena size %#llx
  688. # data_hash_table_offset like: 0 15f0h 15f0h
  689. #>>>>>>>>104 ulequad >0 \b, hash table offset %#llx
  690. # data_hash_table_size like: 0 38e380h
  691. #>>>>>>>>112 ulequad >0 \b, hash table size %#llx
  692. # field_hash_table_offset like: 0 110h
  693. #>>>>>>>>120 ulequad >0 \b, field hash table offset %#llx
  694. # field_hash_table_size like: 0 14d0h
  695. #>>>>>>>>128 ulequad >0 \b, field hash table size %#llx
  696. # tail_object_offset like: 0 43edd8h 511278h c68968h d487d0h efaa98h
  697. #>>>>>>>>136 ulequad >0 \b, tail object offset %#llx
  698. # n_objects like: 0 1032h 5a2eh 92bdh a8b5h aa75h 112adh 40c23h 4714eh
  699. #>>>>>>>>144 ulequad >0 \b, objects %#llx
  700. # n_entries like: 0 3aeh 235ah 2dc4h 3125h 16129h 187a1h
  701. >>>>>>>>152 ulequad >0 \b, entries %#llx
  702. # tail_entry_seqnum like: 0 1988h 16249h 24c12h 24c12h 41e64h 9fefdh
  703. #>>>>>>>>160 ulequad >0 \b, tail entry seqnum %#llx
  704. # head_entry_seqnum like: 0 1h 15dbh 6552h 213bfh 213bfh 3e672h 9a28ah
  705. #>>>>>>>>168 ulequad >0 \b, head entry seqnum %#llx
  706. # entry_array_offset like: 0 390058h 3909d8h 3909e0h
  707. #>>>>>>>>176 ulequad >0 \b, entry array offset %#llx
  708. # BCache backing and cache devices
  709. # From: Gabriel de Perthuis <g2p.code@gmail.com>
  710. 0x1008 lequad 8
  711. >0x1018 string \xc6\x85\x73\xf6\x4e\x1a\x45\xca\x82\x65\xf5\x7f\x48\xba\x6d\x81 BCache
  712. >>0x1010 ulequad 0 cache device
  713. >>0x1010 ulequad 1 backing device
  714. >>0x1010 ulequad 3 cache device
  715. >>0x1010 ulequad 4 backing device
  716. >>0x1048 string >0 \b, label "%.32s"
  717. >>0x1028 ubelong x \b, uuid %08x
  718. >>0x102c ubeshort x \b-%04x
  719. >>0x102e ubeshort x \b-%04x
  720. >>0x1030 ubeshort x \b-%04x
  721. >>0x1032 ubelong x \b-%08x
  722. >>0x1036 ubeshort x \b%04x
  723. >>0x1038 ubelong x \b, set uuid %08x
  724. >>0x103c ubeshort x \b-%04x
  725. >>0x103e ubeshort x \b-%04x
  726. >>0x1040 ubeshort x \b-%04x
  727. >>0x1042 ubelong x \b-%08x
  728. >>0x1046 ubeshort x \b%04x
  729. # Linux device tree:
  730. # File format description can be found in the Linux kernel sources at
  731. # Documentation/devicetree/booting-without-of.txt
  732. # From Christoph Biedl
  733. 0 belong 0xd00dfeed
  734. # structure must be within blob, strings are omitted to handle devicetrees > 1M
  735. >&(8.L) byte x
  736. >>20 belong >1 Device Tree Blob version %d
  737. >>>4 belong x \b, size=%d
  738. >>>20 belong >1
  739. >>>>28 belong x \b, boot CPU=%d
  740. >>>20 belong >2
  741. >>>>32 belong x \b, string block size=%d
  742. >>>20 belong >16
  743. >>>>36 belong x \b, DT structure block size=%d
  744. # glibc locale archive as defined in glibc locale/locarchive.h
  745. 0 lelong 0xde020109 locale archive
  746. >24 lelong x %d strings
  747. # Linux Software RAID (mdadm)
  748. # Russell Coker <russell@coker.com.au>
  749. 0 name linuxraid
  750. >16 belong x UUID=%8x:
  751. >20 belong x \b%8x:
  752. >24 belong x \b%8x:
  753. >28 belong x \b%8x
  754. >32 string x name=%s
  755. >72 lelong x level=%d
  756. >92 lelong x disks=%d
  757. 4096 lelong 0xa92b4efc Linux Software RAID
  758. >4100 lelong x version 1.2 (%d)
  759. >4096 use linuxraid
  760. 0 lelong 0xa92b4efc Linux Software RAID
  761. >4 lelong x version 1.1 (%d)
  762. >0 use linuxraid
  763. # Summary: Database file for mlocate
  764. # Description: A database file as used by mlocate, a fast implementation
  765. # of locate/updatedb. It uses merging to reuse the existing
  766. # database and avoid rereading most of the filesystem. It's
  767. # the default version of locate on Arch Linux (and others).
  768. # File path: /var/lib/mlocate/mlocate.db by default (but configurable)
  769. # Site: https://fedorahosted.org/mlocate/
  770. # Format docs: https://linux.die.net/man/5/mlocate.db
  771. # Type: mlocate database file
  772. # URL: https://en.wikipedia.org/wiki/Locate_(Unix)
  773. # URL: https://fedorahosted.org/mlocate/
  774. # From: Wander Nauta <info@wandernauta.nl>
  775. # Update: Joerg Jenderek
  776. 0 string \0mlocate mlocate database
  777. #!:mime application/octet-stream
  778. !:mime application/x-mlocate
  779. # default mlocate.db if not overriden with --output option of updatedb
  780. !:ext db
  781. # at the moment value is 0; a higher version will probably not occur, because mlocate is now often replaced by plocate
  782. >12 byte !0 \b, version %d
  783. # configured with -l option of updatedb
  784. >13 byte 1 \b, require visibility
  785. # 2 byte pad for 32-bit total alignment
  786. #>14 short !0 \b, padding %#x
  787. # standard is 1 byte / if not overriden with --database-root option of updatedb
  788. >16 string x \b, root %s
  789. # 1st variable name nil terminated like: prune_bind_mounts
  790. >>&1 string x \b, 1st variable %s
  791. # 1st variable value like: 0 1
  792. >>>&1 string x \b=%s
  793. # configuration block size in big endian like: 82 85 174 181 185 483 491 496 497 556 600
  794. >8 ubelong x \b, configuration size %u
  795. # URL: https://plocate.sesse.net/
  796. # Reference: https://plocate.sesse.net/download/plocate-1.1.19.tar.gz
  797. # plocate-1.1.19/db.h
  798. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/db-plocate.trid.xml
  799. # Note: called "plocate database" by TrID
  800. # magic[8]
  801. 0 string \0plocate plocate database
  802. #!:mime application/octet-stream
  803. !:mime application/x-plocate
  804. # default /var/lib/plocate/plocate.db if not overriden with --output option of updatedb.plocate
  805. !:ext db
  806. # version; 2 is the current version
  807. >8 ulelong !1 \b, version %u
  808. # hashtable_size; like 1 (for "empty" samples) 1b5c3h
  809. #>12 ulelong >1 \b, hash table size %#x
  810. # extra_ht_slots; like: 10h
  811. >16 ulelong !0x10 \b, extra_ht_slots %#x
  812. # num_docids; like 0 (for "empty" samples) a132h
  813. >20 ulelong >0 \b, num_docids %u
  814. # hash_table_offset_bytes; 78h (for "empty" samples) afdf99h
  815. #>24 ulequad !0x78 \b, hash table offset %#llx
  816. # filename_index_offset_bytes; 70h (for "empty" samples) aad571h
  817. #>32 ulequad !0x70 \b, filename index offset %#llx
  818. # version 1 and up only
  819. >8 ulelong >0
  820. # max_version; nominally 1 or 2 but can be increased if more features are added in a backward-compatible way
  821. >>40 ulelong !2 \b, max version %u
  822. # zstd_dictionary_length_bytes; 0 (for "empty" samples) 400h
  823. >>44 ulelong !0 \b, at %#x
  824. # zstd_dictionary_offset_bytes; 0 (for "empty" samples) 70h
  825. >>48 ulequad >0 \b+%#llx
  826. # jump to beginning of zstd dictionary
  827. >>>(48.q) ubequad x
  828. # jump realative zstd dictionary length bytes - 8 (quad length) forward to ZST data beginning
  829. #>>>>&(44.l-8) ubelong x ZST=%8.8x
  830. >>>>&(44.l-8) ubelong x
  831. # print 1 space char after zstd_dictionary_offset and then handles Zstandard compressed data by ./compress
  832. # to get phrase like "at 0x400+0x70 Zstandard compressed data (v0.8+)"
  833. >>>>>&-4 indirect x \b
  834. # only if max_version >= 2 and only relevant for updatedb
  835. >40 ulelong >1
  836. # directory_data_length_byte
  837. #>>56 ulequad x \b, directory data length %#llx
  838. # directory_data_offset_bytes;
  839. #>>64 ulequad x offset %#llx
  840. # next_zstd_dictionary_length_bytes; 0 (for "empty" samples) 400h
  841. >>72 ulequad >0 \b, next zstd dictionary length %#llx
  842. # next_zstd_dictionary_offset_bytes; 0 (for "empty" samples) 14b9cb8h
  843. >>>80 ulequad >0 offset %#llx
  844. # conf_block_length_bytes like; 65 147 148 151 152 452 537 540 543
  845. >>88 ulequad x \b, configuration size %llu
  846. # conf_block_offset_bytes; 1a1h (for "empty" samples) 14ba0b8h
  847. >>96 ulequad >0 \b, at %#llx 1st variable
  848. # 1st variable name nil terminated like: prune_bind_mounts
  849. >>>(96.q) string x %s
  850. # 1st variable value nil terminated like: 0 1
  851. >>>>&1 string x \b=%s
  852. # bool check_visibility; 0 or 1 configured with -l option of updatedb.plocate
  853. >>104 ubyte 1 \b, require visibility
  854. #>>104 ubyte x \b, check_visibility %#x
  855. # Dump files for iproute2 tool. Generated by the "ip r|a save" command. URL:
  856. # https://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
  857. # From: Pavel Emelyanov <xemul@parallels.com>
  858. 0 lelong 0x45311224 iproute2 routes dump
  859. 0 lelong 0x47361222 iproute2 addresses dump
  860. # Image and service files for CRIU tool.
  861. # URL: https://criu.org
  862. # From: Pavel Emelyanov <xemul@parallels.com>
  863. 0 lelong 0x54564319 CRIU image file v1.1
  864. 0 lelong 0x55105940 CRIU service file
  865. 0 lelong 0x58313116 CRIU inventory
  866. # Kdump compressed dump files
  867. # https://github.com/makedumpfile/makedumpfile/blob/master/IMPLEMENTATION
  868. 0 string KDUMP\x20\x20\x20 Kdump compressed dump
  869. >0 use kdump-compressed-dump
  870. 0 name kdump-compressed-dump
  871. >8 long x v%d
  872. >12 string >\0 \b, system %s
  873. >77 string >\0 \b, node %s
  874. >142 string >\0 \b, release %s
  875. >207 string >\0 \b, version %s
  876. >272 string >\0 \b, machine %s
  877. >337 string >\0 \b, domain %s
  878. # Flattened format
  879. 0 string makedumpfile
  880. >16 bequad 1
  881. >>0x1010 string KDUMP\x20\x20\x20 Flattened kdump compressed dump
  882. >>>0x1010 use kdump-compressed-dump
  883. # Device Tree files
  884. 0 search/1024 /dts-v1/ Device Tree File (v1)
  885. # beat c code
  886. !:strength +14
  887. # e2fsck undo file
  888. # David Gilman <davidgilman1@gmail.com>
  889. 0 string E2UNDO02 e2fsck undo file, version 2
  890. >44 lelong x \b, undo file is
  891. >>44 lelong&1 0 not finished
  892. >>44 lelong&1 1 finished
  893. >48 lelong x \b, undo file features:
  894. >>48 lelong&1 0 lacks filesystem offset
  895. >>48 lelong&1 1 has filesystem offset
  896. >>>64 lequad x at %#llx
  897. # ansible vault (does not really belong here)
  898. 0 string $ANSIBLE_VAULT; Ansible Vault
  899. >&0 regex [0-9]+\\.[0-9]+ \b, version %s
  900. >>&0 string ;
  901. >>>&0 regex [A-Z0-9]+ \b, encryption %s
  902. # From: Joerg Jenderek
  903. # URL: https://www.gnu.org/software/grub
  904. # Reference: https://ftp.gnu.org/gnu/grub/grub-2.06.tar.gz
  905. # grub-2.06/include/grub/keyboard_layouts.h
  906. # grub-2.06/grub-core/commands/keylayouts.c
  907. # GRUB_KEYBOARD_LAYOUTS_FILEMAGIC
  908. 0 string GRUBLAYO GRUB Keyboard
  909. !:mime application/x-grub-keyboard
  910. !:ext gkb
  911. # GRUB_KEYBOARD_LAYOUTS_VERSION like: 10
  912. >8 ulelong !10 \b, version %u
  913. # 4 grub_uint32_t grub_keyboard_layout[160]
  914. # for normal french keyboard this is letter a
  915. >92 ubyte !0x71
  916. >>92 ubyte >0x40 \b, english q is %c
  917. #>732 ubyte x \b, english Q is %c
  918. # for normal german keyboard this is letter z
  919. >124 ubyte !0x79
  920. >>124 ubyte >0x40 \b, english y is %c
  921. #>764 ubyte x \b, english Y is %c
  922. # From: Ben Dooks <ben.dooks@codethink.co.uk>
  923. # URL: https://github.com/torvalds/linux/blob/master/tools/perf/util/header.c
  924. # perf files for v1 and v2
  925. 0 string PERFFILE Linux perf recording, version 1
  926. 0 lequad 0x32454c4946524550 Linux perf recording, version 2. little endian
  927. 0 bequad 0x32454c4946524550 Linux perf recording, version 2. big endian
  928. # perf(1) (Performance analysis tools) command
  929. #
  930. # For file format details, see:
  931. #
  932. # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/\
  933. # tools/perf/Documentation/perf.data-file-format.txt
  934. # The file is normally called 'perf.data' but can take any name,
  935. # so only check the eye catcher value.
  936. 0 string PERFILE2 perf(1) data