xref: /freebsd/contrib/file/magic/Magdir/archive (revision 9ce06829f29232e312130530c304d287b39b0059)
1b6cee71dSXin LI#------------------------------------------------------------------------------
2*9ce06829SXin LI# $File: archive,v 1.91 2015/09/16 13:49:33 christos Exp $
3b6cee71dSXin LI# archive:  file(1) magic for archive formats (see also "msdos" for self-
4b6cee71dSXin LI#           extracting compressed archives)
5b6cee71dSXin LI#
6b6cee71dSXin LI# cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
7b6cee71dSXin LI# pre-POSIX "tar" archives are handled in the C code.
8b6cee71dSXin LI
9b6cee71dSXin LI# POSIX tar archives
10b6cee71dSXin LI257	string		ustar\0		POSIX tar archive
11b6cee71dSXin LI!:mime	application/x-tar # encoding: posix
12b6cee71dSXin LI257	string		ustar\040\040\0	GNU tar archive
13b6cee71dSXin LI!:mime	application/x-tar # encoding: gnu
14b6cee71dSXin LI
15b6cee71dSXin LI# Incremental snapshot gnu-tar format from:
16b6cee71dSXin LI# http://www.gnu.org/software/tar/manual/html_node/Snapshot-Files.html
17b6cee71dSXin LI0	string		GNU\ tar-	GNU tar incremental snapshot data
18b6cee71dSXin LI>&0	regex		[0-9]\.[0-9]+-[0-9]+	version %s
19b6cee71dSXin LI
20b6cee71dSXin LI# cpio archives
21b6cee71dSXin LI#
22b6cee71dSXin LI# Yes, the top two "cpio archive" formats *are* supposed to just be "short".
23b6cee71dSXin LI# The idea is to indicate archives produced on machines with the same
24b6cee71dSXin LI# byte order as the machine running "file" with "cpio archive", and
25b6cee71dSXin LI# to indicate archives produced on machines with the opposite byte order
26b6cee71dSXin LI# from the machine running "file" with "byte-swapped cpio archive".
27b6cee71dSXin LI#
28b6cee71dSXin LI# The SVR4 "cpio(4)" hints that there are additional formats, but they
29b6cee71dSXin LI# are defined as "short"s; I think all the new formats are
30b6cee71dSXin LI# character-header formats and thus are strings, not numbers.
31b6cee71dSXin LI0	short		070707		cpio archive
32b6cee71dSXin LI!:mime	application/x-cpio
33b6cee71dSXin LI0	short		0143561		byte-swapped cpio archive
34b6cee71dSXin LI!:mime	application/x-cpio # encoding: swapped
35b6cee71dSXin LI0	string		070707		ASCII cpio archive (pre-SVR4 or odc)
36b6cee71dSXin LI0	string		070701		ASCII cpio archive (SVR4 with no CRC)
37b6cee71dSXin LI0	string		070702		ASCII cpio archive (SVR4 with CRC)
38b6cee71dSXin LI
39b6cee71dSXin LI#
40b6cee71dSXin LI# Various archive formats used by various versions of the "ar"
41b6cee71dSXin LI# command.
42b6cee71dSXin LI#
43b6cee71dSXin LI
44b6cee71dSXin LI#
45b6cee71dSXin LI# Original UNIX archive formats.
46b6cee71dSXin LI# They were written with binary values in host byte order, and
47b6cee71dSXin LI# the magic number was a host "int", which might have been 16 bits
48b6cee71dSXin LI# or 32 bits.  We don't say "PDP-11" or "VAX", as there might have
49b6cee71dSXin LI# been ports to little-endian 16-bit-int or 32-bit-int platforms
50b6cee71dSXin LI# (x86?) using some of those formats; if none existed, feel free
51b6cee71dSXin LI# to use "PDP-11" for little-endian 16-bit and "VAX" for little-endian
52b6cee71dSXin LI# 32-bit.  There might have been big-endian ports of that sort as
53b6cee71dSXin LI# well.
54b6cee71dSXin LI#
55b6cee71dSXin LI0	leshort		0177555		very old 16-bit-int little-endian archive
56b6cee71dSXin LI0	beshort		0177555		very old 16-bit-int big-endian archive
57b6cee71dSXin LI0	lelong		0177555		very old 32-bit-int little-endian archive
58b6cee71dSXin LI0	belong		0177555		very old 32-bit-int big-endian archive
59b6cee71dSXin LI
60b6cee71dSXin LI0	leshort		0177545		old 16-bit-int little-endian archive
61b6cee71dSXin LI>2	string		__.SYMDEF	random library
62b6cee71dSXin LI0	beshort		0177545		old 16-bit-int big-endian archive
63b6cee71dSXin LI>2	string		__.SYMDEF	random library
64b6cee71dSXin LI0	lelong		0177545		old 32-bit-int little-endian archive
65b6cee71dSXin LI>4	string		__.SYMDEF	random library
66b6cee71dSXin LI0	belong		0177545		old 32-bit-int big-endian archive
67b6cee71dSXin LI>4	string		__.SYMDEF	random library
68b6cee71dSXin LI
69b6cee71dSXin LI#
70b6cee71dSXin LI# From "pdp" (but why a 4-byte quantity?)
71b6cee71dSXin LI#
72b6cee71dSXin LI0	lelong		0x39bed		PDP-11 old archive
73b6cee71dSXin LI0	lelong		0x39bee		PDP-11 4.0 archive
74b6cee71dSXin LI
75b6cee71dSXin LI#
76b6cee71dSXin LI# XXX - what flavor of APL used this, and was it a variant of
77b6cee71dSXin LI# some ar archive format?  It's similar to, but not the same
78b6cee71dSXin LI# as, the APL workspace magic numbers in pdp.
79b6cee71dSXin LI#
80b6cee71dSXin LI0	long		0100554		apl workspace
81b6cee71dSXin LI
82b6cee71dSXin LI#
83b6cee71dSXin LI# System V Release 1 portable(?) archive format.
84b6cee71dSXin LI#
85b6cee71dSXin LI0	string		=<ar>		System V Release 1 ar archive
86b6cee71dSXin LI!:mime	application/x-archive
87b6cee71dSXin LI
88b6cee71dSXin LI#
89b6cee71dSXin LI# Debian package; it's in the portable archive format, and needs to go
90b6cee71dSXin LI# before the entry for regular portable archives, as it's recognized as
91b6cee71dSXin LI# a portable archive whose first member has a name beginning with
92b6cee71dSXin LI# "debian".
93b6cee71dSXin LI#
94b6cee71dSXin LI0	string		=!<arch>\ndebian
95b6cee71dSXin LI>8	string		debian-split	part of multipart Debian package
96b6cee71dSXin LI!:mime	application/vnd.debian.binary-package
97b6cee71dSXin LI>8	string		debian-binary	Debian binary package
98b6cee71dSXin LI!:mime	application/vnd.debian.binary-package
99b6cee71dSXin LI>8	string		!debian
100b6cee71dSXin LI>68	string		>\0		(format %s)
101b6cee71dSXin LI# These next two lines do not work, because a bzip2 Debian archive
102b6cee71dSXin LI# still uses gzip for the control.tar (first in the archive).  Only
103b6cee71dSXin LI# data.tar varies, and the location of its filename varies too.
104b6cee71dSXin LI# file/libmagic does not current have support for ascii-string based
105b6cee71dSXin LI# (offsets) as of 2005-09-15.
106b6cee71dSXin LI#>81	string		bz2		\b, uses bzip2 compression
107b6cee71dSXin LI#>84	string		gz		\b, uses gzip compression
108b6cee71dSXin LI#>136	ledate		x		created: %s
109b6cee71dSXin LI
110b6cee71dSXin LI#
111b6cee71dSXin LI# MIPS archive; they're in the portable archive format, and need to go
112b6cee71dSXin LI# before the entry for regular portable archives, as it's recognized as
113b6cee71dSXin LI# a portable archive whose first member has a name beginning with
114b6cee71dSXin LI# "__________E".
115b6cee71dSXin LI#
116b6cee71dSXin LI0	string	=!<arch>\n__________E	MIPS archive
117b6cee71dSXin LI!:mime	application/x-archive
118b6cee71dSXin LI>20	string	U			with MIPS Ucode members
119b6cee71dSXin LI>21	string	L			with MIPSEL members
120b6cee71dSXin LI>21	string	B			with MIPSEB members
121b6cee71dSXin LI>19	string	L			and an EL hash table
122b6cee71dSXin LI>19	string	B			and an EB hash table
123b6cee71dSXin LI>22	string	X			-- out of date
124b6cee71dSXin LI
125b6cee71dSXin LI0	search/1	-h-		Software Tools format archive text
126b6cee71dSXin LI
127b6cee71dSXin LI#
128b6cee71dSXin LI# BSD/SVR2-and-later portable archive formats.
129b6cee71dSXin LI#
130b6cee71dSXin LI0	string		=!<arch>		current ar archive
131b6cee71dSXin LI!:mime	application/x-archive
132b6cee71dSXin LI>8	string		__.SYMDEF	random library
133b6cee71dSXin LI>68	string		__.SYMDEF\ SORTED	random library
134b6cee71dSXin LI
135b6cee71dSXin LI#
136b6cee71dSXin LI# "Thin" archive, as can be produced by GNU ar.
137b6cee71dSXin LI#
138b6cee71dSXin LI0	string		=!<thin>\n	thin archive with
139b6cee71dSXin LI>68	belong		0		no symbol entries
140b6cee71dSXin LI>68	belong		1		%d symbol entry
141b6cee71dSXin LI>68	belong		>1		%d symbol entries
142b6cee71dSXin LI
143b6cee71dSXin LI# ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
144b6cee71dSXin LI#
145b6cee71dSXin LI# The first byte is the magic (0x1a), byte 2 is the compression type for
146b6cee71dSXin LI# the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
147b6cee71dSXin LI# filename of the first file (null terminated).  Since some types collide
148b6cee71dSXin LI# we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
149b6cee71dSXin LI# 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%).  0x01 collides with terminfo.
150b6cee71dSXin LI0	lelong&0x8080ffff	0x0000081a	ARC archive data, dynamic LZW
151b6cee71dSXin LI!:mime	application/x-arc
152b6cee71dSXin LI0	lelong&0x8080ffff	0x0000091a	ARC archive data, squashed
153b6cee71dSXin LI!:mime	application/x-arc
154b6cee71dSXin LI0	lelong&0x8080ffff	0x0000021a	ARC archive data, uncompressed
155b6cee71dSXin LI!:mime	application/x-arc
156b6cee71dSXin LI0	lelong&0x8080ffff	0x0000031a	ARC archive data, packed
157b6cee71dSXin LI!:mime	application/x-arc
158b6cee71dSXin LI0	lelong&0x8080ffff	0x0000041a	ARC archive data, squeezed
159b6cee71dSXin LI!:mime	application/x-arc
160b6cee71dSXin LI0	lelong&0x8080ffff	0x0000061a	ARC archive data, crunched
161b6cee71dSXin LI!:mime	application/x-arc
162b6cee71dSXin LI# [JW] stuff taken from idarc, obviously ARC successors:
163b6cee71dSXin LI0	lelong&0x8080ffff	0x00000a1a	PAK archive data
164b6cee71dSXin LI!:mime	application/x-arc
165b6cee71dSXin LI0	lelong&0x8080ffff	0x0000141a	ARC+ archive data
166b6cee71dSXin LI!:mime	application/x-arc
167b6cee71dSXin LI0	lelong&0x8080ffff	0x0000481a	HYP archive data
168b6cee71dSXin LI!:mime	application/x-arc
169b6cee71dSXin LI
170b6cee71dSXin LI# Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
171b6cee71dSXin LI# I can't create either SPARK or ArcFS archives so I have not tested this stuff
172b6cee71dSXin LI# [GRR:  the original entries collide with ARC, above; replaced with combined
173b6cee71dSXin LI#  version (not tested)]
174b6cee71dSXin LI#0	byte		0x1a		RISC OS archive (spark format)
175b6cee71dSXin LI0	string		\032archive	RISC OS archive (ArcFS format)
176b6cee71dSXin LI0       string          Archive\000     RISC OS archive (ArcFS format)
177b6cee71dSXin LI
178b6cee71dSXin LI# All these were taken from idarc, many could not be verified. Unfortunately,
179b6cee71dSXin LI# there were many low-quality sigs, i.e. easy to trigger false positives.
180b6cee71dSXin LI# Please notify me of any real-world fishy/ambiguous signatures and I'll try
181b6cee71dSXin LI# to get my hands on the actual archiver and see if I find something better. [JW]
182b6cee71dSXin LI# probably many can be enhanced by finding some 0-byte or control char near the start
183b6cee71dSXin LI
184b6cee71dSXin LI# idarc calls this Crush/Uncompressed... *shrug*
185b6cee71dSXin LI0	string	CRUSH Crush archive data
186b6cee71dSXin LI# Squeeze It (.sqz)
187b6cee71dSXin LI0	string	HLSQZ Squeeze It archive data
188b6cee71dSXin LI# SQWEZ
189b6cee71dSXin LI0	string	SQWEZ SQWEZ archive data
190b6cee71dSXin LI# HPack (.hpk)
191b6cee71dSXin LI0	string	HPAK HPack archive data
192b6cee71dSXin LI# HAP
193b6cee71dSXin LI0	string	\x91\x33HF HAP archive data
194b6cee71dSXin LI# MD/MDCD
195b6cee71dSXin LI0	string	MDmd MDCD archive data
196b6cee71dSXin LI# LIM
197b6cee71dSXin LI0	string	LIM\x1a LIM archive data
198b6cee71dSXin LI# SAR
199b6cee71dSXin LI3	string	LH5 SAR archive data
200b6cee71dSXin LI# BSArc/BS2
201b6cee71dSXin LI0	string	\212\3SB\020\0	BSArc/BS2 archive data
202b6cee71dSXin LI# Bethesda Softworks Archive (Oblivion)
203b6cee71dSXin LI0	string	BSA\0 		BSArc archive data
204b6cee71dSXin LI>4	lelong	x		version %d
205b6cee71dSXin LI# MAR
206b6cee71dSXin LI2	string	=-ah MAR archive data
207b6cee71dSXin LI# ACB
208b6cee71dSXin LI#0	belong&0x00f800ff	0x00800000 ACB archive data
209b6cee71dSXin LI# CPZ
210b6cee71dSXin LI# TODO, this is what idarc says: 0	string	\0\0\0 CPZ archive data
211b6cee71dSXin LI# JRC
212b6cee71dSXin LI0	string	JRchive JRC archive data
213b6cee71dSXin LI# Quantum
214b6cee71dSXin LI0	string	DS\0 Quantum archive data
215b6cee71dSXin LI# ReSOF
216b6cee71dSXin LI0	string	PK\3\6 ReSOF archive data
217b6cee71dSXin LI# QuArk
218b6cee71dSXin LI0	string	7\4 QuArk archive data
219b6cee71dSXin LI# YAC
220b6cee71dSXin LI14	string	YC YAC archive data
221b6cee71dSXin LI# X1
222b6cee71dSXin LI0	string	X1 X1 archive data
223b6cee71dSXin LI0	string	XhDr X1 archive data
224b6cee71dSXin LI# CDC Codec (.dqt)
225b6cee71dSXin LI0	belong&0xffffe000	0x76ff2000 CDC Codec archive data
226b6cee71dSXin LI# AMGC
227b6cee71dSXin LI0	string	\xad6" AMGC archive data
228b6cee71dSXin LI# NuLIB
229b6cee71dSXin LI0	string	N\xc3\xb5F\xc3\xa9lx\xc3\xa5 NuLIB archive data
230b6cee71dSXin LI# PakLeo
231b6cee71dSXin LI0	string	LEOLZW PAKLeo archive data
232b6cee71dSXin LI# ChArc
233b6cee71dSXin LI0	string	SChF ChArc archive data
234b6cee71dSXin LI# PSA
235b6cee71dSXin LI0	string	PSA PSA archive data
236b6cee71dSXin LI# CrossePAC
237b6cee71dSXin LI0	string	DSIGDCC CrossePAC archive data
238b6cee71dSXin LI# Freeze
239b6cee71dSXin LI0	string	\x1f\x9f\x4a\x10\x0a Freeze archive data
240b6cee71dSXin LI# KBoom
241b6cee71dSXin LI0	string	\xc2\xa8MP\xc2\xa8 KBoom archive data
242b6cee71dSXin LI# NSQ, must go after CDC Codec
243b6cee71dSXin LI0	string	\x76\xff NSQ archive data
244b6cee71dSXin LI# DPA
245b6cee71dSXin LI0	string	Dirk\ Paehl DPA archive data
246b6cee71dSXin LI# BA
247b6cee71dSXin LI# TODO: idarc says "bytes 0-2 == bytes 3-5"
248b6cee71dSXin LI# TTComp
249b6cee71dSXin LI0	string	\0\6 TTComp archive data
250b6cee71dSXin LI# ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
251b6cee71dSXin LI0	string	ESP ESP archive data
252b6cee71dSXin LI# ZPack
253b6cee71dSXin LI0	string	\1ZPK\1 ZPack archive data
254b6cee71dSXin LI# Sky
255b6cee71dSXin LI0	string	\xbc\x40 Sky archive data
256b6cee71dSXin LI# UFA
257b6cee71dSXin LI0	string	UFA UFA archive data
258b6cee71dSXin LI# Dry
259b6cee71dSXin LI0	string	=-H2O DRY archive data
260b6cee71dSXin LI# FoxSQZ
261b6cee71dSXin LI0	string	FOXSQZ FoxSQZ archive data
262b6cee71dSXin LI# AR7
263b6cee71dSXin LI0	string	,AR7 AR7 archive data
264b6cee71dSXin LI# PPMZ
265b6cee71dSXin LI0	string	PPMZ PPMZ archive data
266b6cee71dSXin LI# MS Compress
267b6cee71dSXin LI4	string	\x88\xf0\x27 MS Compress archive data
268b6cee71dSXin LI# updated by Joerg Jenderek
269b6cee71dSXin LI>9	string	\0
270b6cee71dSXin LI>>0	string	KWAJ
271b6cee71dSXin LI>>>7	string	\321\003	MS Compress archive data
272b6cee71dSXin LI>>>>14	ulong	>0		\b, original size: %d bytes
273b6cee71dSXin LI>>>>18		ubyte	>0x65
274b6cee71dSXin LI>>>>>18		string	x       \b, was %.8s
275b6cee71dSXin LI>>>>>(10.b-4)	string	x       \b.%.3s
276b6cee71dSXin LI# MP3 (archiver, not lossy audio compression)
277b6cee71dSXin LI0	string	MP3\x1a MP3-Archiver archive data
278b6cee71dSXin LI# ZET
279b6cee71dSXin LI0	string	OZ\xc3\x9d ZET archive data
280b6cee71dSXin LI# TSComp
281b6cee71dSXin LI0	string	\x65\x5d\x13\x8c\x08\x01\x03\x00 TSComp archive data
282b6cee71dSXin LI# ARQ
283b6cee71dSXin LI0	string	gW\4\1 ARQ archive data
284b6cee71dSXin LI# Squash
285b6cee71dSXin LI3	string	OctSqu Squash archive data
286b6cee71dSXin LI# Terse
287b6cee71dSXin LI0	string	\5\1\1\0 Terse archive data
288b6cee71dSXin LI# PUCrunch
289b6cee71dSXin LI0	string	\x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31 PUCrunch archive data
290b6cee71dSXin LI# UHarc
291b6cee71dSXin LI0	string	UHA UHarc archive data
292b6cee71dSXin LI# ABComp
293b6cee71dSXin LI0	string	\2AB ABComp archive data
294b6cee71dSXin LI0	string	\3AB2 ABComp archive data
295b6cee71dSXin LI# CMP
296b6cee71dSXin LI0	string	CO\0 CMP archive data
297b6cee71dSXin LI# Splint
298b6cee71dSXin LI0	string	\x93\xb9\x06 Splint archive data
299b6cee71dSXin LI# InstallShield
300b6cee71dSXin LI0	string	\x13\x5d\x65\x8c InstallShield Z archive Data
301b6cee71dSXin LI# Gather
302b6cee71dSXin LI1	string	GTH Gather archive data
303b6cee71dSXin LI# BOA
304b6cee71dSXin LI0	string	BOA BOA archive data
305b6cee71dSXin LI# RAX
306b6cee71dSXin LI0	string	ULEB\xa RAX archive data
307b6cee71dSXin LI# Xtreme
308b6cee71dSXin LI0	string	ULEB\0 Xtreme archive data
309b6cee71dSXin LI# Pack Magic
310b6cee71dSXin LI0	string	@\xc3\xa2\1\0 Pack Magic archive data
311b6cee71dSXin LI# BTS
312b6cee71dSXin LI0	belong&0xfeffffff	0x1a034465 BTS archive data
313b6cee71dSXin LI# ELI 5750
314b6cee71dSXin LI0	string	Ora\  ELI 5750 archive data
315b6cee71dSXin LI# QFC
316b6cee71dSXin LI0	string	\x1aFC\x1a QFC archive data
317b6cee71dSXin LI0	string	\x1aQF\x1a QFC archive data
318b6cee71dSXin LI# PRO-PACK
319b6cee71dSXin LI0	string	RNC PRO-PACK archive data
320b6cee71dSXin LI# 777
321b6cee71dSXin LI0	string	777 777 archive data
322b6cee71dSXin LI# LZS221
323b6cee71dSXin LI0	string	sTaC LZS221 archive data
324b6cee71dSXin LI# HPA
325b6cee71dSXin LI0	string	HPA HPA archive data
326b6cee71dSXin LI# Arhangel
327b6cee71dSXin LI0	string	LG Arhangel archive data
328b6cee71dSXin LI# EXP1, uses bzip2
329b6cee71dSXin LI0	string	0123456789012345BZh EXP1 archive data
330b6cee71dSXin LI# IMP
331b6cee71dSXin LI0	string	IMP\xa IMP archive data
332b6cee71dSXin LI# NRV
333b6cee71dSXin LI0	string	\x00\x9E\x6E\x72\x76\xFF NRV archive data
334b6cee71dSXin LI# Squish
335b6cee71dSXin LI0	string	\x73\xb2\x90\xf4 Squish archive data
336b6cee71dSXin LI# Par
337b6cee71dSXin LI0	string	PHILIPP Par archive data
338b6cee71dSXin LI0	string	PAR Par archive data
339b6cee71dSXin LI# HIT
340b6cee71dSXin LI0	string	UB HIT archive data
341b6cee71dSXin LI# SBX
342b6cee71dSXin LI0	belong&0xfffff000	0x53423000 SBX archive data
343b6cee71dSXin LI# NaShrink
344b6cee71dSXin LI0	string	NSK NaShrink archive data
345b6cee71dSXin LI# SAPCAR
346b6cee71dSXin LI0	string	#\ CAR\ archive\ header SAPCAR archive data
347b6cee71dSXin LI0	string	CAR\ 2.00RG SAPCAR archive data
348b6cee71dSXin LI# Disintegrator
349b6cee71dSXin LI0	string	DST Disintegrator archive data
350b6cee71dSXin LI# ASD
351b6cee71dSXin LI0	string	ASD ASD archive data
352b6cee71dSXin LI# InstallShield CAB
353b6cee71dSXin LI0	string	ISc( InstallShield CAB
354b6cee71dSXin LI# TOP4
355b6cee71dSXin LI0	string	T4\x1a TOP4 archive data
356b6cee71dSXin LI# BatComp left out: sig looks like COM executable
357b6cee71dSXin LI# so TODO: get real 4dos batcomp file and find sig
358b6cee71dSXin LI# BlakHole
359b6cee71dSXin LI0	string	BH\5\7 BlakHole archive data
360b6cee71dSXin LI# BIX
361b6cee71dSXin LI0	string	BIX0 BIX archive data
362b6cee71dSXin LI# ChiefLZA
363b6cee71dSXin LI0	string	ChfLZ ChiefLZA archive data
364b6cee71dSXin LI# Blink
365b6cee71dSXin LI0	string	Blink Blink archive data
366b6cee71dSXin LI# Logitech Compress
367b6cee71dSXin LI0	string	\xda\xfa Logitech Compress archive data
368b6cee71dSXin LI# ARS-Sfx (FIXME: really a SFX? then goto COM/EXE)
369b6cee71dSXin LI1	string	(C)\ STEPANYUK ARS-Sfx archive data
370b6cee71dSXin LI# AKT/AKT32
371b6cee71dSXin LI0	string	AKT32 AKT32 archive data
372b6cee71dSXin LI0	string	AKT AKT archive data
373b6cee71dSXin LI# NPack
374b6cee71dSXin LI0	string	MSTSM NPack archive data
375b6cee71dSXin LI# PFT
376b6cee71dSXin LI0	string	\0\x50\0\x14 PFT archive data
377b6cee71dSXin LI# SemOne
378b6cee71dSXin LI0	string	SEM SemOne archive data
379b6cee71dSXin LI# PPMD
380b6cee71dSXin LI0	string	\x8f\xaf\xac\x84 PPMD archive data
381b6cee71dSXin LI# FIZ
382b6cee71dSXin LI0	string	FIZ FIZ archive data
383b6cee71dSXin LI# MSXiE
384b6cee71dSXin LI0	belong&0xfffff0f0	0x4d530000 MSXiE archive data
385b6cee71dSXin LI# DeepFreezer
386b6cee71dSXin LI0	belong&0xfffffff0	0x797a3030 DeepFreezer archive data
387b6cee71dSXin LI# DC
388b6cee71dSXin LI0	string	=<DC- DC archive data
389b6cee71dSXin LI# TPac
390b6cee71dSXin LI0	string	\4TPAC\3 TPac archive data
391b6cee71dSXin LI# Ai
392b6cee71dSXin LI0	string	Ai\1\1\0 Ai archive data
393b6cee71dSXin LI0	string	Ai\1\0\0 Ai archive data
394b6cee71dSXin LI# Ai32
395b6cee71dSXin LI0	string	Ai\2\0 Ai32 archive data
396b6cee71dSXin LI0	string	Ai\2\1 Ai32 archive data
397b6cee71dSXin LI# SBC
398b6cee71dSXin LI0	string	SBC SBC archive data
399b6cee71dSXin LI# Ybs
400b6cee71dSXin LI0	string	YBS Ybs archive data
401b6cee71dSXin LI# DitPack
402b6cee71dSXin LI0	string	\x9e\0\0 DitPack archive data
403b6cee71dSXin LI# DMS
404b6cee71dSXin LI0	string	DMS! DMS archive data
405b6cee71dSXin LI# EPC
406b6cee71dSXin LI0	string	\x8f\xaf\xac\x8c EPC archive data
407b6cee71dSXin LI# VSARC
408b6cee71dSXin LI0	string	VS\x1a VSARC archive data
409b6cee71dSXin LI# PDZ
410b6cee71dSXin LI0	string	PDZ PDZ archive data
411b6cee71dSXin LI# ReDuq
412b6cee71dSXin LI0	string	rdqx ReDuq archive data
413b6cee71dSXin LI# GCA
414b6cee71dSXin LI0	string	GCAX GCA archive data
415b6cee71dSXin LI# PPMN
416b6cee71dSXin LI0	string	pN PPMN archive data
417b6cee71dSXin LI# WinImage
418b6cee71dSXin LI3	string	WINIMAGE WinImage archive data
419b6cee71dSXin LI# Compressia
420b6cee71dSXin LI0	string	CMP0CMP Compressia archive data
421b6cee71dSXin LI# UHBC
422b6cee71dSXin LI0	string	UHB UHBC archive data
423b6cee71dSXin LI# WinHKI
424b6cee71dSXin LI0	string	\x61\x5C\x04\x05 WinHKI archive data
425b6cee71dSXin LI# WWPack data file
426b6cee71dSXin LI0	string	WWP WWPack archive data
427b6cee71dSXin LI# BSN (BSA, PTS-DOS)
428b6cee71dSXin LI0	string	\xffBSG BSN archive data
429b6cee71dSXin LI1	string	\xffBSG BSN archive data
430b6cee71dSXin LI3	string	\xffBSG BSN archive data
431b6cee71dSXin LI1	string	\0\xae\2 BSN archive data
432b6cee71dSXin LI1	string	\0\xae\3 BSN archive data
433b6cee71dSXin LI1	string	\0\xae\7 BSN archive data
434b6cee71dSXin LI# AIN
435b6cee71dSXin LI0	string	\x33\x18 AIN archive data
436b6cee71dSXin LI0	string	\x33\x17 AIN archive data
437*9ce06829SXin LI# XPA32 test moved and merged with XPA by Joerg Jenderek at Sep 2015
438b6cee71dSXin LI# SZip (TODO: doesn't catch all versions)
439b6cee71dSXin LI0	string	SZ\x0a\4 SZip archive data
440b6cee71dSXin LI# XPack DiskImage
441*9ce06829SXin LI# *.XDI updated by Joerg Jenderek Sep 2015
442*9ce06829SXin LI# ftp://ftp.sac.sk/pub/sac/pack/0index.txt
443*9ce06829SXin LI# GRR: this test is still too general as it catches also text files starting with jm
444*9ce06829SXin LI0	string	jm
445*9ce06829SXin LI# only found examples with this additional characteristic 2 bytes
446*9ce06829SXin LI>2	string	\x2\x4	Xpack DiskImage archive data
447*9ce06829SXin LI#!:ext xdi
448b6cee71dSXin LI# XPack Data
449*9ce06829SXin LI# *.xpa updated by Joerg Jenderek Sep 2015
450*9ce06829SXin LI# ftp://ftp.elf.stuba.sk/pub/pc/pack/
451*9ce06829SXin LI0	string	xpa	XPA
452*9ce06829SXin LI!:ext	xpa
453*9ce06829SXin LI# XPA32
454*9ce06829SXin LI# ftp://ftp.elf.stuba.sk/pub/pc/pack/xpa32.zip
455*9ce06829SXin LI# created by XPA32.EXE version 1.0.2 for Windows
456*9ce06829SXin LI>0	string	xpa\0\1 \b32 archive data
457*9ce06829SXin LI# created by XPACK.COM version 1.67m or 1.67r with short 0x1800
458*9ce06829SXin LI>3	ubeshort	!0x0001	\bck archive data
459b6cee71dSXin LI# XPack Single Data
460*9ce06829SXin LI# changed by Joerg Jenderek Sep 2015 back to like in version 5.12
461*9ce06829SXin LI# letter 'I'+ acute accent is equivalent to \xcd
462*9ce06829SXin LI0	string	\xcd\ jm	Xpack single archive data
463*9ce06829SXin LI#!:mime	application/x-xpa-compressed
464*9ce06829SXin LI!:ext xpa
465b6cee71dSXin LI
466b6cee71dSXin LI# TODO: missing due to unknown magic/magic at end of file:
467b6cee71dSXin LI#DWC
468b6cee71dSXin LI#ARG
469b6cee71dSXin LI#ZAR
470b6cee71dSXin LI#PC/3270
471b6cee71dSXin LI#InstallIt
472b6cee71dSXin LI#RKive
473b6cee71dSXin LI#RK
474b6cee71dSXin LI#XPack Diskimage
475b6cee71dSXin LI
476b6cee71dSXin LI# These were inspired by idarc, but actually verified
477b6cee71dSXin LI# Dzip archiver (.dz)
478b6cee71dSXin LI0	string	DZ Dzip archive data
479b6cee71dSXin LI>2	byte	x \b, version %i
480b6cee71dSXin LI>3	byte	x \b.%i
481b6cee71dSXin LI# ZZip archiver (.zz)
482b6cee71dSXin LI0	string	ZZ\ \0\0 ZZip archive data
483b6cee71dSXin LI0	string	ZZ0 ZZip archive data
484b6cee71dSXin LI# PAQ archiver (.paq)
485b6cee71dSXin LI0	string	\xaa\x40\x5f\x77\x1f\xe5\x82\x0d PAQ archive data
486b6cee71dSXin LI0	string	PAQ PAQ archive data
487b6cee71dSXin LI>3	byte&0xf0	0x30
488b6cee71dSXin LI>>3	byte	x (v%c)
489b6cee71dSXin LI# JAR archiver (.j), this is the successor to ARJ, not Java's JAR (which is essentially ZIP)
490b6cee71dSXin LI0xe	string	\x1aJar\x1b JAR (ARJ Software, Inc.) archive data
491b6cee71dSXin LI0	string	JARCS JAR (ARJ Software, Inc.) archive data
492b6cee71dSXin LI
493b6cee71dSXin LI# ARJ archiver (jason@jarthur.Claremont.EDU)
494b6cee71dSXin LI0	leshort		0xea60		ARJ archive data
495b6cee71dSXin LI!:mime	application/x-arj
496b6cee71dSXin LI>5	byte		x		\b, v%d,
497b6cee71dSXin LI>8	byte		&0x04		multi-volume,
498b6cee71dSXin LI>8	byte		&0x10		slash-switched,
499b6cee71dSXin LI>8	byte		&0x20		backup,
500b6cee71dSXin LI>34	string		x		original name: %s,
501b6cee71dSXin LI>7	byte		0		os: MS-DOS
502b6cee71dSXin LI>7	byte		1		os: PRIMOS
503b6cee71dSXin LI>7	byte		2		os: Unix
504b6cee71dSXin LI>7	byte		3		os: Amiga
505b6cee71dSXin LI>7	byte		4		os: Macintosh
506b6cee71dSXin LI>7	byte		5		os: OS/2
507b6cee71dSXin LI>7	byte		6		os: Apple ][ GS
508b6cee71dSXin LI>7	byte		7		os: Atari ST
509b6cee71dSXin LI>7	byte		8		os: NeXT
510b6cee71dSXin LI>7	byte		9		os: VAX/VMS
511b6cee71dSXin LI>3	byte		>0		%d]
512b6cee71dSXin LI# [JW] idarc says this is also possible
513b6cee71dSXin LI2	leshort		0xea60		ARJ archive data
514b6cee71dSXin LI
515b6cee71dSXin LI# HA archiver (Greg Roelofs, newt@uchicago.edu)
516b6cee71dSXin LI# This is a really bad format. A file containing HAWAII will match this...
517b6cee71dSXin LI#0	string		HA		HA archive data,
518b6cee71dSXin LI#>2	leshort		=1		1 file,
519b6cee71dSXin LI#>2	leshort		>1		%hu files,
520b6cee71dSXin LI#>4	byte&0x0f	=0		first is type CPY
521b6cee71dSXin LI#>4	byte&0x0f	=1		first is type ASC
522b6cee71dSXin LI#>4	byte&0x0f	=2		first is type HSC
523b6cee71dSXin LI#>4	byte&0x0f	=0x0e		first is type DIR
524b6cee71dSXin LI#>4	byte&0x0f	=0x0f		first is type SPECIAL
525b6cee71dSXin LI# suggestion: at least identify small archives (<1024 files)
526b6cee71dSXin LI0  belong&0xffff00fc 0x48410000 HA archive data
527b6cee71dSXin LI>2	leshort		=1		1 file,
528b6cee71dSXin LI>2	leshort		>1		%u files,
529b6cee71dSXin LI>4	byte&0x0f	=0		first is type CPY
530b6cee71dSXin LI>4	byte&0x0f	=1		first is type ASC
531b6cee71dSXin LI>4	byte&0x0f	=2		first is type HSC
532b6cee71dSXin LI>4	byte&0x0f	=0x0e		first is type DIR
533b6cee71dSXin LI>4	byte&0x0f	=0x0f		first is type SPECIAL
534b6cee71dSXin LI
535b6cee71dSXin LI# HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
536b6cee71dSXin LI0	string		HPAK		HPACK archive data
537b6cee71dSXin LI
538b6cee71dSXin LI# JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
539b6cee71dSXin LI0	string		\351,\001JAM\ 		JAM archive,
540b6cee71dSXin LI>7	string		>\0			version %.4s
541b6cee71dSXin LI>0x26	byte		=0x27			-
542b6cee71dSXin LI>>0x2b	string          >\0			label %.11s,
543b6cee71dSXin LI>>0x27	lelong		x			serial %08x,
544b6cee71dSXin LI>>0x36	string		>\0			fstype %.8s
545b6cee71dSXin LI
546b6cee71dSXin LI# LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
547b6cee71dSXin LI2	string		-lh0-		LHarc 1.x/ARX archive data [lh0]
548b6cee71dSXin LI!:mime	application/x-lharc
549b6cee71dSXin LI2	string		-lh1-		LHarc 1.x/ARX archive data [lh1]
550b6cee71dSXin LI!:mime	application/x-lharc
551b6cee71dSXin LI2	string		-lz4-		LHarc 1.x archive data [lz4]
552b6cee71dSXin LI!:mime	application/x-lharc
553b6cee71dSXin LI2	string		-lz5-		LHarc 1.x archive data [lz5]
554b6cee71dSXin LI!:mime	application/x-lharc
555b6cee71dSXin LI#	[never seen any but the last; -lh4- reported in comp.compression:]
556b6cee71dSXin LI2	string		-lzs-		LHa/LZS archive data [lzs]
557b6cee71dSXin LI!:mime	application/x-lha
558b6cee71dSXin LI2	string		-lh\40-		LHa 2.x? archive data [lh ]
559b6cee71dSXin LI!:mime	application/x-lha
560b6cee71dSXin LI2	string		-lhd-		LHa 2.x? archive data [lhd]
561b6cee71dSXin LI!:mime	application/x-lha
562b6cee71dSXin LI2	string		-lh2-		LHa 2.x? archive data [lh2]
563b6cee71dSXin LI!:mime	application/x-lha
564b6cee71dSXin LI2	string		-lh3-		LHa 2.x? archive data [lh3]
565b6cee71dSXin LI!:mime	application/x-lha
566b6cee71dSXin LI2	string		-lh4-		LHa (2.x) archive data [lh4]
567b6cee71dSXin LI!:mime	application/x-lha
568b6cee71dSXin LI2	string		-lh5-		LHa (2.x) archive data [lh5]
569b6cee71dSXin LI!:mime	application/x-lha
570b6cee71dSXin LI2	string		-lh6-		LHa (2.x) archive data [lh6]
571b6cee71dSXin LI!:mime	application/x-lha
572b6cee71dSXin LI2	string		-lh7-		LHa (2.x)/LHark archive data [lh7]
573b6cee71dSXin LI!:mime	application/x-lha
574b6cee71dSXin LI>20	byte		x		- header level %d
575b6cee71dSXin LI# taken from idarc [JW]
576b6cee71dSXin LI2   string      -lZ         PUT archive data
577b6cee71dSXin LI2   string      -lz         LZS archive data
578b6cee71dSXin LI2   string      -sw1-       Swag archive data
579b6cee71dSXin LI
580b6cee71dSXin LI# RAR archiver (Greg Roelofs, newt@uchicago.edu)
581b6cee71dSXin LI0	string		Rar!		RAR archive data,
582b6cee71dSXin LI!:mime	application/x-rar
583b6cee71dSXin LI>44	byte		x		v%0x,
584b6cee71dSXin LI>10	byte		>0		flags:
585b6cee71dSXin LI>>10	byte		&0x01		Archive volume,
586b6cee71dSXin LI>>10	byte		&0x02		Commented,
587b6cee71dSXin LI>>10	byte		&0x04		Locked,
588b6cee71dSXin LI>>10	byte		&0x08		Solid,
589b6cee71dSXin LI>>10	byte		&0x20		Authenticated,
590b6cee71dSXin LI>35	byte		0		os: MS-DOS
591b6cee71dSXin LI>35	byte		1		os: OS/2
592b6cee71dSXin LI>35	byte		2		os: Win32
593b6cee71dSXin LI>35	byte		3		os: Unix
594b6cee71dSXin LI# some old version? idarc says:
595b6cee71dSXin LI0   string      RE\x7e\x5e  RAR archive data
596b6cee71dSXin LI
597b6cee71dSXin LI# SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
598b6cee71dSXin LI0	string		SQSH		squished archive data (Acorn RISCOS)
599b6cee71dSXin LI
600b6cee71dSXin LI# UC2 archiver (Greg Roelofs, newt@uchicago.edu)
601b6cee71dSXin LI# [JW] see exe section for self-extracting version
602b6cee71dSXin LI0	string		UC2\x1a		UC2 archive data
603b6cee71dSXin LI
604b6cee71dSXin LI# PKZIP multi-volume archive
605b6cee71dSXin LI0	string		PK\x07\x08PK\x03\x04	Zip multi-volume archive data, at least PKZIP v2.50 to extract
606b6cee71dSXin LI!:mime	application/zip
607b6cee71dSXin LI
608b6cee71dSXin LI# Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
609b6cee71dSXin LI0	string		PK\005\006	Zip archive data (empty)
610b6cee71dSXin LI0	string		PK\003\004
611b6cee71dSXin LI
612b6cee71dSXin LI# Specialised zip formats which start with a member named 'mimetype'
613b6cee71dSXin LI# (stored uncompressed, with no 'extra field') containing the file's MIME type.
614b6cee71dSXin LI# Check for have 8-byte name, 0-byte extra field, name "mimetype", and
615b6cee71dSXin LI#  contents starting with "application/":
616b6cee71dSXin LI>26	string		\x8\0\0\0mimetypeapplication/
617b6cee71dSXin LI
618b6cee71dSXin LI#  KOffice / OpenOffice & StarOffice / OpenDocument formats
619b6cee71dSXin LI#    From: Abel Cheung <abel@oaka.org>
620b6cee71dSXin LI
621b6cee71dSXin LI#   KOffice (1.2 or above) formats
622b6cee71dSXin LI#    (mimetype contains "application/vnd.kde.<SUBTYPE>")
623b6cee71dSXin LI>>50	string	vnd.kde.		KOffice (>=1.2)
624b6cee71dSXin LI>>>58	string	karbon			Karbon document
625b6cee71dSXin LI>>>58	string	kchart			KChart document
626b6cee71dSXin LI>>>58	string	kformula		KFormula document
627b6cee71dSXin LI>>>58	string	kivio			Kivio document
628b6cee71dSXin LI>>>58	string	kontour			Kontour document
629b6cee71dSXin LI>>>58	string	kpresenter		KPresenter document
630b6cee71dSXin LI>>>58	string	kspread			KSpread document
631b6cee71dSXin LI>>>58	string	kword			KWord document
632b6cee71dSXin LI
633b6cee71dSXin LI#   OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7)
634b6cee71dSXin LI#    (mimetype contains "application/vnd.sun.xml.<SUBTYPE>")
635b6cee71dSXin LI>>50	string	vnd.sun.xml.		OpenOffice.org 1.x
636b6cee71dSXin LI>>>62	string	writer			Writer
637b6cee71dSXin LI>>>>68	byte	!0x2e			document
638b6cee71dSXin LI>>>>68	string	.template		template
639b6cee71dSXin LI>>>>68	string	.global			global document
640b6cee71dSXin LI>>>62	string	calc			Calc
641b6cee71dSXin LI>>>>66	byte	!0x2e			spreadsheet
642b6cee71dSXin LI>>>>66	string	.template		template
643b6cee71dSXin LI>>>62	string	draw			Draw
644b6cee71dSXin LI>>>>66	byte	!0x2e			document
645b6cee71dSXin LI>>>>66	string	.template		template
646b6cee71dSXin LI>>>62	string	impress			Impress
647b6cee71dSXin LI>>>>69	byte	!0x2e			presentation
648b6cee71dSXin LI>>>>69	string	.template		template
649b6cee71dSXin LI>>>62	string	math			Math document
650b6cee71dSXin LI>>>62	string	base			Database file
651b6cee71dSXin LI
652b6cee71dSXin LI#   OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
653b6cee71dSXin LI#    http://lists.oasis-open.org/archives/office/200505/msg00006.html
654b6cee71dSXin LI#    (mimetype contains "application/vnd.oasis.opendocument.<SUBTYPE>")
655b6cee71dSXin LI>>50	string	vnd.oasis.opendocument.	OpenDocument
656b6cee71dSXin LI>>>73	string	text
657b6cee71dSXin LI>>>>77	byte	!0x2d			Text
658b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.text
659b6cee71dSXin LI>>>>77	string	-template		Text Template
660b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.text-template
661b6cee71dSXin LI>>>>77	string	-web			HTML Document Template
662b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.text-web
663b6cee71dSXin LI>>>>77	string	-master			Master Document
664b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.text-master
665b6cee71dSXin LI>>>73	string	graphics
666b6cee71dSXin LI>>>>81	byte	!0x2d			Drawing
667b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.graphics
668b6cee71dSXin LI>>>>81	string	-template		Template
669b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.graphics-template
670b6cee71dSXin LI>>>73	string	presentation
671b6cee71dSXin LI>>>>85	byte	!0x2d			Presentation
672b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.presentation
673b6cee71dSXin LI>>>>85	string	-template		Template
674b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.presentation-template
675b6cee71dSXin LI>>>73	string	spreadsheet
676b6cee71dSXin LI>>>>84	byte	!0x2d			Spreadsheet
677b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.spreadsheet
678b6cee71dSXin LI>>>>84	string	-template		Template
679b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.spreadsheet-template
680b6cee71dSXin LI>>>73	string	chart
681b6cee71dSXin LI>>>>78	byte	!0x2d			Chart
682b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.chart
683b6cee71dSXin LI>>>>78	string	-template		Template
684b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.chart-template
685b6cee71dSXin LI>>>73	string	formula
686b6cee71dSXin LI>>>>80	byte	!0x2d			Formula
687b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.formula
688b6cee71dSXin LI>>>>80	string	-template		Template
689b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.formula-template
690b6cee71dSXin LI>>>73	string	database		Database
691b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.database
692b6cee71dSXin LI>>>73	string	image
693b6cee71dSXin LI>>>>78	byte	!0x2d			Image
694b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.image
695b6cee71dSXin LI>>>>78	string	-template		Template
696b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.image-template
697b6cee71dSXin LI
698b6cee71dSXin LI#  EPUB (OEBPS) books using OCF (OEBPS Container Format)
699b6cee71dSXin LI#    http://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4.
700b6cee71dSXin LI#    From: Ralf Brown <ralf.brown@gmail.com>
701b6cee71dSXin LI>>50	string	epub+zip	EPUB document
702b6cee71dSXin LI!:mime application/epub+zip
703b6cee71dSXin LI
704b6cee71dSXin LI#  Catch other ZIP-with-mimetype formats
705b6cee71dSXin LI#	In a ZIP file, the bytes immediately after a member's contents are
706b6cee71dSXin LI#	always "PK". The 2 regex rules here print the "mimetype" member's
707b6cee71dSXin LI#	contents up to the first 'P'. Luckily, most MIME types don't contain
708b6cee71dSXin LI#	any capital 'P's. This is a kludge.
709b6cee71dSXin LI#    (mimetype contains "application/<OTHER>")
710b6cee71dSXin LI>>50		string	!epub+zip
711b6cee71dSXin LI>>>50		string	!vnd.oasis.opendocument.
712b6cee71dSXin LI>>>>50		string	!vnd.sun.xml.
713b6cee71dSXin LI>>>>>50		string	!vnd.kde.
714b6cee71dSXin LI>>>>>>38	regex	[!-OQ-~]+		Zip data (MIME type "%s"?)
715b6cee71dSXin LI!:mime	application/zip
716b6cee71dSXin LI#    (mimetype contents other than "application/*")
717b6cee71dSXin LI>26		string	\x8\0\0\0mimetype
718b6cee71dSXin LI>>38		string	!application/
719b6cee71dSXin LI>>>38		regex	[!-OQ-~]+		Zip data (MIME type "%s"?)
720b6cee71dSXin LI!:mime	application/zip
721b6cee71dSXin LI
722b6cee71dSXin LI# Java Jar files
723b6cee71dSXin LI>(26.s+30)	leshort	0xcafe		Java archive data (JAR)
724b6cee71dSXin LI!:mime	application/java-archive
725b6cee71dSXin LI
726b6cee71dSXin LI# Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
727b6cee71dSXin LI#   Next line excludes specialized formats:
728b6cee71dSXin LI>(26.s+30)	leshort	!0xcafe
729b6cee71dSXin LI>>26    string          !\x8\0\0\0mimetype	Zip archive data
730b6cee71dSXin LI!:mime	application/zip
731b6cee71dSXin LI>>>4	byte		0x09		\b, at least v0.9 to extract
732b6cee71dSXin LI>>>4	byte		0x0a		\b, at least v1.0 to extract
733b6cee71dSXin LI>>>4	byte		0x0b		\b, at least v1.1 to extract
734b6cee71dSXin LI>>>4	byte		0x14		\b, at least v2.0 to extract
7355f0216bdSXin LI>>>4	byte		0x2d		\b, at least v4.5 to extract
736b6cee71dSXin LI>>>0x161	string		WINZIP		\b, WinZIP self-extracting
737b6cee71dSXin LI
738b6cee71dSXin LI# StarView Metafile
739b6cee71dSXin LI# From Pierre Ducroquet <pinaraf@pinaraf.info>
740b6cee71dSXin LI0	string	VCLMTF	StarView MetaFile
741b6cee71dSXin LI>6	beshort	x	\b, version %d
742b6cee71dSXin LI>8	belong	x	\b, size %d
743b6cee71dSXin LI
744b6cee71dSXin LI# Zoo archiver
745b6cee71dSXin LI20	lelong		0xfdc4a7dc	Zoo archive data
746b6cee71dSXin LI!:mime	application/x-zoo
747b6cee71dSXin LI>4	byte		>48		\b, v%c.
748b6cee71dSXin LI>>6	byte		>47		\b%c
749b6cee71dSXin LI>>>7	byte		>47		\b%c
750b6cee71dSXin LI>32	byte		>0		\b, modify: v%d
751b6cee71dSXin LI>>33	byte		x		\b.%d+
752b6cee71dSXin LI>42	lelong		0xfdc4a7dc	\b,
753b6cee71dSXin LI>>70	byte		>0		extract: v%d
754b6cee71dSXin LI>>>71	byte		x		\b.%d+
755b6cee71dSXin LI
756b6cee71dSXin LI# Shell archives
757b6cee71dSXin LI10	string		#\ This\ is\ a\ shell\ archive	shell archive text
758b6cee71dSXin LI!:mime	application/octet-stream
759b6cee71dSXin LI
760b6cee71dSXin LI#
761b6cee71dSXin LI# LBR. NB: May conflict with the questionable
762b6cee71dSXin LI#          "binary Computer Graphics Metafile" format.
763b6cee71dSXin LI#
764b6cee71dSXin LI0       string  \0\ \ \ \ \ \ \ \ \ \ \ \0\0    LBR archive data
765b6cee71dSXin LI#
766b6cee71dSXin LI# PMA (CP/M derivative of LHA)
767b6cee71dSXin LI#
768b6cee71dSXin LI2       string          -pm0-           PMarc archive data [pm0]
769b6cee71dSXin LI2       string          -pm1-           PMarc archive data [pm1]
770b6cee71dSXin LI2       string          -pm2-           PMarc archive data [pm2]
771b6cee71dSXin LI2       string          -pms-           PMarc SFX archive (CP/M, DOS)
772b6cee71dSXin LI5       string          -pc1-           PopCom compressed executable (CP/M)
773b6cee71dSXin LI
774b6cee71dSXin LI# From Rafael Laboissiere <rafael@laboissiere.net>
775b6cee71dSXin LI# The Project Revision Control System (see
776b6cee71dSXin LI# http://prcs.sourceforge.net) generates a packaged project
777b6cee71dSXin LI# file which is recognized by the following entry:
778b6cee71dSXin LI0	leshort		0xeb81	PRCS packaged project
779b6cee71dSXin LI
780b6cee71dSXin LI# Microsoft cabinets
781b6cee71dSXin LI# by David Necas (Yeti) <yeti@physics.muni.cz>
782b6cee71dSXin LI#0	string	MSCF\0\0\0\0	Microsoft cabinet file data,
783b6cee71dSXin LI#>25	byte	x		v%d
784b6cee71dSXin LI#>24	byte	x		\b.%d
785b6cee71dSXin LI# MPi: All CABs have version 1.3, so this is pointless.
786b6cee71dSXin LI# Better magic in debian-additions.
787b6cee71dSXin LI
788b6cee71dSXin LI# GTKtalog catalogs
789b6cee71dSXin LI# by David Necas (Yeti) <yeti@physics.muni.cz>
790b6cee71dSXin LI4	string	gtktalog\ 	GTKtalog catalog data,
791b6cee71dSXin LI>13	string	3		version 3
792b6cee71dSXin LI>>14	beshort	0x677a		(gzipped)
793b6cee71dSXin LI>>14	beshort	!0x677a		(not gzipped)
794b6cee71dSXin LI>13	string	>3		version %s
795b6cee71dSXin LI
796b6cee71dSXin LI############################################################################
797b6cee71dSXin LI# Parity archive reconstruction file, the 'par' file format now used on Usenet.
798b6cee71dSXin LI0       string          PAR\0	PARity archive data
799b6cee71dSXin LI>48	leshort		=0	- Index file
800b6cee71dSXin LI>48	leshort		>0	- file number %d
801b6cee71dSXin LI
802b6cee71dSXin LI# Felix von Leitner <felix-file@fefe.de>
803b6cee71dSXin LI0	string	d8:announce	BitTorrent file
804b6cee71dSXin LI!:mime	application/x-bittorrent
805b6cee71dSXin LI
806b6cee71dSXin LI# Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
807b6cee71dSXin LI0	beshort 0x0e0f		Atari MSA archive data
808b6cee71dSXin LI>2	beshort x		\b, %d sectors per track
809b6cee71dSXin LI>4	beshort 0		\b, 1 sided
810b6cee71dSXin LI>4	beshort 1		\b, 2 sided
811b6cee71dSXin LI>6	beshort x		\b, starting track: %d
812b6cee71dSXin LI>8	beshort x		\b, ending track: %d
813b6cee71dSXin LI
814b6cee71dSXin LI# Alternate ZIP string (amc@arwen.cs.berkeley.edu)
815b6cee71dSXin LI0	string	PK00PK\003\004	Zip archive data
816b6cee71dSXin LI
817b6cee71dSXin LI# ACE archive (from http://www.wotsit.org/download.asp?f=ace)
818b6cee71dSXin LI# by Stefan `Sec` Zehl <sec@42.org>
819b6cee71dSXin LI7	string		**ACE**		ACE archive data
820b6cee71dSXin LI>15	byte	>0		version %d
821b6cee71dSXin LI>16	byte	=0x00		\b, from MS-DOS
822b6cee71dSXin LI>16	byte	=0x01		\b, from OS/2
823b6cee71dSXin LI>16	byte	=0x02		\b, from Win/32
824b6cee71dSXin LI>16	byte	=0x03		\b, from Unix
825b6cee71dSXin LI>16	byte	=0x04		\b, from MacOS
826b6cee71dSXin LI>16	byte	=0x05		\b, from WinNT
827b6cee71dSXin LI>16	byte	=0x06		\b, from Primos
828b6cee71dSXin LI>16	byte	=0x07		\b, from AppleGS
829b6cee71dSXin LI>16	byte	=0x08		\b, from Atari
830b6cee71dSXin LI>16	byte	=0x09		\b, from Vax/VMS
831b6cee71dSXin LI>16	byte	=0x0A		\b, from Amiga
832b6cee71dSXin LI>16	byte	=0x0B		\b, from Next
833b6cee71dSXin LI>14	byte	x		\b, version %d to extract
834b6cee71dSXin LI>5	leshort &0x0080		\b, multiple volumes,
835b6cee71dSXin LI>>17	byte	x		\b (part %d),
836b6cee71dSXin LI>5	leshort &0x0002		\b, contains comment
837b6cee71dSXin LI>5	leshort	&0x0200		\b, sfx
838b6cee71dSXin LI>5	leshort	&0x0400		\b, small dictionary
839b6cee71dSXin LI>5	leshort	&0x0800		\b, multi-volume
840b6cee71dSXin LI>5	leshort	&0x1000		\b, contains AV-String
841b6cee71dSXin LI>>30	string	\x16*UNREGISTERED\x20VERSION*	(unregistered)
842b6cee71dSXin LI>5	leshort &0x2000		\b, with recovery record
843b6cee71dSXin LI>5	leshort &0x4000		\b, locked
844b6cee71dSXin LI>5	leshort &0x8000		\b, solid
845b6cee71dSXin LI# Date in MS-DOS format (whatever that is)
846b6cee71dSXin LI#>18	lelong	x		Created on
847b6cee71dSXin LI
848b6cee71dSXin LI# sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
849b6cee71dSXin LI# <doj@cubic.org>
850b6cee71dSXin LI0x1A	string	sfArk		sfArk compressed Soundfont
851b6cee71dSXin LI>0x15	string	2
852b6cee71dSXin LI>>0x1	string	>\0		Version %s
853b6cee71dSXin LI>>0x2A	string	>\0		: %s
854b6cee71dSXin LI
855b6cee71dSXin LI# DR-DOS 7.03 Packed File *.??_
856b6cee71dSXin LI0	string	Packed\ File\ 	Personal NetWare Packed File
857b6cee71dSXin LI>12	string	x		\b, was "%.12s"
858b6cee71dSXin LI
859b6cee71dSXin LI# EET archive
860b6cee71dSXin LI# From: Tilman Sauerbeck <tilman@code-monkey.de>
861b6cee71dSXin LI0	belong	0x1ee7ff00	EET archive
862b6cee71dSXin LI!:mime	application/x-eet
863b6cee71dSXin LI
864b6cee71dSXin LI# rzip archives
865b6cee71dSXin LI0	string	RZIP		rzip compressed data
866b6cee71dSXin LI>4	byte	x		- version %d
867b6cee71dSXin LI>5	byte	x		\b.%d
868b6cee71dSXin LI>6	belong	x		(%d bytes)
869b6cee71dSXin LI
870b6cee71dSXin LI# From: "Robert Dale" <robdale@gmail.com>
871b6cee71dSXin LI0	belong	123		dar archive,
872b6cee71dSXin LI>4	belong	x		label "%.8x
873b6cee71dSXin LI>>8	belong	x		%.8x
874b6cee71dSXin LI>>>12	beshort	x		%.4x"
875b6cee71dSXin LI>14	byte	0x54		end slice
876b6cee71dSXin LI>14	beshort	0x4e4e		multi-part
877b6cee71dSXin LI>14	beshort	0x4e53		multi-part, with -S
878b6cee71dSXin LI
879b6cee71dSXin LI# Symbian installation files
880b6cee71dSXin LI#  http://www.thouky.co.uk/software/psifs/sis.html
881b6cee71dSXin LI#  http://developer.symbian.com/main/downloads/papers/SymbianOSv91/softwareinstallsis.pdf
882b6cee71dSXin LI8	lelong	0x10000419	Symbian installation file
883b6cee71dSXin LI!:mime	application/vnd.symbian.install
884b6cee71dSXin LI>4	lelong	0x1000006D	(EPOC release 3/4/5)
885b6cee71dSXin LI>4	lelong	0x10003A12	(EPOC release 6)
886b6cee71dSXin LI0	lelong	0x10201A7A	Symbian installation file (Symbian OS 9.x)
887b6cee71dSXin LI!:mime	x-epoc/x-sisx-app
888b6cee71dSXin LI
889b6cee71dSXin LI# From "Nelson A. de Oliveira" <naoliv@gmail.com>
890b6cee71dSXin LI0	string	MPQ\032		MoPaQ (MPQ) archive
891b6cee71dSXin LI
892b6cee71dSXin LI# From: Dirk Jagdmann <doj@cubic.org>
893b6cee71dSXin LI# xar archive format: http://code.google.com/p/xar/
894b6cee71dSXin LI0	string	xar!		xar archive
895b6cee71dSXin LI>6	beshort	x		- version %d
896b6cee71dSXin LI
897b6cee71dSXin LI# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
898b6cee71dSXin LI# .kgb
899b6cee71dSXin LI0	string KGB_arch		KGB Archiver file
900b6cee71dSXin LI>10	string x		with compression level %.1s
901b6cee71dSXin LI
902b6cee71dSXin LI# xar (eXtensible ARchiver) archive
903b6cee71dSXin LI# From: "David Remahl" <dremahl@apple.com>
904b6cee71dSXin LI0	string	xar!		xar archive
905b6cee71dSXin LI#>4	beshort	x		header size %d
906b6cee71dSXin LI>6	beshort	x		version %d,
907b6cee71dSXin LI#>8	quad	x		compressed TOC: %d,
908b6cee71dSXin LI#>16	quad	x		uncompressed TOC: %d,
909b6cee71dSXin LI>24	belong	0		no checksum
910b6cee71dSXin LI>24	belong	1		SHA-1 checksum
911b6cee71dSXin LI>24	belong	2		MD5 checksum
912b6cee71dSXin LI
913b6cee71dSXin LI# Type: Parity Archive
914b6cee71dSXin LI# From: Daniel van Eeden <daniel_e@dds.nl>
915b6cee71dSXin LI0	string	PAR2		Parity Archive Volume Set
916b6cee71dSXin LI
917b6cee71dSXin LI# Bacula volume format. (Volumes always start with a block header.)
918b6cee71dSXin LI# URL: http://bacula.org/3.0.x-manuals/en/developers/developers/Block_Header.html
919b6cee71dSXin LI# From: Adam Buchbinder <adam.buchbinder@gmail.com>
920b6cee71dSXin LI12	string	BB02		Bacula volume
921b6cee71dSXin LI>20	bedate	x		\b, started %s
922b6cee71dSXin LI
923b6cee71dSXin LI# ePub is XHTML + XML inside a ZIP archive.  The first member of the
924b6cee71dSXin LI#   archive must be an uncompressed file called 'mimetype' with contents
925b6cee71dSXin LI#   'application/epub+zip'
926b6cee71dSXin LI
927b6cee71dSXin LI
928b6cee71dSXin LI# From: "Michael Gorny" <mgorny@gentoo.org>
929b6cee71dSXin LI# ZPAQ: http://mattmahoney.net/dc/zpaq.html
930b6cee71dSXin LI0	string	zPQ	ZPAQ stream
931b6cee71dSXin LI>3	byte	x	\b, level %d
9325f0216bdSXin LI# From: Barry Carter <carter.barry@gmail.com>
9335f0216bdSXin LI# http://encode.ru/threads/456-zpaq-updates/page32
9345f0216bdSXin LI0	string	7kSt	ZPAQ file
935b6cee71dSXin LI
936b6cee71dSXin LI# BBeB ebook, unencrypted (LRF format)
937b6cee71dSXin LI# URL: http://www.sven.de/librie/Librie/LrfFormat
938b6cee71dSXin LI# From: Adam Buchbinder <adam.buchbinder@gmail.com>
939b6cee71dSXin LI0	string	L\0R\0F\0\0\0	BBeB ebook data, unencrypted
940b6cee71dSXin LI>8	beshort	x		\b, version %d
941b6cee71dSXin LI>36	byte	1		\b, front-to-back
942b6cee71dSXin LI>36	byte	16		\b, back-to-front
943b6cee71dSXin LI>42	beshort	x		\b, (%dx,
944b6cee71dSXin LI>44	beshort	x		%d)
945b6cee71dSXin LI
946b6cee71dSXin LI# Symantec GHOST image by Joerg Jenderek at May 2014
947b6cee71dSXin LI# http://us.norton.com/ghost/
948b6cee71dSXin LI# http://www.garykessler.net/library/file_sigs.html
949b6cee71dSXin LI0		ubelong&0xFFFFf7f0	0xFEEF0100	Norton GHost image
950b6cee71dSXin LI# *.GHO
951b6cee71dSXin LI>2		ubyte&0x08		0x00		\b, first file
952b6cee71dSXin LI# *.GHS or *.[0-9] with cns program option
953b6cee71dSXin LI>2		ubyte&0x08		0x08		\b, split file
954b6cee71dSXin LI# part of split index interesting for *.ghs
955b6cee71dSXin LI>>4		ubyte			x		id=0x%x
956b6cee71dSXin LI# compression tag minus one equals numeric compression command line switch z[1-9]
957b6cee71dSXin LI>3		ubyte			0		\b, no compression
958b6cee71dSXin LI>3		ubyte			2		\b, fast compression (Z1)
959b6cee71dSXin LI>3		ubyte			3		\b, medium compression (Z2)
960b6cee71dSXin LI>3		ubyte			>3
961b6cee71dSXin LI>>3		ubyte			<11		\b, compression (Z%d-1)
962b6cee71dSXin LI>2		ubyte&0x08		0x00
963b6cee71dSXin LI# ~ 30 byte password field only for *.gho
964b6cee71dSXin LI>>12		ubequad			!0		\b, password protected
965b6cee71dSXin LI>>44		ubyte			!1
966b6cee71dSXin LI# 1~Image All, sector-by-sector only for *.gho
967b6cee71dSXin LI>>>10		ubyte			1		\b, sector copy
968b6cee71dSXin LI# 1~Image Boot track only for *.gho
969b6cee71dSXin LI>>>43		ubyte			1		\b, boot track
970b6cee71dSXin LI# 1~Image Disc only for *.gho implies Image Boot track and sector copy
971b6cee71dSXin LI>>44		ubyte			1		\b, disc sector copy
972b6cee71dSXin LI# optional image description only *.gho
973b6cee71dSXin LI>>0xff		string			>\0		"%-.254s"
974b6cee71dSXin LI# look for DOS sector end sequence
975b6cee71dSXin LI>0xE08	search/7776		\x55\xAA
976b6cee71dSXin LI>>&-512	indirect		x		\b; contains
977b6cee71dSXin LI
978