Import file-5.18.
[dragonfly.git] / contrib / file / magic / Magdir / windows
1
2 #------------------------------------------------------------------------------
3 # $File: windows,v 1.6 2013/04/19 20:12:29 christos Exp $
4 # windows:  file(1) magic for Microsoft Windows
5 #
6 # This file is mainly reserved for files where programs
7 # using them are run almost always on MS Windows 3.x or
8 # above, or files only used exclusively in Windows OS,
9 # where there is no better category to allocate for.
10 # For example, even though WinZIP almost run on Windows
11 # only, it is better to treat them as "archive" instead.
12 # For format usable in DOS, such as generic executable
13 # format, please specify under "msdos" file.
14 #
15
16
17 # Summary: Outlook Express DBX file
18 # Extension: .dbx
19 # Created by: Christophe Monniez
20 0       string  \xCF\xAD\x12\xFE        MS Outlook Express DBX file
21 >4      byte    =0xC5                   \b, message database
22 >4      byte    =0xC6                   \b, folder database
23 >4      byte    =0xC7                   \b, account information
24 >4      byte    =0x30                   \b, offline database
25
26
27 # Summary: Windows crash dump
28 # Extension: .dmp
29 # Created by: Andreas Schuster (http://computer.forensikblog.de/)
30 # Reference (1): http://computer.forensikblog.de/en/2008/02/64bit_magic.html
31 # Modified by (1): Abel Cheung (Avoid match with first 4 bytes only)
32 0       string          PAGE            
33 >4      string          DUMP            MS Windows 32bit crash dump
34 >>0x05c byte            0               \b, no PAE
35 >>0x05c byte            1               \b, PAE
36 >>0xf88 lelong          1               \b, full dump
37 >>0xf88 lelong          2               \b, kernel dump
38 >>0xf88 lelong          3               \b, small dump
39 >>0x068 lelong          x               \b, %ld pages
40 >4      string          DU64            MS Windows 64bit crash dump
41 >>0xf98 lelong          1               \b, full dump
42 >>0xf98 lelong          2               \b, kernel dump
43 >>0xf98 lelong          3               \b, small dump
44 >>0x090 lequad          x               \b, %lld pages
45
46
47 # Summary: Vista Event Log
48 # Extension: .evtx
49 # Created by: Andreas Schuster (http://computer.forensikblog.de/)
50 # Reference (1): http://computer.forensikblog.de/en/2007/05/some_magic.html
51 0       string          ElfFile\0       MS Windows Vista Event Log
52 >0x2a   leshort         x               \b, %d chunks
53 >>0x10  lelong          x               \b (no. %d in use)
54 >0x18   lelong          >1              \b, next record no. %d
55 >0x18   lelong          =1              \b, empty
56 >0x78   lelong          &1              \b, DIRTY
57 >0x78   lelong          &2              \b, FULL
58
59
60 # Summary: Windows 3.1 group files
61 # Extension: .grp
62 # Created by: unknown
63 0       string          \120\115\103\103        MS Windows 3.1 group files
64
65
66 # Summary: Old format help files
67 # Extension: .hlp
68 # Created by: Dirk Jagdmann <doj@cubic.org>
69 0       lelong          0x00035f3f              MS Windows 3.x help file
70
71
72 # Summary: Hyper terminal
73 # Extension: .ht
74 # Created by: unknown
75 0       string          HyperTerminal\ 
76 >15     string          1.0\ --\ HyperTerminal\ data\ file      MS Windows HyperTerminal profile
77
78 # http://ithreats.files.wordpress.com/2009/05/\
79 # lnk_the_windows_shortcut_file_format.pdf
80 # Summary: Windows shortcut
81 # Extension: .lnk
82 # Created by: unknown
83 # 'L' + GUUID
84 0       string          \114\0\0\0\001\024\002\0\0\0\0\0\300\0\0\0\0\0\0\106    MS Windows shortcut
85 >20     lelong&1        1       \b, Item id list present
86 >20     lelong&2        2       \b, Points to a file or directory
87 >20     lelong&4        4       \b, Has Description string
88 >20     lelong&8        8       \b, Has Relative path
89 >20     lelong&16       16      \b, Has Working directory
90 >20     lelong&32       32      \b, Has command line arguments
91 >20     lelong&64       64      \b, Icon
92 >>56    lelong                  \b number=%d
93 >24     lelong&1        1       \b, Read-Only
94 >24     lelong&2        2       \b, Hidden
95 >24     lelong&4        4       \b, System
96 >24     lelong&8        8       \b, Volume Label
97 >24     lelong&16       16      \b, Directory
98 >24     lelong&32       32      \b, Archive
99 >24     lelong&64       64      \b, Encrypted
100 >24     lelong&128      128     \b, Normal
101 >24     lelong&256      256     \b, Temporary
102 >24     lelong&512      512     \b, Sparse
103 >24     lelong&1024     1024    \b, Reparse point
104 >24     lelong&2048     2048    \b, Compressed
105 >24     lelong&4096     4096    \b, Offline
106 >28     leqwdate        x       \b, ctime=%s
107 >36     leqwdate        x       \b, mtime=%s
108 >44     leqwdate        x       \b, atime=%s
109 >52     lelong          x       \b, length=%u, window=
110 >60     lelong&1        1       \bhide
111 >60     lelong&2        2       \bnormal
112 >60     lelong&4        4       \bshowminimized
113 >60     lelong&8        8       \bshowmaximized
114 >60     lelong&16       16      \bshownoactivate
115 >60     lelong&32       32      \bminimize
116 >60     lelong&64       64      \bshowminnoactive
117 >60     lelong&128      128     \bshowna
118 >60     lelong&256      256     \brestore
119 >60     lelong&512      512     \bshowdefault
120 #>20    lelong&1        0
121 #>>20   lelong&2        2
122 #>>>(72.l-64)   pstring/h       x       \b [%s]
123 #>20    lelong&1        1
124 #>>20   lelong&2        2
125 #>>>(72.s)      leshort x
126 #>>>&75 pstring/h       x       \b [%s]
127
128 # Summary: Outlook Personal Folders
129 # Created by: unknown
130 0       lelong          0x4E444221      Microsoft Outlook email folder
131 >10     leshort         0x0e            (<=2002)
132 >10     leshort         0x17            (>=2003)
133
134
135 # Summary: Windows help cache
136 # Created by: unknown
137 0       string          \164\146\115\122\012\000\000\000\001\000\000\000        MS Windows help cache
138
139
140 # Summary: IE cache file
141 # Created by: Christophe Monniez
142 0       string  Client\ UrlCache\ MMF   Internet Explorer cache file
143 >20     string  >\0                     version %s
144
145
146 # Summary: Registry files
147 # Created by: unknown
148 # Modified by (1): Joerg Jenderek
149 0       string          regf            MS Windows registry file, NT/2000 or above
150 0       string          CREG            MS Windows 95/98/ME registry file
151 0       string          SHCC3           MS Windows 3.1 registry file
152
153
154 # Summary: Windows Registry text
155 # Extension: .reg
156 # Submitted by: Abel Cheung <abelcheung@gmail.com>
157 0       string          REGEDIT4\r\n\r\n        Windows Registry text (Win95 or above)
158 0       string          Windows\ Registry\ Editor\ 
159 >&0     string          Version\ 5.00\r\n\r\n   Windows Registry text (Win2K or above)
160
161 # Windows *.INF *.INI files updated by Joerg Jenderek at Apr 2013
162 # emtpy ,comment , section , unicode line
163 0       regex/s         \\`(\r\n|;|[[]|\xFF\xFE)                        
164 # left bracket in section line
165 >&0     search/8192     [                                               
166 # http://en.wikipedia.org/wiki/Autorun.inf
167 # http://msdn.microsoft.com/en-us/library/windows/desktop/cc144200.aspx
168 >>&0    regex/c         \^(autorun)]\r\n                                
169 >>>&0   ubyte           =0x5b                                           INItialization configuration
170 !:mime application/x-wine-extension-ini
171 # From: Pal Tamas <folti@balabit.hu>
172 # Autorun File
173 >>>&0   ubyte           !0x5b                                           Microsoft Windows Autorun file
174 !:mime application/x-setupscript
175 # http://msdn.microsoft.com/en-us/library/windows/hardware/ff549520(v=vs.85).aspx
176 # version strings ASCII coded case-independent for Windows setup information script file
177 >>&0    regex/c         \^(version|strings)]                            Windows setup INFormation
178 !:mime  application/x-setupscript
179 #!:mime application/inf
180 #!:mime application/x-wine-extension-inf
181 >>&0    regex/c         \^(WinsockCRCList|OEMCPL)]                      Windows setup INFormation
182 !:mime  text/inf
183 # http://www.winfaq.de/faq_html/Content/tip2500/onlinefaq.php?h=tip2653.htm
184 # http://msdn.microsoft.com/en-us/library/windows/desktop/cc144102.aspx
185 # .ShellClassInfo DeleteOnCopy LocalizedFileNames ASCII coded case-independent
186 >>&0    regex/c \^(\.ShellClassInfo|DeleteOnCopy|LocalizedFileNames)]   Windows desktop.ini
187 !:mime application/x-wine-extension-ini
188 #!:mime text/plain
189 # http://support.microsoft.com/kb/84709/
190 >>&0    regex/c         \^(don't\ load)]                                Windows CONTROL.INI
191 !:mime application/x-wine-extension-ini
192 >>&0    regex/c         \^(ndishlp\\$|protman\\$|NETBEUI\\$)]           Windows PROTOCOL.INI
193 !:mime application/x-wine-extension-ini
194 # http://technet.microsoft.com/en-us/library/cc722567.aspx
195 # http://www.winfaq.de/faq_html/Content/tip0000/onlinefaq.php?h=tip0137.htm
196 >>&0    regex/c         \^(windows|Compatibility|embedding)]            Windows WIN.INI
197 !:mime application/x-wine-extension-ini
198 # http://en.wikipedia.org/wiki/SYSTEM.INI
199 >>&0    regex/c         \^(boot|386enh|drivers)]                        Windows SYSTEM.INI
200 !:mime application/x-wine-extension-ini
201 # http://www.mdgx.com/newtip6.htm
202 >>&0    regex/c         \^(SafeList)]                                   Windows IOS.INI
203 !:mime application/x-wine-extension-ini
204 # http://en.wikipedia.org/wiki/NTLDR    Windows Boot Loader information
205 >>&0    regex/c         \^(boot\x20loader)]                             Windows boot.ini
206 !:mime application/x-wine-extension-ini
207 >>>&0   ubyte           x                                               
208 # http://en.wikipedia.org/wiki/CONFIG.SYS
209 >>&0    regex/c         \^(menu)]\r\n                                   MS-DOS CONFIG.SYS
210 # http://support.microsoft.com/kb/118579/
211 >>&0    regex/c         \^(Paths)]\r\n                                  MS-DOS MSDOS.SYS
212 # VERS string unicoded case-independent
213 >>&0    ubequad&0xFFdfFFdfFFdfFFdf      0x0056004500520053              
214 # ION] string unicoded case-independent
215 >>>&0   ubequad&0xFFdfFFdfFFdfFFff      0x0049004f004e005d              Windows setup INFormation 
216 !:mime application/x-setupscript
217 # STRI string unicoded case-independent
218 >>&0    ubequad&0xFFdfFFdfFFdfFFdf      0x0053005400520049              
219 # NGS] string unicoded case-independent
220 >>>&0   ubequad&0xFFdfFFdfFFdfFFff      0x004e00470053005D              Windows setup INFormation 
221 !:mime application/x-setupscript
222 # unknown keyword after opening bracket
223 >>&0    default                         x                               
224 >>>&0   search/8192                     [                               
225 # version Strings FileIdentification
226 >>>>&0  string/c                        version                         Windows setup INFormation 
227 !:mime application/x-setupscript
228 # VERS string unicoded case-independent
229 >>>>&0  ubequad&0xFFdfFFdfFFdfFFdf      0x0056004500520053              
230 # ION] string unicoded case-independent
231 >>>>>&0 ubequad&0xFFdfFFdfFFdfFFff      0x0049004f004e005d              Windows setup INFormation 
232 !:mime application/x-setupscript
233 # http://en.wikipedia.org/wiki/Initialization_file      Windows Initialization File or other
234 #>>>>&0 default                         x                               Generic INItialization configuration
235 #!:mime application/x-wine-extension-ini
236
237 # Windows Precompiled INF files *.PNF added by Joerg Jenderek at Mar 2013 of _PNF_HEADER inf.h
238 # http://read.pudn.com/downloads3/sourcecode/windows/248345/win2k/private/windows/setup/setupapi/inf.h__.htm
239 # GRR: line below too general as it catches also PDP-11 UNIX/RT ldp
240 0               leshort&0xFeFe  0x0000          
241 # test for unused null bits in PNF_FLAGs
242 >4      ulelong&0xFCffFe00      0x00000000      
243 # only found 58h for Offset of WinDirPath immediately after _PNF_HEADER structure
244 >>68            ulelong         >0x57           
245 # test for zero high byte of InfValueBlockSize, followed by WinDirPath like
246 # C:\WINDOWS (ASCII 0x433a5c.. , unicode 0x43003a005c..) or X:\MININT
247 >>>(68.l-1)     ubelong&0xffE0C519      =0x00400018     Windows Precompiled iNF
248 !:mime  application/x-pnf
249 # currently only found Major Version=1 and Minor Version=1
250 #>>>>0          uleshort        =0x0101         
251 #>>>>>1         ubyte           x               \b, version %u
252 #>>>>>0         ubyte           x               \b.%u
253 >>>>0           uleshort        !0x0101         
254 >>>>>1          ubyte           x               \b, version %u
255 >>>>>0          ubyte           x               \b.%u
256 # 1 ,2 (windows 98 SE)
257 #>>>>2          uleshort        =2              \b, InfStyle %u
258 >>>>2           uleshort        !2              \b, InfStyle %u
259 #       PNF_FLAG_IS_UNICODE             0x00000001
260 #       PNF_FLAG_HAS_STRINGS            0x00000002
261 #       PNF_FLAG_SRCPATH_IS_URL         0x00000004
262 #       PNF_FLAG_HAS_VOLATILE_DIRIDS    0x00000008
263 #       PNF_FLAG_INF_VERIFIED           0x00000010
264 #       PNF_FLAG_INF_DIGITALLY_SIGNED   0x00000020
265 #       ??                              0x00000100
266 #       ??                              0x01000000
267 #       ??                              0x02000000
268 >>>>4   ulelong&0x00000001      0x00000001      \b, unicoded
269 >>>>4   ulelong&0x00000020      0x00000020      \b, digitally signed
270 #>>>>8          ulelong         x               \b, InfSubstValueListOffset 0x%x
271 # many 0, 1 lmouusb.PNF, 2 linkfx10.PNF , f webfdr16.PNF
272 #>>>>12         uleshort        x               \b, InfSubstValueCount 0x%x
273 # only < 9 found
274 #>>>>14         uleshort        x               \b, InfVersionDatumCount 0x%x
275 # only found values lower 0x0000ffff
276 #>>>>16         ulelong         x               \b, InfVersionDataSize 0x%x
277 # only found positive values lower 0x00ffFFff for InfVersionDataOffset
278 >>>>20          ulelong         x               \b, at 0x%x
279 >>>>4   ulelong&0x00000001      =0x00000001     
280 # case independent: CatalogFile Class DriverVer layoutfile LayoutFile SetupClass signature Signature    
281 >>>>>(20.l)     lestring16      x               "%s"
282 >>>>4   ulelong&0x00000001      !0x00000001     
283 >>>>>(20.l)     string          x               "%s"
284 # FILETIME is number of 100-nanosecond intervals since 1 January 1601
285 #>>>>24         ulequad         x               \b, InfVersionLastWriteTime %16.16llx
286 # only found values lower 0x00ffFFff
287 #>>>>32         ulelong         x               \b, StringTableBlockOffset 0x%x
288 #>>>>36         ulelong         x               \b, StringTableBlockSize 0x%x
289 #>>>>40         ulelong         x               \b, InfSectionCount 0x%x
290 #>>>>44         ulelong         x               \b, InfSectionBlockOffset 0x%x
291 #>>>>48         ulelong         x               \b, InfSectionBlockSize 0x%x
292 #>>>>52         ulelong         x               \b, InfLineBlockOffset 0x%x
293 #>>>>56         ulelong         x               \b, InfLineBlockSize 0x%x
294 #>>>>60         ulelong         x               \b, InfValueBlockOffset 0x%x
295 #>>>>64         ulelong         x               \b, InfValueBlockSize 0x%x
296 # WinDirPathOffset
297 #>>>>68         ulelong         x               \b, at 0x%x
298 >>>>68          ulelong         >0x57           
299 >>>>>4  ulelong&0x00000001      =0x00000001     
300 >>>>>>(68.l)    ubequad         =0x43003a005c005700                     
301 # normally unicoded C:\Windows
302 #>>>>>>>(68.l)  lestring16      x               \b, WinDirPath "%s"
303 >>>>>>(68.l)    ubequad         !0x43003a005c005700                     
304 >>>>>>>(68.l)   lestring16      x               \b, WinDirPath "%s"
305 >>>>>4  ulelong&0x00000001      !0x00000001     
306 # normally ASCII C:\WINDOWS
307 #>>>>>>(68.l)   string          =C:\\WINDOWS    \b, WinDirPath "%s"
308 >>>>>>(68.l)    string          !C:\\WINDOWS    \b, WinDirPath "%s"
309 # found OsLoaderPathOffset values often 0 , once 70h corelist.PNF, once 68h ASCII machine.PNF 
310 #>>>>72         ulelong         >0              \b, at 0x%x
311 >>>>72          ulelong         >0              \b,
312 >>>>>4  ulelong&0x00000001      =0x00000001     
313 >>>>>>(72.l)    lestring16      x               OsLoaderPath "%s"
314 >>>>>4  ulelong&0x00000001      !0x00000001     
315 # seldom C:\ instead empty
316 >>>>>>(72.l)    string          x               OsLoaderPath "%s"
317 # 1fdh
318 #>>>>76         uleshort        x               \b, StringTableHashBucketCount 0x%x
319 >>>>78          uleshort        !0x407          \b, LanguageId %x
320 # only 407h found
321 #>>>>78         uleshort        =0x407          \b, LanguageId %x
322 # InfSourcePathOffset often 0
323 #>>>>80         ulelong         >0              \b, at 0x%x
324 >>>>80          ulelong         >0              \b,
325 >>>>>4  ulelong&0x00000001      =0x00000001     
326 >>>>>>(80.l)    lestring16      x               SourcePath "%s"
327 >>>>>4  ulelong&0x00000001      !0x00000001     
328 >>>>>>(80.l)    string          >\0             SourcePath "%s"
329 # OriginalInfNameOffset often 0
330 #>>>>84         ulelong         >0              \b, at 0x%x
331 >>>>84          ulelong         >0              \b,
332 >>>>>4  ulelong&0x00000001      =0x00000001     
333 >>>>>>(84.l)    lestring16      x               InfName "%s"
334 >>>>>4  ulelong&0x00000001      !0x00000001     
335 >>>>>>(84.l)    string          >\0             InfName "%s"
336