head	1.5;
access;
symbols
	RELENG_4_11_0_RELEASE:1.4.6.1
	RELENG_4_11:1.4.6.1.0.18
	RELENG_4_11_BP:1.4.6.1
	RELENG_4_10_0_RELEASE:1.4.6.1
	RELENG_4_10:1.4.6.1.0.16
	RELENG_4_10_BP:1.4.6.1
	RELENG_4_9_0_RELEASE:1.4.6.1
	RELENG_4_9:1.4.6.1.0.14
	RELENG_4_9_BP:1.4.6.1
	RELENG_4_8_0_RELEASE:1.4.6.1
	RELENG_4_8:1.4.6.1.0.12
	RELENG_4_8_BP:1.4.6.1
	RELENG_4_7_0_RELEASE:1.4.6.1
	RELENG_4_7:1.4.6.1.0.10
	RELENG_4_7_BP:1.4.6.1
	RELENG_4_6_2_RELEASE:1.4.6.1
	RELENG_4_6_1_RELEASE:1.4.6.1
	RELENG_4_6_0_RELEASE:1.4.6.1
	RELENG_4_6:1.4.6.1.0.8
	RELENG_4_6_BP:1.4.6.1
	RELENG_4_5_0_RELEASE:1.4.6.1
	RELENG_4_5:1.4.6.1.0.6
	RELENG_4_5_BP:1.4.6.1
	RELENG_4_4_0_RELEASE:1.4.6.1
	RELENG_4_4:1.4.6.1.0.4
	RELENG_4_4_BP:1.4.6.1
	RELENG_4_3_0_RELEASE:1.4.6.1
	RELENG_4_3:1.4.6.1.0.2
	RELENG_4_3_BP:1.4.6.1
	RELENG_4_2_0_RELEASE:1.4
	RELENG_4_1_1_RELEASE:1.4
	PRE_SMPNG:1.4
	RELENG_4_1_0_RELEASE:1.4
	RELENG_3_5_0_RELEASE:1.4
	RELENG_4_0_0_RELEASE:1.4
	RELENG_4:1.4.0.6
	RELENG_4_BP:1.4
	RELENG_3_4_0_RELEASE:1.4
	RELENG_3_3_0_RELEASE:1.4
	RELENG_3_2_PAO:1.4.0.4
	RELENG_3_2_PAO_BP:1.4
	RELENG_3_2_0_RELEASE:1.4
	RELENG_3_1_0_RELEASE:1.4
	RELENG_3:1.4.0.2
	RELENG_3_BP:1.4
	RELENG_2_2_8_RELEASE:1.1.1.2
	RELENG_3_0_0_RELEASE:1.1.1.2
	RELENG_2_2_7_RELEASE:1.1.1.2
	RELENG_2_2_6_RELEASE:1.1.1.2
	RELENG_2_2_5_RELEASE:1.1.1.2
	RELENG_2_2_2_RELEASE:1.1.1.2
	RELENG_2_2_1_RELEASE:1.1.1.2
	file_3_22:1.1.1.2
	RELENG_2_2_0_RELEASE:1.1.1.2
	RELENG_2_1_7_RELEASE:1.1.1.1
	RELENG_2_1_6_1_RELEASE:1.1.1.1
	RELENG_2_1_6_RELEASE:1.1.1.1
	RELENG_2_2:1.1.1.2.0.2
	RELENG_2_2_BP:1.1.1.2
	RELENG_2_1_5_RELEASE:1.1.1.1
	file_3_19:1.1.1.2
	RELENG_2_1_0_RELEASE:1.1.1.1
	RELENG_2_1_0:1.1.1.1.0.6
	RELENG_2_1_0_BP:1.1.1.1
	RELENG_2_0_5_RELEASE:1.1.1.1
	RELENG_2_0_5:1.1.1.1.0.4
	RELENG_2_0_5_BP:1.1.1.1
	RELENG_2_0_5_ALPHA:1.1.1.1
	RELEASE_2_0:1.1.1.1
	BETA_2_0:1.1.1.1
	ALPHA_2_0:1.1.1.1.0.2
	file_3_14:1.1.1.1
	DARWIN:1.1.1;
locks; strict;
comment	@# @;


1.5
date	2000.11.05.09.06.05;	author obrien;	state dead;
branches;
next	1.4;

1.4
date	99.01.09.00.43.27;	author imp;	state Exp;
branches
	1.4.6.1;
next	1.3;

1.3
date	98.11.15.03.34.31;	author obrien;	state Exp;
branches;
next	1.2;

1.2
date	98.10.22.04.41.34;	author imp;	state Exp;
branches;
next	1.1;

1.1
date	94.09.03.19.16.26;	author csgr;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	94.09.03.19.16.27;	author csgr;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	96.01.23.12.29.07;	author mpp;	state Exp;
branches;
next	;

1.4.6.1
date	2000.11.29.19.32.50;	author obrien;	state dead;
branches;
next	;


desc
@@


1.5
log
@Switch over to using the Christos Zoulas maintained version in contrib/
This also gives use the same exact results as NetBSD, thus sharing more
code with our bretheren.
@
text
@
#------------------------------------------------------------------------------
# msdos:  file(1) magic for MS-DOS files
#

# .BAT files (Daniel Quinlan, quinlan@@yggdrasil.com)
0	string	@@echo\ off	MS-DOS batch file text

# WinNT/WinCE PE files (Warner Losh, imp@@village.org)
#
128	string	PE\000\000	MS Windows PE
>132	leshort	0x0000		Unknown CPU
>132	leshort 0x14c		Intel 386
>132	leshort 0x14d		Intel 486
>132	leshort 0x14e		Intel 586
>132	leshort 0x162		MIPS ISA I
>132	leshort 0x163		MIPS ISA II
>132	leshort 0x166		MIPS ISA III
>132	leshort 0x184		Digital Alpha
>132	leshort 0x1a2		Hitachi SH3
>132	leshort 0x1a6		Hitachi SH4
>132	leshort 0x1c0		ARM
>132	leshort 0x1f0		Power PC
>132	leshort 0x268		Motorola 68000 series
>132	leshort	0x290		PA-RISC
>148	leshort		>27
>>220	leshort		0	unknown subsystem
>>220	leshort		1	native
>>220	leshort		2	GUI
>>220	leshort		3	console
>>220	leshort		7	POSIX
>150	leshort&0x2000	=0	executable
#>>136	ledate		x	stamp %s,
>>150	leshort&0x0001	>0	not relocatable
#>>150	leshort&0x0004	=0	with line numbers,
#>>150	leshort&0x0008	=0	with local symbols,
#>>150	leshort&0x0200	=0	with debug symbols,
>>150	leshort&0x1000	>0	system file
#>>148	leshort		>0
#>>>154	byte		x	linker %d
#>>>155	byte		x	\b.%d,
#>>148	leshort		>27
#>>>192	leshort		x	requires OS %d
#>>>194	leshort		x	\b.%d,
#>>>196	leshort		x	user version %d
#>>>198	leshort		x	\b.%d,
#>>>200	leshort		x	subsystem version %d
#>>>202	leshort		x	\b.%d,
>150	leshort&0x2000	>0	DLL
#>>136	ledate		x	stamp %s,
>>150	leshort&0x0001	>0	not relocatable
#>>150	leshort&0x0004	=0	with line numbers,
#>>150	leshort&0x0008	=0	with local symbols,
#>>150	leshort&0x0200	=0	with debug symbols,
>>150	leshort&0x1000	>0	system file
#>>148	leshort		>0
#>>>154	byte		x	linker %d
#>>>155	byte		x	\b.%d,
#>>148	leshort		>27
#>>>192	leshort		x	requires OS %d
#>>>194	leshort		x	\b.%d,
#>>>196	leshort		x	user version %d
#>>>198	leshort		x	\b.%d,
#>>>200	leshort		x	subsystem version %d
#>>>202	leshort		x	\b.%d,
0	string	PE\000\000	MS Windows PE (no DOS header)
>4	leshort	0x0000		Unknown CPU
>4	leshort 0x14c		Intel 386
>4	leshort 0x14d		Intel 486
>4	leshort 0x14e		Intel 586
>4	leshort 0x162		MIPS ISA I
>4	leshort 0x163		MIPS ISA II
>4	leshort 0x166		MIPS ISA III
>4	leshort 0x184		Digital Alpha
>4	leshort 0x1a2		Hitachi SH3
>4	leshort 0x1a6		Hitachi SH4
>4	leshort 0x1c0		ARM
>4	leshort 0x1f0		Power PC
>4	leshort 0x268		Motorola 68000 series
>4	leshort	0x290		PA-RISC
# It would appear that the debugger information is in basically the same 
# format as what binutils calls PEI files.
0	string	DI\000\000	Microsoft PE Debugger Information
>4	leshort	0x0000		Unknown CPU
>4	leshort 0x14c		Intel 386
>4	leshort 0x14d		Intel 486
>4	leshort 0x14e		Intel 586
>4	leshort 0x162		MIPS ISA I
>4	leshort 0x163		MIPS ISA II
>4	leshort 0x166		MIPS ISA III
>4	leshort 0x184		Digital Alpha
>4	leshort 0x1a2		Hitachi SH3
>4	leshort 0x1a6		Hitachi SH4
>4	leshort 0x1c0		ARM
>4	leshort 0x1f0		Power PC
>4	leshort 0x268		Motorola 68000 series
>4	leshort	0x290		PA-RISC

0	leshort	0x0000		MS Windows COFF Unknown CPU
0	leshort 0x14c		MS Windows COFF Intel 386
0	leshort 0x14d		MS Windows COFF Intel 486
0	leshort 0x14e		MS Windows COFF Intel 586
0	leshort 0x162		MS Windows COFF MIPS ISA I
0	leshort 0x163		MS Windows COFF MIPS ISA II
0	leshort 0x166		MS Windows COFF MIPS ISA III
0	leshort 0x184		MS Windows COFF Digital Alpha
0	leshort 0x1a2		MS Windows COFF Hitachi SH3
0	leshort 0x1a6		MS Windows COFF Hitachi SH4
0	leshort 0x1c0		MS Windows COFF ARM
0	leshort 0x1f0		MS Windows COFF Power PC
0	leshort 0x268		MS Windows COFF Motorola 68000 series
0	leshort	0x290		MS Windows COFF PA-RISC

# .EXE formats (Greg Roelofs, newt@@uchicago.edu)
#
0	string	MZ		MS-DOS executable (EXE)
>24	string	@@		\b, OS/2 or MS Windows
>>0xe7	string	LH/2\ Self-Extract	\b, %s
>>0xe9	string	PKSFX2		\b, %s
>0x1c	string	RJSX\xff\xff	\b, ARJ SFX
>0x1c	string	diet\xf9\x9c	\b, diet compressed
>0x1e	string	Copyright\ 1989-1990\ PKWARE\ Inc.	\b, PKSFX
# JM: 0x1e "PKLITE Copr. 1990-92 PKWARE Inc. All Rights Reserved\7\0\0\0"
>0x1e	string	PKLITE\ Copr.	\b, %.6s compressed
>0x24	string	LHa's\ SFX	\b, %.15s
>0x24	string	LHA's\ SFX	\b, %.15s
>1638	string	-lh5-		\b, LHa SFX archive v2.13S
>7195	string	Rar!		\b, RAR self-extracting archive
#
# [GRR 950118:  file 3.15 has a buffer-size limitation; offsets bigger than
#   8161 bytes are ignored.  To make the following entries work, increase
#   HOWMANY in file.h to 32K at least, and maybe to 70K or more for OS/2,
#   NT/Win32 and VMS.]
# [GRR:  some company sells a self-extractor/displayer for image data(!)]
#
>11696	string	PK\003\004	\b, PKZIP SFX archive v1.1
>13297	string	PK\003\004	\b, PKZIP SFX archive v1.93a
>15588	string	PK\003\004	\b, PKZIP2 SFX archive v1.09
>15770	string	PK\003\004	\b, PKZIP SFX archive v2.04g
>28374	string	PK\003\004	\b, PKZIP2 SFX archive v1.02
#
# Info-ZIP self-extractors
#    these are the DOS versions:
>25115	string	PK\003\004	\b, Info-ZIP SFX archive v5.12
>26331	string	PK\003\004	\b, Info-ZIP SFX archive v5.12 w/decryption
#    these are the OS/2 versions (OS/2 is flagged above):
>47031	string	PK\003\004	\b, Info-ZIP SFX archive v5.12
>49845	string	PK\003\004	\b, Info-ZIP SFX archive v5.12 w/decryption
#    this is the NT/Win32 version:
>69120	string	PK\003\004	\b, Info-ZIP NT SFX archive v5.12 w/decryption
#
# TELVOX Teleinformatica CODEC self-extractor for OS/2:
>49801	string	\x79\xff\x80\xff\x76\xff	\b, CODEC archive v3.21
>>49824	leshort		=1			\b, 1 file
>>49824	leshort		>1			\b, %u files

# .COM formats (Daniel Quinlan, quinlan@@yggdrasil.com)
# Uncommenting only the first two lines will cover about 2/3 of COM files,
# but it isn't feasible to match all COM files since there must be at least
# two dozen different one-byte "magics".
#0	byte		0xe9		MS-DOS executable (COM)
#>6	string	SFX\ of\ LHarc	(%s)
#0	byte		0x8c		MS-DOS executable (COM)
# 0xeb conflicts with "sequent" magic
#0	byte		0xeb		MS-DOS executable (COM)
#0	byte		0xb8		MS-DOS executable (COM)

# miscellaneous formats
0	string		LZ		MS-DOS executable (built-in)
#0	byte		0xf0		MS-DOS program library data
#

#
# Windows NT Registry files.
#
0	string		regf		Windows NT Registry file

# Popular applications
2080	string	Microsoft\ Word\ 6.0\ Document	%s
2080	string	Documento\ Microsoft\ Word\ 6 Spanish Microsoft Word 6 document data
# Pawel Wiecek <coven@@i17linuxb.ists.pwr.wroc.pl> (for polish Word)
2112	string	MSWordDoc	Microsoft Word document data
#
0	belong	0x31be0000	Microsoft Word Document
#
0       string  PO^Q`           Microsoft Word 6.0 Document
#
2080	string	Microsoft\ Excel\ 5.0\ Worksheet	%s
#
# Pawel Wiecek <coven@@i17linuxb.ists.pwr.wroc.pl> (for polish Excel)
2114	string	Biff5		Microsoft Excel 5.0 Worksheet
#
0	belong	0x00001a00	Lotus 1-2-3
>4	belong	0x00100400	wk3 document data
>4	belong	0x02100400	wk4 document data
>4	belong	0x07800100	fm3 or fmb document data
>4	belong	0x07800000	fm3 or fmb document data
#
0	belong	0x00000200 	Lotus 1-2-3
>4	belong	0x06040600	wk1 document data
>4	belong	0x06800200	fmt document data

# WordPerfect documents - Trevor Johnson <trevor@@jpj.net>
#
1	string	WPC		WordPerfect document

# Help files
0	string	?_\3\0		MS Windows Help Data
@


1.4
log
@Add Hitachi SH-3, SH-4, ARM, PPC, 68k PA-ARCH and a few others to PE
file types.  Also add bit interpretation from NetBSD to give more
details about the file.
@
text
@@


1.4.6.1
log
@MFC: switch over to using the Christos Zoulas maintained version in contrib/
@
text
@@


1.3
log
@Additional file formats.
Obtained from:	NetBSD-current/src/usr.bin/file/magdir/msdos
@
text
@d11 70
a80 19
# XXX Missing powerpc from the WinNT world and Hitatchi SH-3 from the CE world.
128	string	PE\000\000	Microsoft Portable Executable
>132	leshort	0x0000		\b, Unknown CPU
>132	leshort 0x14c		\b, Intel 386
>132	leshort 0x14d		\b, Intel 486
>132	leshort 0x14e		\b, Intel 586
>132	leshort 0x162		\b, MIPS ISA I
>132	leshort 0x163		\b, MIPS ISA II
>132	leshort 0x166		\b, MIPS ISA III
>132	leshort 0x184		\b, Digital Alpha
0	string	PE\000\000	Microsoft Portable Executable (no dos header)
>4	leshort	0x0000		\b, Unknown CPU
>4	leshort 0x14c		\b, Intel 386
>4	leshort 0x14d		\b, Intel 486
>4	leshort 0x14e		\b, Intel 586
>4	leshort 0x162		\b, MIPS ISA I
>4	leshort 0x163		\b, MIPS ISA II
>4	leshort 0x166		\b, MIPS ISA III
>4	leshort 0x184		\b, Digital Alpha
d84 29
a112 8
>4	leshort	0x0000		\b, Unknown CPU
>4	leshort 0x14c		\b, Intel 386
>4	leshort 0x14d		\b, Intel 486
>4	leshort 0x14e		\b, Intel 586
>4	leshort 0x162		\b, MIPS ISA I
>4	leshort 0x163		\b, MIPS ISA II
>4	leshort 0x166		\b, MIPS ISA III
>4	leshort 0x184		\b, Digital Alpha
@


1.2
log
@Added Microsoft's PE formatted executables for mips, i386 and Alpha.
Also added entry for the debugger files as well.  The PE format is
used for all Win32 platforms (Win95, Win98, WinNT and WinCE), so it is
nice to be able to tell what kind of thing the foo.dll....  Don't have
any data for powerpc formats, however...
@
text
@d45 10
a54 1
>24	string	@@		\b, OS/2 or Windows
d84 1
d90 1
d101 5
d108 3
d114 2
d118 3
d122 4
a125 4
>4	belong	0x00100400	wk3 document
>4	belong	0x02100400	wk4 document
>4	belong	0x07800100	fm3 or fmb document
>4	belong	0x07800000	fm3 or fmb document
d128 9
a136 2
>4	belong	0x06040600	wk1 document
>4	belong	0x06800200	fmt document
@


1.1
log
@Initial revision
@
text
@d1 3
d5 5
a9 1
# Various MS-DOS magic numbers
d11 95
a105 5
0	string		MZ		DOS executable (EXE)
0	string		LZ		DOS executable (built-in)
0	byte		0xe9		DOS executable (COM)
0	byte		0xeb		DOS executable (COM)
0	byte		0xf0		MS-DOS program library
@


1.1.1.1
log
@Bring in file 3.14 by Ian Darwin (and Christos Zoulas)

The following files were moved to different names:
- file.man -> file.1
- magic.man -> magic.5

The following file was removed:
- Magdir/Makefile
@
text
@@


1.1.1.2
log
@Upgrade to file version 3.19.
@
text
@a0 3

#------------------------------------------------------------------------------
# msdos:  file(1) magic for MS-DOS files
d2 1
a2 5

# .BAT files (Daniel Quinlan, quinlan@@yggdrasil.com)
0	string	@@echo\ off	MS-DOS batch file text

# .EXE formats (Greg Roelofs, newt@@uchicago.edu)
d4 5
a8 63
0	string	MZ		MS-DOS executable (EXE)
>24	string	@@		\b, OS/2 or Windows
>1638	string	-lh5-		\b, LHa SFX archive v2.13S
>7195	string	Rar!		\b, RAR self-extracting archive
#
# [GRR 950118:  file 3.15 has a buffer-size limitation; offsets bigger than
#   8161 bytes are ignored.  To make the following entries work, increase
#   HOWMANY in file.h to 32K at least, and maybe to 70K or more for OS/2,
#   NT/Win32 and VMS.]
# [GRR:  some company sells a self-extractor/displayer for image data(!)]
#
>11696	string	PK\003\004	\b, PKZIP SFX archive v1.1
>13297	string	PK\003\004	\b, PKZIP SFX archive v1.93a
>15588	string	PK\003\004	\b, PKZIP2 SFX archive v1.09
>15770	string	PK\003\004	\b, PKZIP SFX archive v2.04g
>28374	string	PK\003\004	\b, PKZIP2 SFX archive v1.02
#
# Info-ZIP self-extractors
#    these are the DOS versions:
>25115	string	PK\003\004	\b, Info-ZIP SFX archive v5.12
>26331	string	PK\003\004	\b, Info-ZIP SFX archive v5.12 w/decryption
#    these are the OS/2 versions (OS/2 is flagged above):
>47031	string	PK\003\004	\b, Info-ZIP SFX archive v5.12
>49845	string	PK\003\004	\b, Info-ZIP SFX archive v5.12 w/decryption
#    this is the NT/Win32 version:
>69120	string	PK\003\004	\b, Info-ZIP NT SFX archive v5.12 w/decryption
#
# TELVOX Teleinformatica CODEC self-extractor for OS/2:
>49801	string	\x79\xff\x80\xff\x76\xff	\b, CODEC archive v3.21
>>49824	leshort		=1			\b, 1 file
>>49824	leshort		>1			\b, %u files

# .COM formats (Daniel Quinlan, quinlan@@yggdrasil.com)
# Uncommenting only the first two lines will cover about 2/3 of COM files,
# but it isn't feasible to match all COM files since there must be at least
# two dozen different one-byte "magics".
#0	byte		0xe9		MS-DOS executable (COM)
#0	byte		0x8c		MS-DOS executable (COM)
# 0xeb conflicts with "sequent" magic
#0	byte		0xeb		MS-DOS executable (COM)
#0	byte		0xb8		MS-DOS executable (COM)

# miscellaneous formats
0	string		LZ		MS-DOS executable (built-in)
#0	byte		0xf0		MS-DOS program library data
#

# Popular applications
2080	string	Microsoft\ Word\ 6.0\ Document	%s
#
0	belong	0x31be0000	Microsoft Word Document
#
2080	string	Microsoft\ Excel\ 5.0\ Worksheet	%s
#
0	belong	0x00001a00	Lotus 1-2-3
>4	belong	0x00100400	wk3 document
>4	belong	0x02100400	wk4 document
>4	belong	0x07800100	fm3 or fmb document
>4	belong	0x07800000	fm3 or fmb document
#
0	belong	0x00000200 	Lotus 1-2-3
>4	belong	0x06040600	wk1 document
>4	belong	0x06800200	fmt document
@
