windows revision 267843
1186690Sobrien
2186690Sobrien#------------------------------------------------------------------------------
3267843Sdelphij# $File: windows,v 1.8 2014/04/30 21:41:02 christos Exp $
4186690Sobrien# windows:  file(1) magic for Microsoft Windows
5186690Sobrien#
6186690Sobrien# This file is mainly reserved for files where programs
7186690Sobrien# using them are run almost always on MS Windows 3.x or
8186690Sobrien# above, or files only used exclusively in Windows OS,
9186690Sobrien# where there is no better category to allocate for.
10186690Sobrien# For example, even though WinZIP almost run on Windows
11186690Sobrien# only, it is better to treat them as "archive" instead.
12186690Sobrien# For format usable in DOS, such as generic executable
13186690Sobrien# format, please specify under "msdos" file.
14186690Sobrien#
15186690Sobrien
16186690Sobrien
17186690Sobrien# Summary: Outlook Express DBX file
18186690Sobrien# Extension: .dbx
19186690Sobrien# Created by: Christophe Monniez
20186690Sobrien0	string	\xCF\xAD\x12\xFE	MS Outlook Express DBX file
21186690Sobrien>4	byte	=0xC5			\b, message database
22186690Sobrien>4	byte	=0xC6			\b, folder database
23186690Sobrien>4	byte	=0xC7			\b, account information
24186690Sobrien>4	byte	=0x30			\b, offline database
25186690Sobrien
26186690Sobrien
27186690Sobrien# Summary: Windows crash dump
28186690Sobrien# Extension: .dmp
29186690Sobrien# Created by: Andreas Schuster (http://computer.forensikblog.de/)
30186690Sobrien# Reference (1): http://computer.forensikblog.de/en/2008/02/64bit_magic.html
31186690Sobrien# Modified by (1): Abel Cheung (Avoid match with first 4 bytes only)
32186690Sobrien0	string		PAGE		
33186690Sobrien>4	string		DUMP		MS Windows 32bit crash dump
34186690Sobrien>>0x05c	byte            0		\b, no PAE
35186690Sobrien>>0x05c	byte            1		\b, PAE
36186690Sobrien>>0xf88	lelong		1		\b, full dump
37186690Sobrien>>0xf88	lelong		2		\b, kernel dump
38186690Sobrien>>0xf88	lelong		3		\b, small dump
39267843Sdelphij>>0x068	lelong		x		\b, %d pages
40186690Sobrien>4	string		DU64		MS Windows 64bit crash dump
41186690Sobrien>>0xf98	lelong		1		\b, full dump
42186690Sobrien>>0xf98	lelong		2		\b, kernel dump
43186690Sobrien>>0xf98	lelong		3		\b, small dump
44186690Sobrien>>0x090	lequad		x		\b, %lld pages
45186690Sobrien
46186690Sobrien
47186690Sobrien# Summary: Vista Event Log
48186690Sobrien# Extension: .evtx
49186690Sobrien# Created by: Andreas Schuster (http://computer.forensikblog.de/)
50186690Sobrien# Reference (1): http://computer.forensikblog.de/en/2007/05/some_magic.html
51186690Sobrien0	string		ElfFile\0	MS Windows Vista Event Log
52186690Sobrien>0x2a	leshort		x		\b, %d chunks
53186690Sobrien>>0x10	lelong		x		\b (no. %d in use)
54186690Sobrien>0x18	lelong		>1		\b, next record no. %d
55186690Sobrien>0x18	lelong		=1		\b, empty
56186690Sobrien>0x78	lelong		&1		\b, DIRTY
57186690Sobrien>0x78	lelong		&2		\b, FULL
58186690Sobrien
59186690Sobrien
60186690Sobrien# Summary: Windows 3.1 group files
61186690Sobrien# Extension: .grp
62186690Sobrien# Created by: unknown
63186690Sobrien0	string		\120\115\103\103	MS Windows 3.1 group files
64186690Sobrien
65186690Sobrien
66186690Sobrien# Summary: Old format help files
67186690Sobrien# Extension: .hlp
68186690Sobrien# Created by: Dirk Jagdmann <doj@cubic.org>
69186690Sobrien0	lelong		0x00035f3f		MS Windows 3.x help file
70186690Sobrien
71186690Sobrien
72186690Sobrien# Summary: Hyper terminal
73186690Sobrien# Extension: .ht
74186690Sobrien# Created by: unknown
75186690Sobrien0	string		HyperTerminal\ 
76186690Sobrien>15	string		1.0\ --\ HyperTerminal\ data\ file	MS Windows HyperTerminal profile
77186690Sobrien
78267843Sdelphij# http://ithreats.files.wordpress.com/2009/05/\
79267843Sdelphij# lnk_the_windows_shortcut_file_format.pdf
80186690Sobrien# Summary: Windows shortcut
81186690Sobrien# Extension: .lnk
82186690Sobrien# Created by: unknown
83267843Sdelphij# 'L' + GUUID
84186690Sobrien0	string		\114\0\0\0\001\024\002\0\0\0\0\0\300\0\0\0\0\0\0\106	MS Windows shortcut
85267843Sdelphij>20	lelong&1	1	\b, Item id list present
86267843Sdelphij>20	lelong&2	2	\b, Points to a file or directory
87267843Sdelphij>20	lelong&4	4	\b, Has Description string
88267843Sdelphij>20	lelong&8	8	\b, Has Relative path
89267843Sdelphij>20	lelong&16	16	\b, Has Working directory
90267843Sdelphij>20	lelong&32	32	\b, Has command line arguments
91267843Sdelphij>20	lelong&64	64	\b, Icon
92267843Sdelphij>>56	lelong			\b number=%d
93267843Sdelphij>24	lelong&1	1	\b, Read-Only
94267843Sdelphij>24	lelong&2	2	\b, Hidden
95267843Sdelphij>24	lelong&4	4	\b, System
96267843Sdelphij>24	lelong&8	8	\b, Volume Label
97267843Sdelphij>24	lelong&16	16	\b, Directory
98267843Sdelphij>24	lelong&32	32	\b, Archive
99267843Sdelphij>24	lelong&64	64	\b, Encrypted
100267843Sdelphij>24	lelong&128	128	\b, Normal
101267843Sdelphij>24	lelong&256	256	\b, Temporary
102267843Sdelphij>24	lelong&512	512	\b, Sparse
103267843Sdelphij>24	lelong&1024	1024	\b, Reparse point
104267843Sdelphij>24	lelong&2048	2048	\b, Compressed
105267843Sdelphij>24	lelong&4096	4096	\b, Offline
106267843Sdelphij>28	leqwdate	x	\b, ctime=%s
107267843Sdelphij>36	leqwdate	x	\b, mtime=%s
108267843Sdelphij>44	leqwdate	x	\b, atime=%s
109267843Sdelphij>52	lelong		x	\b, length=%u, window=
110267843Sdelphij>60	lelong&1	1	\bhide
111267843Sdelphij>60	lelong&2	2	\bnormal
112267843Sdelphij>60	lelong&4	4	\bshowminimized
113267843Sdelphij>60	lelong&8	8	\bshowmaximized
114267843Sdelphij>60	lelong&16	16	\bshownoactivate
115267843Sdelphij>60	lelong&32	32	\bminimize
116267843Sdelphij>60	lelong&64	64	\bshowminnoactive
117267843Sdelphij>60	lelong&128	128	\bshowna
118267843Sdelphij>60	lelong&256	256	\brestore
119267843Sdelphij>60	lelong&512	512	\bshowdefault
120267843Sdelphij#>20	lelong&1	0
121267843Sdelphij#>>20	lelong&2	2
122267843Sdelphij#>>>(72.l-64)	pstring/h	x	\b [%s]
123267843Sdelphij#>20	lelong&1	1
124267843Sdelphij#>>20	lelong&2	2
125267843Sdelphij#>>>(72.s)	leshort	x
126267843Sdelphij#>>>&75	pstring/h	x	\b [%s]
127186690Sobrien
128186690Sobrien# Summary: Outlook Personal Folders
129186690Sobrien# Created by: unknown
130186690Sobrien0	lelong		0x4E444221	Microsoft Outlook email folder
131186690Sobrien>10	leshort		0x0e		(<=2002)
132186690Sobrien>10	leshort		0x17		(>=2003)
133186690Sobrien
134186690Sobrien
135186690Sobrien# Summary: Windows help cache
136186690Sobrien# Created by: unknown
137186690Sobrien0	string		\164\146\115\122\012\000\000\000\001\000\000\000	MS Windows help cache
138186690Sobrien
139186690Sobrien
140186690Sobrien# Summary: IE cache file
141186690Sobrien# Created by: Christophe Monniez
142186690Sobrien0	string	Client\ UrlCache\ MMF 	Internet Explorer cache file
143186690Sobrien>20	string	>\0			version %s
144186690Sobrien
145186690Sobrien
146186690Sobrien# Summary: Registry files
147186690Sobrien# Created by: unknown
148186690Sobrien# Modified by (1): Joerg Jenderek
149186690Sobrien0	string		regf		MS Windows registry file, NT/2000 or above
150186690Sobrien0	string		CREG		MS Windows 95/98/ME registry file
151186690Sobrien0	string		SHCC3		MS Windows 3.1 registry file
152186690Sobrien
153186690Sobrien
154186690Sobrien# Summary: Windows Registry text
155186690Sobrien# Extension: .reg
156186690Sobrien# Submitted by: Abel Cheung <abelcheung@gmail.com>
157186690Sobrien0	string		REGEDIT4\r\n\r\n	Windows Registry text (Win95 or above)
158186690Sobrien0	string		Windows\ Registry\ Editor\ 
159186690Sobrien>&0	string		Version\ 5.00\r\n\r\n	Windows Registry text (Win2K or above)
160192348Sdelphij
161267843Sdelphij# Windows *.INF *.INI files updated by Joerg Jenderek at Apr 2013
162267843Sdelphij# emtpy ,comment , section , unicode line
163267843Sdelphij0	regex/s		\\`(\r\n|;|[[]|\xFF\xFE)			
164267843Sdelphij# left bracket in section line
165267843Sdelphij>&0	search/8192	[						
166267843Sdelphij# http://en.wikipedia.org/wiki/Autorun.inf
167267843Sdelphij# http://msdn.microsoft.com/en-us/library/windows/desktop/cc144200.aspx
168267843Sdelphij>>&0	regex/c		\^(autorun)]\r\n				
169267843Sdelphij>>>&0	ubyte		=0x5b						INItialization configuration
170267843Sdelphij!:mime application/x-wine-extension-ini
171192348Sdelphij# From: Pal Tamas <folti@balabit.hu>
172192348Sdelphij# Autorun File
173267843Sdelphij>>>&0	ubyte		!0x5b						Microsoft Windows Autorun file
174267843Sdelphij!:mime application/x-setupscript
175267843Sdelphij# http://msdn.microsoft.com/en-us/library/windows/hardware/ff549520(v=vs.85).aspx
176267843Sdelphij# version strings ASCII coded case-independent for Windows setup information script file
177267843Sdelphij>>&0	regex/c		\^(version|strings)]				Windows setup INFormation
178267843Sdelphij!:mime	application/x-setupscript
179267843Sdelphij#!:mime application/inf
180267843Sdelphij#!:mime application/x-wine-extension-inf
181267843Sdelphij>>&0	regex/c		\^(WinsockCRCList|OEMCPL)]			Windows setup INFormation
182267843Sdelphij!:mime	text/inf
183267843Sdelphij# http://www.winfaq.de/faq_html/Content/tip2500/onlinefaq.php?h=tip2653.htm
184267843Sdelphij# http://msdn.microsoft.com/en-us/library/windows/desktop/cc144102.aspx
185267843Sdelphij# .ShellClassInfo DeleteOnCopy LocalizedFileNames ASCII coded case-independent
186267843Sdelphij>>&0	regex/c	\^(\.ShellClassInfo|DeleteOnCopy|LocalizedFileNames)]	Windows desktop.ini
187267843Sdelphij!:mime application/x-wine-extension-ini
188267843Sdelphij#!:mime text/plain
189267843Sdelphij# http://support.microsoft.com/kb/84709/
190267843Sdelphij>>&0	regex/c		\^(don't\ load)]				Windows CONTROL.INI
191267843Sdelphij!:mime application/x-wine-extension-ini
192267843Sdelphij>>&0	regex/c		\^(ndishlp\\$|protman\\$|NETBEUI\\$)]		Windows PROTOCOL.INI
193267843Sdelphij!:mime application/x-wine-extension-ini
194267843Sdelphij# http://technet.microsoft.com/en-us/library/cc722567.aspx
195267843Sdelphij# http://www.winfaq.de/faq_html/Content/tip0000/onlinefaq.php?h=tip0137.htm
196267843Sdelphij>>&0	regex/c		\^(windows|Compatibility|embedding)]		Windows WIN.INI
197267843Sdelphij!:mime application/x-wine-extension-ini
198267843Sdelphij# http://en.wikipedia.org/wiki/SYSTEM.INI
199267843Sdelphij>>&0	regex/c		\^(boot|386enh|drivers)]			Windows SYSTEM.INI
200267843Sdelphij!:mime application/x-wine-extension-ini
201267843Sdelphij# http://www.mdgx.com/newtip6.htm
202267843Sdelphij>>&0	regex/c		\^(SafeList)]					Windows IOS.INI
203267843Sdelphij!:mime application/x-wine-extension-ini
204267843Sdelphij# http://en.wikipedia.org/wiki/NTLDR	Windows Boot Loader information
205267843Sdelphij>>&0	regex/c		\^(boot\x20loader)]				Windows boot.ini
206267843Sdelphij!:mime application/x-wine-extension-ini
207267843Sdelphij>>>&0	ubyte		x						
208267843Sdelphij# http://en.wikipedia.org/wiki/CONFIG.SYS
209267843Sdelphij>>&0	regex/c		\^(menu)]\r\n					MS-DOS CONFIG.SYS
210267843Sdelphij# http://support.microsoft.com/kb/118579/
211267843Sdelphij>>&0	regex/c		\^(Paths)]\r\n					MS-DOS MSDOS.SYS
212267843Sdelphij# VERS string unicoded case-independent
213267843Sdelphij>>&0	ubequad&0xFFdfFFdfFFdfFFdf	0x0056004500520053		
214267843Sdelphij# ION] string unicoded case-independent
215267843Sdelphij>>>&0	ubequad&0xFFdfFFdfFFdfFFff	0x0049004f004e005d		Windows setup INFormation 
216267843Sdelphij!:mime application/x-setupscript
217267843Sdelphij# STRI string unicoded case-independent
218267843Sdelphij>>&0	ubequad&0xFFdfFFdfFFdfFFdf	0x0053005400520049		
219267843Sdelphij# NGS] string unicoded case-independent
220267843Sdelphij>>>&0	ubequad&0xFFdfFFdfFFdfFFff	0x004e00470053005D		Windows setup INFormation 
221267843Sdelphij!:mime application/x-setupscript
222267843Sdelphij# unknown keyword after opening bracket
223267843Sdelphij>>&0	default				x				
224267843Sdelphij>>>&0	search/8192			[				
225267843Sdelphij# version Strings FileIdentification
226267843Sdelphij>>>>&0	string/c			version				Windows setup INFormation 
227267843Sdelphij!:mime application/x-setupscript
228267843Sdelphij# VERS string unicoded case-independent
229267843Sdelphij>>>>&0	ubequad&0xFFdfFFdfFFdfFFdf	0x0056004500520053		
230267843Sdelphij# ION] string unicoded case-independent
231267843Sdelphij>>>>>&0	ubequad&0xFFdfFFdfFFdfFFff	0x0049004f004e005d		Windows setup INFormation 
232267843Sdelphij!:mime application/x-setupscript
233267843Sdelphij# http://en.wikipedia.org/wiki/Initialization_file	Windows Initialization File or other
234267843Sdelphij#>>>>&0	default				x				Generic INItialization configuration
235267843Sdelphij#!:mime application/x-wine-extension-ini
236267843Sdelphij
237267843Sdelphij# Windows Precompiled INF files *.PNF added by Joerg Jenderek at Mar 2013 of _PNF_HEADER inf.h
238267843Sdelphij# http://read.pudn.com/downloads3/sourcecode/windows/248345/win2k/private/windows/setup/setupapi/inf.h__.htm
239267843Sdelphij# GRR: line below too general as it catches also PDP-11 UNIX/RT ldp
240267843Sdelphij0		leshort&0xFeFe	0x0000		
241267843Sdelphij# test for unused null bits in PNF_FLAGs
242267843Sdelphij>4	ulelong&0xFCffFe00	0x00000000	
243267843Sdelphij# only found 58h for Offset of WinDirPath immediately after _PNF_HEADER structure
244267843Sdelphij>>68		ulelong		>0x57		
245267843Sdelphij# test for zero high byte of InfValueBlockSize, followed by WinDirPath like
246267843Sdelphij# C:\WINDOWS (ASCII 0x433a5c.. , unicode 0x43003a005c..) or X:\MININT
247267843Sdelphij>>>(68.l-1)	ubelong&0xffE0C519	=0x00400018	Windows Precompiled iNF
248267843Sdelphij!:mime	application/x-pnf
249267843Sdelphij# currently only found Major Version=1 and Minor Version=1
250267843Sdelphij#>>>>0		uleshort	=0x0101		
251267843Sdelphij#>>>>>1		ubyte		x		\b, version %u
252267843Sdelphij#>>>>>0		ubyte		x		\b.%u
253267843Sdelphij>>>>0		uleshort	!0x0101		
254267843Sdelphij>>>>>1		ubyte		x		\b, version %u
255267843Sdelphij>>>>>0		ubyte		x		\b.%u
256267843Sdelphij# 1 ,2 (windows 98 SE)
257267843Sdelphij#>>>>2		uleshort	=2		\b, InfStyle %u
258267843Sdelphij>>>>2		uleshort	!2		\b, InfStyle %u
259267843Sdelphij#	PNF_FLAG_IS_UNICODE		0x00000001
260267843Sdelphij#	PNF_FLAG_HAS_STRINGS		0x00000002
261267843Sdelphij#	PNF_FLAG_SRCPATH_IS_URL		0x00000004
262267843Sdelphij#	PNF_FLAG_HAS_VOLATILE_DIRIDS	0x00000008
263267843Sdelphij#	PNF_FLAG_INF_VERIFIED		0x00000010
264267843Sdelphij#	PNF_FLAG_INF_DIGITALLY_SIGNED	0x00000020
265267843Sdelphij#	??				0x00000100
266267843Sdelphij#	??				0x01000000
267267843Sdelphij#	??				0x02000000
268267843Sdelphij>>>>4	ulelong&0x00000001	0x00000001	\b, unicoded
269267843Sdelphij>>>>4	ulelong&0x00000020	0x00000020	\b, digitally signed
270267843Sdelphij#>>>>8		ulelong		x		\b, InfSubstValueListOffset 0x%x
271267843Sdelphij# many 0, 1 lmouusb.PNF, 2 linkfx10.PNF , f webfdr16.PNF
272267843Sdelphij#>>>>12		uleshort	x		\b, InfSubstValueCount 0x%x
273267843Sdelphij# only < 9 found
274267843Sdelphij#>>>>14		uleshort	x		\b, InfVersionDatumCount 0x%x
275267843Sdelphij# only found values lower 0x0000ffff
276267843Sdelphij#>>>>16		ulelong		x		\b, InfVersionDataSize 0x%x
277267843Sdelphij# only found positive values lower 0x00ffFFff for InfVersionDataOffset
278267843Sdelphij>>>>20		ulelong		x		\b, at 0x%x
279267843Sdelphij>>>>4	ulelong&0x00000001	=0x00000001	
280267843Sdelphij# case independent: CatalogFile Class DriverVer layoutfile LayoutFile SetupClass signature Signature    
281267843Sdelphij>>>>>(20.l)	lestring16	x		"%s"
282267843Sdelphij>>>>4	ulelong&0x00000001	!0x00000001	
283267843Sdelphij>>>>>(20.l)	string		x		"%s"
284267843Sdelphij# FILETIME is number of 100-nanosecond intervals since 1 January 1601
285267843Sdelphij#>>>>24		ulequad		x		\b, InfVersionLastWriteTime %16.16llx
286267843Sdelphij# only found values lower 0x00ffFFff
287267843Sdelphij#>>>>32		ulelong		x		\b, StringTableBlockOffset 0x%x
288267843Sdelphij#>>>>36		ulelong		x		\b, StringTableBlockSize 0x%x
289267843Sdelphij#>>>>40		ulelong		x		\b, InfSectionCount 0x%x
290267843Sdelphij#>>>>44		ulelong		x		\b, InfSectionBlockOffset 0x%x
291267843Sdelphij#>>>>48		ulelong		x		\b, InfSectionBlockSize 0x%x
292267843Sdelphij#>>>>52		ulelong		x		\b, InfLineBlockOffset 0x%x
293267843Sdelphij#>>>>56		ulelong		x		\b, InfLineBlockSize 0x%x
294267843Sdelphij#>>>>60		ulelong		x		\b, InfValueBlockOffset 0x%x
295267843Sdelphij#>>>>64		ulelong		x		\b, InfValueBlockSize 0x%x
296267843Sdelphij# WinDirPathOffset
297267843Sdelphij#>>>>68		ulelong		x		\b, at 0x%x
298267843Sdelphij>>>>68		ulelong		>0x57		
299267843Sdelphij>>>>>4	ulelong&0x00000001	=0x00000001	
300267843Sdelphij>>>>>>(68.l)	ubequad		=0x43003a005c005700			
301267843Sdelphij# normally unicoded C:\Windows
302267843Sdelphij#>>>>>>>(68.l)	lestring16	x		\b, WinDirPath "%s"
303267843Sdelphij>>>>>>(68.l)	ubequad		!0x43003a005c005700			
304267843Sdelphij>>>>>>>(68.l)	lestring16	x		\b, WinDirPath "%s"
305267843Sdelphij>>>>>4	ulelong&0x00000001	!0x00000001	
306267843Sdelphij# normally ASCII C:\WINDOWS
307267843Sdelphij#>>>>>>(68.l)	string		=C:\\WINDOWS	\b, WinDirPath "%s"
308267843Sdelphij>>>>>>(68.l)	string		!C:\\WINDOWS	\b, WinDirPath "%s"
309267843Sdelphij# found OsLoaderPathOffset values often 0 , once 70h corelist.PNF, once 68h ASCII machine.PNF 
310267843Sdelphij#>>>>72		ulelong		>0		\b, at 0x%x
311267843Sdelphij>>>>72		ulelong		>0		\b,
312267843Sdelphij>>>>>4	ulelong&0x00000001	=0x00000001	
313267843Sdelphij>>>>>>(72.l)	lestring16	x		OsLoaderPath "%s"
314267843Sdelphij>>>>>4	ulelong&0x00000001	!0x00000001	
315267843Sdelphij# seldom C:\ instead empty
316267843Sdelphij>>>>>>(72.l)	string		x		OsLoaderPath "%s"
317267843Sdelphij# 1fdh
318267843Sdelphij#>>>>76		uleshort	x		\b, StringTableHashBucketCount 0x%x
319267843Sdelphij>>>>78		uleshort	!0x407		\b, LanguageId %x
320267843Sdelphij# only 407h found
321267843Sdelphij#>>>>78		uleshort	=0x407		\b, LanguageId %x
322267843Sdelphij# InfSourcePathOffset often 0
323267843Sdelphij#>>>>80		ulelong		>0		\b, at 0x%x
324267843Sdelphij>>>>80		ulelong		>0		\b,
325267843Sdelphij>>>>>4	ulelong&0x00000001	=0x00000001	
326267843Sdelphij>>>>>>(80.l)	lestring16	x		SourcePath "%s"
327267843Sdelphij>>>>>4	ulelong&0x00000001	!0x00000001	
328267843Sdelphij>>>>>>(80.l)	string		>\0		SourcePath "%s"
329267843Sdelphij# OriginalInfNameOffset often 0
330267843Sdelphij#>>>>84		ulelong		>0		\b, at 0x%x
331267843Sdelphij>>>>84		ulelong		>0		\b,
332267843Sdelphij>>>>>4	ulelong&0x00000001	=0x00000001	
333267843Sdelphij>>>>>>(84.l)	lestring16	x		InfName "%s"
334267843Sdelphij>>>>>4	ulelong&0x00000001	!0x00000001	
335267843Sdelphij>>>>>>(84.l)	string		>\0		InfName "%s"
336267843Sdelphij
337