linux 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. # message catalogs, from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
  38. 0 string *nazgul* Linux compiled message catalog
  39. >8 lelong >0 \b, version %ld
  40. # core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
  41. 216 lelong 0421 Linux/i386 core file
  42. >220 string >\0 of '%s'
  43. >200 lelong >0 (signal %d)
  44. #
  45. # LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
  46. # this can be overridden by the DOS executable (COM) entry
  47. 2 string LILO Linux/i386 LILO boot/chain loader
  48. #
  49. # Debian Packages, from Peter Tobias <tobias@server.et-inf.fho-emden.de>
  50. #0 string 0.9
  51. #>8 byte 0x0a old Debian Binary Package
  52. #>>3 byte >0 \b, created by dpkg 0.9%c
  53. #>>4 byte >0 pl%c
  54. # PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
  55. 0 leshort 0x0436 Linux/i386 PC Screen Font data,
  56. >2 byte 0 256 characters, no directory,
  57. >2 byte 1 512 characters, no directory,
  58. >2 byte 2 256 characters, Unicode directory,
  59. >2 byte 3 512 characters, Unicode directory,
  60. >3 byte >0 8x%d
  61. # Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
  62. 4086 string SWAP-SPACE Linux/i386 swap file
  63. # ECOFF magic for OSF/1 and Linux (only tested under Linux though)
  64. #
  65. # from Erik Troan (ewt@redhat.com) examining od dumps, so this
  66. # could be wrong
  67. # updated by David Mosberger (davidm@azstarnet.com) based on
  68. # GNU BFD and MIPS info found below.
  69. #
  70. 0 leshort 0x0183 ECOFF alpha
  71. >24 leshort 0407 executable
  72. >24 leshort 0410 pure
  73. >24 leshort 0413 demand paged
  74. >8 long >0 not stripped
  75. >8 long 0 stripped
  76. >23 leshort >0 - version %ld.
  77. # Linux kernel boot images (i386 arch) (Wolfram Kleff)
  78. 514 string HdrS Linux kernel
  79. >510 leshort 0xAA55 x86 boot executable
  80. >>518 leshort 0x201
  81. >>>529 byte 0 zImage,
  82. >>>529 byte 1 bzImage,
  83. >>>(526.s+0x200) string >\0 version %s,
  84. >>498 leshort 1 RO-rootFS,
  85. >>498 leshort 0 RW-rootFS,
  86. >>508 leshort >0 root_dev=0x%X,
  87. >>502 leshort >0 swap_dev=0x%X,
  88. >>504 leshort >0 RAMdisksize=%u KB,
  89. >>506 leshort 0xFFFF Normal VGA
  90. >>506 leshort 0xFFFE Extended VGA
  91. >>506 leshort 0xFFFD Prompt for Videomode
  92. >>506 leshort >0 Video mode=%d
  93. # This also matches new kernels, which were caught above by "HdrS".
  94. 0 belong 0xb8c0078e Linux kernel
  95. >0x1e3 string Loading version 1.3.79 or older
  96. >0x1e9 string Loading from prehistoric times
  97. # System.map files - Nicolás Lichtmaier <nick@debian.org>
  98. 8 string \ A\ _text Linux kernel symbol map text
  99. # LSM entries - Nicolás Lichtmaier <nick@debian.org>
  100. 0 string Begin3 Linux Software Map entry text
  101. 0 string Begin4 Linux Software Map entry text (new format)
  102. # Moved from filesistems to be able to detect linux kernels.
  103. 0x1FE leshort 0xAA55 x86 boot sector
  104. >2 string OSBS \b, OS/BS MBR
  105. >0x8C string Invalid\ partition\ table \b, MS-DOS MBR
  106. >0 string \0\0\0\0 \b, extended partition table
  107. >0 leshort 0x3CEB \b, system
  108. >>3 string >\0 %s
  109. >>0x36 string FAT \b, %s
  110. >>>0x39 string 12 (%s bit)
  111. >>>0x39 string 16 (%s bit)
  112. >0x52 string FAT32 \b, FAT (32 bit)
  113. >>>43 string >NO\ NAME label: %.11s,
  114. >>>43 string <NO\ NAME label: %.11s,
  115. >>>43 string NO\ NAME unlabeled,
  116. >>>19 leshort >0 %d sectors
  117. >>>19 leshort 0
  118. >>>>32 lelong x %d sectors
  119. >0x200 lelong 0x82564557 \b, BSD disklabel