linux 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. #------------------------------------------------------------------------------
  2. # $File: linux,v 1.41 2011/04/20 18:57:10 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. # core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
  39. 216 lelong 0421 Linux/i386 core file
  40. >220 string >\0 of '%s'
  41. >200 lelong >0 (signal %d)
  42. #
  43. # LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
  44. # this can be overridden by the DOS executable (COM) entry
  45. 2 string LILO Linux/i386 LILO boot/chain loader
  46. #
  47. # Linux make config build file, from Ole Aamot <oka@oka.no>
  48. 28 string make\ config Linux make config build file
  49. #
  50. # PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
  51. # Updated by Adam Buchbinder <adam.buchbinder@gmail.com>
  52. # See: http://www.win.tue.nl/~aeb/linux/kbd/font-formats-1.html
  53. 0 leshort 0x0436 Linux/i386 PC Screen Font v1 data,
  54. >2 byte&0x01 0 256 characters,
  55. >2 byte&0x01 !0 512 characters,
  56. >2 byte&0x02 0 no directory,
  57. >2 byte&0x02 !0 Unicode directory,
  58. >3 byte >0 8x%d
  59. 0 string \x72\xb5\x4a\x86\x00\x00 Linux/i386 PC Screen Font v2 data,
  60. >16 lelong x %d characters,
  61. >12 lelong&0x01 0 no directory,
  62. >12 lelong&0x01 !0 Unicode directory,
  63. >24 lelong x %d
  64. >28 lelong x \bx%d
  65. # Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
  66. 4086 string SWAP-SPACE Linux/i386 swap file
  67. # From: Jeff Bailey <jbailey@ubuntu.com>
  68. # Linux swap file with swsusp1 image, from Jeff Bailey <jbailey@ubuntu.com>
  69. 4076 string SWAPSPACE2S1SUSPEND Linux/i386 swap file (new style) with SWSUSP1 image
  70. # From: James Hunt <james.hunt@ubuntu.com>
  71. 4076 string SWAPSPACE2LINHIB0001 Linux/i386 swap file (new style) (compressed hibernate)
  72. # according to man page of mkswap (8) March 1999
  73. # volume label and UUID Russell Coker
  74. # http://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
  75. 4086 string SWAPSPACE2 Linux/i386 swap file (new style),
  76. >0x400 long x version %d (4K pages),
  77. >0x404 long x size %d pages,
  78. >1052 string \0 no label,
  79. >1052 string >\0 LABEL=%s,
  80. >0x40c belong x UUID=%08x
  81. >0x410 beshort x \b-%04x
  82. >0x412 beshort x \b-%04x
  83. >0x414 beshort x \b-%04x
  84. >0x416 belong x \b-%08x
  85. >0x41a beshort x \b%04x
  86. # From Daniel Novotny <dnovotny@redhat.com>
  87. # swap file for PowerPC
  88. 65526 string SWAPSPACE2 Linux/ppc swap file
  89. #
  90. # Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu>
  91. # and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
  92. # and Nicolás Lichtmaier <nick@debian.org>
  93. # All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
  94. # Linux kernel boot images (i386 arch) (Wolfram Kleff)
  95. 514 string HdrS Linux kernel
  96. >510 leshort 0xAA55 x86 boot executable
  97. >>518 leshort >0x1ff
  98. >>>529 byte 0 zImage,
  99. >>>529 byte 1 bzImage,
  100. >>>(526.s+0x200) string >\0 version %s,
  101. >>498 leshort 1 RO-rootFS,
  102. >>498 leshort 0 RW-rootFS,
  103. >>508 leshort >0 root_dev 0x%X,
  104. >>502 leshort >0 swap_dev 0x%X,
  105. >>504 leshort >0 RAMdisksize %u KB,
  106. >>506 leshort 0xFFFF Normal VGA
  107. >>506 leshort 0xFFFE Extended VGA
  108. >>506 leshort 0xFFFD Prompt for Videomode
  109. >>506 leshort >0 Video mode %d
  110. # This also matches new kernels, which were caught above by "HdrS".
  111. 0 belong 0xb8c0078e Linux kernel
  112. >0x1e3 string Loading version 1.3.79 or older
  113. >0x1e9 string Loading from prehistoric times
  114. # System.map files - Nicolás Lichtmaier <nick@debian.org>
  115. 8 search/1 \ A\ _text Linux kernel symbol map text
  116. # LSM entries - Nicolás Lichtmaier <nick@debian.org>
  117. 0 search/1 Begin3 Linux Software Map entry text
  118. 0 search/1 Begin4 Linux Software Map entry text (new format)
  119. # From Matt Zimmerman, enhanced for v3 by Matthew Palmer
  120. 0 belong 0x4f4f4f4d User-mode Linux COW file
  121. >4 belong <3 \b, version %d
  122. >>8 string >\0 \b, backing file %s
  123. >4 belong >2 \b, version %d
  124. >>32 string >\0 \b, backing file %s
  125. ############################################################################
  126. # Linux kernel versions
  127. 0 string \xb8\xc0\x07\x8e\xd8\xb8\x00\x90 Linux
  128. >497 leshort 0 x86 boot sector
  129. >>514 belong 0x8e of a kernel from the dawn of time!
  130. >>514 belong 0x908ed8b4 version 0.99-1.1.42
  131. >>514 belong 0x908ed8b8 for memtest86
  132. >497 leshort !0 x86 kernel
  133. >>504 leshort >0 RAMdisksize=%u KB
  134. >>502 leshort >0 swap=0x%X
  135. >>508 leshort >0 root=0x%X
  136. >>>498 leshort 1 \b-ro
  137. >>>498 leshort 0 \b-rw
  138. >>506 leshort 0xFFFF vga=normal
  139. >>506 leshort 0xFFFE vga=extended
  140. >>506 leshort 0xFFFD vga=ask
  141. >>506 leshort >0 vga=%d
  142. >>514 belong 0x908ed881 version 1.1.43-1.1.45
  143. >>514 belong 0x15b281cd
  144. >>>0xa8e belong 0x55AA5a5a version 1.1.46-1.2.13,1.3.0
  145. >>>0xa99 belong 0x55AA5a5a version 1.3.1,2
  146. >>>0xaa3 belong 0x55AA5a5a version 1.3.3-1.3.30
  147. >>>0xaa6 belong 0x55AA5a5a version 1.3.31-1.3.41
  148. >>>0xb2b belong 0x55AA5a5a version 1.3.42-1.3.45
  149. >>>0xaf7 belong 0x55AA5a5a version 1.3.46-1.3.72
  150. >>514 string HdrS
  151. >>>518 leshort >0x1FF
  152. >>>>529 byte 0 \b, zImage
  153. >>>>529 byte 1 \b, bzImage
  154. >>>>(526.s+0x200) string >\0 \b, version %s
  155. # Linux boot sector thefts.
  156. 0 belong 0xb8c0078e Linux
  157. >0x1e6 belong 0x454c4b53 ELKS Kernel
  158. >0x1e6 belong !0x454c4b53 style boot sector
  159. ############################################################################
  160. # Linux S390 kernel image
  161. # Created by: Jan Kaluza <jkaluza@redhat.com>
  162. 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
  163. >0x00010000 search/b/4096 \x00\x0a\x00\x00\x8b\xad\xcc\xcc
  164. # 64bit
  165. >>&0 string \xc1\x00\xef\xe3\xf0\x68\x00\x00 Z10 64bit kernel
  166. >>&0 string \xc1\x00\xef\xc3\x00\x00\x00\x00 Z9-109 64bit kernel
  167. >>&0 string \xc0\x00\x20\x00\x00\x00\x00\x00 Z990 64bit kernel
  168. >>&0 string \x00\x00\x00\x00\x00\x00\x00\x00 Z900 64bit kernel
  169. # 32bit
  170. >>&0 string \x81\x00\xc8\x80\x00\x00\x00\x00 Z10 32bit kernel
  171. >>&0 string \x81\x00\xc8\x80\x00\x00\x00\x00 Z9-109 32bit kernel
  172. >>&0 string \x80\x00\x20\x00\x00\x00\x00\x00 Z990 32bit kernel
  173. >>&0 string \x80\x00\x00\x00\x00\x00\x00\x00 Z900 32bit kernel
  174. ############################################################################
  175. # Linux 8086 executable
  176. 0 lelong&0xFF0000FF 0xC30000E9 Linux-Dev86 executable, headerless
  177. >5 string .
  178. >>4 string >\0 \b, libc version %s
  179. 0 lelong&0xFF00FFFF 0x4000301 Linux-8086 executable
  180. >2 byte&0x01 !0 \b, unmapped zero page
  181. >2 byte&0x20 0 \b, impure
  182. >2 byte&0x20 !0
  183. >>2 byte&0x10 !0 \b, A_EXEC
  184. >2 byte&0x02 !0 \b, A_PAL
  185. >2 byte&0x04 !0 \b, A_NSYM
  186. >2 byte&0x08 !0 \b, A_STAND
  187. >2 byte&0x40 !0 \b, A_PURE
  188. >2 byte&0x80 !0 \b, A_TOVLY
  189. >28 long !0 \b, not stripped
  190. >37 string .
  191. >>36 string >\0 \b, libc version %s
  192. # 0 lelong&0xFF00FFFF 0x10000301 ld86 I80386 executable
  193. # 0 lelong&0xFF00FFFF 0xB000301 ld86 M68K executable
  194. # 0 lelong&0xFF00FFFF 0xC000301 ld86 NS16K executable
  195. # 0 lelong&0xFF00FFFF 0x17000301 ld86 SPARC executable
  196. # SYSLINUX boot logo files (from 'ppmtolss16' sources)
  197. # http://syslinux.zytor.com/
  198. #
  199. 0 lelong =0x1413f33d SYSLINUX' LSS16 image data
  200. >4 leshort x \b, width %d
  201. >6 leshort x \b, height %d
  202. 0 string OOOM User-Mode-Linux's Copy-On-Write disk image
  203. >4 belong x version %d
  204. # SE Linux policy database
  205. # From: Mike Frysinger <vapier@gentoo.org>
  206. 0 lelong 0xf97cff8c SE Linux policy
  207. >16 lelong x v%d
  208. >20 lelong 1 MLS
  209. >24 lelong x %d symbols
  210. >28 lelong x %d ocons
  211. # Linux Logical Volume Manager (LVM)
  212. # Emmanuel VARAGNAT <emmanuel.varagnat@guzu.net>
  213. #
  214. # System ID, UUID and volume group name are 128 bytes long
  215. # but they should never be full and initialized with zeros...
  216. #
  217. # LVM1
  218. #
  219. 0x0 string HM\001 LVM1 (Linux Logical Volume Manager), version 1
  220. >0x12c string >\0 , System ID: %s
  221. 0x0 string HM\002 LVM1 (Linux Logical Volume Manager), version 2
  222. >0x12c string >\0 , System ID: %s
  223. # LVM2
  224. #
  225. # It seems that the label header can be in one the four first sector
  226. # of the disk... (from _find_labeller in lib/label/label.c of LVM2)
  227. #
  228. # 0x200 seems to be the common case
  229. 0x218 string LVM2\ 001 LVM2 PV (Linux Logical Volume Manager)
  230. # read the offset to add to the start of the header, and the header
  231. # start in 0x200
  232. >&(&-12.l-0x21) byte x
  233. # display UUID in LVM format + display all 32 bytes (instead of max string length: 31)
  234. >>&0x0 string >\x2f \b, UUID: %.6s
  235. >>&0x6 string >\x2f \b-%.4s
  236. >>&0xa string >\x2f \b-%.4s
  237. >>&0xe string >\x2f \b-%.4s
  238. >>&0x12 string >\x2f \b-%.4s
  239. >>&0x16 string >\x2f \b-%.4s
  240. >>&0x1a string >\x2f \b-%.6s
  241. >>&0x20 lequad x \b, size: %lld
  242. 0x018 string LVM2\ 001 LVM2 PV (Linux Logical Volume Manager)
  243. >&(&-12.l-0x21) byte x
  244. # display UUID in LVM format + display all 32 bytes (instead of max string length: 31)
  245. >>&0x0 string >\x2f \b, UUID: %.6s
  246. >>&0x6 string >\x2f \b-%.4s
  247. >>&0xa string >\x2f \b-%.4s
  248. >>&0xe string >\x2f \b-%.4s
  249. >>&0x12 string >\x2f \b-%.4s
  250. >>&0x16 string >\x2f \b-%.4s
  251. >>&0x1a string >\x2f \b-%.6s
  252. >>&0x20 lequad x \b, size: %lld
  253. 0x418 string LVM2\ 001 LVM2 PV (Linux Logical Volume Manager)
  254. >&(&-12.l-0x21) byte x
  255. # display UUID in LVM format + display all 32 bytes (instead of max string length: 31)
  256. >>&0x0 string >\x2f \b, UUID: %.6s
  257. >>&0x6 string >\x2f \b-%.4s
  258. >>&0xa string >\x2f \b-%.4s
  259. >>&0xe string >\x2f \b-%.4s
  260. >>&0x12 string >\x2f \b-%.4s
  261. >>&0x16 string >\x2f \b-%.4s
  262. >>&0x1a string >\x2f \b-%.6s
  263. >>&0x20 lequad x \b, size: %lld
  264. 0x618 string LVM2\ 001 LVM2 PV (Linux Logical Volume Manager)
  265. >&(&-12.l-0x21) byte x
  266. # display UUID in LVM format + display all 32 bytes (instead of max string length: 31)
  267. >>&0x0 string >\x2f \b, UUID: %.6s
  268. >>&0x6 string >\x2f \b-%.4s
  269. >>&0xa string >\x2f \b-%.4s
  270. >>&0xe string >\x2f \b-%.4s
  271. >>&0x12 string >\x2f \b-%.4s
  272. >>&0x16 string >\x2f \b-%.4s
  273. >>&0x1a string >\x2f \b-%.6s
  274. >>&0x20 lequad x \b, size: %lld
  275. # LVM snapshot
  276. # from Jason Farrel
  277. 0 string SnAp LVM Snapshot (CopyOnWrite store)
  278. >4 lelong !0 - valid,
  279. >4 lelong 0 - invalid,
  280. >8 lelong x version %d,
  281. >12 lelong x chunk_size %d
  282. # SE Linux policy database
  283. 0 lelong 0xf97cff8c SE Linux policy
  284. >16 lelong x v%d
  285. >20 lelong 1 MLS
  286. >24 lelong x %d symbols
  287. >28 lelong x %d ocons
  288. # LUKS: Linux Unified Key Setup, On-Disk Format, http://luks.endorphin.org/spec
  289. # Anthon van der Neut (anthon@mnt.org)
  290. 0 string LUKS\xba\xbe LUKS encrypted file,
  291. >6 beshort x ver %d
  292. >8 string x [%s,
  293. >40 string x %s,
  294. >72 string x %s]
  295. >168 string x UUID: %s
  296. # Summary: Xen saved domain file
  297. # Created by: Radek Vokal <rvokal@redhat.com>
  298. 0 string LinuxGuestRecord Xen saved domain
  299. >20 search/256 (name
  300. >>&1 string x (name %s)
  301. # Type: Xen, the virtual machine monitor
  302. # From: Radek Vokal <rvokal@redhat.com>
  303. 0 string LinuxGuestRecord Xen saved domain
  304. #>2 regex \(name\ [^)]*\) %s
  305. >20 search/256 (name (name
  306. >>&1 string x %s...)