1ef01931fSBen Gras 2ef01931fSBen Gras#------------------------------------------------------------------------------ 3*0a6a1f1dSLionel Sambuc# $File: msdos,v 1.100 2014/06/03 19:17:27 christos Exp $ 4ef01931fSBen Gras# msdos: file(1) magic for MS-DOS files 5ef01931fSBen Gras# 6ef01931fSBen Gras 7ef01931fSBen Gras# .BAT files (Daniel Quinlan, quinlan@yggdrasil.com) 8835f6802SDirk Vogt# updated by Joerg Jenderek at Oct 2008,Apr 2011 9835f6802SDirk Vogt0 string/t @ 10835f6802SDirk Vogt>1 string/cW \ echo\ off DOS batch file text 11ef01931fSBen Gras!:mime text/x-msdos-batch 12835f6802SDirk Vogt>1 string/cW echo\ off DOS batch file text 13ef01931fSBen Gras!:mime text/x-msdos-batch 14835f6802SDirk Vogt>1 string/cW rem DOS batch file text 15ef01931fSBen Gras!:mime text/x-msdos-batch 16835f6802SDirk Vogt>1 string/cW set\ DOS batch file text 17ef01931fSBen Gras!:mime text/x-msdos-batch 18ef01931fSBen Gras 19ef01931fSBen Gras 20ef01931fSBen Gras# OS/2 batch files are REXX. the second regex is a bit generic, oh well 21ef01931fSBen Gras# the matched commands seem to be common in REXX and uncommon elsewhere 22835f6802SDirk Vogt100 search/0xffff rxfuncadd 23835f6802SDirk Vogt>100 regex/c =^[\ \t]{0,10}call[\ \t]{1,10}rxfunc OS/2 REXX batch file text 24835f6802SDirk Vogt100 search/0xffff say 25835f6802SDirk Vogt>100 regex/c =^[\ \t]{0,10}say\ ['"] OS/2 REXX batch file text 26ef01931fSBen Gras 27ef01931fSBen Gras0 leshort 0x14c MS Windows COFF Intel 80386 object file 28ef01931fSBen Gras#>4 ledate x stamp %s 29ef01931fSBen Gras0 leshort 0x166 MS Windows COFF MIPS R4000 object file 30ef01931fSBen Gras#>4 ledate x stamp %s 31ef01931fSBen Gras0 leshort 0x184 MS Windows COFF Alpha object file 32ef01931fSBen Gras#>4 ledate x stamp %s 33ef01931fSBen Gras0 leshort 0x268 MS Windows COFF Motorola 68000 object file 34ef01931fSBen Gras#>4 ledate x stamp %s 35ef01931fSBen Gras0 leshort 0x1f0 MS Windows COFF PowerPC object file 36ef01931fSBen Gras#>4 ledate x stamp %s 37ef01931fSBen Gras0 leshort 0x290 MS Windows COFF PA-RISC object file 38ef01931fSBen Gras#>4 ledate x stamp %s 39ef01931fSBen Gras 40835f6802SDirk Vogt# Tests for various EXE types. 41ef01931fSBen Gras# 42835f6802SDirk Vogt# Many of the compressed formats were extraced from IDARC 1.23 source code. 43ef01931fSBen Gras# 4408ff44c4SLionel Sambuc0 string/b MZ 45835f6802SDirk Vogt# All non-DOS EXE extensions have the relocation table more than 0x40 bytes into the file. 46ef01931fSBen Gras>0x18 leshort <0x40 MS-DOS executable 47*0a6a1f1dSLionel Sambuc!:mime application/x-dosexec 48835f6802SDirk Vogt# These traditional tests usually work but not always. When test quality support is 49835f6802SDirk Vogt# implemented these can be turned on. 50835f6802SDirk Vogt#>>0x18 leshort 0x1c (Borland compiler) 51835f6802SDirk Vogt#>>0x18 leshort 0x1e (MS compiler) 52ef01931fSBen Gras 53835f6802SDirk Vogt# If the relocation table is 0x40 or more bytes into the file, it's definitely 54835f6802SDirk Vogt# not a DOS EXE. 55ef01931fSBen Gras>0x18 leshort >0x3f 56835f6802SDirk Vogt 57835f6802SDirk Vogt# Maybe it's a PE? 58ef01931fSBen Gras>>(0x3c.l) string PE\0\0 PE 59*0a6a1f1dSLionel Sambuc!:mime application/x-dosexec 60835f6802SDirk Vogt>>>(0x3c.l+24) leshort 0x010b \b32 executable 61835f6802SDirk Vogt>>>(0x3c.l+24) leshort 0x020b \b32+ executable 62835f6802SDirk Vogt>>>(0x3c.l+24) leshort 0x0107 ROM image 63835f6802SDirk Vogt>>>(0x3c.l+24) default x Unknown PE signature 64835f6802SDirk Vogt>>>>&0 leshort x 0x%x 65835f6802SDirk Vogt>>>(0x3c.l+22) leshort&0x2000 >0 (DLL) 66835f6802SDirk Vogt>>>(0x3c.l+92) leshort 1 (native) 67835f6802SDirk Vogt>>>(0x3c.l+92) leshort 2 (GUI) 68835f6802SDirk Vogt>>>(0x3c.l+92) leshort 3 (console) 69835f6802SDirk Vogt>>>(0x3c.l+92) leshort 7 (POSIX) 70835f6802SDirk Vogt>>>(0x3c.l+92) leshort 9 (Windows CE) 71ef01931fSBen Gras>>>(0x3c.l+92) leshort 10 (EFI application) 72ef01931fSBen Gras>>>(0x3c.l+92) leshort 11 (EFI boot service driver) 73ef01931fSBen Gras>>>(0x3c.l+92) leshort 12 (EFI runtime driver) 74835f6802SDirk Vogt>>>(0x3c.l+92) leshort 13 (EFI ROM) 75835f6802SDirk Vogt>>>(0x3c.l+92) leshort 14 (XBOX) 76835f6802SDirk Vogt>>>(0x3c.l+92) leshort 15 (Windows boot application) 77835f6802SDirk Vogt>>>(0x3c.l+92) default x (Unknown subsystem 78835f6802SDirk Vogt>>>>&0 leshort x 0x%x) 79ef01931fSBen Gras>>>(0x3c.l+4) leshort 0x14c Intel 80386 80ef01931fSBen Gras>>>(0x3c.l+4) leshort 0x166 MIPS R4000 81835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0x168 MIPS R10000 82ef01931fSBen Gras>>>(0x3c.l+4) leshort 0x184 Alpha 83835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0x1a2 Hitachi SH3 84835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0x1a6 Hitachi SH4 85835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0x1c0 ARM 86835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0x1c2 ARM Thumb 8784d9c625SLionel Sambuc>>>(0x3c.l+4) leshort 0x1c4 ARMv7 Thumb 88ef01931fSBen Gras>>>(0x3c.l+4) leshort 0x1f0 PowerPC 89ef01931fSBen Gras>>>(0x3c.l+4) leshort 0x200 Intel Itanium 90835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0x266 MIPS16 91835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0x268 Motorola 68000 92835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0x290 PA-RISC 93835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0x366 MIPSIV 94835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0x466 MIPS16 with FPU 95835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0xebc EFI byte code 96835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0x8664 x86-64 97835f6802SDirk Vogt>>>(0x3c.l+4) leshort 0xc0ee MSIL 98835f6802SDirk Vogt>>>(0x3c.l+4) default x Unknown processor type 99835f6802SDirk Vogt>>>>&0 leshort x 0x%x 100835f6802SDirk Vogt>>>(0x3c.l+22) leshort&0x0200 >0 (stripped to external PDB) 101ef01931fSBen Gras>>>(0x3c.l+22) leshort&0x1000 >0 system file 102835f6802SDirk Vogt>>>(0x3c.l+24) leshort 0x010b 103835f6802SDirk Vogt>>>>(0x3c.l+232) lelong >0 Mono/.Net assembly 104835f6802SDirk Vogt>>>(0x3c.l+24) leshort 0x020b 105835f6802SDirk Vogt>>>>(0x3c.l+248) lelong >0 Mono/.Net assembly 106ef01931fSBen Gras 107835f6802SDirk Vogt# hooray, there's a DOS extender using the PE format, with a valid PE 108835f6802SDirk Vogt# executable inside (which just prints a message and exits if run in win) 109835f6802SDirk Vogt>>>(8.s*16) string 32STUB \b, 32rtm DOS extender 110835f6802SDirk Vogt>>>(8.s*16) string !32STUB \b, for MS Windows 111835f6802SDirk Vogt>>>(0x3c.l+0xf8) string UPX0 \b, UPX compressed 112835f6802SDirk Vogt>>>(0x3c.l+0xf8) search/0x140 PEC2 \b, PECompact2 compressed 113835f6802SDirk Vogt>>>(0x3c.l+0xf8) search/0x140 UPX2 114835f6802SDirk Vogt>>>>(&0x10.l+(-4)) string PK\3\4 \b, ZIP self-extracting archive (Info-Zip) 115835f6802SDirk Vogt>>>(0x3c.l+0xf8) search/0x140 .idata 116835f6802SDirk Vogt>>>>(&0xe.l+(-4)) string PK\3\4 \b, ZIP self-extracting archive (Info-Zip) 117835f6802SDirk Vogt>>>>(&0xe.l+(-4)) string ZZ0 \b, ZZip self-extracting archive 118835f6802SDirk Vogt>>>>(&0xe.l+(-4)) string ZZ1 \b, ZZip self-extracting archive 119835f6802SDirk Vogt>>>(0x3c.l+0xf8) search/0x140 .rsrc 120835f6802SDirk Vogt>>>>(&0x0f.l+(-4)) string a\\\4\5 \b, WinHKI self-extracting archive 121835f6802SDirk Vogt>>>>(&0x0f.l+(-4)) string Rar! \b, RAR self-extracting archive 122835f6802SDirk Vogt>>>>(&0x0f.l+(-4)) search/0x3000 MSCF \b, InstallShield self-extracting archive 123835f6802SDirk Vogt>>>>(&0x0f.l+(-4)) search/32 Nullsoft \b, Nullsoft Installer self-extracting archive 124835f6802SDirk Vogt>>>(0x3c.l+0xf8) search/0x140 .data 125835f6802SDirk Vogt>>>>(&0x0f.l) string WEXTRACT \b, MS CAB-Installer self-extracting archive 126835f6802SDirk Vogt>>>(0x3c.l+0xf8) search/0x140 .petite\0 \b, Petite compressed 127835f6802SDirk Vogt>>>>(0x3c.l+0xf7) byte x 128835f6802SDirk Vogt>>>>>(&0x104.l+(-4)) string =!sfx! \b, ACE self-extracting archive 129835f6802SDirk Vogt>>>(0x3c.l+0xf8) search/0x140 .WISE \b, WISE installer self-extracting archive 130835f6802SDirk Vogt>>>(0x3c.l+0xf8) search/0x140 .dz\0\0\0 \b, Dzip self-extracting archive 131835f6802SDirk Vogt>>>&(0x3c.l+0xf8) search/0x100 _winzip_ \b, ZIP self-extracting archive (WinZip) 132835f6802SDirk Vogt>>>&(0x3c.l+0xf8) search/0x100 SharedD \b, Microsoft Installer self-extracting archive 133835f6802SDirk Vogt>>>0x30 string Inno \b, InnoSetup self-extracting archive 134ef01931fSBen Gras 135835f6802SDirk Vogt# Hmm, not a PE but the relocation table is too high for a traditional DOS exe, 136835f6802SDirk Vogt# must be one of the unusual subformats. 137ef01931fSBen Gras>>(0x3c.l) string !PE\0\0 MS-DOS executable 138*0a6a1f1dSLionel Sambuc!:mime application/x-dosexec 139ef01931fSBen Gras 140ef01931fSBen Gras>>(0x3c.l) string NE \b, NE 141*0a6a1f1dSLionel Sambuc!:mime application/x-dosexec 142ef01931fSBen Gras>>>(0x3c.l+0x36) byte 1 for OS/2 1.x 143ef01931fSBen Gras>>>(0x3c.l+0x36) byte 2 for MS Windows 3.x 144ef01931fSBen Gras>>>(0x3c.l+0x36) byte 3 for MS-DOS 145835f6802SDirk Vogt>>>(0x3c.l+0x36) byte 4 for Windows 386 146835f6802SDirk Vogt>>>(0x3c.l+0x36) byte 5 for Borland Operating System Services 147835f6802SDirk Vogt>>>(0x3c.l+0x36) default x 148835f6802SDirk Vogt>>>>(0x3c.l+0x36) byte x (unknown OS %x) 149ef01931fSBen Gras>>>(0x3c.l+0x36) byte 0x81 for MS-DOS, Phar Lap DOS extender 150ef01931fSBen Gras>>>(0x3c.l+0x0c) leshort&0x8003 0x8002 (DLL) 151ef01931fSBen Gras>>>(0x3c.l+0x0c) leshort&0x8003 0x8001 (driver) 152ef01931fSBen Gras>>>&(&0x24.s-1) string ARJSFX \b, ARJ self-extracting archive 153ef01931fSBen Gras>>>(0x3c.l+0x70) search/0x80 WinZip(R)\ Self-Extractor \b, ZIP self-extracting archive (WinZip) 154ef01931fSBen Gras 155ef01931fSBen Gras>>(0x3c.l) string LX\0\0 \b, LX 156*0a6a1f1dSLionel Sambuc!:mime application/x-dosexec 157ef01931fSBen Gras>>>(0x3c.l+0x0a) leshort <1 (unknown OS) 158ef01931fSBen Gras>>>(0x3c.l+0x0a) leshort 1 for OS/2 159ef01931fSBen Gras>>>(0x3c.l+0x0a) leshort 2 for MS Windows 160ef01931fSBen Gras>>>(0x3c.l+0x0a) leshort 3 for DOS 161ef01931fSBen Gras>>>(0x3c.l+0x0a) leshort >3 (unknown OS) 162ef01931fSBen Gras>>>(0x3c.l+0x10) lelong&0x28000 =0x8000 (DLL) 163ef01931fSBen Gras>>>(0x3c.l+0x10) lelong&0x20000 >0 (device driver) 164ef01931fSBen Gras>>>(0x3c.l+0x10) lelong&0x300 0x300 (GUI) 165ef01931fSBen Gras>>>(0x3c.l+0x10) lelong&0x28300 <0x300 (console) 166ef01931fSBen Gras>>>(0x3c.l+0x08) leshort 1 i80286 167ef01931fSBen Gras>>>(0x3c.l+0x08) leshort 2 i80386 168ef01931fSBen Gras>>>(0x3c.l+0x08) leshort 3 i80486 169ef01931fSBen Gras>>>(8.s*16) string emx \b, emx 170ef01931fSBen Gras>>>>&1 string x %s 171ef01931fSBen Gras>>>&(&0x54.l-3) string arjsfx \b, ARJ self-extracting archive 172ef01931fSBen Gras 173ef01931fSBen Gras# MS Windows system file, supposedly a collection of LE executables 174ef01931fSBen Gras>>(0x3c.l) string W3 \b, W3 for MS Windows 175*0a6a1f1dSLionel Sambuc!:mime application/x-dosexec 176ef01931fSBen Gras 177ef01931fSBen Gras>>(0x3c.l) string LE\0\0 \b, LE executable 178*0a6a1f1dSLionel Sambuc!:mime application/x-dosexec 179ef01931fSBen Gras>>>(0x3c.l+0x0a) leshort 1 180ef01931fSBen Gras# some DOS extenders use LE files with OS/2 header 181ef01931fSBen Gras>>>>0x240 search/0x100 DOS/4G for MS-DOS, DOS4GW DOS extender 182ef01931fSBen Gras>>>>0x240 search/0x200 WATCOM\ C/C++ for MS-DOS, DOS4GW DOS extender 183ef01931fSBen Gras>>>>0x440 search/0x100 CauseWay\ DOS\ Extender for MS-DOS, CauseWay DOS extender 184ef01931fSBen Gras>>>>0x40 search/0x40 PMODE/W for MS-DOS, PMODE/W DOS extender 185ef01931fSBen Gras>>>>0x40 search/0x40 STUB/32A for MS-DOS, DOS/32A DOS extender (stub) 186ef01931fSBen Gras>>>>0x40 search/0x80 STUB/32C for MS-DOS, DOS/32A DOS extender (configurable stub) 187ef01931fSBen Gras>>>>0x40 search/0x80 DOS/32A for MS-DOS, DOS/32A DOS extender (embedded) 188ef01931fSBen Gras# this is a wild guess; hopefully it is a specific signature 189ef01931fSBen Gras>>>>&0x24 lelong <0x50 190ef01931fSBen Gras>>>>>(&0x4c.l) string \xfc\xb8WATCOM 191ef01931fSBen Gras>>>>>>&0 search/8 3\xdbf\xb9 \b, 32Lite compressed 192ef01931fSBen Gras# another wild guess: if real OS/2 LE executables exist, they probably have higher start EIP 193ef01931fSBen Gras#>>>>(0x3c.l+0x1c) lelong >0x10000 for OS/2 194ef01931fSBen Gras# fails with DOS-Extenders. 195ef01931fSBen Gras>>>(0x3c.l+0x0a) leshort 2 for MS Windows 196ef01931fSBen Gras>>>(0x3c.l+0x0a) leshort 3 for DOS 197ef01931fSBen Gras>>>(0x3c.l+0x0a) leshort 4 for MS Windows (VxD) 198ef01931fSBen Gras>>>(&0x7c.l+0x26) string UPX \b, UPX compressed 199ef01931fSBen Gras>>>&(&0x54.l-3) string UNACE \b, ACE self-extracting archive 200ef01931fSBen Gras 201ef01931fSBen Gras# looks like ASCII, probably some embedded copyright message. 202ef01931fSBen Gras# and definitely not NE/LE/LX/PE 203ef01931fSBen Gras>>0x3c lelong >0x20000000 204ef01931fSBen Gras>>>(4.s*512) leshort !0x014c \b, MZ for MS-DOS 205*0a6a1f1dSLionel Sambuc!:mime application/x-dosexec 206ef01931fSBen Gras# header data too small for extended executable 207ef01931fSBen Gras>2 long !0 208ef01931fSBen Gras>>0x18 leshort <0x40 209ef01931fSBen Gras>>>(4.s*512) leshort !0x014c 210ef01931fSBen Gras 211ef01931fSBen Gras>>>>&(2.s-514) string !LE 212ef01931fSBen Gras>>>>>&-2 string !BW \b, MZ for MS-DOS 213*0a6a1f1dSLionel Sambuc!:mime application/x-dosexec 214ef01931fSBen Gras>>>>&(2.s-514) string LE \b, LE 215ef01931fSBen Gras>>>>>0x240 search/0x100 DOS/4G for MS-DOS, DOS4GW DOS extender 216ef01931fSBen Gras# educated guess since indirection is still not capable enough for complex offset 217ef01931fSBen Gras# calculations (next embedded executable would be at &(&2*512+&0-2) 218ef01931fSBen Gras# I suspect there are only LE executables in these multi-exe files 219ef01931fSBen Gras>>>>&(2.s-514) string BW 220*0a6a1f1dSLionel Sambuc>>>>>0x240 search/0x100 DOS/4G \b, LE for MS-DOS, DOS4GW DOS extender (embedded) 221*0a6a1f1dSLionel Sambuc>>>>>0x240 search/0x100 !DOS/4G \b, BW collection for MS-DOS 222ef01931fSBen Gras 223ef01931fSBen Gras# This sequence skips to the first COFF segment, usually .text 224ef01931fSBen Gras>(4.s*512) leshort 0x014c \b, COFF 225*0a6a1f1dSLionel Sambuc!:mime application/x-dosexec 226ef01931fSBen Gras>>(8.s*16) string go32stub for MS-DOS, DJGPP go32 DOS extender 227ef01931fSBen Gras>>(8.s*16) string emx 228ef01931fSBen Gras>>>&1 string x for DOS, Win or OS/2, emx %s 229ef01931fSBen Gras>>&(&0x42.l-3) byte x 230ef01931fSBen Gras>>>&0x26 string UPX \b, UPX compressed 231ef01931fSBen Gras# and yet another guess: small .text, and after large .data is unusal, could be 32lite 232ef01931fSBen Gras>>&0x2c search/0xa0 .text 233ef01931fSBen Gras>>>&0x0b lelong <0x2000 234ef01931fSBen Gras>>>>&0 lelong >0x6000 \b, 32lite compressed 235ef01931fSBen Gras 236ef01931fSBen Gras>(8.s*16) string $WdX \b, WDos/X DOS extender 237ef01931fSBen Gras 238835f6802SDirk Vogt# By now an executable type should have been printed out. The executable 239835f6802SDirk Vogt# may be a self-uncompressing archive, so look for evidence of that and 240835f6802SDirk Vogt# print it out. 241835f6802SDirk Vogt# 242835f6802SDirk Vogt# Some signatures below from Greg Roelofs, newt@uchicago.edu. 243ef01931fSBen Gras# 244ef01931fSBen Gras>0x35 string \x8e\xc0\xb9\x08\x00\xf3\xa5\x4a\x75\xeb\x8e\xc3\x8e\xd8\x33\xff\xbe\x30\x00\x05 \b, aPack compressed 245ef01931fSBen Gras>0xe7 string LH/2\ Self-Extract \b, %s 246835f6802SDirk Vogt>0x1c string UC2X \b, UCEXE compressed 247835f6802SDirk Vogt>0x1c string WWP\ \b, WWPACK compressed 248835f6802SDirk Vogt>0x1c string RJSX \b, ARJ self-extracting archive 249ef01931fSBen Gras>0x1c string diet \b, diet compressed 250ef01931fSBen Gras>0x1c string LZ09 \b, LZEXE v0.90 compressed 251ef01931fSBen Gras>0x1c string LZ91 \b, LZEXE v0.91 compressed 252ef01931fSBen Gras>0x1c string tz \b, TinyProg compressed 253835f6802SDirk Vogt>0x1e string Copyright\ 1989-1990\ PKWARE\ Inc. Self-extracting PKZIP archive 254835f6802SDirk Vogt!:mime application/zip 255835f6802SDirk Vogt# Yes, this really is "Copr", not "Corp." 256835f6802SDirk Vogt>0x1e string PKLITE\ Copr. Self-extracting PKZIP archive 257835f6802SDirk Vogt!:mime application/zip 258835f6802SDirk Vogt# winarj stores a message in the stub instead of the sig in the MZ header 259835f6802SDirk Vogt>0x20 search/0xe0 aRJsfX \b, ARJ self-extracting archive 260835f6802SDirk Vogt>0x20 string AIN 261835f6802SDirk Vogt>>0x23 string 2 \b, AIN 2.x compressed 262835f6802SDirk Vogt>>0x23 string <2 \b, AIN 1.x compressed 263835f6802SDirk Vogt>>0x23 string >2 \b, AIN 1.x compressed 264ef01931fSBen Gras>0x24 string LHa's\ SFX \b, LHa self-extracting archive 265ef01931fSBen Gras!:mime application/x-lha 266ef01931fSBen Gras>0x24 string LHA's\ SFX \b, LHa self-extracting archive 267ef01931fSBen Gras!:mime application/x-lha 268ef01931fSBen Gras>0x24 string \ $ARX \b, ARX self-extracting archive 269ef01931fSBen Gras>0x24 string \ $LHarc \b, LHarc self-extracting archive 270ef01931fSBen Gras>0x20 string SFX\ by\ LARC \b, LARC self-extracting archive 271835f6802SDirk Vogt>0x40 string aPKG \b, aPackage self-extracting archive 272835f6802SDirk Vogt>0x64 string W\ Collis\0\0 \b, Compack compressed 273835f6802SDirk Vogt>0x7a string Windows\ self-extracting\ ZIP \b, ZIP self-extracting archive 274835f6802SDirk Vogt>>&0xf4 search/0x140 \x0\x40\x1\x0 275835f6802SDirk Vogt>>>(&0.l+(4)) string MSCF \b, WinHKI CAB self-extracting archive 276ef01931fSBen Gras>1638 string -lh5- \b, LHa self-extracting archive v2.13S 277ef01931fSBen Gras>0x17888 string Rar! \b, RAR self-extracting archive 278ef01931fSBen Gras 279835f6802SDirk Vogt# Skip to the end of the EXE. This will usually work fine in the PE case 280835f6802SDirk Vogt# because the MZ image is hardcoded into the toolchain and almost certainly 281835f6802SDirk Vogt# won't match any of these signatures. 282ef01931fSBen Gras>(4.s*512) long x 283ef01931fSBen Gras>>&(2.s-517) byte x 284ef01931fSBen Gras>>>&0 string PK\3\4 \b, ZIP self-extracting archive 285ef01931fSBen Gras>>>&0 string Rar! \b, RAR self-extracting archive 286ef01931fSBen Gras>>>&0 string =!\x11 \b, AIN 2.x self-extracting archive 287ef01931fSBen Gras>>>&0 string =!\x12 \b, AIN 2.x self-extracting archive 288ef01931fSBen Gras>>>&0 string =!\x17 \b, AIN 1.x self-extracting archive 289ef01931fSBen Gras>>>&0 string =!\x18 \b, AIN 1.x self-extracting archive 290ef01931fSBen Gras>>>&7 search/400 **ACE** \b, ACE self-extracting archive 291ef01931fSBen Gras>>>&0 search/0x480 UC2SFX\ Header \b, UC2 self-extracting archive 292ef01931fSBen Gras 293ef01931fSBen Gras# a few unknown ZIP sfxes, no idea if they are needed or if they are 294ef01931fSBen Gras# already captured by the generic patterns above 295ef01931fSBen Gras>(8.s*16) search/0x20 PKSFX \b, ZIP self-extracting archive (PKZIP) 296ef01931fSBen Gras# TODO: how to add this? >FileSize-34 string Windows\ Self-Installing\ Executable \b, ZIP self-extracting archive 297ef01931fSBen Gras# 298ef01931fSBen Gras 299ef01931fSBen Gras# TELVOX Teleinformatica CODEC self-extractor for OS/2: 300ef01931fSBen Gras>49801 string \x79\xff\x80\xff\x76\xff \b, CODEC archive v3.21 301ef01931fSBen Gras>>49824 leshort =1 \b, 1 file 302ef01931fSBen Gras>>49824 leshort >1 \b, %u files 303ef01931fSBen Gras 304835f6802SDirk Vogt# added by Joerg Jenderek of http://www.freedos.org/software/?prog=kc 305835f6802SDirk Vogt# and http://www.freedos.org/software/?prog=kpdos 306835f6802SDirk Vogt# for FreeDOS files like KEYBOARD.SYS, KEYBRD2.SYS, KEYBRD3.SYS, *.KBD 30708ff44c4SLionel Sambuc0 string/b KCF FreeDOS KEYBoard Layout collection 308835f6802SDirk Vogt# only version=0x100 found 309835f6802SDirk Vogt>3 uleshort x \b, version 0x%x 310835f6802SDirk Vogt# length of string containing author,info and special characters 311835f6802SDirk Vogt>6 ubyte >0 312835f6802SDirk Vogt#>>6 pstring x \b, name=%s 313835f6802SDirk Vogt>>7 string >\0 \b, author=%-.14s 314835f6802SDirk Vogt>>7 search/254 \xff \b, info= 315835f6802SDirk Vogt#>>>&0 string x \b%-s 316835f6802SDirk Vogt>>>&0 string x \b%-.15s 317835f6802SDirk Vogt# for FreeDOS *.KL files 31808ff44c4SLionel Sambuc0 string/b KLF FreeDOS KEYBoard Layout file 319835f6802SDirk Vogt# only version=0x100 or 0x101 found 320835f6802SDirk Vogt>3 uleshort x \b, version 0x%x 321835f6802SDirk Vogt# stringlength 322835f6802SDirk Vogt>5 ubyte >0 323835f6802SDirk Vogt>>8 string x \b, name=%-.2s 324835f6802SDirk Vogt0 string \xffKEYB\ \ \ \0\0\0\0 32584d9c625SLionel Sambuc>12 string \0\0\0\0`\004\360 MS-DOS KEYBoard Layout file 326835f6802SDirk Vogt 327ef01931fSBen Gras# .COM formats (Daniel Quinlan, quinlan@yggdrasil.com) 328ef01931fSBen Gras# Uncommenting only the first two lines will cover about 2/3 of COM files, 329ef01931fSBen Gras# but it isn't feasible to match all COM files since there must be at least 330ef01931fSBen Gras# two dozen different one-byte "magics". 331ef01931fSBen Gras# test too generic ? 332ef01931fSBen Gras0 byte 0xe9 DOS executable (COM) 333ef01931fSBen Gras>0x1FE leshort 0xAA55 \b, boot code 334ef01931fSBen Gras>6 string SFX\ of\ LHarc (%s) 335835f6802SDirk Vogt 336835f6802SDirk Vogt# DOS device driver updated by Joerg Jenderek at May 2011 337835f6802SDirk Vogt# http://maben.homeip.net/static/S100/IBM/software/DOS/DOS%20techref/CHAPTER.009 338835f6802SDirk Vogt0 ulequad&0x07a0ffffffff 0xffffffff DOS executable ( 339835f6802SDirk Vogt>40 search/7 UPX! \bUPX compressed 340835f6802SDirk Vogt# DOS device driver attributes 341835f6802SDirk Vogt>4 uleshort&0x8000 0x0000 \bblock device driver 342835f6802SDirk Vogt# character device 343835f6802SDirk Vogt>4 uleshort&0x8000 0x8000 \b 344835f6802SDirk Vogt>>4 uleshort&0x0008 0x0008 \bclock 345835f6802SDirk Vogt# fast video output by int 29h 346835f6802SDirk Vogt>>4 uleshort&0x0010 0x0010 \bfast 347835f6802SDirk Vogt# standard input/output device 348835f6802SDirk Vogt>>4 uleshort&0x0003 >0 \bstandard 349835f6802SDirk Vogt>>>4 uleshort&0x0001 0x0001 \binput 350835f6802SDirk Vogt>>>4 uleshort&0x0003 0x0003 \b/ 351835f6802SDirk Vogt>>>4 uleshort&0x0002 0x0002 \boutput 352835f6802SDirk Vogt>>4 uleshort&0x8000 0x8000 \bcharacter device driver 353835f6802SDirk Vogt>0 ubyte x 354835f6802SDirk Vogt# upx compressed device driver has garbage instead of real in name field of header 355835f6802SDirk Vogt>>40 search/7 UPX! 356835f6802SDirk Vogt>>40 default x 357835f6802SDirk Vogt# leading/trailing nulls, zeros or non ASCII characters in 8-byte name field at offset 10 are skipped 358835f6802SDirk Vogt>>>12 ubyte >0x27 \b 359835f6802SDirk Vogt>>>>10 ubyte >0x20 360835f6802SDirk Vogt>>>>>10 ubyte !0x2E 361835f6802SDirk Vogt>>>>>>10 ubyte !0x2A \b%c 362835f6802SDirk Vogt>>>>11 ubyte >0x20 363835f6802SDirk Vogt>>>>>11 ubyte !0x2E \b%c 364835f6802SDirk Vogt>>>>12 ubyte >0x20 365835f6802SDirk Vogt>>>>>12 ubyte !0x39 366835f6802SDirk Vogt>>>>>>12 ubyte !0x2E \b%c 367835f6802SDirk Vogt>>>13 ubyte >0x20 368835f6802SDirk Vogt>>>>13 ubyte !0x2E \b%c 369835f6802SDirk Vogt>>>>14 ubyte >0x20 370835f6802SDirk Vogt>>>>>14 ubyte !0x2E \b%c 371835f6802SDirk Vogt>>>>15 ubyte >0x20 372835f6802SDirk Vogt>>>>>15 ubyte !0x2E \b%c 373835f6802SDirk Vogt>>>>16 ubyte >0x20 374835f6802SDirk Vogt>>>>>16 ubyte !0x2E 375835f6802SDirk Vogt>>>>>>16 ubyte <0xCB \b%c 376835f6802SDirk Vogt>>>>17 ubyte >0x20 377835f6802SDirk Vogt>>>>>17 ubyte !0x2E 378835f6802SDirk Vogt>>>>>>17 ubyte <0x90 \b%c 379835f6802SDirk Vogt# some character device drivers like ASPICD.SYS, btcdrom.sys and Cr_atapi.sys contain only spaces or points in name field 380835f6802SDirk Vogt>>>4 uleshort&0x8000 0x8000 381835f6802SDirk Vogt>>>>12 ubyte <0x2F 382835f6802SDirk Vogt# they have their real name at offset 22 383835f6802SDirk Vogt>>>>>22 string >\0 \b%-.5s 384835f6802SDirk Vogt>4 uleshort&0x8000 0x0000 385*0a6a1f1dSLionel Sambuc# 32 bit sector addressing ( > 32 MB) for block devices 386835f6802SDirk Vogt>>4 uleshort&0x0002 0x0002 \b,32-bit sector- 387835f6802SDirk Vogt# support by driver functions 13h, 17h, 18h 388835f6802SDirk Vogt>4 uleshort&0x0040 0x0040 \b,IOCTL- 389835f6802SDirk Vogt# open, close, removable media support by driver functions 0Dh, 0Eh, 0Fh 390835f6802SDirk Vogt>4 uleshort&0x0800 0x0800 \b,close media- 391835f6802SDirk Vogt# output until busy support by int 10h for character device driver 392835f6802SDirk Vogt>4 uleshort&0x8000 0x8000 393835f6802SDirk Vogt>>4 uleshort&0x2000 0x2000 \b,until busy- 394835f6802SDirk Vogt# direct read/write support by driver functions 03h,0Ch 395835f6802SDirk Vogt>4 uleshort&0x4000 0x4000 \b,control strings- 396835f6802SDirk Vogt>4 uleshort&0x8000 0x8000 397835f6802SDirk Vogt>>4 uleshort&0x6840 >0 \bsupport 398835f6802SDirk Vogt>4 uleshort&0x8000 0x0000 399835f6802SDirk Vogt>>4 uleshort&0x4842 >0 \bsupport 400835f6802SDirk Vogt>0 ubyte x \b) 401835f6802SDirk Vogt# DOS driver cmd640x.sys has 0x12 instead of 0xffffffff for pointer field to next device header 402835f6802SDirk Vogt# Too weak, matches files that only contain 0's 403835f6802SDirk Vogt#0 ulequad&0x000007a0ffffffed 0x0000000000000000 DOS-executable ( 404835f6802SDirk Vogt#>4 uleshort&0x8000 0x8000 \bcharacter device driver 405835f6802SDirk Vogt#>>10 string x %-.8s 406835f6802SDirk Vogt#>4 uleshort&0x4000 0x4000 \b,control strings-support) 407835f6802SDirk Vogt 408ef01931fSBen Gras# test too generic ? 409ef01931fSBen Gras0 byte 0x8c DOS executable (COM) 410ef01931fSBen Gras# updated by Joerg Jenderek at Oct 2008 411ef01931fSBen Gras0 ulelong 0xffff10eb DR-DOS executable (COM) 412ef01931fSBen Gras# byte 0xeb conflicts with "sequent" magic leshort 0xn2eb 413ef01931fSBen Gras0 ubeshort&0xeb8d >0xeb00 414ef01931fSBen Gras# DR-DOS STACKER.COM SCREATE.SYS missed 41508ff44c4SLionel Sambuc>0 byte 0xeb 41608ff44c4SLionel Sambuc>>0x1FE leshort 0xAA55 DOS executable (COM), boot code 41708ff44c4SLionel Sambuc>>85 string UPX DOS executable (COM), UPX compressed 41808ff44c4SLionel Sambuc>>4 string \ $ARX DOS executable (COM), ARX self-extracting archive 41908ff44c4SLionel Sambuc>>4 string \ $LHarc DOS executable (COM), LHarc self-extracting archive 42008ff44c4SLionel Sambuc>>0x20e string SFX\ by\ LARC DOS executable (COM), LARC self-extracting archive 421ef01931fSBen Gras# updated by Joerg Jenderek at Oct 2008 422ef01931fSBen Gras#0 byte 0xb8 COM executable 423ef01931fSBen Gras0 uleshort&0x80ff 0x00b8 424ef01931fSBen Gras# modified by Joerg Jenderek 425ef01931fSBen Gras>1 lelong !0x21cd4cff COM executable for DOS 426ef01931fSBen Gras# http://syslinux.zytor.com/comboot.php 427ef01931fSBen Gras# (32-bit COMBOOT) programs *.C32 contain 32-bit code and run in flat-memory 32-bit protected mode 428ef01931fSBen Gras# start with assembler instructions mov eax,21cd4cffh 429ef01931fSBen Gras0 uleshort&0xc0ff 0xc0b8 430ef01931fSBen Gras>1 lelong 0x21cd4cff COM executable (32-bit COMBOOT) 431835f6802SDirk Vogt# syslinux:doc/comboot.txt 432835f6802SDirk Vogt# A COM32R program must start with the byte sequence B8 FE 4C CD 21 (mov 433835f6802SDirk Vogt# eax,21cd4cfeh) as a magic number. 43408ff44c4SLionel Sambuc0 string/b \xb8\xfe\x4c\xcd\x21 COM executable (COM32R) 435835f6802SDirk Vogt# start with assembler instructions mov eax,21cd4cfeh 436835f6802SDirk Vogt0 uleshort&0xc0ff 0xc0b8 437835f6802SDirk Vogt>1 lelong 0x21cd4cfe COM executable (32-bit COMBOOT, relocatable) 43808ff44c4SLionel Sambuc0 string/b \x81\xfc 439ef01931fSBen Gras>4 string \x77\x02\xcd\x20\xb9 440ef01931fSBen Gras>>36 string UPX! FREE-DOS executable (COM), UPX compressed 441ef01931fSBen Gras252 string Must\ have\ DOS\ version DR-DOS executable (COM) 442ef01931fSBen Gras# added by Joerg Jenderek at Oct 2008 443ef01931fSBen Gras# GRR search is not working 444ef01931fSBen Gras#34 search/2 UPX! FREE-DOS executable (COM), UPX compressed 445ef01931fSBen Gras34 string UPX! FREE-DOS executable (COM), UPX compressed 446ef01931fSBen Gras35 string UPX! FREE-DOS executable (COM), UPX compressed 447ef01931fSBen Gras# GRR search is not working 448ef01931fSBen Gras#2 search/28 \xcd\x21 COM executable for MS-DOS 449ef01931fSBen Gras#WHICHFAT.cOM 450ef01931fSBen Gras2 string \xcd\x21 COM executable for DOS 451ef01931fSBen Gras#DELTREE.cOM DELTREE2.cOM 452ef01931fSBen Gras4 string \xcd\x21 COM executable for DOS 453ef01931fSBen Gras#IFMEMDSK.cOM ASSIGN.cOM COMP.cOM 454ef01931fSBen Gras5 string \xcd\x21 COM executable for DOS 455ef01931fSBen Gras#DELTMP.COm HASFAT32.cOM 456ef01931fSBen Gras7 string \xcd\x21 457ef01931fSBen Gras>0 byte !0xb8 COM executable for DOS 458ef01931fSBen Gras#COMP.cOM MORE.COm 459ef01931fSBen Gras10 string \xcd\x21 460ef01931fSBen Gras>5 string !\xcd\x21 COM executable for DOS 461ef01931fSBen Gras#comecho.com 462ef01931fSBen Gras13 string \xcd\x21 COM executable for DOS 463ef01931fSBen Gras#HELP.COm EDIT.coM 464ef01931fSBen Gras18 string \xcd\x21 COM executable for MS-DOS 465ef01931fSBen Gras#NWRPLTRM.COm 466ef01931fSBen Gras23 string \xcd\x21 COM executable for MS-DOS 467ef01931fSBen Gras#LOADFIX.cOm LOADFIX.cOm 468ef01931fSBen Gras30 string \xcd\x21 COM executable for MS-DOS 469ef01931fSBen Gras#syslinux.com 3.11 470ef01931fSBen Gras70 string \xcd\x21 COM executable for DOS 471ef01931fSBen Gras# many compressed/converted COMs start with a copy loop instead of a jump 472ef01931fSBen Gras0x6 search/0xa \xfc\x57\xf3\xa5\xc3 COM executable for MS-DOS 473ef01931fSBen Gras0x6 search/0xa \xfc\x57\xf3\xa4\xc3 COM executable for DOS 474ef01931fSBen Gras>0x18 search/0x10 \x50\xa4\xff\xd5\x73 \b, aPack compressed 475ef01931fSBen Gras0x3c string W\ Collis\0\0 COM executable for MS-DOS, Compack compressed 476ef01931fSBen Gras# FIXME: missing diet .com compression 477ef01931fSBen Gras 478ef01931fSBen Gras# miscellaneous formats 47908ff44c4SLionel Sambuc0 string/b LZ MS-DOS executable (built-in) 480ef01931fSBen Gras#0 byte 0xf0 MS-DOS program library data 481ef01931fSBen Gras# 482ef01931fSBen Gras 483ef01931fSBen Gras# AAF files: 484ef01931fSBen Gras# <stuartc@rd.bbc.co.uk> Stuart Cunningham 48508ff44c4SLionel Sambuc0 string/b \320\317\021\340\241\261\032\341AAFB\015\000OM\006\016\053\064\001\001\001\377 AAF legacy file using MS Structured Storage 486ef01931fSBen Gras>30 byte 9 (512B sectors) 487ef01931fSBen Gras>30 byte 12 (4kB sectors) 48808ff44c4SLionel Sambuc0 string/b \320\317\021\340\241\261\032\341\001\002\001\015\000\002\000\000\006\016\053\064\003\002\001\001 AAF file using MS Structured Storage 489ef01931fSBen Gras>30 byte 9 (512B sectors) 490ef01931fSBen Gras>30 byte 12 (4kB sectors) 491ef01931fSBen Gras 492ef01931fSBen Gras# Popular applications 493ef01931fSBen Gras2080 string Microsoft\ Word\ 6.0\ Document %s 494ef01931fSBen Gras!:mime application/msword 495ef01931fSBen Gras2080 string Documento\ Microsoft\ Word\ 6 Spanish Microsoft Word 6 document data 496ef01931fSBen Gras!:mime application/msword 497ef01931fSBen Gras# Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Word) 498ef01931fSBen Gras2112 string MSWordDoc Microsoft Word document data 499ef01931fSBen Gras!:mime application/msword 500ef01931fSBen Gras# 501ef01931fSBen Gras0 belong 0x31be0000 Microsoft Word Document 502ef01931fSBen Gras!:mime application/msword 503ef01931fSBen Gras# 50408ff44c4SLionel Sambuc0 string/b PO^Q` Microsoft Word 6.0 Document 505ef01931fSBen Gras!:mime application/msword 506ef01931fSBen Gras# 50708ff44c4SLionel Sambuc0 string/b \376\067\0\043 Microsoft Office Document 508ef01931fSBen Gras!:mime application/msword 50908ff44c4SLionel Sambuc0 string/b \333\245-\0\0\0 Microsoft Office Document 510ef01931fSBen Gras!:mime application/msword 51108ff44c4SLionel Sambuc512 string/b \354\245\301 Microsoft Word Document 512ef01931fSBen Gras!:mime application/msword 51384d9c625SLionel Sambuc 51484d9c625SLionel Sambuc# 51584d9c625SLionel Sambuc0 string/b \xDB\xA5\x2D\x00 Microsoft WinWord 2.0 Document 51684d9c625SLionel Sambuc!:mime application/msword 517ef01931fSBen Gras# 518ef01931fSBen Gras2080 string Microsoft\ Excel\ 5.0\ Worksheet %s 519ef01931fSBen Gras!:mime application/vnd.ms-excel 52084d9c625SLionel Sambuc# 52184d9c625SLionel Sambuc0 string/b \xDB\xA5\x2D\x00 Microsoft WinWord 2.0 Document 52284d9c625SLionel Sambuc!:mime application/msword 523ef01931fSBen Gras 524ef01931fSBen Gras2080 string Foglio\ di\ lavoro\ Microsoft\ Exce %s 525ef01931fSBen Gras!:mime application/vnd.ms-excel 526ef01931fSBen Gras# 527ef01931fSBen Gras# Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Excel) 528ef01931fSBen Gras2114 string Biff5 Microsoft Excel 5.0 Worksheet 529ef01931fSBen Gras!:mime application/vnd.ms-excel 530ef01931fSBen Gras# Italian MS-Excel 531ef01931fSBen Gras2121 string Biff5 Microsoft Excel 5.0 Worksheet 532ef01931fSBen Gras!:mime application/vnd.ms-excel 53308ff44c4SLionel Sambuc0 string/b \x09\x04\x06\x00\x00\x00\x10\x00 Microsoft Excel Worksheet 534ef01931fSBen Gras!:mime application/vnd.ms-excel 535ef01931fSBen Gras# 536ef01931fSBen Gras0 belong 0x00001a00 Lotus 1-2-3 537ef01931fSBen Gras!:mime application/x-123 538ef01931fSBen Gras>4 belong 0x00100400 wk3 document data 539ef01931fSBen Gras>4 belong 0x02100400 wk4 document data 540ef01931fSBen Gras>4 belong 0x07800100 fm3 or fmb document data 541ef01931fSBen Gras>4 belong 0x07800000 fm3 or fmb document data 542ef01931fSBen Gras# 543ef01931fSBen Gras0 belong 0x00000200 Lotus 1-2-3 544ef01931fSBen Gras!:mime application/x-123 545ef01931fSBen Gras>4 belong 0x06040600 wk1 document data 546ef01931fSBen Gras>4 belong 0x06800200 fmt document data 54708ff44c4SLionel Sambuc0 string/b WordPro\0 Lotus WordPro 548ef01931fSBen Gras!:mime application/vnd.lotus-wordpro 54908ff44c4SLionel Sambuc0 string/b WordPro\r\373 Lotus WordPro 550ef01931fSBen Gras!:mime application/vnd.lotus-wordpro 551ef01931fSBen Gras 552ef01931fSBen Gras 553ef01931fSBen Gras# Summary: Script used by InstallScield to uninstall applications 554ef01931fSBen Gras# Extension: .isu 555ef01931fSBen Gras# Submitted by: unknown 556ef01931fSBen Gras# Modified by (1): Abel Cheung <abelcheung@gmail.com> (replace useless entry) 557ef01931fSBen Gras0 string \x71\xa8\x00\x00\x01\x02 558ef01931fSBen Gras>12 string Stirling\ Technologies, InstallShield Uninstall Script 559ef01931fSBen Gras 560ef01931fSBen Gras# Winamp .avs 561ef01931fSBen Gras#0 string Nullsoft\ AVS\ Preset\ \060\056\061\032 A plug in for Winamp ms-windows Freeware media player 56208ff44c4SLionel Sambuc0 string/b Nullsoft\ AVS\ Preset\ Winamp plug in 563ef01931fSBen Gras 564ef01931fSBen Gras# Windows Metafont .WMF 56508ff44c4SLionel Sambuc0 string/b \327\315\306\232 ms-windows metafont .wmf 56608ff44c4SLionel Sambuc0 string/b \002\000\011\000 ms-windows metafont .wmf 56708ff44c4SLionel Sambuc0 string/b \001\000\011\000 ms-windows metafont .wmf 568ef01931fSBen Gras 569ef01931fSBen Gras#tz3 files whatever that is (MS Works files) 57008ff44c4SLionel Sambuc0 string/b \003\001\001\004\070\001\000\000 tz3 ms-works file 57108ff44c4SLionel Sambuc0 string/b \003\002\001\004\070\001\000\000 tz3 ms-works file 57208ff44c4SLionel Sambuc0 string/b \003\003\001\004\070\001\000\000 tz3 ms-works file 573ef01931fSBen Gras 574ef01931fSBen Gras# PGP sig files .sig 575ef01931fSBen Gras#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 576ef01931fSBen Gras0 string \211\000\077\003\005\000\063\237\127\065\027\266\151\064\005\045\101\233\021\002 PGP sig 577ef01931fSBen Gras0 string \211\000\077\003\005\000\063\237\127\066\027\266\151\064\005\045\101\233\021\002 PGP sig 578ef01931fSBen Gras0 string \211\000\077\003\005\000\063\237\127\067\027\266\151\064\005\045\101\233\021\002 PGP sig 579ef01931fSBen Gras0 string \211\000\077\003\005\000\063\237\127\070\027\266\151\064\005\045\101\233\021\002 PGP sig 580ef01931fSBen Gras0 string \211\000\077\003\005\000\063\237\127\071\027\266\151\064\005\045\101\233\021\002 PGP sig 581ef01931fSBen Gras0 string \211\000\225\003\005\000\062\122\207\304\100\345\042 PGP sig 582ef01931fSBen Gras 583ef01931fSBen Gras# windows zips files .dmf 58408ff44c4SLionel Sambuc0 string/b MDIF\032\000\010\000\000\000\372\046\100\175\001\000\001\036\001\000 MS Windows special zipped file 585ef01931fSBen Gras 586ef01931fSBen Gras 587ef01931fSBen Gras#ico files 58808ff44c4SLionel Sambuc0 string/b \102\101\050\000\000\000\056\000\000\000\000\000\000\000 Icon for MS Windows 589ef01931fSBen Gras 590*0a6a1f1dSLionel Sambuc# Windows icons 591*0a6a1f1dSLionel Sambuc0 name ico-dir 592*0a6a1f1dSLionel Sambuc# not entirely accurate, the number of icons is part of the header 593*0a6a1f1dSLionel Sambuc>0 byte 1 - 1 icon 594*0a6a1f1dSLionel Sambuc>0 ubyte >1 - %d icons 595*0a6a1f1dSLionel Sambuc>2 byte 0 \b, 256x 596*0a6a1f1dSLionel Sambuc>2 byte !0 \b, %dx 597*0a6a1f1dSLionel Sambuc>3 byte 0 \b256 598*0a6a1f1dSLionel Sambuc>3 byte !0 \b%d 599*0a6a1f1dSLionel Sambuc>4 ubyte !0 \b, %d colors 600ef01931fSBen Gras 601*0a6a1f1dSLionel Sambuc0 belong 0x00000100 602*0a6a1f1dSLionel Sambuc>9 byte 0 603*0a6a1f1dSLionel Sambuc>>0 byte x MS Windows icon resource 604*0a6a1f1dSLionel Sambuc!:mime image/x-icon 605*0a6a1f1dSLionel Sambuc>>4 use ico-dir 606*0a6a1f1dSLionel Sambuc>9 ubyte 0xff 607*0a6a1f1dSLionel Sambuc>>0 byte x MS Windows icon resource 608*0a6a1f1dSLionel Sambuc!:mime image/x-icon 609*0a6a1f1dSLionel Sambuc>>4 use ico-dir 610*0a6a1f1dSLionel Sambuc 611*0a6a1f1dSLionel Sambuc# Windows non-animated cursors 612*0a6a1f1dSLionel Sambuc0 name cur-dir 613*0a6a1f1dSLionel Sambuc# not entirely accurate, the number of icons is part of the header 614*0a6a1f1dSLionel Sambuc>0 byte 1 - 1 icon 615*0a6a1f1dSLionel Sambuc>0 ubyte >1 - %d icons 616*0a6a1f1dSLionel Sambuc>2 byte 0 \b, 256x 617*0a6a1f1dSLionel Sambuc>2 byte !0 \b, %dx 618*0a6a1f1dSLionel Sambuc>3 byte 0 \b256 619*0a6a1f1dSLionel Sambuc>3 byte !0 \b%d 620*0a6a1f1dSLionel Sambuc>6 uleshort x \b, hotspot @%dx 621*0a6a1f1dSLionel Sambuc>8 uleshort x \b%d 622*0a6a1f1dSLionel Sambuc 623*0a6a1f1dSLionel Sambuc0 belong 0x00000200 624*0a6a1f1dSLionel Sambuc>9 byte 0 625*0a6a1f1dSLionel Sambuc>>0 byte x MS Windows cursor resource 626*0a6a1f1dSLionel Sambuc!:mime image/x-cur 627*0a6a1f1dSLionel Sambuc>>4 use cur-dir 628*0a6a1f1dSLionel Sambuc>9 ubyte 0xff 629*0a6a1f1dSLionel Sambuc>>0 byte x MS Windows cursor resource 630*0a6a1f1dSLionel Sambuc!:mime image/x-cur 631*0a6a1f1dSLionel Sambuc>>4 use cur-dir 632ef01931fSBen Gras 633ef01931fSBen Gras# .chr files 63408ff44c4SLionel Sambuc0 string/b PK\010\010BGI Borland font 635ef01931fSBen Gras>4 string >\0 %s 636ef01931fSBen Gras# then there is a copyright notice 637ef01931fSBen Gras 638ef01931fSBen Gras 639ef01931fSBen Gras# .bgi files 64008ff44c4SLionel Sambuc0 string/b pk\010\010BGI Borland device 641ef01931fSBen Gras>4 string >\0 %s 642ef01931fSBen Gras# then there is a copyright notice 643ef01931fSBen Gras 644ef01931fSBen Gras 645ef01931fSBen Gras# Windows Recycle Bin record file (named INFO2) 646ef01931fSBen Gras# By Abel Cheung (abelcheung AT gmail dot com) 647ef01931fSBen Gras# Version 4 always has 280 bytes (0x118) per record, version 5 has 800 bytes 648ef01931fSBen Gras# Since Vista uses another structure, INFO2 structure probably won't change 649ef01931fSBen Gras# anymore. Detailed analysis in: 650ef01931fSBen Gras# http://www.cybersecurityinstitute.biz/downloads/INFO2.pdf 651ef01931fSBen Gras0 lelong 0x00000004 652ef01931fSBen Gras>12 lelong 0x00000118 Windows Recycle Bin INFO2 file (Win98 or below) 653ef01931fSBen Gras 654ef01931fSBen Gras0 lelong 0x00000005 655ef01931fSBen Gras>12 lelong 0x00000320 Windows Recycle Bin INFO2 file (Win2k - WinXP) 656ef01931fSBen Gras 657ef01931fSBen Gras 658ef01931fSBen Gras##### put in Either Magic/font or Magic/news 659ef01931fSBen Gras# Acroread or something files wrongly identified as G3 .pfm 660ef01931fSBen Gras# these have the form \000 \001 any? \002 \000 \000 661ef01931fSBen Gras# or \000 \001 any? \022 \000 \000 662835f6802SDirk Vogt0 belong&0xffff00ff 0x00010012 PFM data 663835f6802SDirk Vogt>4 string \000\000 664835f6802SDirk Vogt>6 string >\060 - %s 665835f6802SDirk Vogt 666835f6802SDirk Vogt0 belong&0xffff00ff 0x00010002 PFM data 667835f6802SDirk Vogt>4 string \000\000 668835f6802SDirk Vogt>6 string >\060 - %s 669ef01931fSBen Gras#0 string \000\001 pfm? 670ef01931fSBen Gras#>3 string \022\000\000Copyright\ yes 671ef01931fSBen Gras#>3 string \002\000\000Copyright\ yes 672ef01931fSBen Gras#>3 string >\0 oops, not a font file. Cancel that. 673ef01931fSBen Gras#it clashes with ttf files so put it lower down. 674ef01931fSBen Gras 675ef01931fSBen Gras# From Doug Lee via a FreeBSD pr 676ef01931fSBen Gras9 string GERBILDOC First Choice document 677ef01931fSBen Gras9 string GERBILDB First Choice database 678ef01931fSBen Gras9 string GERBILCLIP First Choice database 679ef01931fSBen Gras0 string GERBIL First Choice device file 680ef01931fSBen Gras9 string RABBITGRAPH RabbitGraph file 681ef01931fSBen Gras0 string DCU1 Borland Delphi .DCU file 682ef01931fSBen Gras0 string =!<spell> MKS Spell hash list (old format) 683ef01931fSBen Gras0 string =!<spell2> MKS Spell hash list 684ef01931fSBen Gras# Too simple - MPi 685ef01931fSBen Gras#0 string AH Halo(TM) bitmapped font file 686ef01931fSBen Gras0 lelong 0x08086b70 TurboC BGI file 687ef01931fSBen Gras0 lelong 0x08084b50 TurboC Font file 688ef01931fSBen Gras 689*0a6a1f1dSLionel Sambuc# Debian#712046: The magic below identifies "Delphi compiled form data". 690*0a6a1f1dSLionel Sambuc# An additional source of information is available at: 691*0a6a1f1dSLionel Sambuc# http://www.woodmann.com/fravia/dafix_t1.htm 692*0a6a1f1dSLionel Sambuc0 string TPF0 693*0a6a1f1dSLionel Sambuc>4 pstring >\0 Delphi compiled form '%s' 694*0a6a1f1dSLionel Sambuc 69584d9c625SLionel Sambuc# tests for DBase files moved, updated and merged to database 69684d9c625SLionel Sambuc 697ef01931fSBen Gras0 string PMCC Windows 3.x .GRP file 698ef01931fSBen Gras1 string RDC-meg MegaDots 699ef01931fSBen Gras>8 byte >0x2F version %c 700ef01931fSBen Gras>9 byte >0x2F \b.%c file 701ef01931fSBen Gras0 lelong 0x4C 702ef01931fSBen Gras>4 lelong 0x00021401 Windows shortcut file 703ef01931fSBen Gras 704835f6802SDirk Vogt# .PIF files added by Joerg Jenderek from http://smsoft.ru/en/pifdoc.htm 705835f6802SDirk Vogt# only for windows versions equal or greater 3.0 706835f6802SDirk Vogt0x171 string MICROSOFT\ PIFEX\0 Windows Program Information File 707835f6802SDirk Vogt!:mime application/x-dosexec 708835f6802SDirk Vogt#>2 string >\0 \b, Title:%.30s 709835f6802SDirk Vogt>0x24 string >\0 \b for %.63s 710835f6802SDirk Vogt>0x65 string >\0 \b, directory=%.64s 711835f6802SDirk Vogt>0xA5 string >\0 \b, parameters=%.64s 712835f6802SDirk Vogt#>0x181 leshort x \b, offset %x 713835f6802SDirk Vogt#>0x183 leshort x \b, offsetdata %x 714835f6802SDirk Vogt#>0x185 leshort x \b, section length %x 715835f6802SDirk Vogt>0x187 search/0xB55 WINDOWS\ VMM\ 4.0\0 716835f6802SDirk Vogt>>&0x5e ubyte >0 717835f6802SDirk Vogt>>>&-1 string <PIFMGR.DLL \b, icon=%s 718835f6802SDirk Vogt#>>>&-1 string PIFMGR.DLL \b, icon=%s 719835f6802SDirk Vogt>>>&-1 string >PIFMGR.DLL \b, icon=%s 720835f6802SDirk Vogt>>&0xF0 ubyte >0 721835f6802SDirk Vogt>>>&-1 string <Terminal \b, font=%.32s 722835f6802SDirk Vogt#>>>&-1 string =Terminal \b, font=%.32s 723835f6802SDirk Vogt>>>&-1 string >Terminal \b, font=%.32s 724835f6802SDirk Vogt>>&0x110 ubyte >0 725835f6802SDirk Vogt>>>&-1 string <Lucida\ Console \b, TrueTypeFont=%.32s 726835f6802SDirk Vogt#>>>&-1 string =Lucida\ Console \b, TrueTypeFont=%.32s 727835f6802SDirk Vogt>>>&-1 string >Lucida\ Console \b, TrueTypeFont=%.32s 728835f6802SDirk Vogt#>0x187 search/0xB55 WINDOWS\ 286\ 3.0\0 \b, Windows 3.X standard mode-style 729835f6802SDirk Vogt#>0x187 search/0xB55 WINDOWS\ 386\ 3.0\0 \b, Windows 3.X enhanced mode-style 730835f6802SDirk Vogt>0x187 search/0xB55 WINDOWS\ NT\ \ 3.1\0 \b, Windows NT-style 731835f6802SDirk Vogt#>0x187 search/0xB55 WINDOWS\ NT\ \ 4.0\0 \b, Windows NT-style 732835f6802SDirk Vogt>0x187 search/0xB55 CONFIG\ \ SYS\ 4.0\0 \b +CONFIG.SYS 733835f6802SDirk Vogt#>>&06 string x \b:%s 734835f6802SDirk Vogt>0x187 search/0xB55 AUTOEXECBAT\ 4.0\0 \b +AUTOEXEC.BAT 735835f6802SDirk Vogt#>>&06 string x \b:%s 736835f6802SDirk Vogt 737ef01931fSBen Gras# DOS EPS Binary File Header 738ef01931fSBen Gras# From: Ed Sznyter <ews@Black.Market.NET> 739ef01931fSBen Gras0 belong 0xC5D0D3C6 DOS EPS Binary File 740ef01931fSBen Gras>4 long >0 Postscript starts at byte %d 741ef01931fSBen Gras>>8 long >0 length %d 742ef01931fSBen Gras>>>12 long >0 Metafile starts at byte %d 743ef01931fSBen Gras>>>>16 long >0 length %d 744ef01931fSBen Gras>>>20 long >0 TIFF starts at byte %d 745ef01931fSBen Gras>>>>24 long >0 length %d 746ef01931fSBen Gras 747ef01931fSBen Gras# TNEF magic From "Joomy" <joomy@se-ed.net> 748ef01931fSBen Gras# Microsoft Outlook's Transport Neutral Encapsulation Format (TNEF) 749ef01931fSBen Gras0 leshort 0x223e9f78 TNEF 750ef01931fSBen Gras!:mime application/vnd.ms-tnef 751ef01931fSBen Gras 752*0a6a1f1dSLionel Sambuc# Norton Guide (.NG , .HLP) files added by Joerg Jenderek from source NG2HTML.C 753*0a6a1f1dSLionel Sambuc# of http://www.davep.org/norton-guides/ng2h-105.tgz 754*0a6a1f1dSLionel Sambuc# http://en.wikipedia.org/wiki/Norton_Guides 755*0a6a1f1dSLionel Sambuc0 string NG\0\001 756*0a6a1f1dSLionel Sambuc# only value 0x100 found at offset 2 757*0a6a1f1dSLionel Sambuc>2 ulelong 0x00000100 Norton Guide 758*0a6a1f1dSLionel Sambuc# Title[40] 759*0a6a1f1dSLionel Sambuc>>8 string >\0 "%-.40s" 760*0a6a1f1dSLionel Sambuc#>>6 uleshort x \b, MenuCount=%u 761*0a6a1f1dSLionel Sambuc# szCredits[5][66] 762*0a6a1f1dSLionel Sambuc>>48 string >\0 \b, %-.66s 763*0a6a1f1dSLionel Sambuc>>114 string >\0 %-.66s 764*0a6a1f1dSLionel Sambuc 76584d9c625SLionel Sambuc# 4DOS help (.HLP) files added by Joerg Jenderek from source TPHELP.PAS 76684d9c625SLionel Sambuc# of http://www.4dos.info/ 76784d9c625SLionel Sambuc# pointer,HelpID[8]=4DHnnnmm 76884d9c625SLionel Sambuc0 ulelong 0x48443408 4DOS help file 76984d9c625SLionel Sambuc>4 string x \b, version %-4.4s 77084d9c625SLionel Sambuc 77184d9c625SLionel Sambuc# old binary Microsoft (.HLP) files added by Joerg Jenderek from http://file-extension.net/seeker/file_extension_hlp 77284d9c625SLionel Sambuc0 ulequad 0x3a000000024e4c MS Advisor help file 77384d9c625SLionel Sambuc 774ef01931fSBen Gras# HtmlHelp files (.chm) 77508ff44c4SLionel Sambuc0 string/b ITSF\003\000\000\000\x60\000\000\000\001\000\000\000 MS Windows HtmlHelp Data 776ef01931fSBen Gras 777ef01931fSBen Gras# GFA-BASIC (Wolfram Kleff) 77808ff44c4SLionel Sambuc2 string/b GFA-BASIC3 GFA-BASIC 3 data 779ef01931fSBen Gras 780ef01931fSBen Gras#------------------------------------------------------------------------------ 781ef01931fSBen Gras# From Stuart Caie <kyzer@4u.net> (developer of cabextract) 782ef01931fSBen Gras# Microsoft Cabinet files 78308ff44c4SLionel Sambuc0 string/b MSCF\0\0\0\0 Microsoft Cabinet archive data 784ef01931fSBen Gras!:mime application/vnd.ms-cab-compressed 785ef01931fSBen Gras>8 lelong x \b, %u bytes 786ef01931fSBen Gras>28 leshort 1 \b, 1 file 787ef01931fSBen Gras>28 leshort >1 \b, %u files 788ef01931fSBen Gras 789ef01931fSBen Gras# InstallShield Cabinet files 79008ff44c4SLionel Sambuc0 string/b ISc( InstallShield Cabinet archive data 791ef01931fSBen Gras>5 byte&0xf0 =0x60 version 6, 792ef01931fSBen Gras>5 byte&0xf0 !0x60 version 4/5, 793ef01931fSBen Gras>(12.l+40) lelong x %u files 794ef01931fSBen Gras 795ef01931fSBen Gras# Windows CE package files 79608ff44c4SLionel Sambuc0 string/b MSCE\0\0\0\0 Microsoft WinCE install header 797ef01931fSBen Gras>20 lelong 0 \b, architecture-independent 798ef01931fSBen Gras>20 lelong 103 \b, Hitachi SH3 799ef01931fSBen Gras>20 lelong 104 \b, Hitachi SH4 800ef01931fSBen Gras>20 lelong 0xA11 \b, StrongARM 801ef01931fSBen Gras>20 lelong 4000 \b, MIPS R4000 802ef01931fSBen Gras>20 lelong 10003 \b, Hitachi SH3 803ef01931fSBen Gras>20 lelong 10004 \b, Hitachi SH3E 804ef01931fSBen Gras>20 lelong 10005 \b, Hitachi SH4 805ef01931fSBen Gras>20 lelong 70001 \b, ARM 7TDMI 806ef01931fSBen Gras>52 leshort 1 \b, 1 file 807ef01931fSBen Gras>52 leshort >1 \b, %u files 808ef01931fSBen Gras>56 leshort 1 \b, 1 registry entry 809ef01931fSBen Gras>56 leshort >1 \b, %u registry entries 810ef01931fSBen Gras 811ef01931fSBen Gras 812ef01931fSBen Gras# Windows Enhanced Metafile (EMF) 813ef01931fSBen Gras# See msdn.microsoft.com/archive/en-us/dnargdi/html/msdn_enhmeta.asp 814ef01931fSBen Gras# for further information. 815ef01931fSBen Gras0 ulelong 1 816ef01931fSBen Gras>40 string \ EMF Windows Enhanced Metafile (EMF) image data 817ef01931fSBen Gras>>44 ulelong x version 0x%x 818ef01931fSBen Gras 819ef01931fSBen Gras# from http://filext.com by Derek M Jones <derek@knosof.co.uk> 820ef01931fSBen Gras# False positive with PPT (also currently this string is too long) 82108ff44c4SLionel Sambuc#0 string/b \xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF\x09\x00\x06 Microsoft Installer 82208ff44c4SLionel Sambuc0 string/b \320\317\021\340\241\261\032\341 Microsoft Office Document 823ef01931fSBen Gras#>48 byte 0x1B Excel Document 824ef01931fSBen Gras#!:mime application/vnd.ms-excel 825ef01931fSBen Gras>546 string bjbj Microsoft Word Document 826ef01931fSBen Gras!:mime application/msword 827ef01931fSBen Gras>546 string jbjb Microsoft Word Document 828ef01931fSBen Gras!:mime application/msword 829ef01931fSBen Gras 83008ff44c4SLionel Sambuc0 string/b \224\246\056 Microsoft Word Document 831ef01931fSBen Gras!:mime application/msword 832ef01931fSBen Gras 833ef01931fSBen Gras512 string R\0o\0o\0t\0\ \0E\0n\0t\0r\0y Microsoft Word Document 834ef01931fSBen Gras!:mime application/msword 835ef01931fSBen Gras 836ef01931fSBen Gras# From: "Nelson A. de Oliveira" <naoliv@gmail.com> 837ef01931fSBen Gras# Magic type for Dell's BIOS .hdr files 838ef01931fSBen Gras# Dell's .hdr 83908ff44c4SLionel Sambuc0 string/b $RBU 840ef01931fSBen Gras>23 string Dell %s system BIOS 841835f6802SDirk Vogt>5 byte 2 842835f6802SDirk Vogt>>48 byte x version %d. 843835f6802SDirk Vogt>>49 byte x \b%d. 844835f6802SDirk Vogt>>50 byte x \b%d 845835f6802SDirk Vogt>5 byte <2 846835f6802SDirk Vogt>>48 string x version %.3s 847ef01931fSBen Gras 848ef01931fSBen Gras# Type: Microsoft DirectDraw Surface 849ef01931fSBen Gras# URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp 850ef01931fSBen Gras# From: Morten Hustveit <morten@debian.org> 85108ff44c4SLionel Sambuc0 string/b DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS), 852*0a6a1f1dSLionel Sambuc>16 lelong >0 %d x 853*0a6a1f1dSLionel Sambuc>12 lelong >0 %d, 854ef01931fSBen Gras>84 string x %.4s 855ef01931fSBen Gras 856ef01931fSBen Gras# Type: Microsoft Document Imaging Format (.mdi) 857ef01931fSBen Gras# URL: http://en.wikipedia.org/wiki/Microsoft_Document_Imaging_Format 858ef01931fSBen Gras# From: Daniele Sempione <scrows@oziosi.org> 859ef01931fSBen Gras0 short 0x5045 Microsoft Document Imaging Format 860ef01931fSBen Gras 861ef01931fSBen Gras# MS eBook format (.lit) 86208ff44c4SLionel Sambuc0 string/b ITOLITLS Microsoft Reader eBook Data 863ef01931fSBen Gras>8 lelong x \b, version %u 864ef01931fSBen Gras!:mime application/x-ms-reader 865835f6802SDirk Vogt 866835f6802SDirk Vogt# Windows CE Binary Image Data Format 867835f6802SDirk Vogt# From: Dr. Jesus <j@hug.gs> 86808ff44c4SLionel Sambuc0 string/b B000FF\n Windows Embedded CE binary image 869835f6802SDirk Vogt 870835f6802SDirk Vogt# Windows Imaging (WIM) Image 87108ff44c4SLionel Sambuc0 string/b MSWIM\000\000\000 Windows imaging (WIM) image 87284d9c625SLionel Sambuc 87384d9c625SLionel Sambuc# The second byte of these signatures is a file version; I don't know what, 87484d9c625SLionel Sambuc# if anything, produced files with version numbers 0-2. 87584d9c625SLionel Sambuc# From: John Elliott <johne@seasip.demon.co.uk> 87684d9c625SLionel Sambuc0 string \xfc\x03\x00 Mallard BASIC program data (v1.11) 87784d9c625SLionel Sambuc0 string \xfc\x04\x00 Mallard BASIC program data (v1.29+) 87884d9c625SLionel Sambuc0 string \xfc\x03\x01 Mallard BASIC protected program data (v1.11) 87984d9c625SLionel Sambuc0 string \xfc\x04\x01 Mallard BASIC protected program data (v1.29+) 88084d9c625SLionel Sambuc 88184d9c625SLionel Sambuc0 string MIOPEN Mallard BASIC Jetsam data 88284d9c625SLionel Sambuc0 string Jetsam0 Mallard BASIC Jetsam index data 88384d9c625SLionel Sambuc 884