xref: /freebsd/contrib/file/magic/Magdir/windows (revision f4b37ed0f8b307b1f3f0f630ca725d68f1dff30d)
1
2#------------------------------------------------------------------------------
3# $File: windows,v 1.10 2014/09/24 19:52:46 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
200	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)
320	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, %d 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
510	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
630	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>
690	lelong		0x00035f3f		MS Windows 3.x help file
70
71
72# Summary: Hyper terminal
73# Extension: .ht
74# Created by: unknown
750	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
840	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
1300	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
1370	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
1420	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
1490	string		regf		MS Windows registry file, NT/2000 or above
1500	string		CREG		MS Windows 95/98/ME registry file
1510	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>
1570	string		REGEDIT4\r\n\r\n	Windows Registry text (Win95 or above)
1580	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# empty ,comment , section
163# PR/383: remove unicode BOM because it is not portable across regex impls
1640	regex/s		\\`(\\r\\n|;|[[])
165# left bracket in section line
166>&0	search/8192	[
167# http://en.wikipedia.org/wiki/Autorun.inf
168# http://msdn.microsoft.com/en-us/library/windows/desktop/cc144200.aspx
169>>&0	regex/c		\^(autorun)]\r\n
170>>>&0	ubyte		=0x5b						INItialization configuration
171!:mime application/x-wine-extension-ini
172# From: Pal Tamas <folti@balabit.hu>
173# Autorun File
174>>>&0	ubyte		!0x5b						Microsoft Windows Autorun file
175!:mime application/x-setupscript
176# http://msdn.microsoft.com/en-us/library/windows/hardware/ff549520(v=vs.85).aspx
177# version strings ASCII coded case-independent for Windows setup information script file
178>>&0	regex/c		\^(version|strings)]				Windows setup INFormation
179!:mime	application/x-setupscript
180#!:mime application/inf
181#!:mime application/x-wine-extension-inf
182>>&0	regex/c		\^(WinsockCRCList|OEMCPL)]			Windows setup INFormation
183!:mime	text/inf
184# http://www.winfaq.de/faq_html/Content/tip2500/onlinefaq.php?h=tip2653.htm
185# http://msdn.microsoft.com/en-us/library/windows/desktop/cc144102.aspx
186# .ShellClassInfo DeleteOnCopy LocalizedFileNames ASCII coded case-independent
187>>&0	regex/c	\^(\.ShellClassInfo|DeleteOnCopy|LocalizedFileNames)]	Windows desktop.ini
188!:mime application/x-wine-extension-ini
189#!:mime text/plain
190# http://support.microsoft.com/kb/84709/
191>>&0	regex/c		\^(don't\ load)]				Windows CONTROL.INI
192!:mime application/x-wine-extension-ini
193>>&0	regex/c		\^(ndishlp\\$|protman\\$|NETBEUI\\$)]		Windows PROTOCOL.INI
194!:mime application/x-wine-extension-ini
195# http://technet.microsoft.com/en-us/library/cc722567.aspx
196# http://www.winfaq.de/faq_html/Content/tip0000/onlinefaq.php?h=tip0137.htm
197>>&0	regex/c		\^(windows|Compatibility|embedding)]		Windows WIN.INI
198!:mime application/x-wine-extension-ini
199# http://en.wikipedia.org/wiki/SYSTEM.INI
200>>&0	regex/c		\^(boot|386enh|drivers)]			Windows SYSTEM.INI
201!:mime application/x-wine-extension-ini
202# http://www.mdgx.com/newtip6.htm
203>>&0	regex/c		\^(SafeList)]					Windows IOS.INI
204!:mime application/x-wine-extension-ini
205# http://en.wikipedia.org/wiki/NTLDR	Windows Boot Loader information
206>>&0	regex/c		\^(boot\x20loader)]				Windows boot.ini
207!:mime application/x-wine-extension-ini
208>>>&0	ubyte		x
209# http://en.wikipedia.org/wiki/CONFIG.SYS
210>>&0	regex/c		\^(menu)]\r\n					MS-DOS CONFIG.SYS
211# http://support.microsoft.com/kb/118579/
212>>&0	regex/c		\^(Paths)]\r\n					MS-DOS MSDOS.SYS
213# VERS string unicoded case-independent
214>>&0	ubequad&0xFFdfFFdfFFdfFFdf	0x0056004500520053
215# ION] string unicoded case-independent
216>>>&0	ubequad&0xFFdfFFdfFFdfFFff	0x0049004f004e005d		Windows setup INFormation
217!:mime application/x-setupscript
218# STRI string unicoded case-independent
219>>&0	ubequad&0xFFdfFFdfFFdfFFdf	0x0053005400520049
220# NGS] string unicoded case-independent
221>>>&0	ubequad&0xFFdfFFdfFFdfFFff	0x004e00470053005D		Windows setup INFormation
222!:mime application/x-setupscript
223# unknown keyword after opening bracket
224>>&0	default				x
225>>>&0	search/8192			[
226# version Strings FileIdentification
227>>>>&0	string/c			version				Windows setup INFormation
228!:mime application/x-setupscript
229# VERS string unicoded case-independent
230>>>>&0	ubequad&0xFFdfFFdfFFdfFFdf	0x0056004500520053
231# ION] string unicoded case-independent
232>>>>>&0	ubequad&0xFFdfFFdfFFdfFFff	0x0049004f004e005d		Windows setup INFormation
233!:mime application/x-setupscript
234# http://en.wikipedia.org/wiki/Initialization_file	Windows Initialization File or other
235#>>>>&0	default				x				Generic INItialization configuration
236#!:mime application/x-wine-extension-ini
237
238# Windows Precompiled INF files *.PNF added by Joerg Jenderek at Mar 2013 of _PNF_HEADER inf.h
239# http://read.pudn.com/downloads3/sourcecode/windows/248345/win2k/private/windows/setup/setupapi/inf.h__.htm
240# GRR: line below too general as it catches also PDP-11 UNIX/RT ldp
2410		leshort&0xFeFe	0x0000
242# test for unused null bits in PNF_FLAGs
243>4	ulelong&0xFCffFe00	0x00000000
244# only found 58h for Offset of WinDirPath immediately after _PNF_HEADER structure
245>>68		ulelong		>0x57
246# test for zero high byte of InfValueBlockSize, followed by WinDirPath like
247# C:\WINDOWS (ASCII 0x433a5c.. , unicode 0x43003a005c..) or X:\MININT
248>>>(68.l-1)	ubelong&0xffE0C519	=0x00400018	Windows Precompiled iNF
249!:mime	application/x-pnf
250# currently only found Major Version=1 and Minor Version=1
251#>>>>0		uleshort	=0x0101
252#>>>>>1		ubyte		x		\b, version %u
253#>>>>>0		ubyte		x		\b.%u
254>>>>0		uleshort	!0x0101
255>>>>>1		ubyte		x		\b, version %u
256>>>>>0		ubyte		x		\b.%u
257# 1 ,2 (windows 98 SE)
258#>>>>2		uleshort	=2		\b, InfStyle %u
259>>>>2		uleshort	!2		\b, InfStyle %u
260#	PNF_FLAG_IS_UNICODE		0x00000001
261#	PNF_FLAG_HAS_STRINGS		0x00000002
262#	PNF_FLAG_SRCPATH_IS_URL		0x00000004
263#	PNF_FLAG_HAS_VOLATILE_DIRIDS	0x00000008
264#	PNF_FLAG_INF_VERIFIED		0x00000010
265#	PNF_FLAG_INF_DIGITALLY_SIGNED	0x00000020
266#	??				0x00000100
267#	??				0x01000000
268#	??				0x02000000
269>>>>4	ulelong&0x00000001	0x00000001	\b, unicoded
270>>>>4	ulelong&0x00000020	0x00000020	\b, digitally signed
271#>>>>8		ulelong		x		\b, InfSubstValueListOffset 0x%x
272# many 0, 1 lmouusb.PNF, 2 linkfx10.PNF , f webfdr16.PNF
273#>>>>12		uleshort	x		\b, InfSubstValueCount 0x%x
274# only < 9 found
275#>>>>14		uleshort	x		\b, InfVersionDatumCount 0x%x
276# only found values lower 0x0000ffff
277#>>>>16		ulelong		x		\b, InfVersionDataSize 0x%x
278# only found positive values lower 0x00ffFFff for InfVersionDataOffset
279>>>>20		ulelong		x		\b, at 0x%x
280>>>>4	ulelong&0x00000001	=0x00000001
281# case independent: CatalogFile Class DriverVer layoutfile LayoutFile SetupClass signature Signature
282>>>>>(20.l)	lestring16	x		"%s"
283>>>>4	ulelong&0x00000001	!0x00000001
284>>>>>(20.l)	string		x		"%s"
285# FILETIME is number of 100-nanosecond intervals since 1 January 1601
286#>>>>24		ulequad		x		\b, InfVersionLastWriteTime %16.16llx
287# only found values lower 0x00ffFFff
288#>>>>32		ulelong		x		\b, StringTableBlockOffset 0x%x
289#>>>>36		ulelong		x		\b, StringTableBlockSize 0x%x
290#>>>>40		ulelong		x		\b, InfSectionCount 0x%x
291#>>>>44		ulelong		x		\b, InfSectionBlockOffset 0x%x
292#>>>>48		ulelong		x		\b, InfSectionBlockSize 0x%x
293#>>>>52		ulelong		x		\b, InfLineBlockOffset 0x%x
294#>>>>56		ulelong		x		\b, InfLineBlockSize 0x%x
295#>>>>60		ulelong		x		\b, InfValueBlockOffset 0x%x
296#>>>>64		ulelong		x		\b, InfValueBlockSize 0x%x
297# WinDirPathOffset
298#>>>>68		ulelong		x		\b, at 0x%x
299>>>>68		ulelong		>0x57
300>>>>>4	ulelong&0x00000001	=0x00000001
301>>>>>>(68.l)	ubequad		=0x43003a005c005700
302# normally unicoded C:\Windows
303#>>>>>>>(68.l)	lestring16	x		\b, WinDirPath "%s"
304>>>>>>(68.l)	ubequad		!0x43003a005c005700
305>>>>>>>(68.l)	lestring16	x		\b, WinDirPath "%s"
306>>>>>4	ulelong&0x00000001	!0x00000001
307# normally ASCII C:\WINDOWS
308#>>>>>>(68.l)	string		=C:\\WINDOWS	\b, WinDirPath "%s"
309>>>>>>(68.l)	string		!C:\\WINDOWS	\b, WinDirPath "%s"
310# found OsLoaderPathOffset values often 0 , once 70h corelist.PNF, once 68h ASCII machine.PNF
311#>>>>72		ulelong		>0		\b, at 0x%x
312>>>>72		ulelong		>0		\b,
313>>>>>4	ulelong&0x00000001	=0x00000001
314>>>>>>(72.l)	lestring16	x		OsLoaderPath "%s"
315>>>>>4	ulelong&0x00000001	!0x00000001
316# seldom C:\ instead empty
317>>>>>>(72.l)	string		x		OsLoaderPath "%s"
318# 1fdh
319#>>>>76		uleshort	x		\b, StringTableHashBucketCount 0x%x
320>>>>78		uleshort	!0x407		\b, LanguageId %x
321# only 407h found
322#>>>>78		uleshort	=0x407		\b, LanguageId %x
323# InfSourcePathOffset often 0
324#>>>>80		ulelong		>0		\b, at 0x%x
325>>>>80		ulelong		>0		\b,
326>>>>>4	ulelong&0x00000001	=0x00000001
327>>>>>>(80.l)	lestring16	x		SourcePath "%s"
328>>>>>4	ulelong&0x00000001	!0x00000001
329>>>>>>(80.l)	string		>\0		SourcePath "%s"
330# OriginalInfNameOffset often 0
331#>>>>84		ulelong		>0		\b, at 0x%x
332>>>>84		ulelong		>0		\b,
333>>>>>4	ulelong&0x00000001	=0x00000001
334>>>>>>(84.l)	lestring16	x		InfName "%s"
335>>>>>4	ulelong&0x00000001	!0x00000001
336>>>>>>(84.l)	string		>\0		InfName "%s"
337
338