# Magic file for Efsd.
#
# This is a heavily tweaked version of the magic file that came with my
# Debian 2.2. I basically threw out anything I have never heard of or
# don't consider important enough, new things are at the end of the file.
# This file is used to generate Efsd's magic database, magic.db.
#
# The only thing I really changed is a the way in which you specify
# that any magic value should be accepted (and used in a formatting
# specifier) -- just use a dot (".") as in:
#
# >9      string          .               %.1s.x
#
# This accepts any one-character string at offset 9 (".1" precision, see
# man printf) and outputs it as, e.g., "1.x" or "2.x" etc. It's not better
# as the original, but more straightforward.
#
# CAUTION -- you need to make sure you don't pass a single "-" character
# as data, otherwise edb_ed will block and wait for input from stdin.
#
#                                                                -- cK.


#------------------------------------------------------------------------------
# alpha architecture description
#
0	leshort		0603		""
>22	leshort&030000	!020000		executable/alpha-coff
>22	leshort&030000	020000		binary/alpha-coff/shared-lib
>24	leshort		0407		binary/alpha-coff

# Basic recognition of Digital UNIX core dumps - Mike Bremford <mike@opac.bl.uk>
#
0	string		Core\001	object/core/alpha-COFF
0	string		Core\002	object/core/alpha-COFF

#------------------------------------------------------------------------------
# amigaos:  file(1) magic for AmigaOS binary formats:
#
# From ignatios@cs.uni-bonn.de (Ignatios Souvatzis)
# Some formats are still missing: AmigaOS special IFF's, e.g.: FORM....CTLG
# (the others should be seperate, anyway)
#
0	belong		0x000003f3	executable/AmigaOS
0	belong		0x000003e7	binary/AmigaOS

#------------------------------------------------------------------------------
# animation:  file(1) magic for animation/movie formats
#
# animation formats
# MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
# FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)

# MPEG animation format
0	belong		0x000001b3	video/mpeg
0	belong		0x000001ba	video/mpeg
0	beshort		&0xffe0		audio
>1	byte&0x08	=0x08		""
# Layer 3
>>1	byte		&0x02		mp3
>>>2	byte&0xf0	=0x10		32-KBit-s
>>>2	byte&0xf0	=0x20		40-KBit-s
>>>2	byte&0xf0	=0x30		48-KBit-s
>>>2	byte&0xf0	=0x40		56-KBit-s
>>>2	byte&0xf0	=0x50		64-KBit-s
>>>2	byte&0xf0	=0x60		80-KBit-s
>>>2	byte&0xf0	=0x70		96-KBit-s
>>>2	byte&0xf0	=0x80		112-KBit-s
>>>2	byte&0xf0	=0x90		128-KBit-s
>>>2	byte&0xf0	=0xA0		160-KBit-s
>>>2	byte&0xf0	=0xB0		192-KBit-s
>>>2	byte&0xf0	=0xC0		224-KBit-s
>>>2	byte&0xf0	=0xD0		256-KBit-s
>>>2	byte&0xf0	=0xE0		320-KBit-s
# Layer 2
>>1	byte		&0x04		mp2
>>>2	byte&0xf0	=0x10		32-KBit-s
>>>2	byte&0xf0	=0x20		48-KBit-s
>>>2	byte&0xf0	=0x30		56-KBit-s
>>>2	byte&0xf0	=0x40		64-KBit-s
>>>2	byte&0xf0	=0x50		80-KBit-s
>>>2	byte&0xf0	=0x60		96-KBit-s
>>>2	byte&0xf0	=0x70		112-KBit-s
>>>2	byte&0xf0	=0x80		128-KBit-s
>>>2	byte&0xf0	=0x90		160-KBit-s
>>>2	byte&0xf0	=0xA0		192-KBit-s
>>>2	byte&0xf0	=0xB0		224-KBit-s
>>>2	byte&0xf0	=0xC0		256-KBit-s
>>>2	byte&0xf0	=0xD0		320-KBit-s
>>>2	byte&0xf0	=0xE0		384-KBit-s
# freq
>>2	byte&0x0C	=0x00		44.1-kHz
>>2	byte&0x0C	=0x04		48-kHz
>>2	byte&0x0C	=0x08		32-kHz
# MPEG 2.5
>1	byte&0x18	=0x00		""
# Layer 3
>>1	byte		&0x02		mp3
# Layer 2
>>1	byte		&0x04		mp2
# MPEG 2.0
>1	byte&0x18	=0x10		""
## Layer 3
>>1	byte		&0x02		mp3
# Layer 2
>>1	byte		&0x04		mp2
>>2	byte&0xf0	=0x10		  8-kBit-s
>>2	byte&0xf0	=0x20		  16-kBit-s
>>2	byte&0xf0	=0x30		  24-kBit-s
>>2	byte&0xf0	=0x40		  32-kBit-s
>>2	byte&0xf0	=0x50		  40-kBit-s
>>2	byte&0xf0	=0x60		  48-kBit-s
>>2	byte&0xf0	=0x70		  56-kBit-s
>>2	byte&0xf0	=0x80		  64-kBit-s
>>2	byte&0xf0	=0x90		  80-kBit-s
>>2	byte&0xf0	=0xA0		  96-kBit-s
>>2	byte&0xf0	=0xB0		 112-kBit-s
>>2	byte&0xf0	=0xC0		 128-kBit-s
>>2	byte&0xf0	=0xD0		 144-kBit-s
>>2	byte&0xf0	=0xE0		 160-kBit-s
# freq
>>2	byte&0x0C	=0x00		 22.05-kHz
>>2	byte&0x0C	=0x04		 24-kHz
>>2	byte&0x0C	=0x08		 16-kHz
# misc
>3	byte&0xC0	=0x00		 stereo
>3	byte&0xC0	=0x40		 jstereo
>3	byte&0xC0	=0x80		 dual-ch
>3	byte&0xC0	=0xC0		 mono

# FLI animation format
4	leshort		0xAF11			video/fli
# FLC animation format
4	leshort		0xAF12			video/flc

# SGI and Apple formats
0	string		MOVI		video/sgi-movie-file
4	string		moov		video/quicktime
4	string		mdat		video/quicktime

# Vivo video (Wolfram Kleff)
3	string		\x0D\x0AVersion:Vivo	video/vivo

#------------------------------------------------------------------------------
# applix:  file(1) magic for Applixware
# From: Peter Soos <sp@osb.hu>
#
0	string		*BEGIN		        Applixware
>7	string		WORDS			Words
>7	string		GRAPHICS		Graphic
>7	string		RASTER			Bitmap
>7	string		SPREADSHEETS		Spreadsheet
>7	string		MACRO			Macro
>7	string		BUILDER			Builder-Object

#------------------------------------------------------------------------------
# archive:  file(1) magic for archive formats (see also "msdos" for self-
#           extracting compressed archives)
#
# cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
# pre-POSIX "tar" archives are handled in the C code.

# POSIX tar archives
257	string		ustar\0		archive/posix-tar
257	string		ustar\040\040\0	archive/GNU-tar

# cpio archives
#
# Yes, the top two "cpio archive" formats *are* supposed to just be "short".
# The idea is to indicate archives produced on machines with the same
# byte order as the machine running "file" with "cpio archive", and
# to indicate archives produced on machines with the opposite byte order
# from the machine running "file" with "byte-swapped cpio archive".
#
# The SVR4 "cpio(4)" hints that there are additional formats, but they
# are defined as "short"s; I think all the new formats are
# character-header formats and thus are strings, not numbers.
0	short		070707		archive/cpio
0	short		0143561		archive/cpio/byteswapped
0	string		070707		archive/cpio/ascii/pre-SVR4
0	string		070701		archive/cpio/ascii/SVR4
0	string		070702		archive/cpio/ascii/SVR4-CRC

# Debian package (needs to go before regular portable archives)
#
0	string		!<arch>\ndebian archive/debian
>8	string		debian-split	multipart
>8	string		debian-binary	binary

# other archives
0	long		0177555		archive/ancient
0	short		0177555		archive/old-PDP-11
0	long		0177545		archive/old
0	short		0177545		archive/old-PDP-11
0	long		0100554		archive/apl-workspace
0	string		=<ar>		archive

# MIPS archive (needs to go before regular portable archives)
#
0	string	!<arch>\n__________E	archive/mips
>20	string	U			Ucode
>21	string	L			MIPSEL
>21	string	B			MIPSEB
>19	string	L			EL-hashtable
>19	string	B			EB-hashtable
>22	string	X			outdated

0	string		-h-		archive/Software Tools

0	string		!<arch>		archive/ar-current
>8	string		__.SYMDEF	random-lib
>0	belong		=65538		pre-SR9-5
>0	belong		=65539		post-SR9-5
>0	beshort		2		object-archive
>0	beshort		3		shared-library-module
>0	beshort		4		debug-module
>0	beshort		5		absolute-code
0	string		\<ar>		archive/SVR1-ar
0	string		=<ar>		archive


# ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
#
# The first byte is the magic (0x1a), byte 2 is the compression type for
# the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
# filename of the first file (null terminated).  Since some types collide
# we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
# 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%).  0x01 collides with terminfo.
0	lelong&0x8080ffff	0x0000081a	archive/arc/dynamic-LZW
0	lelong&0x8080ffff	0x0000091a	archive/arc/squashed
0	lelong&0x8080ffff	0x0000021a	archive/arc/uncompressed
0	lelong&0x8080ffff	0x0000031a	archive/arc/packed
0	lelong&0x8080ffff	0x0000041a	archive/arc/squeezed
0	lelong&0x8080ffff	0x0000061a	archive/arc/crunched

# ARJ archiver (jason@jarthur.Claremont.EDU)
0	leshort		0xea60		archive/arj-data
>8	byte		&0x04		multi-volume
>8	byte		&0x10		slash-switched
>8	byte		&0x20		backup
>7	byte		0		MS-DOS
>7	byte		1		PRIMOS
>7	byte		2		Unix
>7	byte		3		Amiga
>7	byte		4		Macintosh
>7	byte		5		OS-2
>7	byte		6		Apple-II-GS
>7	byte		7		Atari-ST
>7	byte		8		NeXT
>7	byte		9		VAX-VMS

# HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
0	string		HPAK		archive/hpack

# JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
0	string		\351,\001JAM\		archive/JAM

# LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
2	string		-lh0-		archive/LHa-1-lh0
2	string		-lh1-		archive/LHa-1-lh1
2	string		-lz4-		archive/LHa-1-lh4
2	string		-lz5-		archive/LHa-1-lh5
2	string		-lzs-		archive/LHa-2-lzs
2	string		-lh\40-		archive/LHa-2-lh 
2	string		-lhd-		archive/LHa-2-lhd
2	string		-lh2-		archive/LHa-2-lh2
2	string		-lh3-		archive/LHa-2-lh3
2	string		-lh4-		archive/LHa-2-lh4
2	string		-lh5-		archive/LHa-2-lh5

# RAR archiver (Greg Roelofs, newt@uchicago.edu)
0	string		Rar!		archive/rar

# SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
0	string		SQSH		archive/acorn-riscos-squished

# UC2 archiver (Greg Roelofs, newt@uchicago.edu)
# I can't figure out the self-extracting form of these buggers...
0	string		UC2\x1a		archive/UC2

# ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
0	string		PK\003\004	archive/Zip
>4	byte		0x09		v0.9
>4	byte		0x0a		v1.0
>4	byte		0x0b		v1.1
>4	byte		0x14		v2.0

# Zoo archiver
20	lelong		0xfdc4a7dc	archive/Zoo
>4	byte		>48		v%c

# Shell archives
10	string		#\ This\ is\ a\ shell\ archive	archive/shell-text


#------------------------------------------------------------------------------
# audio:  file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
# and others
#

# Sun/NeXT audio data
0	string		.snd		audio/sun-next
>12	belong		1		8-bit-ISDN-u-law
>12	belong		2		8-bit-linear-PCM
>12	belong		3		16-bit-linear-PCM
>12	belong		4		24-bit-linear-PCM
>12	belong		5		32-bit-linear-PCM
>12	belong		6		32-bit-IEEE-floating-point
>12	belong		7		64-bit-IEEE-floating-point
>12	belong		23		8-bit-ISDN-u-law compressed
>12	belong		24		compressed-8-bit
>12	belong		25		compressed-3-bit
>12	belong		26		compressed-5-bit
>12	belong		27		8-bit-A-law
>20	belong		1		mono
>20	belong		2		stereo
>20	belong		4		quad
>16	belong		>0		%d-Hz

# DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
# that uses little-endian encoding and has a different magic number
0	lelong		0x0064732E	audio/dec
>12	lelong		1		8-bit-ISDN-u-law
>12	lelong		2		8-bit-linear-PCM
>12	lelong		3		16-bit-linear-PCM
>12	lelong		4		24-bit-linear-PCM
>12	lelong		5		32-bit-linear-PCM
>12	lelong		6		32-bit-IEEE-floating-point
>12	lelong		7		64-bit-IEEE-floating-point
>12	lelong		23		8-bit-ISDN-u-law-compressed
>20	lelong		1		mono
>20	lelong		2		stereo
>20	lelong		4		quad
>16	lelong		>0		%d-Hz

# Creative Labs AUDIO stuff
0	string	MThd			audio/midi
0	string	CTMF			Creative-Music-data
0	string	SBI			SoundBlaster-instrument-data
0	string	Creative\ Voice\ File	Creative-Labs-voice-data

# first entry is also the string "NTRK"
0	belong		0x4e54524b	audio/MultiTrack

# Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
# [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
0	string		EMOD		audio/mod-extended
>83	byte		0		module
>83	byte		1		song

# Real Audio (Magic .ra\0375)
0	belong		0x2e7261fd	audio/RealAudio
0	string		.RMF		audio/RealMedia

# MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
# Oct 31, 1995
0	string		MTM		audio/MultiTracker-Module
0	string		FAR		audio/Module
0	string		MAS_U		audio/ULTimate-Module
0x2c	string		SCRM		audio/ScreamTracker-III-Module
0	string		Extended Module	audio/Extended-Module

# sidfiles <pooka@iki.fi>
0	string		SIDPLAY\ INFOFILE	audio/Sidplay-info
0	string		PSID			audio/PlaySID
>14	beshort		=1			single-song
>14	beshort		>1			multiple-songs

# IRCAM <mpruett@sgi.com>
0	belong		0x64a30400		audio/ircam/next
0	belong		0x64a30200		audio/ircam/sun
0	belong		0x64a30300		audio/ircam/mips
0	belong		0x0001a364		audio/ircam

# NIST SPHERE <mpruett@sgi.com>
0	string		NIST_1A\n\ \ \ 1024\n	audio/NIST-SPHERE

# Sample Vision <mpruett@sgi.com>
0	string		SOUND\ SAMPLE\ DATA\ 	audio/Sample-Vision

# Audio Visual Research <mpruett@sgi.com>
0	string		2BIT			audio/Audio-Visual-Research

# From Felix von Leitner <leitner@fefe.de>
0	string		OggS	                audio/Ogg-bitstream

# From Matt Zimmerman <mdz@debian.org>
0	string		fLaC	                audio/FLAC-compressed

#------------------------------------------------------------------------------
#
# Blender file magic
#
0	string	BLENDER_	document/blender
>9	byte	.		%c.x/32-bit
>8	string	v		little-endian
>8	string	V		big-endian
0	string	BLENDER-	document/blender
>9	byte	.		%c.x/64-bit
>8	string	v		little-endian
>8	string	V		big-endian


#------------------------------------------------------------------------------
# bsdi:  file(1) magic for BSD/OS (from BSDI) objects
#

0	lelong		0314		executable/bsd-os/386
>16	lelong		>0		unstripped
>32	byte		0x6a		using-shared-libs

0	lelong		0407		executable/bsd-os/386
>16	lelong		>0		unstripped
>32	byte		0x6a		using-shared-libs

0	lelong		0410		executable/bsd-os/386
>16	lelong		>0		unstripped
>32	byte		0x6a		using-shared-libs

0	lelong		0413		executable/bsd-os/386
>16	lelong		>0		unstripped
>32	byte		0x6a		using-shared-libs

# same as in SunOS 4.x, except for static shared libraries

0	belong&077777777	0600413		executable/bsd-os/sparc
>16	belong		>0			unstripped
>36	belong		0xb4100001		using-shared-libs

0	belong&077777777	0600410		executable/bsd-os/sparc
>16	belong		>0			unstripped
>36	belong		0xb4100001		using-shared-libs

0	belong&077777777	0600407		executable/bsd-os/sparc
>16	belong		>0			unstripped
>36	belong		0xb4100001		using-shared-libs

#------------------------------------------------------------------------------
# c-lang:  file(1) magic for C programs (or REXX)
#

# this first will upset you if you're a PL/1 shop...
# in which case rm it; ascmagic will catch real C programs
#0	string		/*		text/c
#0	string		//		text/c++

#------------------------------------------------------------------------------
# cisco:  file(1) magic for cisco Systems routers
#
# Most cisco file-formats are covered by the generic elf code
#
# Microcode files are non-ELF, 0x8501 conflicts with NetBSD/alpha.
0	belong&0xffffff00	0x85011400  binary/cisco-IOS-microcode
0	belong&0xffffff00	0x8501cb00  binary/cisco-IOS-microcode/experimental

#------------------------------------------------------------------------------
# commands:  file(1) magic for various shells and interpreters
#
0	string		#!/bin/sh		script/sh
0	string		#!\ /bin/sh		script/sh
0	string		#!\	/bin/sh		script/sh
0	string		#!/bin/csh		script/csh
0	string		#!\ /bin/csh		script/csh
0	string		#!\	/bin/csh	script/csh
# korn shell magic, sent by George Wu, gwu@clyde.att.com
0	string		#!/bin/ksh		script/ksh
0	string		#!\ /bin/ksh		script/ksh
0	string		#!\	/bin/ksh	script/ksh
0	string	 	#!/bin/tcsh		script/tcsh
0	string	 	#!\ /bin/tcsh		script/tcsh
0	string	 	#!\	/bin/tcsh	script/tcsh
0	string		#!/usr/local/tcsh	script/tcsh
0	string	 	#!\ /usr/local/tcsh	script/tcsh
0	string		#!/usr/local/bin/tcsh	script/tcsh
0	string		#!\ /usr/local/bin/tcsh	        script/tcsh
0	string		#!\	/usr/local/bin/tcsh	script/tcsh
#
# zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
0	string		#!/usr/local/bin/zsh	script/zsh
0	string		#!\ /usr/local/bin/zsh	script/zsh
0	string		#!\	/usr/local/bin/zsh	script/zsh
0	string		#!/usr/local/bin/ash	script/ash
0	string		#!\ /usr/local/bin/ash	script/ash
0	string		#!\	/usr/local/bin/ash	script/ash
0	string		#!/usr/local/bin/ae	script/ae
0	string		#!\ /usr/local/bin/ae	script/ae
0	string		#!\	/usr/local/bin/ae	script/ae
0	string		#!/bin/nawk		script/nawk
0	string		#!\ /bin/nawk		script/nawk
0	string		#!\	/bin/nawk		script/nawk
0	string		#!/usr/bin/nawk		script/nawk
0	string		#!\ /usr/bin/nawk	script/nawk
0	string		#!\	/usr/bin/nawk	script/nawk
0	string		#!/usr/local/bin/nawk	script/nawk
0	string		#!\ /usr/local/bin/nawk	script/nawk
0	string		#!\	/usr/local/bin/nawk	script/nawk
0	string		#!/bin/gawk		script/gawk
0	string		#!\ /bin/gawk		script/gawk
0	string		#!\	/bin/gawk	script/gawk
0	string		#!/usr/bin/gawk		script/gawk
0	string		#!\ /usr/bin/gawk	script/gawk
0	string		#!\	/usr/bin/gawk	script/gawk
0	string		#!/usr/local/bin/gawk	script/gawk
0	string		#!\ /usr/local/bin/gawk	script/gawk
0	string		#!\	/usr/local/bin/gawk	script/gawk
#
0	string		#!/bin/awk		script/awk
0	string		#!\ /bin/awk		script/awk
0	string		#!\	/bin/awk	script/awk
0	string		#!/usr/bin/awk		script/awk
0	string		#!\ /usr/bin/awk	script/awk
0	string		#!\	/usr/bin/awk	script/awk
0	string		#!/usr/local/bin/awk		script/awk
0	string		#!\ /usr/local/bin/awk	script/awk
0	string		#!\	/usr/local/bin/awk	script/awk
0	string		BEGIN			script/awk

# For Larry Wall's perl language.  The ``eval'' line recognizes an
# outrageously clever hack for USG systems.
#				Keith Waclena <keith@cerberus.uchicago.edu>
0	string		#!/bin/perl			script/perl
0	string		#!\ /bin/perl			script/perl
0	string		#!\	/bin/perl		script/perl
0	string		eval\ "exec\ /bin/perl		script/perl
0	string		#!/usr/bin/perl			script/perl
0	string		#!\ /usr/bin/perl		script/perl
0	string		#!\	/usr/bin/perl		script/perl
0	string		eval\ "exec\ /usr/bin/perl	script/perl
0	string		#!/usr/local/bin/perl		script/perl
0	string		#!\ /usr/local/bin/perl		script/perl
0	string		#!\	/usr/local/bin/perl	script/perl
0	string		eval\ "exec\ /usr/local/bin/perl	script/perl

# AT&T Bell Labs' Plan 9 shell
0	string		#!/bin/rc	script/plan9
0	string		#!\ /bin/rc	script/plan9
0	string		#!\	/bin/rc	script/plan9

# bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
0	string		#!/bin/bash	script/bash
0	string		#!\ /bin/bash	script/bash
0	string		#!\	/bin/bash	script/bash
0	string		#!/usr/local/bin/bash	script/bash
0	string		#!\ /usr/local/bin/bash	script/bash
0	string		#!\	/usr/local/bin/bash	script/bash

#------------------------------------------------------------------------------
# compress:  file(1) magic for pure-compression formats (no archives)
#
# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
#
# Formats for various forms of compressed data
# Formats for "compress" proper have been moved into "compress.c",
# because it tries to uncompress it to figure out what's inside.

# standard unix compress
0	string		\037\235	archive/compressed
>2	byte&0x80	>0		block

# gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
0       string          \037\213        archive/gnu-zip
>3	byte		&0x01		ASCII
>3	byte		&0x02		continuation
>3	byte		&0x04		extra-field
>3	byte		&0x08		original-filename
>3	byte		&0x10		comment
>3	byte		&0x20		encrypted
>8	byte		2		max-compression
>8	byte		4		max-speed
>9	byte		=0x00		MS-DOS
>9	byte		=0x01		Amiga
>9	byte		=0x02		VMS
>9	byte		=0x03		Unix
>9	byte		=0x05		Atari
>9	byte		=0x06		OS-2
>9	byte		=0x07		MacOS
>9	byte		=0x0A		Tops-20
>9	byte		=0x0B		Win-32

# bzip2
0	string		BZh		archive/bzip2

# squeeze and crunch
# Michael Haardt <michael@cantor.informatik.rwth-aachen.de>
0	beshort		0x76FF		archive/squeezed
0	beshort		0x76FE		archive/crunched
0	beshort		0x76FD		archive/LZH

# Freeze
0	string		\037\237	archive/freeze-2.1
0	string		\037\236	archive/freeze-1.0

# SCO compress -H (LZH)
0	string		\037\240	archive/compress-SCO

# bzip	a block-sorting file compressor
#	by Julian Seward <sewardj@cs.man.ac.uk> and others
#
0	string		BZ		archive/bzip
>3	string		=1		100k-blocks
>3	string		=2		200k-blocks
>3	string		=3		300k-blocks
>3	string		=4		400k-blocks
>3	string		=5		500k-blocks
>3	string		=6		600k-blocks
>3	string		=7		700k-blocks
>3	string		=8		800k-blocks
>3	string		=9		900k-blocks

# lzop from <markus.oberhumer@jk.uni-linz.ac.at>
0	string		\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a	archive/lzop

# AFX compressed files (Wolfram Kleff)
2	string		-afx-		archive/afx

#------------------------------------------------------------------------------
# Console game magic
# Toby Deshane <hac@shoelace.digivill.net>
#    ines:  file(1) magic for Marat's iNES Nintendo Entertainment System
#           ROM dump format
0 string NES\032			binary/iNES-ROM

#------------------------------------------------------------------------------
# gameboy:  file(1) magic for the Nintendo (Color) Gameboy raw ROM format
#
0x104 belong 0xCEED6666			binary/Gameboy-ROM

#------------------------------------------------------------------------------
# genesis:  file(1) magic for the Sega MegaDrive/Genesis raw ROM format
#
0x100 string SEGA			binary/Sega-MegaDrive-rom
0x280 string EAMG                       binary/sega-SuperMagicDrive-ROM
0x280 string EAGN			binary/sega-SuperMagicDrive-ROM

#------------------------------------------------------------------------------
# dreamcast:  file(1) uncertain magic for the Sega Dreamcast VMU image format
#
0 belong 0x21068028			binary/Sega-Dreamcast-rom
0 string LCDi				binary/sega-DreamAnimator

#------------------------------------------------------------------------------
# v64: file(1) uncertain magic for the V64 format N64 ROM dumps
#
0 belong 0x37804012			binary/Nintendo-64-rom

#-----------------------------------------------------------------------------
# Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) :
0	string	PS-X\ EXE	        binary/Sony-Playstation

#------------------------------------------------------------------------------
# database:  file(1) magic for various databases
#
# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
#
#
# GDBM magic numbers
#  Will be maintained as part of the GDBM distribution in the future.
#  <downsj@teeny.org>
0	belong	0x13579ace	db/GNU-dbm/1.x/big-endian
0	lelong	0x13579ace	db/GNU-dbm/1.x/little-endian
0	string	GDBM		db/GNU-dbm/2.x
#
0	belong	0x061561	db/Berkeley DB
>4	belong	>2		1.86
>4	belong	<3		1.85
>8	belong	4321		Hash-Big-Endian
>8	belong	1234		Hash-Little-Endian
#
0	belong	0x053162	db/Berkeley-DB/1.85/Btree/Big-Endian
0	lelong	0x053162	db/Berkeley-DB/1.85/Btree/Little-Endian
#
12	belong	0x061561	db/Berkeley-DB/2.X/Hash/Big-Endian
#
# DB2.X formats from Khimenko Victor <khim@sch57.msk.ru>
#
12	lelong	0x061561	db/Berkeley-DB/2.X/Hash/Little-Endian
12	belong	0x053162	db/Berkeley-DB/2.X/Btree/Big-Endian
12	lelong	0x053162	db/Berkeley-DB/2.X/Btree/Little-Endian

#------------------------------------------------------------------------------
# diff:  file(1) magic for diff(1) output
#
0	string		Index:				text/diff
0	string		diff\				text/diff
0	string		***\				text/diff
0	string		---\				text/diff
0	string		Only\ in\			text/diff
0	string		Common\ subdirectories:\ 	text/diff

# xdelta is like diff(1) for binary files (works for text, too).
# Available from: ftp://ftp.xcf.berkeley.edu/pub/xdelta/
0       string          %XDZ            text/xdelta
>4      string          .               v%.3s

#------------------------------------------------------------------------------
# elf:  file(1) magic for ELF executables
#
# We have to check the byte order flag to see what byte order all the
# other stuff in the header is in.
#
# MIPS R3000 may also be for MIPS R2000.
# What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
#
# updated by Daniel Quinlan (quinlan@yggdrasil.com)
0	string		\177ELF		""
>5	byte		1               ""
>>16	leshort		0		binary/elf/lsb
>>16	leshort		1		binary/elf/lsb/relocatable
>>16	leshort		2		executable/elf/lsb
>>16	leshort		3		binary/elf/lsb/shared-object
>>16	leshort		4		binary/core/elf/lsb
>>16	leshort		&0xff00		processor-specific
>>18	leshort		0		no-machine
>>18	leshort		1		AT+T-WE32100-invalid-byte-order
>>18	leshort		2		SPARC-invalid-byte-order
>>18	leshort		3		Intel-80386
>>18	leshort		4		Motorola-68000-invalid-byte-order
>>18	leshort		5		Motorola-88000-invalid-byte-order
>>18	leshort		6		Intel-80486
>>18	leshort		7		Intel-80860
>>18	leshort		8		MIPS-R3000BE-invalid-byte-order
>>18	leshort		9		Amdahl-invalid-byte-order
>>18	leshort		10		MIPS-R3000LE
>>18	leshort		11		RS6000-invalid-byte-order
>>18	leshort		15		PA-RISC-invalid-byte-order
>>18	leshort		16		nCUBE
>>18	leshort		17		Fujitsu-VPP500
>>18	leshort		18		SPARC32PLUS
>>18	leshort		20		PowerPC
>>18	leshort		36		NEC-V800
>>18	leshort		37		Fujitsu-FR20
>>18	leshort		38		TRW-RH-32
>>18	leshort		39		Motorola-RCE
>>18	leshort		40		ARM
>>18	leshort		41		Alpha
>>18	leshort		42		Hitachi-SH
>>18	leshort		43		SPARC-V9-invalid-byte-order
>>18	leshort		44		Siemens-Tricore-Embedded-Processor
>>18	leshort		45		Argonaut-RISC-Core
>>18	leshort		46		Hitachi-H8-300
>>18	leshort		47		Hitachi-H8-300H
>>18	leshort		48		Hitachi-H8S
>>18	leshort		49		Hitachi-H8-500
>>18	leshort		50		IA-64
>>18	leshort		51		Stanford-MIPS-X
>>18	leshort		52		Motorola-Coldfire
>>18	leshort		53		Motorola-M68HC12
>>18	leshort		0x9026		Alpha
>>20	lelong		0		invalid
>>36	lelong		1		MathCoPro-Required
>5	byte		2		""
# only for MIPS R3000_BE
>>18    beshort		8		""
# only for 32-bit
>>>4	byte		1		""
>>>>36  belong&0xf0000000       0x00000000      mips-1
>>>>36  belong&0xf0000000       0x10000000      mips-2
>>>>36  belong&0xf0000000       0x20000000      mips-3
>>>>36  belong&0xf0000000       0x30000000      mips-4
>>>>36  belong&0xf0000000       0x40000000      mips-5
>>>>36  belong&0xf0000000       0x50000000      mips-6
# only for 64-bit
>>>4	byte		2		""
>>>>48  belong&0xf0000000       0x00000000      mips-1
>>>>48  belong&0xf0000000       0x10000000      mips-2
>>>>48  belong&0xf0000000       0x20000000      mips-3
>>>>48  belong&0xf0000000       0x30000000      mips-4
>>>>48  belong&0xf0000000       0x40000000      mips-5
>>>>48  belong&0xf0000000       0x50000000      mips-6
>>16	beshort		0		binary/elf/msb
>>16	beshort		1		binary/elf/msb/relocatable,
>>16	beshort		2		executable/elf/msb
>>16	beshort		3		binary/shared object/msb
>>16	beshort		4		binary/core/elf/msb
>>16	beshort		&0xff00		processor-specific,
>>18	beshort		0		no-machine,
>>18	beshort		1		AT+T-WE32100
>>18	beshort		2		SPARC
>>18	beshort		3		Intel-80386-invalid-byte-order
>>18	beshort		4		Motorola-68000
>>18	beshort		5		Motorola-88000
>>18	beshort		6		Intel-80486-invalid-byte-order
>>18	beshort		7		Intel-80860
>>18	beshort		8		MIPS-R3000BE
>>18	beshort		9		Amdahl
>>18	beshort		10		MIPS-R3000LE-invalid-byte-order
>>18	beshort		11		RS6000
>>18	beshort		15		PA-RISC
>>18	beshort		16		nCUBE
>>18	beshort		17		Fujitsu-VPP500
>>18	beshort		18		SPARC32PLUS
>>>36	belong&0xffff00	&0x000100	V8+-Required
>>>36	belong&0xffff00	&0x000200	Sun-UltraSPARC1-Extensions-Required
>>>36	belong&0xffff00	&0x000400	HaL-R1-Extensions-Required
>>>36	belong&0xffff00	&0x000800	Sun-UltraSPARC3-Extensions-Required
>>18	beshort		20		PowerPC
>>18	beshort		21		cisco-7500
>>18	beshort		24		cisco-SVIP
>>18	beshort		25		cisco-7200
>>18	beshort		36		NEC-V800
>>18	beshort		37		Fujitsu-FR20
>>18	beshort		38		TRW-RH-32
>>18	beshort		39		Motorola-RCE
>>18	beshort		40		ARM
>>18	beshort		41		Alpha
>>18	beshort		42		Hitachi-SH
>>18	beshort		43		SPARC-V9
>>18	beshort		44		Siemens-Tricore-Embedded-Processor
>>18	beshort		45		Argonaut-RISC-Core
>>18	beshort		46		Hitachi-H8-300
>>18	beshort		47		Hitachi-H8-300H
>>18	beshort		48		Hitachi-H8S
>>18	beshort		49		Hitachi-H8-500
>>18	beshort		50		Intel-Merced
>>18	beshort		51		Stanford-MIPS-X
>>18	beshort		52		Motorola-Coldfire
>>18	beshort		53		Motorola-M68HC12
>>18	beshort		0x9026		Alpha
>>20	belong		0		invalid-version
>>20	belong		1		version-1
>>36	belong		1		MathCoPro-Required
>4	byte		1		32-bit
>4	byte		2		64-bit

#------------------------------------------------------------------------------
# flash:	file(1) magic for Macromedia Flash file format
#
# See
#
#	http://www.macromedia.com/software/flash/open/
#
0	string		FWS		document/Macromedia-Flash
>3	byte		.		v%d

#------------------------------------------------------------------------------
# fonts:  file(1) magic for font data
#
# PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com
0	string		%!PS-AdobeFont-1.0	font/PostScript/Type-1
6	string		%!PS-AdobeFont-1.0	font/PostScript/Type-1

# X11 font files in SNF (Server Natural Format) format
0	belong		00000004		font/X11-SNF/big-endian
0	lelong		00000004		font/X11-SNF/little-endian

# X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com)
0	string		STARTFONT\040		font/X11/BDF

# X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com)
# PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides)
0	string		\001fcp			font/X11-Portable-Compiled
>12	byte		0x02			 LSB-first
>12	byte		0x0a			 MSB-first
0	string		D1.0\015		font/X11-Speedo-font-data

# Windows fonts
0	belong		0x00010000	font/truetype

#------------------------------------------------------------------------------
# frame:  file(1) magic for FrameMaker files
#
# This stuff came on a FrameMaker demo tape, most of which is
# copyright, but this file is "published" as witness the following:
#
0	string		\<MakerFile		document/FrameMaker
>11	string		5.5			v5.5
>11	string		5.0			v5.0
>11	string		4.0			v4.0
>11	string		3.0			v3.0
>11	string		2.0			v2.0
>11	string		1.0			v1.0
0	string		\<MIFFile		document/FrameMaker/MIF
>9	string		4.0			v4.0
>9	string		3.0			v3.0
>9	string		2.0			v2.0
>9	string		1.0			v1.x
0	string		\<MakerDictionary	document/FrameMaker/Dictionary
>17	string		3.0			v3.0
>17	string		2.0			v2.0
>17	string		1.0			v1.x
0	string		\<MakerScreenFont	document/FrameMaker/Fontfile
0	string		\<MML			document/FrameMaker/MML
0	string		\<BookFile		document/FrameMaker/Book
>10	string		3.0			v3.0
>10	string		2.0			v2.0
>10	string		1.0			v1.0

#------------------------------------------------------------------------------
# freebsd:  file(1) magic for FreeBSD objects
#
# All new-style FreeBSD magic numbers are in host byte order (i.e.,
# little-endian on x86).
#
# XXX - this comes from the file "freebsd" in a recent FreeBSD version of
# "file"; it, and the NetBSD stuff in "netbsd", appear to use different
# schemes for distinguishing between executable images, shared libraries,
# and object files.
#
# FreeBSD says:
#
#    Regardless of whether it's pure, demand-paged, or none of the
#    above:
#
#	if the entry point is < 4096, then it's a shared lib if
#	the "has run-time loader information" bit is set, and is
#	position-independent if the "is position-independent" bit
#	is set;
#
#	if the entry point is >= 4096 (or >4095, same thing), then it's
#	an executable, and is dynamically-linked if the "has run-time
#	loader information" bit is set.
#
# On x86, NetBSD says:
#
#    If it's neither pure nor demand-paged:
#
#	if it has the "has run-time loader information" bit set, it's
#	a dynamically-linked executable;
#
#	if it doesn't have that bit set, then:
#
#	    if it has the "is position-independent" bit set, it's
#	    position-independent;
#
#	    if the entry point is non-zero, it's an executable, otherwise
#	    it's an object file.
#
#    If it's pure:
#
#	if it has the "has run-time loader information" bit set, it's
#	a dynamically-linked executable, otherwise it's just an
#	executable.
#
#    If it's demand-paged:
#
#	if it has the "has run-time loader information" bit set,
#	then:
#
#	    if the entry point is < 4096, it's a shared lib;
#
#	    if the entry point is = 4096 or > 4096 (i.e., >= 4096),
#	    it's a dynamically-linked executable);
#
#	if it doesn't have the "has run-time loader information" bit
#	set, then it's just an executable.
#
# (On non-x86, NetBSD does much the same thing, except that it uses
# 8192 on 68K - except for "68k4k", which is presumably "68K with 4K
# pages - SPARC, and MIPS, presumably because Sun-3's and Sun-4's
# had 8K pages; dunno about MIPS.)
#
# I suspect the two will differ only in perverse and uninteresting cases
# ("shared" libraries that aren't demand-paged and whose pages probably
# won't actually be shared, executables with entry points <4096).
#
# I leave it to those more familiar with FreeBSD and NetBSD to figure out
# what the right answer is (although using ">4095", FreeBSD-style, is
# probably better than separately checking for "=4096" and ">4096",
# NetBSD-style).  (The old "netbsd" file analyzed FreeBSD demand paged
# executables using the NetBSD technique.)
#
0	lelong&0377777777	041400407	""
>20	lelong			<4096		""
>>3	byte&0xC0		&0x80		binary/FreeBSD/i386/shared-lib
>>3	byte&0xC0		0x40		binary/FreeBSD/i386/PIC-object
>>3	byte&0xC0		0x00		binary/FreeBSD/i386/object
>20	lelong			>4095		""
>>3	byte&0x80		0x80		executable/FreeBSD/i386/dynamically-linked
>>3	byte&0x80		0x00		executable/FreeBSD/i386

0	lelong&0377777777	041400410	""
>20	lelong			<4096		""
>>3	byte&0xC0		&0x80		binary/FreeBSD/i386/shared-lib
>>3	byte&0xC0		0x40		binary/FreeBSD/i386/PIC-object
>>3	byte&0xC0		0x00		binary/FreeBSD/i386/object
>20	lelong			>4095		""
>>3	byte&0x80		0x80		executable/FreeBSD/i386/dynamically-linked
>>3	byte&0x80		0x00		executable/FreeBSD/i386

0	lelong&0377777777	041400413	""
>20	lelong			<4096		""
>>3	byte&0xC0		&0x80		binary/FreeBSD/i386/shared-lib
>>3	byte&0xC0		0x40		binary/FreeBSD/i386/PIC-object
>>3	byte&0xC0		0x00		binary/FreeBSD/i386/object
>20	lelong			>4095		""
>>3	byte&0x80		0x80		executable/FreeBSD/i386/dynamically-linked
>>3	byte&0x80		0x00		executable/FreeBSD/i386/executable

0	lelong&0377777777	041400314	""
>20	lelong			<4096		""
>>3	byte&0xC0		&0x80		binary/FreeBSD/i386/shared-lib
>>3	byte&0xC0		0x40		binary/FreeBSD/i386/PIC-object
>>3	byte&0xC0		0x00		binary/FreeBSD/i386/object
>20	lelong			>4095		""
>>3	byte&0x80		0x80		executable/FreeBSD/i386/dynamically-linked
>>3	byte&0x80		0x00		executable/FreeBSD/i386/executable

#------------------------------------------------------------------------------
# GIMP Gradient: file(1) magic for the GIMP's gradient data files
# by Federico Mena <federico@nuclecu.unam.mx>

0       string          GIMP\ Gradient  document/GIMP/gradient-data

#------------------------------------------------------------------------------
# XCF:  file(1) magic for the XCF image format used in the GIMP developed
#       by Spencer Kimball and Peter Mattis
#       ('Bucky' LaDieu, nega@vt.edu)

0	string		gimp\ xcf	image/xcf
>22     belong          0               RGB-Color
>22     belong          1               Greyscale
>22     belong          2               Indexed-Color
>22	belong		>2		Unknown

#------------------------------------------------------------------------------
# XCF:  file(1) magic for the patterns used in the GIMP, developed
#       by Spencer Kimball and Peter Mattis
#       ('Bucky' LaDieu, nega@vt.edu)

20      string          GPAT            document/GIMP/pattern-data

#------------------------------------------------------------------------------
# XCF:  file(1) magic for the brushes used in the GIMP, developed
#       by Spencer Kimball and Peter Mattis
#       ('Bucky' LaDieu, nega@vt.edu)

20      string          GIMP            document/GIMP/brush-data

#------------------------------------------------------------------------------
# hp:  file(1) magic for Hewlett Packard machines (see also "printer")
#
# XXX - somebody should figure out whether any byte order needs to be
# applied to the "TML" stuff; I'm assuming the Apollo stuff is
# big-endian as it was mostly 68K-based.
#
# I think the 500 series was the old stack-based machines, running a
# UNIX environment atop the "SUN kernel"; dunno whether it was
# big-endian or little-endian.
#
# Daniel Quinlan (quinlan@yggdrasil.com): hp200 machines are 68010 based;
# hp300 are 68020+68881 based; hp400 are also 68k.  The following basic
# HP magic is useful for reference, but using "long" magic is a better
# practice in order to avoid collisions.
#
# Guy Harris (guy@netapp.com): some additions to this list came from
# HP-UX 10.0's "/usr/include/sys/unistd.h" (68030, 68040, PA-RISC 1.1,
# 1.2, and 2.0).  The 1.2 and 2.0 stuff isn't in the HP-UX 10.0
# "/etc/magic", though, except for the "archive file relocatable library"
# stuff, and the 68030 and 68040 stuff isn't there at all - are they not
# used in executables, or have they just not yet updated "/etc/magic"
# completely?
#
# 0	beshort		200		hp200 (68010) BSD binary
# 0	beshort		300		hp300 (68020+68881) BSD binary
# 0	beshort		0x20c		hp200/300 HP-UX binary
# 0	beshort		0x20d		hp400 (68030) HP-UX binary
# 0	beshort		0x20e		hp400 (68040?) HP-UX binary
# 0	beshort		0x20b		PA-RISC1.0 HP-UX binary
# 0	beshort		0x210		PA-RISC1.1 HP-UX binary
# 0	beshort		0x211		PA-RISC1.2 HP-UX binary
# 0	beshort		0x214		PA-RISC2.0 HP-UX binary

#
# The "misc" stuff needs a byte order; the archives look suspiciously
# like the old 177545 archives (0xff65 = 0177545).
#
#### Old Apollo stuff
0	beshort		0627		executable/Apollo-m68k-COFF
>18	beshort		^040000		unstripped
>22	beshort		>0		v%ld
0	beshort		0624		executable/apollo-a88k-COFF
>18	beshort		^040000		unstripped
>22	beshort		>0		v%ld

#### PA-RISC 1.1
0	belong 		0x02100106	binary/PA-RISC/v1-1/relocatable
0	belong 		0x02100107	executable/PA-RISC/v1-1
>168	belong		&0x00000004	dynamically-linked
>96	belong		>0		unstripped

0	belong 		0x02100108	executable/PA-RISC-v1-1/shared
>168	belong&0x4	0x4		dynamically-linked
>96	belong		>0		unstripped

0	belong 		0x0210010b	executable/PA-RISC-v1-1/demand-load
>168	belong&0x4	0x4		dynamically-linked
>96	belong		>0		unstripped

0	belong 		0x0210010e	binary/PA-RISC-v1-1/shared-library
>96	belong		>0		unstripped

0	belong 		0x0210010d	binary/PA-RISC-v1-1/dll
>96	belong		>0		unstripped

#### PA-RISC 2.0
0	belong		0x02140106	binary/PA-RISC-v2

0       belong		0x02140107	executable/PA-RISC-v2
>168	belong		&0x00000004	dynamically-linked
>96	belong		>0		unstripped

0       belong		0x02140108	executable/PA-RISC-v2/shared
>168	belong		&0x00000004	dynamically-linked
>96	belong		>0		unstripped

0       belong		0x0214010b	executable/PA-RISC-v2/demand-load
>168	belong		&0x00000004	dynamically linked
>96	belong		>0		unstripped

0       belong		0x0214010e	binary/PA-RISC-v2/shared-lib
>96	belong		>0		unstripped

0       belong		0x0214010d	binary/PA-RISC-v2/dll
>96	belong		>0		unstripped

#### 800
0	belong 		0x020b0106	binary/PA-RISC-v1/relocatable

0	belong 		0x020b0107	executable/PA-RISC-v1
>168	belong&0x4	0x4		dynamically-linked
>96	belong		>0		unstripped

0	belong 		0x020b0108	executable/PA-RISC-v1/shared
>168	belong&0x4	0x4		dynamically-linked
>96	belong		>0		unstripped

0	belong 		0x020b010b	executable/PA-RISC-v1/demand-load
>168	belong&0x4	0x4		dynamically-linked
>96	belong		>0		unstripped

0	belong 		0x020b010e	executable/PA-RISC-v1/shared-lib
>96	belong		>0		unstripped

0	belong 		0x020b010d	executable/PA-RISC-v1/dll
>96	belong		>0		unstripped

#### 500
0	long		0x02080106	executable/HP-s500/relocatable
>16	long		>0		v%ld

0	long		0x02080107	executable/HP-s500
>16	long		>0		v%ld

0	long		0x02080108	executable/HP-s500/pure
>16	long		>0		v%ld

#### 200
0	belong 		0x020c0108	executable/HP-s200/pure
>4	beshort		>0		v%ld
>8	belong		&0x80000000	save-fp-regs
>8	belong		&0x40000000	dynamically-linked
>8	belong		&0x20000000	debuggable
>36	belong		>0		unstripped

0	belong		0x020c0107	executable/HP-s200
>4	beshort		>0		v%ld
>8	belong		&0x80000000	save-fp-regs
>8	belong		&0x40000000	dynamically-linked
>8	belong		&0x20000000	debuggable
>36	belong		>0		unstripped

0	belong		0x020c010b	executable/HP-s200/demand-load
>4	beshort		>0		v%ld
>8	belong		&0x80000000	save-fp-regs
>8	belong		&0x40000000	dynamically-linked
>8	belong		&0x20000000	debuggable
>36	belong		>0		unstripped

0	belong		0x020c0106	executable/HP-s200/relocatable
>4	beshort		>0		v%ld
>6	beshort		>0		highwater-%d
>8	belong		&0x80000000	save-fp-regs
>8	belong		&0x20000000	debuggable
>8	belong		&0x10000000	pic

0	belong 		0x020a0108	executable/HP-s200/v2-x/pure
>4	beshort		>0		v%ld
>36	belong		>0		unstripped

0	belong		0x020a0107	executable/HP-s200/v2-x
>4	beshort		>0		v%ld
>36	belong		>0		unstripped

0	belong		0x020c010e	executable/HP-s200/shared-library
>4	beshort		>0		v%ld
>6	beshort		>0		highwater-%d
>36	belong		>0		unstripped

0	belong		0x020c010d	executable/HP-s200/dll
>4	beshort		>0		v%ld
>6	beshort		>0		highwater-%d
>36	belong		>0		unstripped

#### MISC
0	long		0x0000ff65	archive/HP
0	long		0x020aff65	archive/HP-s200
0	long		0x020cff65	archive/HP-s200
0	long		0x0208ff65	archive/HP-s500

0	long		0x015821a6	binary/core/HP

# addendum to /etc/magic with HP-48sx file-types by phk@data.fls.dk 1jan92
0	string		HPHP48-		binary/HP48
>7	byte		>0		rev-%c
>8	beshort		0x1129		ADR
>8	beshort		0x3329		REAL
>8	beshort		0x5529		LREAL
>8	beshort		0x7729		COMPLX
>8	beshort		0x9d29		LCOMPLX
>8	beshort		0xbf29		CHAR
>8	beshort		0xe829		ARRAY
>8	beshort		0x0a2a		LNKARRAY
>8	beshort		0x2c2a		STRING
>8	beshort		0x4e2a		HXS
>8	beshort		0x742a		LIST
>8	beshort		0x962a		DIR
>8	beshort		0xb82a		ALG
>8	beshort		0xda2a		UNIT
>8	beshort		0xfc2a		TAGGED
>8	beshort		0x1e2b		GROB
>8	beshort		0x402b		LIB
>8	beshort		0x622b		BACKUP
>8	beshort		0x882b		LIBDATA
>8	beshort		0x9d2d		PROG
>8	beshort		0xcc2d		CODE
>8	beshort		0x482e		GNAME
>8	beshort		0x6d2e		LNAME
>8	beshort		0x922e		XLIB

0	string		%%HP:		text/HP48
>6	string		T(0)		T-0
>6	string		T(1)		T-1
>6	string		T(2)		T-2
>6	string		T(3)		T-3
>10	string		A(D)		A-D
>10	string		A(R)		A-R
>10	string		A(G)		A-G

# hpBSD magic numbers
0	beshort		200		""
>2	beshort		0407		binary/hp200/impure
>2	beshort		0410		binary/hp200/read-only
>2	beshort		0413		binary/hp200/demand-paged
0	beshort		300		""
>2	beshort		0407		binary/hp300/impure
>2	beshort		0410		binary/hp300/read-only
>2	beshort		0413		binary/hp300/demand-paged

#------------------------------------------------------------------------------
# ibm370:  file(1) magic for IBM 370 and compatibles.
#
# "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable".
# What the heck *is* "USS/370"?
# AIX 4.1's "/etc/magic" has
#
#	0	short		0535		370 sysV executable 
#	>12	long		>0		not stripped
#	>22	short		>0		v%d
#	>30	long		>0		- 5.2 format
#	0	short		0530		370 sysV pure executable 
#	>12	long		>0		not stripped
#	>22	short		>0		v%d
#	>30	long		>0		- 5.2 format
#
# instead of the "USS/370" versions of the same magic numbers.
#
0	beshort		0537		executable/370-XA-sysV
>12	belong		>0		unstripped
>22	beshort		>0		v%d
>30	belong		>0		5-2-format
0	beshort		0532		executable/370-XA-sysV/pure
>12	belong		>0		unstripped
>22	beshort		>0		v%d
>30	belong		>0		5.2-format
0	beshort		054001		executable/370-sysV/pure
>12	belong		>0		unstripped
0	beshort		055001		executable/370-XA-sysV/pure
>12	belong		>0		unstripped
0	beshort		056401		executable/370-sysV
>12	belong		>0		unstripped
0	beshort		057401		executable/370-XA-sysV
>12	belong		>0		unstripped
0       beshort		0531		executable/SVR2
>12	belong		>0		unstripped
>24     belong		>0		v%ld
0	beshort		0534		executable/SVR2/pure
>12	belong		>0		unstripped
>24	belong		>0		v%ld
0	beshort		0530		executable/SVR2/pure
>12	belong		>0		unstripped
>24	belong		>0		v%ld
0	beshort		0535		executable/SVR2
>12	belong		>0		unstripped
>24	belong		>0		v%ld

#------------------------------------------------------------------------------
# ibm6000:  file(1) magic for RS/6000 and the RT PC.
#
0	beshort		0x01df		executable/ibm6000/v3-1
>12	belong		>0		unstripped
# Breaks sun4 statically linked execs.
#0      beshort		0x0103		executable/ibm6000/RT-v2
#>2	byte		0x50		pure
#>28	belong		>0		unstripped
#>6	beshort		>0		v%ld
0	beshort		0x0104		binary/ibm6000/shared-lib
0	beshort		0x0105		binary/ibm6000/ctab-data
0	beshort		0xfe04		binary/ibm6000/structured-file
0	string		0xabcdef	documemt/AIX/message-catalog
0	belong		0x000001f9	document/AIX/message-catalog/compiled
0	string		\<aiaff>	archive/aix


#------------------------------------------------------------------------------
# iff:	file(1) magic for Interchange File Format (see also "audio" & "images")
#
# Daniel Quinlan (quinlan@yggdrasil.com) -- IFF was designed by Electronic
# Arts for file interchange.  It has also been used by Apple, SGI, and
# especially Commodore-Amiga.
#
# IFF files begin with an 8 byte FORM header, followed by a 4 character
# FORM type, which is followed by the first chunk in the FORM.

0	string		FORM		""
# audio formats
>8	string		AIFF		audio/aiff
>8	string		AIFC		audio/aiff-c
>8	string		8SVX		audio/8SVX-8-bit
>8	string		SAMP		audio/SAMP
# image formats
>8	string		ILBMBMHD	image/ilbm
>8	string		RGBN		image/RGBN-12-bit-RGB
>8	string		RGB8		image/RGB8-24-bit-RGB
>8	string		DR2D		image/DR2D-2D
>8	string		TDDD		image/TDDD-3D

#------------------------------------------------------------------------------
# images:  file(1) magic for image formats (see also "iff")
#
# originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
# additions by janl@ifi.uio.no as well as others. Jan also suggested
# merging several one- and two-line files into here.
#

# Targa - matches `povray', `ppmtotga' and `xv' outputs
# by Philippe De Muyter <phdm@macqel.be>
# at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
# at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
# at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
# `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
# `tgatoppm' recognizes a superset (Index may be anything)
1	belong&0xfff7ffff	0x01010000	image/targa/map
>2	byte&8			8		RLE
1	belong&0xfff7ffff	0x00020000	image/targa/rgb
>2	byte&8			8		RLE
1	belong&0xfff7ffff	0x00030000	image/targa/Mono
>2	byte&8			8		RLE

# PBMPLUS images
# The next byte following the magic is always whitespace.
0	string		P1		image/PBM
0	string		P2		image/PGM
0	string		P3		image/PPM
0	string		P4		image/PBM/raw
0	string		P5		image/PGM/raw
0	string		P6		image/PPM/raw

# NITF is defined by United States MIL-STD-2500A
0	string	NITF	image/nitf	""

# NIFF (Navy Interchange File Format, a modification of TIFF) images
0	string		IIN1		image/NIFF

# Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
# The second word of TIFF files is the TIFF version number, 42, which has
# never changed.  The TIFF specification recommends testing for it.
0	string		MM\x00\x2a	image/TIFF/big-endian
0	string		II\x2a\x00	image/TIFF/little-endian

# PNG [Portable Network Graphics, or "PNG's Not GIF"] images
# (Greg Roelofs, newt@uchicago.edu)
# (Albert Cahalan, acahalan@cs.uml.edu)
#
# 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
#
0	string		\x89PNG		image/png
>4	belong		!0x0d0a1a0a	corrupted
>4	belong		0x0d0a1a0a	""
>>25	byte		0		grayscale
>>25	byte		2		color-RGB
>>25	byte		3		colormap
>>25	byte		4		gray-alpha
>>25	byte		6		color-RGBA
>>28	byte		0		non-interlaced
>>28	byte		1		interlaced

# GIF
0	string		GIF8		image/gif
>4	string		7a		87
>4	string		9a		89

# Magick Image File Format
0	string		id=ImageMagick	image/MIFF

# Artisan
0	long		1123028772	image/Artisan

# FIG (Facility for Interactive Generation of figures), an object-based format
0	string		#FIG		image/FIG

# PHIGS
0	string		ARF_BEGARF	image/phigs
0	string		@(#)SunPHIGS	image/sunphigs

# GKS (Graphics Kernel System)
0	string		GKSM		image/GKS-Metafile

# CGM image files
0	string		BEGMF		image/cgm

# MGR bitmaps  (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
0	string		yz		image/mgr

# Fuzzy Bitmap (FBM) images
0	string		%bitmap\0	image/fbm

# PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
0	string		BM		image/bmp
0	string		IC		image/pc-icon
0	string		PI		image/pc-pointer
0	string		CI		image/pc-icon/color
0	string		CP		image/pc-pointer/color

# XPM icons (Greg Roelofs, newt@uchicago.edu)
# note possible collision with C/REXX entry in c-lang; currently commented out
0	string		/*\ XPM\ */	image/xpm

# Utah Raster Toolkit RLE images (janl@ifi.uio.no)
0	leshort		0xcc52		image/utah-rle

# image file format (Robert Potter, potter@cs.rochester.edu)
0	string		Imagefile\ version-	image/iff
# this adds the whole header (inc. version number), informative but longish
>10	string		.		%s

# Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
0	belong		0x59a66a95	image/sun-raster

# SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
#
# See
#	http://reality.sgi.com/grafica/sgiimage.html
#
0	beshort		474		image/sgi
#>2	byte		0		verbatim
>2	byte		1		RLE
#>3	byte		1		normal-precision
>3	byte		2		high-precision

2048	string		PCD_IPI		image/kodak-photo-cd
0	string		PCD_OPA		image/kodak-photo-cd

# FITS format.  Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
0	string	SIMPLE\ \ =	image/fits

# Visio drawings
03000	string	Visio\ (TM)\ Drawing	image/visio

# PSD (Adobe Photoshop bitmap) (Wolfram Kleff)
0	string		8BPS	image/psd

# PCX (should be reliable with a 2 byte header - Wolfram Kleff)
0	beshort		0x0A00	image/pcx
0	beshort		0x0A02	image/pcx-2.8
0	beshort		0x0A03	image/pcx-2.8
0	beshort		0x0A05	image/pcx-3

# GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
0	belong		0x00010008	image/gem

# GEM Metafile (Wolfram Kleff)
0	lelong		0x0018FFFF	document/GEM-Metafile
>4	leshort		.		v%d

#
# SMJPEG. A custom Motion JPEG format used by Loki Entertainment
# Software Torbjorn Andersson <d91tan@Update.UU.SE>.
#
0	string	\0\nSMJPEG	video/SMJPEG
>8	belong	.		v%d.x
>16	string	_SND		""
>>24	beshort	>0		%d-Hz
>>26	byte	8		8-bit
>>26	byte	16		16-bit
>>27	byte	1		mono
>>28	byte	2		stereo
>>32	string	_VID		""
# >>>48	string	JFIF		JPEG
>>>40	belong	>0		%d-frames
>16	string	_VID		""
# >>32	string	JFIF		JPEG
>>24	belong	>0		%d-frames

0	string	Paint\ Shop\ Pro\ Image\ File	image/PaintShop-Pro

#------------------------------------------------------------------------------
# intel:  file(1) magic for x86 Unix
#
# Various flavors of x86 UNIX executable/object (other than Xenix, which
# is in "microsoft").  DOS is in "msdos"; the ambitious soul can do
# Windows as well.
#
# Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and
# whatever comes next (HP-PA Hummingbird?).  OS/2 may also go elsewhere
# as well, if, as, and when IBM makes it portable.
#
# The `versions' should be un-commented if they work for you.
# (Was the problem just one of endianness?)
#
0	leshort		0502		executable/basic-16
>12	lelong		>0		unstripped
#>22	leshort		>0		v%ld
0	leshort		0503		executable/basic-16/tv
>12	lelong		>0		unstripped
#>22	leshort		>0		v%ld
0	leshort		0510		executable/x86
>12	lelong		>0		unstripped
0	leshort		0511		executable/x86/tv
>12	lelong		>0		unstripped
0	leshort		=0512		executable/iAPX-286/small-model
>12	lelong		>0		unstripped
#>22	leshort		>0		v%ld
0	leshort		=0522		executable/iAPX-286/large-model
>12	lelong		>0		unstripped
#>22	leshort		>0		v%ld
0	leshort		=0514		executable/80386-COFF
>12	lelong		>0		unstripped
>22	leshort		>0		v%ld


#------------------------------------------------------------------------------
# ispell:  file(1) magic for ispell
#
# Ispell 3.0 has a magic of 0x9601 and ispell 3.1 has 0x9602.  This magic
# will match 0x9600 through 0x9603 in *both* little endian and big endian.
# (No other current magic entries collide.)
#
# Updated by Daniel Quinlan (quinlan@yggdrasil.com)
#
0	leshort&0xFFFC	0x9600		document/ispell/little-endian
0	beshort&0xFFFC	0x9600		document/ispell/big-endian
0       string          ISPL            document/ispell/hashfile

#------------------------------------------------------------
# Java ByteCode
# From Larry Schwimmer (schwim@cs.stanford.edu)
0	belong		0xcafebabe	binary/java/bytecode
#------------------------------------------------------------
# Java serialization
# From Martin Pool (m.pool@pharos.com.au)
0	beshort		0xaced		binary/java/serialization

#------------------------------------------------------------------------------
# JPEG images
# SunOS 5.5.1 had
#
#	0	string		\377\330\377\340	JPEG file
#	0	string		\377\330\377\356	JPG file
#
# both of which turn into "JPEG image data" here.
#
0	beshort		0xffd8		image/jpeg
>6	string		JFIF		JFIF
# HSI is Handmade Software's proprietary JPEG encoding scheme
0	string		hsi1		image/jpeg/HSI-proprietary

#------------------------------------------------------------------------------
# lex:  file(1) magic for lex
#
#	derived empirically, your offsets may vary!
53	string		yyprevious	text/c/lex
21	string		generated\ by\ flex	text/c/flex
0	string		%{		text/lex-description


#------------------------------------------------------------------------------
# linux:  file(1) magic for Linux files
#
# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
#
0	lelong		0x00640107	executable/Linux/i386/impure
>16	lelong		0		 stripped
0	lelong		0x00640108	executable/Linux/i386/pure
>16	lelong		0		 stripped
0	lelong		0x0064010b	executable/Linux/i386/demand-paged
>16	lelong		0		 stripped
0	lelong		0x006400cc	executable/Linux/i386/demand-paged
>16	lelong		0		 stripped
#
0	string		\007\001\000	binary/Linux/i386/object
>20	lelong		>0x1020		 DLL-lib
# core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
216	lelong		0421		binary/core/Linux/i386
#
# LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
# this can be overridden by the DOS executable (COM) entry
2	string		LILO		binary/Linux/i386/LILO
# Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
4086	string		SWAP-SPACE	binary/Linux/i386/swap-file

# Linux kernel boot images (i386 arch) (Wolfram Kleff)
514	string		HdrS		executable/Linux-kernel
>510	leshort		0xAA55		x86-boot-executable
>>518	leshort		0x201		""
>>>529	byte		0		zImage
>>>529	byte		1		bzImage
>>498	leshort		1		RO-rootFS
>>498	leshort		0		RW-rootFS

# This also matches new kernels, which were caught above by "HdrS".
0		belong	0xb8c0078e	executable/Linux-kernel

# System.map files - Nicols Lichtmaier <nick@debian.org>
8	string	\ A\ _text	binary/Linux/kernel-symbol-map


#------------------------------------------------------------------------------
# lisp:  file(1) magic for lisp programs
#
# various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
0	string	;;			text/lisp-scheme
0	string	;\ 			text/lisp-scheme
# Emacs 18 - this is always correct, but not very magical.
0	string	\012(			binary/emacs/lisp-bytecode
# Emacs 19
0	string	;ELC\023\000\000\000	binary/emacs/lisp-bytecode
#
# Files produced by CLISP Common Lisp From: Bruno Haible <haible@ilog.fr>
0	string	(SYSTEM::VERSION\040'	binary/clisp-bytecode
# Files produced by GNU gettext
0	long	0xDE120495		binary/gettext/message-catalog
0	long	0x950412DE		binary/gettext/message-catalog

#------------------------------------------------------------------------------
# macintosh description
#
# BinHex is the Macintosh ASCII-encoded file format (see also "apple")
# Daniel Quinlan, quinlan@yggdrasil.com
11	string	must\ be\ converted\ with\ BinHex	binary/macintosh/BinHex

# Stuffit archives are the de facto standard of compression for Macintosh
# files obtained from most archives. (franklsm@tuns.ca)
0	string		SIT!			archive/StuffIt
0	string		SITD			archive/StuffIt/Deluxe
0	string		Seg			archive/StuffIt/Deluxe-Segment

# Macintosh Applications and Installation binaries (franklsm@tuns.ca)
0	string		APPL			executable/macintosh

# Macintosh System files (franklsm@tuns.ca)
0	string		zsys			binary/Macintosh/System-File
0	string		libr			binary/Macintosh/Lib
0	string		shlb			binary/Macintosh/Shared-Lib
65	string		zsys			binary/Macintosh/System-File
65	string		libr			binary/Macintosh/Lib
65	string		shlb			binary/Macintosh/Shared-Lib


#------------------------------------------------------------------------------
# magic:  file(1) magic for magic files
#
0	string		#\ Magic	text/file-magic

#------------------------------------------------------------------------------
# motorola:  file(1) magic for Motorola 68K and 88K binaries
#
# Atari ST/TT... program format (sent by Wolfram Kleff <kleff@cs.uni-bonn.de>)
0       beshort         0x601A          executable/Atari-68xxx
0       beshort         0x0064          binary/Atari-68xxx-CPX
0	beshort		0554		executable/motorola-68K

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

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


# .EXE formats (Greg Roelofs, newt@uchicago.edu)
#
0	string	MZ		executable/MS-DOS
>24	string	@		MS-Windows
>1638	string	-lh5-		LHa-SFX-archive
>7195	string	Rar!		RAR-self-extracting
#
# [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	PKZIP-SFX/v1.1
>13297	string	PK\003\004	PKZIP-SFX/v1.93a
>15588	string	PK\003\004	PKZIP2-SFX/v1.09
>15770	string	PK\003\004	PKZIP-SFX/v2.04g
>28374	string	PK\003\004	PKZIP2-SFX/v1.02
#
# Info-ZIP self-extractors
#    these are the DOS versions:
>25115	string	PK\003\004	Info-ZIP-SFX/v5.12
>26331	string	PK\003\004	Info-ZIP SFX/v5.12-decryption
#    these are the OS/2 versions (OS/2 is flagged above):
>47031	string	PK\003\004	Info-ZIP-SFX/v5.12
>49845	string	PK\003\004	Info-ZIP-SFX/v5.12-decryption
#    this is the NT/Win32 version:
>69120	string	PK\003\004	Info-ZIP-NT-SFX/v5.12-decryption

# miscellaneous formats
0	string		LZ		executable/MS-DOS


# Windows Registry files.
#
0	string		regf		binary/Windows-NT/registry
0	string		CREG		binary/Windows-95/registry

# Popular applications
2080	string	Microsoft\ Word\ 6.0\ Document	document/ms-word-6-0
0	belong	0x31be0000			document/ms-word
0       string  PO^Q`				document/ms-word-6-0

# I guess this is the one that works:
# MS-Word Document (Wolfram Kleff)
0	string	\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1	document/ms-word

0	string	\376\067\000\043			document/ms-office
0	string	\320\317\021\340\241\261		document/ms-office
0	string	\333\245-\000\000\000			document/ms-office
#
2080	string	Microsoft\ Excel\ 5.0\ Worksheet	document/ms-excel-5-0
##
0	belong	0x00001a00	document/Lotus123
0	belong	0x00000200 	document/Lotus123

# Help files
0	string	?_\003\000		document/Windows-help

# Windows Metafont .WMF
0	string	\327\315\306\232\000\000\000\000\000\000	font/ms-windows-metafont

# lnk files windows symlinks
0	string	\114\000\000\000\001\024\002\000\000\000\000\000\300\000\000\000\000\000\000\106	document/ms-windows-shortcut

#ico files
0	string	\000\000\001\000\001\000\040\040\020\000\000\000\000\000\350\002\000\000	image/ms-windows-icon
0	string	\000\000\001\000\004\000\040\040\020\000\000\000\000\000\350\002		image/ms-windows-icon
0	string	\102\101\050\000\000\000\056\000\000\000\000\000\000\000			image/ms-windows-icon
0	string	\000\000\001\000\002\000\040\040\010\000\000\000\000\000\350\002		image/ms-windows-icon
0	string	\000\000\001\000\006\000\020\020\020\000\000\000\000\000\050\001		image/ms-windows-icon
0	string	\000\000\001\000\002\000\020\020\020\000\000\000\000\000\050\001		image/ms-windows-icon

# WARNING: below line conflicts with Infocom game data Z-machine 3
0	byte		0x03		document/DBase-3
0	byte		0x83		document/DBase-3/memos
0	leshort		0x0006		document/DBase-3/index

#------------------------------------------------------------------------------
# netbsd:  file(1) magic for NetBSD objects
#
# All new-style magic numbers are in network byte order.
#

0	lelong			000000407	binary/NetBSD/little-endian
>16	lelong			>0		unstripped
0	belong			000000407	binary/NetBSD/big-endian
>16	belong			>0		unstripped

0	belong&0377777777	041400413	""
>0	byte			&0x80		""
>>20	lelong			<4096		binary/netbsd/i386/shared-lib
>>20	lelong			=4096		executable/netbsd/i386/dynamically-linked
>>20	lelong			>4096		executable/netbsd/i386/dynamically-linked
>0	byte			^0x80		executable/netbsd/i386
>16	lelong			>0		executable/netbsd/i386/unstripped

0	belong&0377777777	041400410	executable/NetBSD/i386
>0	byte			&0x80		dynamically-linked
>0	byte			^0x80		executable
>16	lelong			>0		unstripped

0	belong&0377777777	041400407	executable/NetBSD/i386
>0	byte			&0x80		dynamically-linked
>16	lelong			>0		unstripped

0	belong&0377777777	041400507	binary/core/NetBSD/i386

0	belong&0377777777	041600413	""
>0	byte			&0x80		""
>>20	belong			<8192		binary/NetBSD/m68k/shared-lib
>>20	belong			=8192		executable/NetBSD/m68k/dynamically-linked
>>20	belong			>8192		executable/NetBSD/m68kdynamically-linked
>0	byte			^0x80		executable/NetBSD/m68k
>16	belong			>0		unstripped

0	belong&0377777777	041600410	executable/NetBSD/m68k
>0	byte			&0x80		dynamically-linked

0	belong&0377777777	041600407	""
>0	byte			&0x80		executable/NetBSD/m68k/dynamically-linked
>0	byte			^0x80		""
>>0	byte			&0x40		binary/NetBSD/m68k/pic
>>20	belong			!0		executable/NetBSD/m68k
>>20	belong			=0		binary/NetBSD/m68k
>16	belong			>0		unstripped

0	belong&0377777777	041600507	binary/core/NetBSD/m68k

0	belong&0377777777	042000413	""
>0	byte			&0x80		""
>>20	belong			<4096		binary/NetBSD/m68k/shared lib
>>20	belong			=4096		executable/NetBSD/m68k/dynamically-linked
>>20	belong			>4096		executable/NetBSD/m68k/dynamically-linked
>0	byte			^0x80		executable/NetBSD/m68k
>16	belong			>0		unstripped

0	belong&0377777777	042000410	executable/NetBSD/m68k
>0	byte			&0x80		dynamically-linked
>0	byte			^0x80		""
>16	belong			>0		unstripped

0	belong&0377777777	042000407	""
>0	byte			&0x80		executable/NetBSD/m68k/dynamically-linked
>0	byte			^0x80		""
>>0	byte			&0x40		binary/NetBSD/m68k/pic
>>20	belong			!0		executable/NetBSD/m68k
>>20	belong			=0		binary/NetBSD/m68k
>16	belong			>0		unstripped

0	belong&0377777777	042000507	binary/core/NetBSD/m68k

0	belong&0377777777	042200413	""
>0	byte			&0x80		""
>>20	lelong			<4096		binary/NetBSD/ns32532/shared lib
>>20	lelong			=4096		executable/NetBSD/ns32532/dynamically-linked
>>20	lelong			>4096		executable/NetBSD/ns32532/dynamically-linked
>0	byte			^0x80		executable/NetBSD/ns32532
>16	lelong			>0		unstripped

0	belong&0377777777	042200410	""
>0	byte			&0x80		executable/NetBSD/ns32532/dynamically-linked
>0	byte			^0x80		executable/NetBSD/ns32532
>16	lelong			>0		unstripped

0	belong&0377777777	042200407	""
>0	byte			&0x80		executable/NetBSD/ns32532/dynamically-linked
>0	byte			^0x80		""
>>0	byte			&0x40		binary/NetBSD/ns32532/pic
>>20	lelong			!0		executable/NetBSD/ns32532
>>20	lelong			=0		binary/NetBSD/ns32532
>16	lelong			>0		unstripped

0	belong&0377777777	042200507	binary/core/NetBSD/ns32532
0	belong&0377777777	045200507	binary/core/NetBSD/powerpc

0	belong&0377777777	042400413	""
>0	byte			&0x80		""
>>20	belong			<8192		binary/NetBSD/sparc/shared-lib
>>20	belong			=8192		executable/NetBSD/sparc/dynamically-linked
>>20	belong			>8192		executable/NetBSD/sparc/dynamically-linked
>0	byte			^0x80		executable/NetBSD/sparc/
>16	belong			>0		unstripped

0	belong&0377777777	042400410	""
>0	byte			&0x80		executable/NetBSD/sparc/dynamically-linked
>0	byte			^0x80		executable/NetBSD/sparc
>16	belong			>0		unstripped

0	belong&0377777777	042400407	""
>0	byte			&0x80		executable/NetBSD/sparc/dynamically-linked
>0	byte			^0x80		""
>>0	byte			&0x40		binary/NetBSD/sparc/pic
>>20	belong			!0		executableNetBSD/sparc
>>20	belong			=0		binary/NetBSD/sparc/pic
>16	belong			>0		unstripped

0	belong&0377777777	042400507	binary/core/NetBSD/sparc

0	belong&0377777777	042600413	""
>0	byte			&0x80		""
>>20	lelong			<4096		binary/NetBSD/pmax/shared lib
>>20	lelong			=4096		executable/NetBSD/pmax/dynamically-linked
>>20	lelong			>4096		executable/NetBSD/pmax/dynamically-linked
>0	byte			^0x80		executable/NetBSD/pmax
>16	lelong			>0		unstripped

0	belong&0377777777	042600410	""
>0	byte			&0x80		executable/NetBSD/pmax/dynamically-linked
>0	byte			^0x80		executable/NetBSD/pmax
>16	lelong			>0		unstripped

0	belong&0377777777	042600407	""
>0	byte			&0x80		executable/NetBSD/pmax/dynamically-linked
>0	byte			^0x80		""
>>0	byte			&0x40		binary/NetBSD/pmax/pic
>>20	lelong			!0		executable/NetBSD/pmax
>>20	lelong			=0		binary/NetBSD/pmax
>16	lelong			>0		unstripped

0	belong&0377777777	042600507	binary/core/NetBSD/pmax

0	belong&0377777777	043000413	""
>0	byte			&0x80		""
>>20	lelong			<4096		binary/NetBSD/vax/shared-lib
>>20	lelong			=4096		executable/NetBSD/vax/dynamically-linked
>>20	lelong			>4096		executable/NetBSD/vax/dynamically-linked
>0	byte			^0x80		executable/NetBSD/vax
>16	lelong			>0		unstripped

0	belong&0377777777	043000410	""
>0	byte			&0x80		executable/NetBSD/vax/dynamically-linked
>0	byte			^0x80		executable/NetBSD/vax
>16	lelong			>0		unstripped

0	belong&0377777777	043000407	""
>0	byte			&0x80		executable/NetBSD/vax/dynamically-linked
>0	byte			^0x80		""
>>0	byte			&0x40		binary/NetBSD/vax/pic
>>20	lelong			!0		executable/NetBSD/vax
>>20	lelong			=0		binary/NetBSD/vax
>16	lelong			>0		unstripped

0	belong&0377777777	043000507	binary/core/NetBSD/vax

0	belong&0377777777	045400413	""
>0	byte			&0x80		""
>>20	lelong			<4096		binary/NetBSD/vax/shared-lib
>>20	lelong			=4096		executable/NetBSD/vax/dynamically-linked
>>20	lelong			>4096		executable/NetBSD/vax/dynamically-linked
>0	byte			^0x80		executable/NetBSD/vax
>16	lelong			>0		unstripped

0	belong&0377777777	045400410	""
>0	byte			&0x80		executable/NetBSD/vax/dynamically-linked
>0	byte			^0x80		executable/NetBSD/vax
>16	lelong			>0		unstripped

0	belong&0377777777	045400407	""
>0	byte			&0x80		executable/NetBSD/vax/dynamically-linked
>0	byte			^0x80		""
>>0	byte			&0x40		binary/NetBSD/vax/pic
>>20	lelong			!0		executable/NetBSD/vax
>>20	lelong			=0		binary/NetBSD/vax
>16	lelong			>0		unstripped

0	belong&0377777777	045400507	binary/core/NetBSD/vax

# NetBSD/alpha does not support (and has never supported) a.out objects,
# so no rules are provided for them.  NetBSD/alpha ELF objects are 
# dealt with in "elf".
0	lelong		0x00070185		binary/NetBSD/alpha
>10	leshort		0x0001			unstripped
>10	leshort		0x0000			stripped
0	belong&0377777777	043200507	binary/core/NetBSD/alpha

0	belong&0377777777	043400413	""
>0	byte			&0x80		""
>>20	belong			<8192		binary/NetBSD/mips/shared-lib
>>20	belong			=8192		executable/NetBSD/mips/dynamically-linked
>>20	belong			>8192		executable/NetBSD/mips/dynamically-linked
>0	byte			^0x80		executable/NetBSD/mips
>16	belong			>0		unstripped

0	belong&0377777777	043400410	""
>0	byte			&0x80		executable/NetBSD/mips/dynamically-linked
>0	byte			^0x80		executable/NetBSD/mips
>16	belong			>0		unstripped

0	belong&0377777777	043400407	""
>0	byte			&0x80		executable/NetBSD/mips/dynamically-linked
>0	byte			^0x80		""
>>0	byte			&0x40		executable/NetBSD/mips/pic
>>20	belong			!0		executable/NetBSD/mips
>>20	belong			=0		binary/NetBSD/mips
>16	belong			>0		unstripped

0	belong&0377777777	043400507	binary/core/NetBSD/mips

0	belong&0377777777	043600413	""
>0	byte			&0x80		""
>>20	lelong			<8192		binary/NetBSD/arm32/shared-lib
>>20	lelong			=8192		executable/NetBSD/arm32/dynamically-linked
>>20	lelong			>8192		executable/NetBSD/arm32/dynamically-linked
>0	byte			^0x80		executable/NetBSD/arm32
>16	lelong			>0		unstripped

0	belong&0377777777	043600410	""
>0	byte			&0x80		executable/NetBSD/arm32/dynamically-linked
>0	byte			^0x80		executable/NetBSD/arm32
>16	lelong			>0		unstripped

0	belong&0377777777	043600407	""
>0	byte			&0x80		executable/NetBSD/arm32/dynamically-linked
>0	byte			^0x80		""
>>0	byte			&0x40		executable/NetBSD/arm32/pic
>>20	lelong			!0		executable/NetBSD/arm32
>>20	lelong			=0		binary/NetBSD/arm32
>16	lelong			>0		unstripped

0	belong&0377777777	043600507	binary/core/NetBSD/arm32

#------------------------------------------------------------------------------
# netscape:  file(1) magic for Netscape files
# "H. Nanosecond" <aldomel@ix.netcom.com>
# version 3 and 4 I think
#

# Netscape Address book  .nab
0	string \000\017\102\104\000\000\000\000\000\000\001\000\000\000\000\002\000\000\000\002\000\000\004\000		document/Netscape/Address-book

# .snm Caches
0	string		#\ Netscape\ folder\ cache	document/Netscape/folder-cache
0	string	\000\036\204\220\000			document/Netscape/folder-cache

#------------------------------------------------------------------------------
# octave binary data file(1) magic, from Dirk Eddelbuettel <edd@debian.org>
0	string		Octave-1-L	binary/Octave/little-endian
0	string		Octave-1-B	binary/Octave/big-endian

#------------------------------------------------------------------------------
# os2:  file(1) magic for OS/2 files
#

# Provided 1998/08/22 by
# David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
1	string	InternetShortcut	document/MS-Windows-95/Internet-shortcut

# >>>>> OS/2 INF/HLP <<<<<  (source: Daniel Dissett ddissett@netcom.com)
# Carl Hauser (chauser.parc@xerox.com) and 
# Marcus Groeber (marcusg@ph-cip.uni-koeln.de)
# list the following header format in inf02a.doc:
#
#  int16 ID;           // ID magic word (5348h = "HS")
#  int8  unknown1;     // unknown purpose, could be third letter of ID
#  int8  flags;        // probably a flag word...
#                      //  bit 0: set if INF style file
#                      //  bit 4: set if HLP style file
#                      // patching this byte allows reading HLP files
#                      // using the VIEW command, while help files 
#                      // seem to work with INF settings here as well.
#  int16 hdrsize;      // total size of header
#  int16 unknown2;     // unknown purpose
# 
0   string  HSP\x01\x9b\x00         document/OS-2-INF
0   string  HSP\x10\x9b\x00         document/OS-2-HLP

# OS/2 INI (this is a guess)
0  string   \xff\xff\xff\xff\x14\0\0\0  document/OS-2-INI
#
#	$NetBSD: os9,v 1.2 1997/01/09 20:19:04 tls Exp $
#
# Copyright (c) 1996 Ignatios Souvatzis. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#      This product includes software developed by Ignatios Souvatzis for
#      the NetBSD project.
# 4. The name of the author may not be used to endorse or promote products
#    derived from this software without specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
#
# OS9/6809 module descriptions:
#
0	beshort		0x87CD	""
#
>6	byte&0x0f	0x00	binary/OS9-6809/non-executable
>6	byte&0x0f	0x01	binary/OS9-6809/machine-language
>6	byte&0x0f	0x02	binary/OS9-6809/BASIC-I-code
>6	byte&0x0f	0x03	binary/OS9-6809/P-code
>6	byte&0x0f	0x04	binary/OS9-6809/C-I-code
>6	byte&0x0f	0x05	binary/OS9-6809/COBOL-I-code
>6	byte&0x0f	0x06	binary/OS9-6809/FORTRAN-I-code
#
>6	byte&0xf0	0x10	executable/OS9-6809
>6	byte&0xf0	0x20	binary/OS9-6809/subroutine
>6	byte&0xf0	0x30	binary/OS9-6809/multi-module
>6	byte&0xf0	0x40	binary/OS9-6809/data-module
#
>6	byte&0xf0	0xC0	binary/OS9-6809/system-module
>6	byte&0xf0	0xD0	binary/OS9-6809/file-manager
>6	byte&0xf0	0xE0	binary/OS9-6809/device-driver
>6	byte&0xf0	0xF0	binary/OS9-6809/device-descriptor
#
# OS9/m68k stuff (to be continued)
#
0	beshort		0x4AFC	""
#
# attr
>14	byte&0x80	0x80	binary/OS9-68K/re-entrant
>14	byte&0x40	0x40	binary/OS9-68K/ghost
>14	byte&0x20	0x20	binary/OS9-68K/system-state
#
# lang:
#
>13	byte		1	binary/OS9-68K/machine-language
>13	byte		2	binary/OS9-68K/BASIC-I-code
>13	byte		3	binary/OS9-68K/P-code
>13	byte		4	binary/OS9-68K/C-I-code
>13	byte		5	binary/OS9-68K/COBOL-I-code
>13	byte		6	binary/OS9-68K/Fortran-I-code
#
#
# type:
#
>12	byte		1       executable/OS9-68K
>12	byte		2	binary/OS9-68K/subroutine
>12	byte		3	binary/OS9-68K/multi-module
>12	byte		4	binary/OS9-68K/data-module
>12	byte		11	binary/OS9-68K/trap-lib
>12	byte		12	binary/OS9-68K/system-module
>12	byte		13	binary/OS9-68K/file-manager
>12	byte		14	binary/OS9-68K/device-driver
>12	byte		15	binary/OS9-68K/device-descriptor

#-----------------------------------------------------------------------------
# palm:  file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles,
# and hacks
#

# Variety of PalmOS document types
# Michael-John Turner <mj@debian.org>
# Thanks to Hasan Umit Ezerce <humit@tr-net.net.tr> for his DocType 
60		string	BVokBDIC			document/palm-os/BDicty
>0    string                  .             "%s"

60		string	DB99DBOS			document/palm-os/DB
>0    string                  .             "%s"

60		string	vIMGView			document/palm-os/FireViewer
>0    string                  .             "%s"

60		string	PmDBPmDB			document/palm-os/HanDBase
>0    string                  .             "%s"

60		string	InfoINDB			document/palm-os/InfoView
>0    string                  .             "%s"

60		string	ToGoToGo			document/palm-os/iSilo
>0    string                  .             "%s"

60		string	JfDbJBas			document/palm-os/JFile
>0    string                  .             "%s"

60		string	JfDbJFil			document/palm-os/JFile-Pro
>0    string                  .             "%s"

60		string	DATALSdb			document/palm-os/List
>0    string                  .             "%s"

60		string	Mdb1Mdb1			document/palm-os/MobileDB
>0    string                  .             "%s"

60		string	PNRdPPrs			document/palm-os/PeanutPress
>0    string                  .             "%s"

60		string	DataPlkr			document/palm-os/Plucker
>0    string                  .             "%s"

60		string	DataSprd			document/palm-os/QuickSheet
>0    string                  .             "%s"

60		string	SM01SMem			document/palm-os/SuperMemo
>0    string                  .             "%s"

60		string	DataTlPt			document/palm-os/TealDoc
>0    string                  .             "%s"

60		string	InfoTlIf			document/palm-os/TealInfo
>0    string                  .             "%s"

60		string	DataTlMl			document/palm-os/TealMeal
>0    string                  .             "%s"

60		string	DataTlPt			document/palm-os/TealPaint
>0    string                  .             "%s"

60		string	dataTDBP			document/palm-os/ThinkDB
>0    string                  .             "%s"

60		string	TdatTide			document/palm-os/Tides
>0    string                  .             "%s"

60		string	ToRaTRPW			document/palm-os/TomeRaider
>0    string                  .             "%s"

# Brian Lalor <blalor@hcirisc.cs.binghamton.edu>
# appl
60      belong                  0x6170706c      executable/Palm-OS
>0      string                  .             "%s"
# TEXt
60      belong                  0x54455874      document/Palm-OS/AportisDoc
>0      string                  .             "%s"
# HACK
60      belong                  0x4841434b      document/Palm-OS/HackMaster
>0      string                  .             "%s"


#------------------------------------------------------------------------------
# pdf:  file(1) magic for Portable Document Format
#

0	string		%PDF-		document/PDF

#------------------------------------------------------------------------------
# pgp:  file(1) magic for Pretty Good Privacy
#
0       beshort         0x9900                  docmument/PGP/key-public-ring
0       beshort         0x9501                  docmument/PGP/key-security-ring
0       beshort         0x9500                  docmument/PGP/key-security-ring
0	beshort		0xa600			docmument/PGP/encrypted-data
0       string          -----BEGIN\040PGP       docmument/PGP/armored-data
>15     string          PUBLIC\040KEY\040BLOCK- public-key-block
>15     string          MESSAGE-                message
>15     string          SIGNED\040MESSAGE-      signed-message
>15     string          PGP\040SIGNATURE-       signature

#------------------------------------------------------------------------------
# printer:  file(1) magic for printer-formatted files
#

# PostScript, updated by Daniel Quinlan (quinlan@yggdrasil.com)
0	string		%!		        document/PostScript
0	string		\004%!		        document/PostScript
0	string		\033%-12345X%!PS	document/PostScript


# DOS EPS Binary File Header
# From: Ed Sznyter <ews@Black.Market.NET>
0       belong          0xC5D0D3C6      document/postscript/encapsulated-DOS

# Adobe's PostScript Printer Description (PPD) files
#       Yves Arrouye <arrouye@marin.fdn.fr>
#
0      string          *PPD-Adobe:      document/adobe-PPD

#------------------------------------------------------------------------------
# psdbms:  file(1) magic for psdatabase
#
0	belong&0xff00ffff	0x56000000	db/psdatabase

#------------------------------------------------------------------------------
# riff:  file(1) magic for RIFF format
# See
#
#	http://www.seanet.com/users/matts/riffmci/riffmci.htm
#
# and
#
#	http://www.ora.com/centers/gff/formats/micriff/index.htm
#
# and
#
#	http://www.jtauber.com/music/encoding/niff/spec/
#
0	string		RIFF		 ""
# RIFF Palette format
>8	string		PAL		 document/riff-palette/little-endian
>>16	leshort		.		 v%d
# RIFF Device Independent Bitmap format
>8	string		RDIB		 image/riff-bitmap/little-endian
>>16	string		BM		 ""
>>>30	leshort		12		 OS2-1.x
>>>30	leshort		64		 OS2-2.x
>>>30	leshort		40		 Windows-3.x
# RIFF MIDI format
>8	string		RMID		 audio/midi/little-endian
# RIFF Multimedia Movie File format
>8	string		RMMP		 videa/riff-multimedia/little-endian
# Microsoft WAVE format (*.wav)
>8	string		WAVE		 audio/wav/little-endian
>>20	leshort		1		 Microsoft-PCM
>>>34	leshort		.		 %d bit
>>22	leshort		=1		 mono
>>22	leshort		=2		 stereo
>>22	leshort		.		 %d channels
>>24	lelong		.		 %d Hz
# AVI == Audio Video Interleave
>8      string          AVI\             video/AVI/little-endian
# Animated Cursor format
>8	string		ACON		 document/riff-animated-cursor/little-endian

#
# XXX - some of the below may only appear in little-endian form.
#
# Also "MV93" appears to be for one form of Macromedia Director
# files, and "GDMF" appears to be another multimedia format.
#
0	string		RIFX		 ""
# RIFF Palette format
>8	string		PAL		 document/riff-palette/big-endian
>>16	beshort		.		 v%d
# RIFF Device Independent Bitmap format
>8	string		RDIB		 image/riff-bitmap/big-endian
>>16	string		BM		 ""
>>>30	beshort		12		 OS2 1.x
>>>30	beshort		64		 OS2 2.x
>>>30	beshort		40		 Windows 3.x
# RIFF MIDI format
>8	string		RMID		 audio/MIDI/bid-endian
# RIFF Multimedia Movie File format
>8	string		RMMP		 video/riff-multimedia/big-endian
# Microsoft WAVE format (*.wav)
>8	string		WAVE		 audio/wav/big-endian
>>20	leshort		1		 Microsoft-PCM
>>>34	leshort		.		 %d bit
>>22	beshort		=1		 mono
>>22	beshort		=2		 stereo
>>22	beshort		.		 %d channels
>>24	belong		.		 %d Hz
# AVI == Audio Video Interleave
>8      string          AVI\             video/avi/big-endian
# Animated Cursor format
>8	string		ACON		 document/riff-animated-cursor/big-endian
# Notation Interchange File Format (big-endian only)
>8	string		NIFF		 document/riff-Notation-Interchange-Format

#------------------------------------------------------------------------------
#
# RPM: file(1) magic for Red Hat Packages   Erik Troan (ewt@redhat.com)
#
0	beshort		0xedab    	 ""
>2	beshort		0xeedb		 archive/rpm
>>4     byte            .                v%d
>>6	beshort		0		 bin
>>6	beshort		1		 src
>>8	beshort		1		 i386
>>8	beshort		2		 Alpha
>>8	beshort		3		 Sparc
>>8	beshort		4		 MIPS
>>8	beshort		5		 PowerPC
>>8	beshort		6		 68000
>>8     beshort         7                SGI

#------------------------------------------------------------------------------
# rtf:	file(1) magic for Rich Text Format (RTF)
#
# Duncan P. Simpson, D.P.Simpson@dcs.warwick.ac.uk
#
0	string		{\\rtf		text/rtf

#------------------------------------------------------------------------------
# sgi:  file(1) magic for Silicon Graphics (MIPS, IRIS, IRIX, etc.)
#                         Dec Ultrix (MIPS)
# all of SGI's *current* machines and OSes run in big-endian mode on the
# MIPS machines, as far as I know.
#
# XXX - what is the blank "-" line?
#
# kbd file definitions
0	belong	0407		executable/SGI/68020
0	belong	0410		executable/SGI/68020
#
0	beshort	0x0160		executable/SGI/MIPSEB-COFF
0	beshort	0x0162		executable/SGI/MIPSEL-COFF
0	beshort	0x6001		executable/SGI/MIPSEB-LE-COFF
0	beshort	0x6201		executable/SGI/MIPSEL-LE-COFF
0	beshort	0x0163		executable/SGI/MIPSEB-MIPS-II-COFF
0	beshort	0x0166		executable/SGI/MIPSEL-MIPS-II-COFF
0	beshort	0x6301		executable/SGI/MIPSEB-LE-MIPS-II-COFF
0	beshort	0x6601		executable/SGI/MIPSEL-LE-MIPS-II-COFF
0	beshort	0x0140		executable/SGI/MIPSEB-MIPS-III-COFF
0	beshort	0x0142		executable/SGI/MIPSEL-MIPS-III-COFF
0	beshort	0x4001		executable/SGI/MIPSEB-LE MIPS-III-COFF
0	beshort	0x4201		executable/SGI/MIPSEL-LE MIPS-III-COFF
0	belong	0xdeadadb0	binary/core/IRIX
0	belong	0xdeadad40	binary/core/IRIX/64-bit
0       belong	0xbabec0bb	binary/core/IRIX/N32
0	string	\x43\x72\x73\x68\x44\x75\x6d\x70	binary/core/IRIX/vmcore

#------------------------------------------------------------------------------
# sgml:  file(1) magic for Standard Generalized Markup Language
# HyperText Markup Language (HTML) is an SGML document type,
# from Daniel Quinlan (quinlan@yggdrasil.com)
0   string      \<!DOCTYPE\ HTML    text/HTML
0   string      \<!doctype\ html    text/HTML
0   string	\<!DOCTYPE\ html    text/HTML
0   string      \<HEAD              text/HTML
0   string      \<head              text/HTML
0   string      \<TITLE             text/HTML
0   string      \<title             text/HTML
0   string      \<html              text/HTML
0   string      \<HTML              text/HTML

# Extensible markup language (XML), a subset of SGML
# from Marc Prud'hommeaux (marc@apocalypse.org)
0	string		\<?xml	                text/XML
>23	string		\<xsl:stylesheet        XSL
>24	string		\<xsl:stylesheet        XSL

# SGML, mostly from rph@sq
0   string      \<!DOCTYPE  text/SGML
0   string      \<!doctype  text/SGML
0   string      \<!SUBDOC   text/SGML
0   string      \<!subdoc   text/SGML
0   string      \<!--       text/SGML

#------------------------------------------------------------------------------
# sniffer:  file(1) magic for packet capture files
#
# From: guy@netapp.com (Guy Harris)
#
# Microsoft Network Monitor capture files.
#
0	string		RTSS		binary/capture/NetMon
>6	leshort		0		Unknown-linklayer
>6	leshort		1		Ethernet
>6	leshort		2		Token-Ring
>6	leshort		3		FDDI

# Network General Sniffer capture files.
# Sorry, make that "Network Associates Sniffer capture files."
#
0	string		TRSNIFF\ data\ \ \ \ \032	binary/capture/Sniffer
>33	byte		2		compressed
>32	byte		0		Token-Ring
>32	byte		1		Ethernet
>32	byte		2		ARCNET
>32	byte		3		StarLAN
>32	byte		4		PC-Network
>32	byte		5		LocalTalk
>32	byte		6		Znet
>32	byte		7		Internetwork-Analyzer
>32	byte		9		FDDI
>32	byte		10		ATM

# Cinco Networks NetXRay capture files.
# Sorry, make that "Network General Sniffer Basic capture files."
# Sorry, make that "Network Associates Sniffer Basic capture files."
#
0	string		XCP\0		binary/capture/NetXRay

# "libpcap" capture files.
# (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
# the main program that uses that format, but there are other programs
# that use "libpcap", or that use the same capture file format.)
#
0	belong		0xa1b2cd34	binary/capture/tcpdump/big-endian
>20	belong		0		no-link-layer
>20	belong		1		Ethernet
>20	belong		2		3Mb-Ethernet
>20	belong		3		AX.25
>20	belong		4		ProNET
>20	belong		5		CHAOS
>20	belong		6		IEEE-802.x
>20	belong		7		ARCNET
>20	belong		8		SLIP
>20	belong		9		PPP
>20	belong		10		FDDI
>20	belong		11		RFC-1483-ATM
>20	belong		12		raw-IP
>20	belong		13		BSD-OS-SLIP
>20	belong		14		BSD-OS-PPP
0	lelong		0xa1b2cd34	binary/capture/tcpdump/little-endian
>20	lelong		0		no-link-layer
>20	lelong		1		Ethernet
>20	lelong		2		3Mb-Ethernet
>20	lelong		3		AX.25
>20	lelong		4		ProNET
>20	lelong		5		CHAOS
>20	lelong		6		IEEE-802.x
>20	lelong		7		ARCNET
>20	lelong		8		SLIP
>20	lelong		9		PPP
>20	lelong		10		FDDI
>20	lelong		11		RFC-1483-ATM
>20	lelong		12		raw-IP
>20	lelong		13		BSD-OS-SLIP
>20	lelong		14		BSD-OS-PPP

0	belong		0xa1b2c3d4	binary/capture/tcpdump-patched/big-endian
>20	belong		0		no-link-layer
>20	belong		1		Ethernet
>20	belong		2		3Mb-Ethernet
>20	belong		3		AX.25
>20	belong		4		ProNET
>20	belong		5		CHAOS
>20	belong		6		IEEE-802.x
>20	belong		7		ARCNET
>20	belong		8		SLIP
>20	belong		9		PPP
>20	belong		10		FDDI
>20	belong		11		RFC-1483-ATM
>20	belong		12		raw-IP
>20	belong		13		BSD-OS-SLIP
>20	belong		14		BSD-OS-PPP
0	lelong		0xa1b2c3d4	binary/capture/tcpdump-patched/little-endian
>20	lelong		0		no-link-layer
>20	lelong		1		Ethernet
>20	lelong		2		3Mb-Ethernet
>20	lelong		3		AX.25
>20	lelong		4		ProNET
>20	lelong		5		CHAOS
>20	lelong		6		IEEE-802.x
>20	lelong		7		ARCNET
>20	lelong		8		SLIP
>20	lelong		9		PPP
>20	lelong		10		FDDI
>20	lelong		11		RFC-1483-ATM
>20	lelong		12		raw-IP
>20	lelong		13		BSD-OS-SLIP
>20	lelong		14		BSD-OS-PPP

#
# AIX "iptrace" capture files.
#
0	string		iptrace\ 2.0	binary/capture/iptrace

#
# Novell LANalyzer capture files.
#
0	leshort		0x1001		binary/capture/LANalyzer
0	leshort		0x1007		binary/capture/LANalyzer

#
# HP-UX "nettl" capture files.
#
0	string		\x54\x52\x00\x64\x00	binary/capture/nettl

#
# RADCOM WAN/LAN Analyzer capture files.
#
0	string		\x42\xd2\x00\x34\x12\x66\x22\x88	binary/capture/RADCOM

#------------------------------------------------------------------------------
# sun:  file(1) magic for Sun machines
#
# Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x
# releases.  (5.x uses ELF.)
#
0	belong&077777777	0600413	""
>0	byte		&0x80		""
>>20	belong		<4096		binary/sun-sparc/shared-lib
>>20	belong		=4096		binary/sun-sparc/dynamically-linked-executable
>>20	belong		>4096		binary/sun-sparc/dynamically-linked-executable
>0	byte		^0x80		executable/sun-sparc
0	belong&077777777	0600410	""
>0	byte		&0x80		binary/sun-sparc/dynamically-linked-executable
>0	byte		^0x80		executable/sun-sparc
0	belong&077777777	0600407	""
>0	byte		&0x80		binary/sun-sparc/dynamically-linked-executable
>0	byte		^0x80		executable/sun-sparc

0	belong&077777777	0400413	""
>0	byte		&0x80		""
>>20	belong		<4096		binary/sun-mc68020/shared-lib
>>20	belong		>4095		executable/sun-mc68020

0	belong&077777777	0400410	""
>0	byte		&0x80		executable/sun-mc68020

0	belong&077777777	0200413	""
>0	byte		&0x80		""
>>20	belong		<4096		binary/sun-mc68010/shared-lib
>>20	belong		=4096		executable/sun-mc68010
>>20	belong		>4096		executable/sun-mc68010

0	belong&077777777	0200410	""
>0	byte		&0x80		executable/sun-mc68010
>0	byte		^0x80		executable/sun-mc68010

0	belong&077777777	0200407	""
>0	byte		&0x80		executable/sun-mc68010
>0	byte		^0x80		executable/sun-mc68010

# Core files.  "SPARC 4.x BCP" means "core file from a SunOS 4.x SPARC
# binary executed in compatibility mode under SunOS 5.x".
#
0	belong		0x080456	binary/core/SunOS

# Sun snoop (see RFC 1761, which describes the capture file format).
#
0	string		snoop		binary/capture/snoop


#------------------------------------------------------------------------------
# tex:  file(1) magic for TeX files
#
# From <conklin@talisman.kaleida.com>

# Although we may know the offset of certain text fields in TeX DVI
# and font files, we can't use them reliably because they are not
# zero terminated. [but we do anyway, christos]
0	string		\367\002	document/TeX/DVI
0	string		\367\203	font/TeX/generic
0	string		\367\131	font/TeX/packed
0	string		\367\312	font/TeX/virtual
0	string		This\ is\ TeX,	document/TeX/transcript
0	string		This\ is\ METAFONT,	document/METAFONT/transcript

# There is no way to detect TeX Font Metric (*.tfm) files without
# breaking them apart and reading the data.  The following patterns
# match most *.tfm files generated by METAFONT or afm2tfm.
2	string		\000\021	document/TeX/font-metric
2	string		\000\022	document/TeX/font-metric

# Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
0	string		\\input\ texinfo	document/texinfo
0	string		This\ is\ Info\ file	document/GNU-Info

# TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com)
0	string		\\input		document/TeX
0	string		\\section	document/LaTeX
0	string		\\setlength	document/LaTeX
0	string		\\documentstyle	document/LaTeX
0	string		\\chapter	document/LaTeX
0	string		\\documentclass	document/LaTeX
0	string		\\relax		document/LaTeX/auxiliary
0	string		\\contentsline	document/LaTeX/toc

# Index and glossary files
0	string		\\indexentry	        document/LaTeX/index/raw
0	string		\\begin{theindex}	document/LaTeX/index/sorted
0	string		\\glossaryentry	        document/LaTeX/glossary/raw
0	string		\\begin{theglossary}	document/LaTeX/glossary/sorted
0	string		This\ is\ makeindex	document/Makeindex
# End of TeX

#------------------------------------------------------------------------------
# troff:  file(1) magic for *roff
#
# updated by Daniel Quinlan (quinlan@yggdrasil.com)

# troff input
0	string		.\\"		text/troff
0	string		'\\"		text/troff
0	string		'.\\"		text/troff
0	string		\\"		text/troff

# ditroff intermediate output text
0	string		x\ T		text/ditroff

#------------------------------------------------------------------------------
# uuencode:  file(1) magic for ASCII-encoded files
#

# GRR:  the first line of xxencoded files is identical to that in uuencoded
# files, but the first character in most subsequent lines is 'h' instead of
# 'M'.  (xxencoding uses lowercase letters in place of most of uuencode's
# punctuation and survives BITNET gateways better.)  If regular expressions
# were supported, this entry could possibly be split into two with
# "begin\040\.\*\012M" or "begin\040\.\*\012h" (where \. and \* are REs).
0	string		begin\040	text/uuencoded

# btoa(1) is an alternative to uuencode that requires less space.
0	string		xbtoa\ Begin	text/btoa

# ship(1) is another, much cooler alternative to uuencode.
# Greg Roelofs, newt@uchicago.edu
0	string		$\012ship	text/ship

# BinHex is the Macintosh ASCII-encoded file format (see also "apple")
# Daniel Quinlan, quinlan@yggdrasil.com
11	string	must\ be\ converted\ with\ BinHex	text/BinHex

#------------------------------------------------------------------------------
# varied.out:  file(1) magic for various USG systems
#
#	Herewith many of the object file formats used by USG systems.
#	Most have been moved to files for a particular processor,
#	and deleted if they duplicate other entries.
#
# I'm keeping this in because my dad used to work for Perkin-Elmer :) --cK
#
0	short		0610		executable/Perkin-Elmer
# Cray
6	beshort		0407		executable/cray
# Ultrix 4.3
596	string		\130\337\377\377	binary/core/Ultrix
# gnu gmon magic From: Eugen Dedu <dedu@ese-metz.fr>
0	string		gmon		document/GNU-prof

#------------------------------------------------------------------------------
# VAX a.out (32V, BSD)
#
0	lelong		0407		executable/VAX
>16	lelong		>0		unstripped
0	lelong		0410		executable/VAX
>16	lelong		>0		unstripped
0	lelong		0413		executable/VAX/demand-paged
>16	lelong		>0		unstripped
0	lelong		0420		executable/VAX/demand-paged
>16	lelong		>0		unstripped

# VAX COFF
#
# The `versions' should be un-commented if they work for you.
# (Was the problem just one of endianness?)
#
0	leshort		0570		executable/VAX
>12	lelong		>0		unstripped
0	leshort		0575		executable/VAX
>12	lelong		>0		unstripped

#------------------------------------------------------------------------------
# vms:  file(1) magic for VMS executables (experimental)
#
# VMS .exe formats, both VAX and AXP (Greg Roelofs, newt@uchicago.edu)

# GRR 950122:  I'm just guessing on these, based on inspection of the headers
# of three executables each for Alpha and VAX architectures.  The VAX files
# all had headers similar to this:
#
#   00000  b0 00 30 00 44 00 60 00  00 00 00 00 30 32 30 35  ..0.D.`.....0205
#   00010  01 01 00 00 ff ff ff ff  ff ff ff ff 00 00 00 00  ................
#
0	string	\xb0\0\x30\0	executable/VMS-VAX
>44032	string	PK\003\004	Info-ZIP-SFX
#
# The AXP files all looked like this, except that the byte at offset 0x22
# was 06 in some of them and 07 in others:
#
#   00000  03 00 00 00 00 00 00 00  ec 02 00 00 10 01 00 00  ................
#   00010  68 00 00 00 98 00 00 00  b8 00 00 00 00 00 00 00  h...............
#   00020  00 00 07 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
#   00030  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  ................
#   00040  00 00 00 00 ff ff ff ff  ff ff ff ff 02 00 00 00  ................
#
0	belong	0x03000000	executable/VMS-Alpha
>75264	string	PK\003\004	Info-ZIP-SFX

# -----------------------------------------------------------
# VMware specific files (deducted from version 1.1 and log file entries)
# Anthon van der Neut (anthon@mnt.org)
0	belong	0x4d52564e	document/VMware/nvram
0	belong	0x434f5744	""
>8	byte	3	 	document/VMware/virtual-disk
>8	byte	2	 	document/VMware/virtual-disk/undoable


# -----------------------------------------------------------
#WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
1	string	WPC	document
>8	short	257	WordPerfect/macro
>8	short	258	WordPerfect/help-file
>8	short	259	WordPerfect/keyboard-file
>8	short	266	WordPerfect/document
>8	short	267	WordPerfect/dictionary
>8	short	268	WordPerfect/thesaurus
>8	short	269	WordPerfect/block
>8	short	270	WordPerfect/rectangular-block
>8	short	271	WordPerfect/column-block
>8	short	272	WordPerfect/printer-data
>8	short	275	WordPerfect/printer-data
>8	short	276	WordPerfect/driver-resource-data
>8	short	279	WordPerfect/hyphenation-code
>8	short	280	WordPerfect/hyphenation-data
>8	short	281	WordPerfect/macro-resource-data
>8	short	283	WordPerfect/hyphenation-lex
>8	short	285	WordPerfect/wordlist
>8	short	286	WordPerfect/equation-resource-data
>8	short	289	WordPerfect/spell-rules
>8	short	290	WordPerfect/dictionary-rules
>8	short	295	WordPerfect/spell-rules
>8	short	299	WordPerfect/settings-file
>8	short	301	WordPerfect/4.2-document
>8	short	325	WordPerfect/dialog-file
>8	short	332	WordPerfect/button-bar
>8	short	513	Shell/macro
>8	short	522	Shell/definition
>8	short	769	Notebook/macro
>8	short	770	Notebook/help-file
>8	short	771	Notebook/keyboard-file
>8	short	778	Notebook/definition
>8	short	1026	Calculator/help-file
>8	short 	1538	Calendar/help-file
>8	short 	1546	Calendar/data-file
>8	short	1793	Editor/macro
>8	short	1794	Editor/help-file
>8	short	1795	Editor/keyboard-file
>8	short	1817	Editor/macro-resource-file
>8	short 	2049	Macro-editor/macro
>8	short 	2050	Macro-editor/help-file
>8	short	2051	Macro-editor/keyboard-file
>8	short	2305	PlanPerfect/macro
>8	short	2306	PlanPerfect/help-file
>8	short	2307	PlanPerfect/keyboard-file
>8	short	2314	PlanPerfect/worksheet
>8	short	2319	PlanPerfect/printer-definition
>8	short	2322	PlanPerfect/graphic-definition
>8	short	2323	PlanPerfect/data
>8	short	2324	PlanPerfect/temporary-printer
>8	short	2329	PlanPerfect/macro-resource-data
>8	byte	11	Mail
>8	short	2818	help-file
>8	short	2821	distribution-list
>8	short	2826	outbox
>8	short	2827	inbox
>8	short	2836	user-archived-mailbox
>8	short	2837	archived-message-database
>8	short	2838	archived-attachments
>8	short	3083	Printer-temp-file
>8	short	3330	Scheduler/help-file
>8	short	3338	Scheduler/in-file
>8	short	3339	Scheduler/out-file
>8	short	3594	GroupWise/settings-file
>8	short	3601	GroupWise/directory-services
>8	short	3627	GroupWise/settings-file
>8	short	4362	Terminal/resource-data
>8	short	4363	Terminal/resource-data
>8	short	4395	Terminal/resource-data
>8	short	4619	GUI-loadable-text
>8	short	4620	graphics-resource-data
>8	short	4621	printer-settings-file
>8	short	4622	port-definition-file
>8	short	4623	print-queue-parameters
>8	short	4624	compressed-file
>8	short	5130	Network-service/msg-file
>8	short	5131	Network-service/msg-file
>8	short	5132	Async-gateway/login-msg
>8	short	5134	GroupWise/message-file
>8	short	7956	GroupWise/admin-domain-database
>8	short	7957	GroupWise/admin-host-database
>8	short	7959	GroupWise/admin-remote-host-database
>8	short	7960	GroupWise/admin-ADS-deferment-data-file
>8	short	8458	IntelliTAG-SGML-compiled-DTD
>8	long	18219264	WordPerfect/graphic-image/1.0
>8	long	18219520	WordPerfect/graphic-image/2.0
#end of WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE

#------------------------------------------------------------------------------
# xenix:  file(1) magic for Microsoft Xenix
#
# "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small
# model" lifted from "magic.xenix", with comment "derived empirically;
# treat as folklore until proven"
#
# "small model", "large model", "huge model" stuff lifted from XXX
#
# XXX - "x.out" collides with PDP-11 archives
#
0	string		core		object/core/xenix
0	byte		0x80		object/8086/relocatable/Microsoft
0	leshort		0x206		executable/a.out/Microsoft 
0	leshort		0x140		executable/x.out/Microsoft-8086
0	lelong		0x206		executable/b.out/Microsoft-8086

#------------------------------------------------------------------------------
# X11 Xauthority file (Wolfram Kleff)
14	string		MIT-MAGIC-COOKIE-1	document/X11/Xauthority

#------------------------------------------------------------------------------
# New stuff goes here:
#------------------------------------------------------------------------------
#
# RGB data with alpha layer magic
#
0       string          ARGB            image/imlib2-argb
