linux 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. #------------------------------------------------------------------------------
  2. # linux: file(1) magic for Linux files
  3. #
  4. # Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
  5. # The following basic Linux magic is useful for reference, but using
  6. # "long" magic is a better practice in order to avoid collisions.
  7. #
  8. # 2 leshort 100 Linux/i386
  9. # >0 leshort 0407 impure executable (OMAGIC)
  10. # >0 leshort 0410 pure executable (NMAGIC)
  11. # >0 leshort 0413 demand-paged executable (ZMAGIC)
  12. # >0 leshort 0314 demand-paged executable (QMAGIC)
  13. #
  14. 0 lelong 0x00640107 Linux/i386 impure executable (OMAGIC)
  15. >16 lelong 0 \b, stripped
  16. 0 lelong 0x00640108 Linux/i386 pure executable (NMAGIC)
  17. >16 lelong 0 \b, stripped
  18. 0 lelong 0x0064010b Linux/i386 demand-paged executable (ZMAGIC)
  19. >16 lelong 0 \b, stripped
  20. 0 lelong 0x006400cc Linux/i386 demand-paged executable (QMAGIC)
  21. >16 lelong 0 \b, stripped
  22. #
  23. 0 string \007\001\000 Linux/i386 object file
  24. >20 lelong >0x1020 \b, DLL library
  25. # Linux-8086 stuff:
  26. 0 string \01\03\020\04 Linux-8086 impure executable
  27. >28 long !0 not stripped
  28. 0 string \01\03\040\04 Linux-8086 executable
  29. >28 long !0 not stripped
  30. #
  31. 0 string \243\206\001\0 Linux-8086 object file
  32. #
  33. 0 string \01\03\020\20 Minix-386 impure executable
  34. >28 long !0 not stripped
  35. 0 string \01\03\040\20 Minix-386 executable
  36. >28 long !0 not stripped
  37. # core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
  38. 216 lelong 0421 Linux/i386 core file
  39. >220 string >\0 of '%s'
  40. >200 lelong >0 (signal %d)
  41. #
  42. # LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
  43. # this can be overridden by the DOS executable (COM) entry
  44. 2 string LILO Linux/i386 LILO boot/chain loader
  45. #
  46. # PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
  47. 0 leshort 0x0436 Linux/i386 PC Screen Font data,
  48. >2 byte 0 256 characters, no directory,
  49. >2 byte 1 512 characters, no directory,
  50. >2 byte 2 256 characters, Unicode directory,
  51. >2 byte 3 512 characters, Unicode directory,
  52. >3 byte >0 8x%d
  53. # Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
  54. 4086 string SWAP-SPACE Linux/i386 swap file
  55. # From: Jeff Bailey <jbailey@ubuntu.com>
  56. # Linux swap file with swsusp1 image, from Jeff Bailey <jbailey@ubuntu.com>
  57. 4076 string SWAPSPACE2S1SUSPEND Linux/i386 swap file (new style) with SWSUSP1 image
  58. # according to man page of mkswap (8) March 1999
  59. 4086 string SWAPSPACE2 Linux/i386 swap file (new style)
  60. >0x400 long x %d (4K pages)
  61. >0x404 long x size %d pages
  62. >>4086 string SWAPSPACE2
  63. >>>1052 string >\0 Label %s
  64. # ECOFF magic for OSF/1 and Linux (only tested under Linux though)
  65. #
  66. # from Erik Troan (ewt@redhat.com) examining od dumps, so this
  67. # could be wrong
  68. # updated by David Mosberger (davidm@azstarnet.com) based on
  69. # GNU BFD and MIPS info found below.
  70. #
  71. 0 leshort 0x0183 ECOFF alpha
  72. >24 leshort 0407 executable
  73. >24 leshort 0410 pure
  74. >24 leshort 0413 demand paged
  75. >8 long >0 not stripped
  76. >8 long 0 stripped
  77. >23 leshort >0 - version %ld.
  78. #
  79. # Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu>
  80. # and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
  81. # and Nicolás Lichtmaier <nick@debian.org>
  82. # All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
  83. # Linux kernel boot images (i386 arch) (Wolfram Kleff)
  84. 514 string HdrS Linux kernel
  85. >510 leshort 0xAA55 x86 boot executable
  86. >>518 leshort >0x1ff
  87. >>>529 byte 0 zImage,
  88. >>>529 byte 1 bzImage,
  89. >>>(526.s+0x200) string >\0 version %s,
  90. >>498 leshort 1 RO-rootFS,
  91. >>498 leshort 0 RW-rootFS,
  92. >>508 leshort >0 root_dev 0x%X,
  93. >>502 leshort >0 swap_dev 0x%X,
  94. >>504 leshort >0 RAMdisksize %u KB,
  95. >>506 leshort 0xFFFF Normal VGA
  96. >>506 leshort 0xFFFE Extended VGA
  97. >>506 leshort 0xFFFD Prompt for Videomode
  98. >>506 leshort >0 Video mode %d
  99. # This also matches new kernels, which were caught above by "HdrS".
  100. 0 belong 0xb8c0078e Linux kernel
  101. >0x1e3 string Loading version 1.3.79 or older
  102. >0x1e9 string Loading from prehistoric times
  103. # System.map files - Nicolás Lichtmaier <nick@debian.org>
  104. 8 search/1 \ A\ _text Linux kernel symbol map text
  105. # LSM entries - Nicolás Lichtmaier <nick@debian.org>
  106. 0 search/1 Begin3 Linux Software Map entry text
  107. 0 search/1 Begin4 Linux Software Map entry text (new format)
  108. # From Matt Zimmerman, enhanced for v3 by Matthew Palmer
  109. 0 belong 0x4f4f4f4d User-mode Linux COW file
  110. >4 belong <3 \b, version %d
  111. >>8 string >\0 \b, backing file %s
  112. >4 belong >2 \b, version %d
  113. >>32 string >\0 \b, backing file %s
  114. ############################################################################
  115. # Linux kernel versions
  116. 0 string \xb8\xc0\x07\x8e\xd8\xb8\x00\x90 Linux
  117. >497 leshort 0 x86 boot sector
  118. >>514 belong 0x8e of a kernel from the dawn of time!
  119. >>514 belong 0x908ed8b4 version 0.99-1.1.42
  120. >>514 belong 0x908ed8b8 for memtest86
  121. >497 leshort !0 x86 kernel
  122. >>504 leshort >0 RAMdisksize=%u KB
  123. >>502 leshort >0 swap=0x%X
  124. >>508 leshort >0 root=0x%X
  125. >>>498 leshort 1 \b-ro
  126. >>>498 leshort 0 \b-rw
  127. >>506 leshort 0xFFFF vga=normal
  128. >>506 leshort 0xFFFE vga=extended
  129. >>506 leshort 0xFFFD vga=ask
  130. >>506 leshort >0 vga=%d
  131. >>514 belong 0x908ed881 version 1.1.43-1.1.45
  132. >>514 belong 0x15b281cd
  133. >>>0xa8e belong 0x55AA5a5a version 1.1.46-1.2.13,1.3.0
  134. >>>0xa99 belong 0x55AA5a5a version 1.3.1,2
  135. >>>0xaa3 belong 0x55AA5a5a version 1.3.3-1.3.30
  136. >>>0xaa6 belong 0x55AA5a5a version 1.3.31-1.3.41
  137. >>>0xb2b belong 0x55AA5a5a version 1.3.42-1.3.45
  138. >>>0xaf7 belong 0x55AA5a5a version 1.3.46-1.3.72
  139. >>514 string HdrS
  140. >>>518 leshort >0x1FF
  141. >>>>529 byte 0 \b, zImage
  142. >>>>529 byte 1 \b, bzImage
  143. >>>>(526.s+0x200) string >\0 \b, version %s
  144. # Linux boot sector thefts.
  145. 0 belong 0xb8c0078e Linux
  146. >0x1e6 belong 0x454c4b53 ELKS Kernel
  147. >0x1e6 belong !0x454c4b53 style boot sector
  148. ############################################################################
  149. # Linux 8086 executable
  150. 0 lelong&0xFF0000FF 0xC30000E9 Linux-Dev86 executable, headerless
  151. >5 string .
  152. >>4 string >\0 \b, libc version %s
  153. 0 lelong&0xFF00FFFF 0x4000301 Linux-8086 executable
  154. >2 byte&0x01 !0 \b, unmapped zero page
  155. >2 byte&0x20 0 \b, impure
  156. >2 byte&0x20 !0
  157. >>2 byte&0x10 !0 \b, A_EXEC
  158. >2 byte&0x02 !0 \b, A_PAL
  159. >2 byte&0x04 !0 \b, A_NSYM
  160. >2 byte&0x08 !0 \b, A_STAND
  161. >2 byte&0x40 !0 \b, A_PURE
  162. >2 byte&0x80 !0 \b, A_TOVLY
  163. >28 long !0 \b, not stripped
  164. >37 string .
  165. >>36 string >\0 \b, libc version %s
  166. # 0 lelong&0xFF00FFFF 0x10000301 ld86 I80386 executable
  167. # 0 lelong&0xFF00FFFF 0xB000301 ld86 M68K executable
  168. # 0 lelong&0xFF00FFFF 0xC000301 ld86 NS16K executable
  169. # 0 lelong&0xFF00FFFF 0x17000301 ld86 SPARC executable
  170. # SYSLINUX boot logo files (from 'ppmtolss16' sources)
  171. # http://syslinux.zytor.com/
  172. #
  173. 0 lelong =0x1413f33d SYSLINUX' LSS16 image data
  174. >4 leshort x \b, width %d
  175. >6 leshort x \b, height %d
  176. 0 string OOOM User-Mode-Linux's Copy-On-Write disk image
  177. >4 belong x version %d
  178. # SE Linux policy database
  179. # From: Mike Frysinger <vapier@gentoo.org>
  180. 0 lelong 0xf97cff8c SE Linux policy
  181. >16 lelong x v%d
  182. >20 lelong 1 MLS
  183. >24 lelong x %d symbols
  184. >28 lelong x %d ocons
  185. # Linux Logical Volume Manager (LVM)
  186. # Emmanuel VARAGNAT <emmanuel.varagnat@guzu.net>
  187. #
  188. # System ID, UUID and volume group name are 128 bytes long
  189. # but they should never be full and initialized with zeros...
  190. #
  191. # LVM1
  192. #
  193. 0x0 string HM\001 LVM1 (Linux Logical Volume Manager), version 1
  194. >0x12c string >\0 , System ID: %s
  195. 0x0 string HM\002 LVM1 (Linux Logical Volume Manager), version 2
  196. >0x12c string >\0 , System ID: %s
  197. # LVM2
  198. #
  199. # It seems that the label header can be in one the four first sector
  200. # of the disk... (from _find_labeller in lib/label/label.c of LVM2)
  201. #
  202. # 0x200 seems to be the common case
  203. 0x218 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
  204. # read the offset to add to the start of the header, and the header
  205. # start in 0x200
  206. >(0x214.l+0x200) string >\0 , UUID: %s
  207. 0x018 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
  208. >(0x014.l) string >\0 , UUID: %s
  209. 0x418 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
  210. >(0x414.l+0x400) string >\0 , UUID: %s
  211. 0x618 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
  212. >(0x614.l+0x600) string >\0 , UUID: %s
  213. # LVM snapshot
  214. # from Jason Farrel
  215. 0 string SnAp LVM Snapshot (CopyOnWrite store)
  216. >4 lelong !0 - valid,
  217. >4 lelong 0 - invalid,
  218. >8 lelong x version %d,
  219. >12 lelong x chunk_size %d
  220. # SE Linux policy database
  221. 0 lelong 0xf97cff8c SE Linux policy
  222. >16 lelong x v%d
  223. >20 lelong 1 MLS
  224. >24 lelong x %d symbols
  225. >28 lelong x %d ocons
  226. # LUKS: Linux Unified Key Setup, On-Disk Format, http://luks.endorphin.org/spec
  227. # Anthon van der Neut (anthon@mnt.org)
  228. 0 string LUKS\xba\xbe LUKS encrypted file,
  229. >6 beshort x ver %d
  230. >8 string x [%s,
  231. >40 string x %s,
  232. >72 string x %s]
  233. >168 string x UUID: %s
  234. # Summary: Xen saved domain file
  235. # Created by: Radek Vokal <rvokal@redhat.com>
  236. 0 string LinuxGuestRecord Xen saved domain
  237. >20 search/256 (name
  238. >>&1 string x (name %s)