msdos 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. #------------------------------------------------------------------------------
  2. # msdos: file(1) magic for MS-DOS files
  3. #
  4. # .BAT files (Daniel Quinlan, quinlan@yggdrasil.com)
  5. 0 string @echo\ off MS-DOS batch file text
  6. 0 string @ECHO\ OFF MS-DOS batch file text
  7. # XXX - according to Microsoft's spec, at an offset of 0x3c in a
  8. # PE-format executable is the offset in the file of the PE header;
  9. # unfortunately, that's a little-endian offset, and there's no way
  10. # to specify an indirect offset with a specified byte order.
  11. # So, for now, we assume the standard MS-DOS stub, which puts the
  12. # PE header at 0x80 = 128.
  13. #
  14. # Required OS version and subsystem version were 4.0 on some NT 3.51
  15. # executables built with Visual C++ 4.0, so it's not clear that
  16. # they're interesting. The user version was 0.0, but there's
  17. # probably some linker directive to set it. The linker version was
  18. # 3.0, except for one ".exe" which had it as 4.20 (same damn linker!).
  19. #
  20. 128 string PE\0\0 MS Windows PE
  21. >150 leshort&0x0100 >0 32-bit
  22. >132 leshort 0x0 unknown processor
  23. >132 leshort 0x14c Intel 80386
  24. >132 leshort 0x166 MIPS R4000
  25. >132 leshort 0x184 Alpha
  26. >132 leshort 0x268 Motorola 68000
  27. >132 leshort 0x1f0 PowerPC
  28. >132 leshort 0x290 PA-RISC
  29. >148 leshort >27
  30. >>220 leshort 0 unknown subsystem
  31. >>220 leshort 1 native
  32. >>220 leshort 2 GUI
  33. >>220 leshort 3 console
  34. >>220 leshort 7 POSIX
  35. >150 leshort&0x2000 =0 executable
  36. #>>136 ledate x stamp %s,
  37. >>150 leshort&0x0001 >0 not relocatable
  38. #>>150 leshort&0x0004 =0 with line numbers,
  39. #>>150 leshort&0x0008 =0 with local symbols,
  40. #>>150 leshort&0x0200 =0 with debug symbols,
  41. >>150 leshort&0x1000 >0 system file
  42. #>>148 leshort >0
  43. #>>>154 byte x linker %d
  44. #>>>155 byte x \b.%d,
  45. #>>148 leshort >27
  46. #>>>192 leshort x requires OS %d
  47. #>>>194 leshort x \b.%d,
  48. #>>>196 leshort x user version %d
  49. #>>>198 leshort x \b.%d,
  50. #>>>200 leshort x subsystem version %d
  51. #>>>202 leshort x \b.%d,
  52. >150 leshort&0x2000 >0 DLL
  53. #>>136 ledate x stamp %s,
  54. >>150 leshort&0x0001 >0 not relocatable
  55. #>>150 leshort&0x0004 =0 with line numbers,
  56. #>>150 leshort&0x0008 =0 with local symbols,
  57. #>>150 leshort&0x0200 =0 with debug symbols,
  58. >>150 leshort&0x1000 >0 system file
  59. #>>148 leshort >0
  60. #>>>154 byte x linker %d
  61. #>>>155 byte x \b.%d,
  62. #>>148 leshort >27
  63. #>>>192 leshort x requires OS %d
  64. #>>>194 leshort x \b.%d,
  65. #>>>196 leshort x user version %d
  66. #>>>198 leshort x \b.%d,
  67. #>>>200 leshort x subsystem version %d
  68. #>>>202 leshort x \b.%d,
  69. 0 leshort 0x14c MS Windows COFF Intel 80386 object file
  70. #>4 ledate x stamp %s
  71. 0 leshort 0x166 MS Windows COFF MIPS R4000 object file
  72. #>4 ledate x stamp %s
  73. 0 leshort 0x184 MS Windows COFF Alpha object file
  74. #>4 ledate x stamp %s
  75. 0 leshort 0x268 MS Windows COFF Motorola 68000 object file
  76. #>4 ledate x stamp %s
  77. 0 leshort 0x1f0 MS Windows COFF PowerPC object file
  78. #>4 ledate x stamp %s
  79. 0 leshort 0x290 MS Windows COFF PA-RISC object file
  80. #>4 ledate x stamp %s
  81. # .EXE formats (Greg Roelofs, newt@uchicago.edu)
  82. #
  83. 0 string MZ MS-DOS executable (EXE)
  84. >24 string @ \b, OS/2 or MS Windows
  85. >>0xe7 string LH/2\ Self-Extract \b, %s
  86. >>0xe9 string PKSFX2 \b, %s
  87. >>122 string Windows\ self-extracting\ ZIP \b, %s
  88. >0x1c string RJSX\xff\xff \b, ARJ SFX
  89. >0x1c string diet\xf9\x9c \b, diet compressed
  90. >0x1e string Copyright\ 1989-1990\ PKWARE\ Inc. \b, PKSFX
  91. # JM: 0x1e "PKLITE Copr. 1990-92 PKWARE Inc. All Rights Reserved\7\0\0\0"
  92. >0x1e string PKLITE\ Copr. \b, %.6s compressed
  93. >0x24 string LHa's\ SFX \b, %.15s
  94. >0x24 string LHA's\ SFX \b, %.15s
  95. >1638 string -lh5- \b, LHa SFX archive v2.13S
  96. >7195 string Rar! \b, RAR self-extracting archive
  97. #
  98. # [GRR 950118: file 3.15 has a buffer-size limitation; offsets bigger than
  99. # 8161 bytes are ignored. To make the following entries work, increase
  100. # HOWMANY in file.h to 32K at least, and maybe to 70K or more for OS/2,
  101. # NT/Win32 and VMS.]
  102. # [GRR: some company sells a self-extractor/displayer for image data(!)]
  103. #
  104. >11696 string PK\003\004 \b, PKZIP SFX archive v1.1
  105. >13297 string PK\003\004 \b, PKZIP SFX archive v1.93a
  106. >15588 string PK\003\004 \b, PKZIP2 SFX archive v1.09
  107. >15770 string PK\003\004 \b, PKZIP SFX archive v2.04g
  108. >28374 string PK\003\004 \b, PKZIP2 SFX archive v1.02
  109. #
  110. # Info-ZIP self-extractors
  111. # these are the DOS versions:
  112. >25115 string PK\003\004 \b, Info-ZIP SFX archive v5.12
  113. >26331 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption
  114. # these are the OS/2 versions (OS/2 is flagged above):
  115. >47031 string PK\003\004 \b, Info-ZIP SFX archive v5.12
  116. >49845 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption
  117. # this is the NT/Win32 version:
  118. >69120 string PK\003\004 \b, Info-ZIP NT SFX archive v5.12 w/decryption
  119. #
  120. # TELVOX Teleinformatica CODEC self-extractor for OS/2:
  121. >49801 string \x79\xff\x80\xff\x76\xff \b, CODEC archive v3.21
  122. >>49824 leshort =1 \b, 1 file
  123. >>49824 leshort >1 \b, %u files
  124. # .COM formats (Daniel Quinlan, quinlan@yggdrasil.com)
  125. # Uncommenting only the first two lines will cover about 2/3 of COM files,
  126. # but it isn't feasible to match all COM files since there must be at least
  127. # two dozen different one-byte "magics".
  128. #0 byte 0xe9 MS-DOS executable (COM)
  129. #>6 string SFX\ of\ LHarc (%s)
  130. #0 byte 0x8c MS-DOS executable (COM)
  131. # 0xeb conflicts with "sequent" magic
  132. #0 byte 0xeb MS-DOS executable (COM)
  133. #0 byte 0xb8 MS-DOS executable (COM)
  134. # miscellaneous formats
  135. 0 string LZ MS-DOS executable (built-in)
  136. #0 byte 0xf0 MS-DOS program library data
  137. #
  138. #
  139. # Windows Registry files.
  140. #
  141. 0 string regf Windows NT registry file
  142. 0 string CREG Windows 95 registry file
  143. # Popular applications
  144. 2080 string Microsoft\ Word\ 6.0\ Document %s
  145. 2080 string Documento\ Microsoft\ Word\ 6 Spanish Microsoft Word 6 document data
  146. # Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Word)
  147. 2112 string MSWordDoc Microsoft Word document data
  148. #
  149. 0 belong 0x31be0000 Microsoft Word Document
  150. #
  151. 0 string PO^Q` Microsoft Word 6.0 Document
  152. # I guess this is the one that works:
  153. # Microsoft Office Document (e.g.: doc,xls) (Wolfram Kleff)
  154. 0 string \xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1 Microsoft Office document data
  155. 0 string \376\067\0\043 Microsoft Office Document
  156. #0 string \320\317\021\340\241\261 Microsoft Office Document
  157. 0 string \333\245-\0\0\0 Microsoft Office Document
  158. #
  159. 2080 string Microsoft\ Excel\ 5.0\ Worksheet %s
  160. #
  161. # Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Excel)
  162. 2114 string Biff5 Microsoft Excel 5.0 Worksheet
  163. #
  164. 0 belong 0x00001a00 Lotus 1-2-3
  165. >4 belong 0x00100400 wk3 document data
  166. >4 belong 0x02100400 wk4 document data
  167. >4 belong 0x07800100 fm3 or fmb document data
  168. >4 belong 0x07800000 fm3 or fmb document data
  169. #
  170. 0 belong 0x00000200 Lotus 1-2-3
  171. >4 belong 0x06040600 wk1 document data
  172. >4 belong 0x06800200 fmt document data
  173. # Help files
  174. 0 string ?_\3\0 MS Windows Help Data
  175. # HtmlHelp files (.chm)
  176. 0 string ITSF\003\000\000\000\x60\000\000\000\001\000\000\000 MS Windows HtmlHelp Data
  177. # Microsoft CAB distribution format Dale Worley <root@dworley.ny.mediaone.net>
  178. 0 string MSCF\000\000\000\000 Microsoft CAB file
  179. # DeIsL1.isu what this is I don't know
  180. 0 string \161\250\000\000\001\002 DeIsL1.isu whatever that is
  181. # Winamp .avs
  182. #0 string Nullsoft\ AVS\ Preset\ \060\056\061\032 A plug in for Winamp ms-windows Freeware media player
  183. 0 string Nullsoft\ AVS\ Preset\ Winamp plug in
  184. # Hyper terminal:
  185. 0 string HyperTerminal\ hyperterm
  186. >15 string 1.0\ --\ HyperTerminal\ data\ file MS-windows Hyperterminal
  187. # Windows Metafont .WMF
  188. 0 string \327\315\306\232\000\000\000\000\000\000 ms-windows metafont .wmf
  189. #tz3 files whatever that is (MS Works files)
  190. 0 string \003\001\001\004\070\001\000\000 tz3 ms-works file
  191. 0 string \003\002\001\004\070\001\000\000 tz3 ms-works file
  192. 0 string \003\003\001\004\070\001\000\000 tz3 ms-works file
  193. # PGP sig files .sig
  194. #0 string \211\000\077\003\005\000\063\237\127 065 to \027\266\151\064\005\045\101\233\021\002 PGP sig
  195. 0 string \211\000\077\003\005\000\063\237\127\065\027\266\151\064\005\045\101\233\021\002 PGP sig
  196. 0 string \211\000\077\003\005\000\063\237\127\066\027\266\151\064\005\045\101\233\021\002 PGP sig
  197. 0 string \211\000\077\003\005\000\063\237\127\067\027\266\151\064\005\045\101\233\021\002 PGP sig
  198. 0 string \211\000\077\003\005\000\063\237\127\070\027\266\151\064\005\045\101\233\021\002 PGP sig
  199. 0 string \211\000\077\003\005\000\063\237\127\071\027\266\151\064\005\045\101\233\021\002 PGP sig
  200. 0 string \211\000\225\003\005\000\062\122\207\304\100\345\042 PGP sig
  201. # windows zips files .dmf
  202. 0 string MDIF\032\000\010\000\000\000\372\046\100\175\001\000\001\036\001\000 Ms-windows special zipped file
  203. # Windows help file FTG FTS
  204. 0 string \164\146\115\122\012\000\000\000\001\000\000\000 ms-windows help cache
  205. # grp old windows 3.1 group files
  206. 0 string \120\115\103\103 Ms-windows 3.1 group files
  207. # lnk files windows symlinks
  208. 0 string \114\000\000\000\001\024\002\000\000\000\000\000\300\000\000\000\000\000\000\106 ms-Windows shortcut
  209. #ico files
  210. 0 string \102\101\050\000\000\000\056\000\000\000\000\000\000\000 Icon for ms-windows
  211. # Windows icons (Ian Springer <ips@fpk.hp.com>)
  212. 0 string \000\000\001\000 ms-windows icon resource
  213. >4 byte 1 - 1 icon
  214. >4 byte >1 - %d icons
  215. >>6 byte >0 \b, %dx
  216. >>>7 byte >0 \b%d
  217. >>8 byte 0 \b, 256-colors
  218. >>8 byte >0 \b, %d-colors
  219. # True Type fonts currently misidentified as raw G3 data
  220. 0 string \000\001\000\000\000 MS-Windows TrueType font data
  221. # .chr files
  222. 0 string PK\010\010BGI Borland font
  223. >4 string >\0 %s
  224. # then there is a copyright notice
  225. # .bgi files
  226. 0 string pk\010\010BGI Borland device
  227. >4 string >\0 %s
  228. # then there is a copyright notice
  229. # recycled/info the windows trash bin index
  230. 9 string \000\000\000\030\001\000\000\000 ms-windows recycled bin info
  231. ##### put in Either Magic/font or Magic/news
  232. # Acroread or something files wrongly identified as G3 .pfm
  233. # these have the form \000 \001 any? \002 \000 \000
  234. # or \000 \001 any? \022 \000 \000
  235. 0 string \000\001 pfm?
  236. >3 string \022\000\000Copyright\ yes
  237. >3 string \002\000\000Copyright\ yes
  238. #>3 string >\0 oops, not a font file. Cancel that.
  239. #it clashes with ttf files so put it lower down.
  240. # From Doug Lee via a FreeBSD pr
  241. 9 string GERBILDOC First Choice document
  242. 9 string GERBILDB First Choice database
  243. 9 string GERBILCLIP First Choice database
  244. 0 string GERBIL First Choice device file
  245. 9 string RABBITGRAPH RabbitGraph file
  246. 0 string DCU1 Borland Delphi .DCU file
  247. 0 string !<spell> MKS Spell hash list (old format)
  248. 0 string !<spell2> MKS Spell hash list
  249. 0 string AH Halo(TM) bitmapped font file
  250. 0 lelong 0x08086b70 TurboC BGI file
  251. 0 lelong 0x08084b50 TurboC Font file
  252. # WARNING: below line conflicts with Infocom game data Z-machine 3
  253. 0 byte 0x03 DBase 3 data file
  254. >0x04 lelong 0 (no records)
  255. >0x04 lelong >0 (%ld records)
  256. 0 byte 0x83 DBase 3 data file with memo(s)
  257. >0x04 lelong 0 (no records)
  258. >0x04 lelong >0 (%ld records)
  259. 0 leshort 0x0006 DBase 3 index file
  260. 0 string PMCC Windows 3.x .GRP file
  261. 1 string RDC-meg MegaDots
  262. >8 byte >0x2F version %c
  263. >9 byte >0x2F \b.%c file
  264. 0 lelong 0x4C
  265. >4 lelong 0x00021401 Windows shortcut file
  266. # DOS EPS Binary File Header
  267. # From: Ed Sznyter <ews@Black.Market.NET>
  268. 0 belong 0xC5D0D3C6 DOS EPS Binary File
  269. >4 long >0 Postscript starts at byte %d
  270. >>8 long >0 length %d
  271. >>>12 long >0 Metafile starts at byte %d
  272. >>>>16 long >0 length %d
  273. >>>20 long >0 TIFF starts at byte %d
  274. >>>>24 long >0 length %d
  275. # TNEF magic From "Joomy" <joomy@se-ed.net>
  276. 0 leshort 0x223e9f78 TNEF
  277. # GFA-BASIC (Wolfram Kleff)
  278. 2 string GFA-BASIC3 GFA-BASIC 3 data
  279. # DJGPP compiled files
  280. # v >2, uses DPMI & small(2k) stub (Robert vd Boon, rjvdboon@europe.com)
  281. 0x200 string go32stub DOS-executable compiled w/DJGPP
  282. >0x20c string >0 (stub v%.4s)
  283. >>0x8b2 string djp [compressed w/%s
  284. >>>&1 string >\0 %.4s]
  285. >>0x8ad string UPX [compressed w/%s
  286. >>>&1 string >\0 %.4s]
  287. >>0x1c string pmodedj stubbed with %s