xref: /openbsd/usr.bin/file/magdir/archive (revision 70e96360)
1*70e96360Ssthen#	$OpenBSD: archive,v 1.7 2016/03/06 01:33:12 sthen Exp $
2df930be7Sderaadt
3df930be7Sderaadt#------------------------------------------------------------------------------
4df930be7Sderaadt# archive:  file(1) magic for archive formats (see also "msdos" for self-
5df930be7Sderaadt#           extracting compressed archives)
6df930be7Sderaadt#
7df930be7Sderaadt# cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
8df930be7Sderaadt# pre-POSIX "tar" archives are handled in the C code.
9df930be7Sderaadt
10df930be7Sderaadt# POSIX tar archives
11df930be7Sderaadt257	string		ustar\0		POSIX tar archive
120ee74395Schl!:mime	application/x-tar # encoding: posix
13df930be7Sderaadt257	string		ustar\040\040\0	GNU tar archive
140ee74395Schl!:mime	application/x-tar # encoding: gnu
15df930be7Sderaadt
16*70e96360Ssthen# Incremental snapshot gnu-tar format from:
17*70e96360Ssthen# http://www.gnu.org/software/tar/manual/html_node/Snapshot-Files.html
18*70e96360Ssthen0	string		GNU\ tar-	GNU tar incremental snapshot data
19*70e96360Ssthen>&0	regex		[0-9]\.[0-9]+-[0-9]+	version %s
20*70e96360Ssthen
21df930be7Sderaadt# cpio archives
22df930be7Sderaadt#
23df930be7Sderaadt# Yes, the top two "cpio archive" formats *are* supposed to just be "short".
24df930be7Sderaadt# The idea is to indicate archives produced on machines with the same
25df930be7Sderaadt# byte order as the machine running "file" with "cpio archive", and
26df930be7Sderaadt# to indicate archives produced on machines with the opposite byte order
27df930be7Sderaadt# from the machine running "file" with "byte-swapped cpio archive".
28df930be7Sderaadt#
29df930be7Sderaadt# The SVR4 "cpio(4)" hints that there are additional formats, but they
30df930be7Sderaadt# are defined as "short"s; I think all the new formats are
31df930be7Sderaadt# character-header formats and thus are strings, not numbers.
32df930be7Sderaadt0	short		070707		cpio archive
330ee74395Schl!:mime	application/x-cpio
34df930be7Sderaadt0	short		0143561		byte-swapped cpio archive
350ee74395Schl!:mime	application/x-cpio # encoding: swapped
36df930be7Sderaadt0	string		070707		ASCII cpio archive (pre-SVR4 or odc)
37df930be7Sderaadt0	string		070701		ASCII cpio archive (SVR4 with no CRC)
38df930be7Sderaadt0	string		070702		ASCII cpio archive (SVR4 with CRC)
39df930be7Sderaadt
40*70e96360Ssthen#
41*70e96360Ssthen# Various archive formats used by various versions of the "ar"
42*70e96360Ssthen# command.
43*70e96360Ssthen#
44*70e96360Ssthen
45*70e96360Ssthen#
46*70e96360Ssthen# Original UNIX archive formats.
47*70e96360Ssthen# They were written with binary values in host byte order, and
48*70e96360Ssthen# the magic number was a host "int", which might have been 16 bits
49*70e96360Ssthen# or 32 bits.  We don't say "PDP-11" or "VAX", as there might have
50*70e96360Ssthen# been ports to little-endian 16-bit-int or 32-bit-int platforms
51*70e96360Ssthen# (x86?) using some of those formats; if none existed, feel free
52*70e96360Ssthen# to use "PDP-11" for little-endian 16-bit and "VAX" for little-endian
53*70e96360Ssthen# 32-bit.  There might have been big-endian ports of that sort as
54*70e96360Ssthen# well.
55*70e96360Ssthen#
56*70e96360Ssthen0	leshort		0177555		very old 16-bit-int little-endian archive
57*70e96360Ssthen0	beshort		0177555		very old 16-bit-int big-endian archive
58*70e96360Ssthen0	lelong		0177555		very old 32-bit-int little-endian archive
59*70e96360Ssthen0	belong		0177555		very old 32-bit-int big-endian archive
60*70e96360Ssthen
61*70e96360Ssthen0	leshort		0177545		old 16-bit-int little-endian archive
62*70e96360Ssthen>2	string		__.SYMDEF	random library
63*70e96360Ssthen0	beshort		0177545		old 16-bit-int big-endian archive
64*70e96360Ssthen>2	string		__.SYMDEF	random library
65*70e96360Ssthen0	lelong		0177545		old 32-bit-int little-endian archive
66*70e96360Ssthen>4	string		__.SYMDEF	random library
67*70e96360Ssthen0	belong		0177545		old 32-bit-int big-endian archive
68*70e96360Ssthen>4	string		__.SYMDEF	random library
69*70e96360Ssthen
70*70e96360Ssthen#
71*70e96360Ssthen# From "pdp" (but why a 4-byte quantity?)
72*70e96360Ssthen#
73*70e96360Ssthen0	lelong		0x39bed		PDP-11 old archive
74*70e96360Ssthen0	lelong		0x39bee		PDP-11 4.0 archive
75*70e96360Ssthen
76*70e96360Ssthen#
77*70e96360Ssthen# XXX - what flavor of APL used this, and was it a variant of
78*70e96360Ssthen# some ar archive format?  It's similar to, but not the same
79*70e96360Ssthen# as, the APL workspace magic numbers in pdp.
80*70e96360Ssthen#
81*70e96360Ssthen0	long		0100554		apl workspace
82*70e96360Ssthen
83*70e96360Ssthen#
84*70e96360Ssthen# System V Release 1 portable(?) archive format.
85*70e96360Ssthen#
86*70e96360Ssthen0	string		=<ar>		System V Release 1 ar archive
87*70e96360Ssthen!:mime	application/x-archive
88*70e96360Ssthen
89*70e96360Ssthen#
90*70e96360Ssthen# Debian package; it's in the portable archive format, and needs to go
91*70e96360Ssthen# before the entry for regular portable archives, as it's recognized as
92*70e96360Ssthen# a portable archive whose first member has a name beginning with
93*70e96360Ssthen# "debian".
9436c0c0feStedu#
95380b5c7dSchl0	string		=!<arch>\ndebian
9636c0c0feStedu>8	string		debian-split	part of multipart Debian package
97*70e96360Ssthen!:mime	application/vnd.debian.binary-package
9836c0c0feStedu>8	string		debian-binary	Debian binary package
99*70e96360Ssthen!:mime	application/vnd.debian.binary-package
1000ee74395Schl>8	string		!debian
10136c0c0feStedu>68	string		>\0		(format %s)
102380b5c7dSchl# These next two lines do not work, because a bzip2 Debian archive
103380b5c7dSchl# still uses gzip for the control.tar (first in the archive).  Only
104380b5c7dSchl# data.tar varies, and the location of its filename varies too.
105380b5c7dSchl# file/libmagic does not current have support for ascii-string based
106380b5c7dSchl# (offsets) as of 2005-09-15.
107380b5c7dSchl#>81	string		bz2		\b, uses bzip2 compression
108380b5c7dSchl#>84	string		gz		\b, uses gzip compression
10936c0c0feStedu#>136	ledate		x		created: %s
11036c0c0feStedu
111*70e96360Ssthen#
112*70e96360Ssthen# MIPS archive; they're in the portable archive format, and need to go
113*70e96360Ssthen# before the entry for regular portable archives, as it's recognized as
114*70e96360Ssthen# a portable archive whose first member has a name beginning with
115*70e96360Ssthen# "__________E".
116df930be7Sderaadt#
117380b5c7dSchl0	string	=!<arch>\n__________E	MIPS archive
118*70e96360Ssthen!:mime	application/x-archive
119df930be7Sderaadt>20	string	U			with MIPS Ucode members
120df930be7Sderaadt>21	string	L			with MIPSEL members
121df930be7Sderaadt>21	string	B			with MIPSEB members
122df930be7Sderaadt>19	string	L			and an EL hash table
123df930be7Sderaadt>19	string	B			and an EB hash table
124df930be7Sderaadt>22	string	X			-- out of date
125df930be7Sderaadt
1260ee74395Schl0	search/1	-h-		Software Tools format archive text
127df930be7Sderaadt
128df930be7Sderaadt#
129*70e96360Ssthen# BSD/SVR2-and-later portable archive formats.
130df930be7Sderaadt#
131380b5c7dSchl0	string		=!<arch>		current ar archive
1320ee74395Schl!:mime	application/x-archive
133df930be7Sderaadt>8	string		__.SYMDEF	random library
134*70e96360Ssthen>68	string		__.SYMDEF\ SORTED	random library
135*70e96360Ssthen
136df930be7Sderaadt#
137*70e96360Ssthen# "Thin" archive, as can be produced by GNU ar.
138df930be7Sderaadt#
139*70e96360Ssthen0	string		=!<thin>\n	thin archive with
140*70e96360Ssthen>68	belong		0		no symbol entries
141*70e96360Ssthen>68	belong		1		%d symbol entry
142*70e96360Ssthen>68	belong		>1		%d symbol entries
143df930be7Sderaadt
144df930be7Sderaadt# ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
145df930be7Sderaadt#
146df930be7Sderaadt# The first byte is the magic (0x1a), byte 2 is the compression type for
147df930be7Sderaadt# the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
148df930be7Sderaadt# filename of the first file (null terminated).  Since some types collide
149df930be7Sderaadt# we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
150df930be7Sderaadt# 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%).  0x01 collides with terminfo.
151df930be7Sderaadt0	lelong&0x8080ffff	0x0000081a	ARC archive data, dynamic LZW
1520ee74395Schl!:mime	application/x-arc
153df930be7Sderaadt0	lelong&0x8080ffff	0x0000091a	ARC archive data, squashed
1540ee74395Schl!:mime	application/x-arc
155df930be7Sderaadt0	lelong&0x8080ffff	0x0000021a	ARC archive data, uncompressed
1560ee74395Schl!:mime	application/x-arc
157df930be7Sderaadt0	lelong&0x8080ffff	0x0000031a	ARC archive data, packed
1580ee74395Schl!:mime	application/x-arc
159df930be7Sderaadt0	lelong&0x8080ffff	0x0000041a	ARC archive data, squeezed
1600ee74395Schl!:mime	application/x-arc
161df930be7Sderaadt0	lelong&0x8080ffff	0x0000061a	ARC archive data, crunched
1620ee74395Schl!:mime	application/x-arc
163380b5c7dSchl# [JW] stuff taken from idarc, obviously ARC successors:
164380b5c7dSchl0	lelong&0x8080ffff	0x00000a1a	PAK archive data
1650ee74395Schl!:mime	application/x-arc
166380b5c7dSchl0	lelong&0x8080ffff	0x0000141a	ARC+ archive data
1670ee74395Schl!:mime	application/x-arc
168380b5c7dSchl0	lelong&0x8080ffff	0x0000481a	HYP archive data
1690ee74395Schl!:mime	application/x-arc
170df930be7Sderaadt
171df930be7Sderaadt# Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
172df930be7Sderaadt# I can't create either SPARK or ArcFS archives so I have not tested this stuff
173df930be7Sderaadt# [GRR:  the original entries collide with ARC, above; replaced with combined
174df930be7Sderaadt#  version (not tested)]
175380b5c7dSchl#0	byte		0x1a		RISC OS archive (spark format)
176df930be7Sderaadt0	string		\032archive	RISC OS archive (ArcFS format)
177380b5c7dSchl0       string          Archive\000     RISC OS archive (ArcFS format)
178380b5c7dSchl
179380b5c7dSchl# All these were taken from idarc, many could not be verified. Unfortunately,
180380b5c7dSchl# there were many low-quality sigs, i.e. easy to trigger false positives.
181380b5c7dSchl# Please notify me of any real-world fishy/ambiguous signatures and I'll try
182380b5c7dSchl# to get my hands on the actual archiver and see if I find something better. [JW]
183380b5c7dSchl# probably many can be enhanced by finding some 0-byte or control char near the start
184380b5c7dSchl
185380b5c7dSchl# idarc calls this Crush/Uncompressed... *shrug*
186380b5c7dSchl0	string	CRUSH Crush archive data
187380b5c7dSchl# Squeeze It (.sqz)
188380b5c7dSchl0	string	HLSQZ Squeeze It archive data
189380b5c7dSchl# SQWEZ
190380b5c7dSchl0	string	SQWEZ SQWEZ archive data
191380b5c7dSchl# HPack (.hpk)
192380b5c7dSchl0	string	HPAK HPack archive data
193380b5c7dSchl# HAP
194380b5c7dSchl0	string	\x91\x33HF HAP archive data
195380b5c7dSchl# MD/MDCD
196380b5c7dSchl0	string	MDmd MDCD archive data
197380b5c7dSchl# LIM
198380b5c7dSchl0	string	LIM\x1a LIM archive data
199380b5c7dSchl# SAR
200380b5c7dSchl3	string	LH5 SAR archive data
201380b5c7dSchl# BSArc/BS2
202*70e96360Ssthen0	string	\212\3SB\020\0	BSArc/BS2 archive data
203*70e96360Ssthen# Bethesda Softworks Archive (Oblivion)
204*70e96360Ssthen0	string	BSA\0 		BSArc archive data
205*70e96360Ssthen>4	lelong	x		version %d
206380b5c7dSchl# MAR
207380b5c7dSchl2	string	=-ah MAR archive data
208380b5c7dSchl# ACB
209*70e96360Ssthen#0	belong&0x00f800ff	0x00800000 ACB archive data
210380b5c7dSchl# CPZ
211380b5c7dSchl# TODO, this is what idarc says: 0	string	\0\0\0 CPZ archive data
212380b5c7dSchl# JRC
213380b5c7dSchl0	string	JRchive JRC archive data
214380b5c7dSchl# Quantum
215380b5c7dSchl0	string	DS\0 Quantum archive data
216380b5c7dSchl# ReSOF
217380b5c7dSchl0	string	PK\3\6 ReSOF archive data
218380b5c7dSchl# QuArk
219380b5c7dSchl0	string	7\4 QuArk archive data
220380b5c7dSchl# YAC
221380b5c7dSchl14	string	YC YAC archive data
222380b5c7dSchl# X1
223380b5c7dSchl0	string	X1 X1 archive data
224380b5c7dSchl0	string	XhDr X1 archive data
225380b5c7dSchl# CDC Codec (.dqt)
226380b5c7dSchl0	belong&0xffffe000	0x76ff2000 CDC Codec archive data
227380b5c7dSchl# AMGC
228380b5c7dSchl0	string	\xad6" AMGC archive data
229380b5c7dSchl# NuLIB
230*70e96360Ssthen0	string	N\xc3\xb5F\xc3\xa9lx\xc3\xa5 NuLIB archive data
231380b5c7dSchl# PakLeo
232380b5c7dSchl0	string	LEOLZW PAKLeo archive data
233380b5c7dSchl# ChArc
234380b5c7dSchl0	string	SChF ChArc archive data
235380b5c7dSchl# PSA
236380b5c7dSchl0	string	PSA PSA archive data
237380b5c7dSchl# CrossePAC
238380b5c7dSchl0	string	DSIGDCC CrossePAC archive data
239380b5c7dSchl# Freeze
240380b5c7dSchl0	string	\x1f\x9f\x4a\x10\x0a Freeze archive data
241380b5c7dSchl# KBoom
242*70e96360Ssthen0	string	\xc2\xa8MP\xc2\xa8 KBoom archive data
243380b5c7dSchl# NSQ, must go after CDC Codec
244380b5c7dSchl0	string	\x76\xff NSQ archive data
245380b5c7dSchl# DPA
246380b5c7dSchl0	string	Dirk\ Paehl DPA archive data
247380b5c7dSchl# BA
248380b5c7dSchl# TODO: idarc says "bytes 0-2 == bytes 3-5"
249380b5c7dSchl# TTComp
250380b5c7dSchl0	string	\0\6 TTComp archive data
251380b5c7dSchl# ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
252380b5c7dSchl0	string	ESP ESP archive data
253380b5c7dSchl# ZPack
254380b5c7dSchl0	string	\1ZPK\1 ZPack archive data
255380b5c7dSchl# Sky
256380b5c7dSchl0	string	\xbc\x40 Sky archive data
257380b5c7dSchl# UFA
258380b5c7dSchl0	string	UFA UFA archive data
259380b5c7dSchl# Dry
260380b5c7dSchl0	string	=-H2O DRY archive data
261380b5c7dSchl# FoxSQZ
262380b5c7dSchl0	string	FOXSQZ FoxSQZ archive data
263380b5c7dSchl# AR7
264380b5c7dSchl0	string	,AR7 AR7 archive data
265380b5c7dSchl# PPMZ
266380b5c7dSchl0	string	PPMZ PPMZ archive data
267380b5c7dSchl# MS Compress
268380b5c7dSchl4	string	\x88\xf0\x27 MS Compress archive data
269380b5c7dSchl# updated by Joerg Jenderek
270380b5c7dSchl>9	string	\0
271380b5c7dSchl>>0	string	KWAJ
272380b5c7dSchl>>>7	string	\321\003	MS Compress archive data
273*70e96360Ssthen>>>>14	ulong	>0		\b, original size: %d bytes
274380b5c7dSchl>>>>18		ubyte	>0x65
275380b5c7dSchl>>>>>18		string	x       \b, was %.8s
276380b5c7dSchl>>>>>(10.b-4)	string	x       \b.%.3s
277380b5c7dSchl# MP3 (archiver, not lossy audio compression)
278380b5c7dSchl0	string	MP3\x1a MP3-Archiver archive data
279380b5c7dSchl# ZET
280*70e96360Ssthen0	string	OZ\xc3\x9d ZET archive data
281380b5c7dSchl# TSComp
282380b5c7dSchl0	string	\x65\x5d\x13\x8c\x08\x01\x03\x00 TSComp archive data
283380b5c7dSchl# ARQ
284380b5c7dSchl0	string	gW\4\1 ARQ archive data
285380b5c7dSchl# Squash
286380b5c7dSchl3	string	OctSqu Squash archive data
287380b5c7dSchl# Terse
288380b5c7dSchl0	string	\5\1\1\0 Terse archive data
289380b5c7dSchl# PUCrunch
290380b5c7dSchl0	string	\x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31 PUCrunch archive data
291380b5c7dSchl# UHarc
292380b5c7dSchl0	string	UHA UHarc archive data
293380b5c7dSchl# ABComp
294380b5c7dSchl0	string	\2AB ABComp archive data
295380b5c7dSchl0	string	\3AB2 ABComp archive data
296380b5c7dSchl# CMP
297380b5c7dSchl0	string	CO\0 CMP archive data
298380b5c7dSchl# Splint
299380b5c7dSchl0	string	\x93\xb9\x06 Splint archive data
300380b5c7dSchl# InstallShield
301380b5c7dSchl0	string	\x13\x5d\x65\x8c InstallShield Z archive Data
302380b5c7dSchl# Gather
303380b5c7dSchl1	string	GTH Gather archive data
304380b5c7dSchl# BOA
305380b5c7dSchl0	string	BOA BOA archive data
306380b5c7dSchl# RAX
307380b5c7dSchl0	string	ULEB\xa RAX archive data
308380b5c7dSchl# Xtreme
309380b5c7dSchl0	string	ULEB\0 Xtreme archive data
310380b5c7dSchl# Pack Magic
311*70e96360Ssthen0	string	@\xc3\xa2\1\0 Pack Magic archive data
312380b5c7dSchl# BTS
313380b5c7dSchl0	belong&0xfeffffff	0x1a034465 BTS archive data
314380b5c7dSchl# ELI 5750
315380b5c7dSchl0	string	Ora\  ELI 5750 archive data
316380b5c7dSchl# QFC
317380b5c7dSchl0	string	\x1aFC\x1a QFC archive data
318380b5c7dSchl0	string	\x1aQF\x1a QFC archive data
319380b5c7dSchl# PRO-PACK
320380b5c7dSchl0	string	RNC PRO-PACK archive data
321380b5c7dSchl# 777
322380b5c7dSchl0	string	777 777 archive data
323380b5c7dSchl# LZS221
324380b5c7dSchl0	string	sTaC LZS221 archive data
325380b5c7dSchl# HPA
326380b5c7dSchl0	string	HPA HPA archive data
327380b5c7dSchl# Arhangel
328380b5c7dSchl0	string	LG Arhangel archive data
329380b5c7dSchl# EXP1, uses bzip2
330380b5c7dSchl0	string	0123456789012345BZh EXP1 archive data
331380b5c7dSchl# IMP
332380b5c7dSchl0	string	IMP\xa IMP archive data
333380b5c7dSchl# NRV
334380b5c7dSchl0	string	\x00\x9E\x6E\x72\x76\xFF NRV archive data
335380b5c7dSchl# Squish
336380b5c7dSchl0	string	\x73\xb2\x90\xf4 Squish archive data
337380b5c7dSchl# Par
338380b5c7dSchl0	string	PHILIPP Par archive data
339380b5c7dSchl0	string	PAR Par archive data
340380b5c7dSchl# HIT
341380b5c7dSchl0	string	UB HIT archive data
342380b5c7dSchl# SBX
343380b5c7dSchl0	belong&0xfffff000	0x53423000 SBX archive data
344380b5c7dSchl# NaShrink
345380b5c7dSchl0	string	NSK NaShrink archive data
346380b5c7dSchl# SAPCAR
347380b5c7dSchl0	string	#\ CAR\ archive\ header SAPCAR archive data
348380b5c7dSchl0	string	CAR\ 2.00RG SAPCAR archive data
349380b5c7dSchl# Disintegrator
350380b5c7dSchl0	string	DST Disintegrator archive data
351380b5c7dSchl# ASD
352380b5c7dSchl0	string	ASD ASD archive data
353380b5c7dSchl# InstallShield CAB
354380b5c7dSchl0	string	ISc( InstallShield CAB
355380b5c7dSchl# TOP4
356380b5c7dSchl0	string	T4\x1a TOP4 archive data
357380b5c7dSchl# BatComp left out: sig looks like COM executable
358380b5c7dSchl# so TODO: get real 4dos batcomp file and find sig
359380b5c7dSchl# BlakHole
360380b5c7dSchl0	string	BH\5\7 BlakHole archive data
361380b5c7dSchl# BIX
362380b5c7dSchl0	string	BIX0 BIX archive data
363380b5c7dSchl# ChiefLZA
364380b5c7dSchl0	string	ChfLZ ChiefLZA archive data
365380b5c7dSchl# Blink
366380b5c7dSchl0	string	Blink Blink archive data
367380b5c7dSchl# Logitech Compress
368380b5c7dSchl0	string	\xda\xfa Logitech Compress archive data
369380b5c7dSchl# ARS-Sfx (FIXME: really a SFX? then goto COM/EXE)
370380b5c7dSchl1	string	(C)\ STEPANYUK ARS-Sfx archive data
371380b5c7dSchl# AKT/AKT32
372380b5c7dSchl0	string	AKT32 AKT32 archive data
373380b5c7dSchl0	string	AKT AKT archive data
374380b5c7dSchl# NPack
375380b5c7dSchl0	string	MSTSM NPack archive data
376380b5c7dSchl# PFT
377380b5c7dSchl0	string	\0\x50\0\x14 PFT archive data
378380b5c7dSchl# SemOne
379380b5c7dSchl0	string	SEM SemOne archive data
380380b5c7dSchl# PPMD
381380b5c7dSchl0	string	\x8f\xaf\xac\x84 PPMD archive data
382380b5c7dSchl# FIZ
383380b5c7dSchl0	string	FIZ FIZ archive data
384380b5c7dSchl# MSXiE
385380b5c7dSchl0	belong&0xfffff0f0	0x4d530000 MSXiE archive data
386380b5c7dSchl# DeepFreezer
387380b5c7dSchl0	belong&0xfffffff0	0x797a3030 DeepFreezer archive data
388380b5c7dSchl# DC
389380b5c7dSchl0	string	=<DC- DC archive data
390380b5c7dSchl# TPac
391380b5c7dSchl0	string	\4TPAC\3 TPac archive data
392380b5c7dSchl# Ai
393380b5c7dSchl0	string	Ai\1\1\0 Ai archive data
394380b5c7dSchl0	string	Ai\1\0\0 Ai archive data
395380b5c7dSchl# Ai32
396380b5c7dSchl0	string	Ai\2\0 Ai32 archive data
397380b5c7dSchl0	string	Ai\2\1 Ai32 archive data
398380b5c7dSchl# SBC
399380b5c7dSchl0	string	SBC SBC archive data
400380b5c7dSchl# Ybs
401380b5c7dSchl0	string	YBS Ybs archive data
402380b5c7dSchl# DitPack
403380b5c7dSchl0	string	\x9e\0\0 DitPack archive data
404380b5c7dSchl# DMS
405380b5c7dSchl0	string	DMS! DMS archive data
406380b5c7dSchl# EPC
407380b5c7dSchl0	string	\x8f\xaf\xac\x8c EPC archive data
408380b5c7dSchl# VSARC
409380b5c7dSchl0	string	VS\x1a VSARC archive data
410380b5c7dSchl# PDZ
411380b5c7dSchl0	string	PDZ PDZ archive data
412380b5c7dSchl# ReDuq
413380b5c7dSchl0	string	rdqx ReDuq archive data
414380b5c7dSchl# GCA
415380b5c7dSchl0	string	GCAX GCA archive data
416380b5c7dSchl# PPMN
417380b5c7dSchl0	string	pN PPMN archive data
418380b5c7dSchl# WinImage
419380b5c7dSchl3	string	WINIMAGE WinImage archive data
420380b5c7dSchl# Compressia
421380b5c7dSchl0	string	CMP0CMP Compressia archive data
422380b5c7dSchl# UHBC
423380b5c7dSchl0	string	UHB UHBC archive data
424380b5c7dSchl# WinHKI
425380b5c7dSchl0	string	\x61\x5C\x04\x05 WinHKI archive data
426380b5c7dSchl# WWPack data file
427380b5c7dSchl0	string	WWP WWPack archive data
428380b5c7dSchl# BSN (BSA, PTS-DOS)
429380b5c7dSchl0	string	\xffBSG BSN archive data
430380b5c7dSchl1	string	\xffBSG BSN archive data
431380b5c7dSchl3	string	\xffBSG BSN archive data
432380b5c7dSchl1	string	\0\xae\2 BSN archive data
433380b5c7dSchl1	string	\0\xae\3 BSN archive data
434380b5c7dSchl1	string	\0\xae\7 BSN archive data
435380b5c7dSchl# AIN
436380b5c7dSchl0	string	\x33\x18 AIN archive data
437380b5c7dSchl0	string	\x33\x17 AIN archive data
438*70e96360Ssthen# XPA32 test moved and merged with XPA by Joerg Jenderek at Sep 2015
439380b5c7dSchl# SZip (TODO: doesn't catch all versions)
440380b5c7dSchl0	string	SZ\x0a\4 SZip archive data
441380b5c7dSchl# XPack DiskImage
442*70e96360Ssthen# *.XDI updated by Joerg Jenderek Sep 2015
443*70e96360Ssthen# ftp://ftp.sac.sk/pub/sac/pack/0index.txt
444*70e96360Ssthen# GRR: this test is still too general as it catches also text files starting with jm
445*70e96360Ssthen0	string	jm
446*70e96360Ssthen# only found examples with this additional characteristic 2 bytes
447*70e96360Ssthen>2	string	\x2\x4	Xpack DiskImage archive data
448*70e96360Ssthen#!:ext xdi
449380b5c7dSchl# XPack Data
450*70e96360Ssthen# *.xpa updated by Joerg Jenderek Sep 2015
451*70e96360Ssthen# ftp://ftp.elf.stuba.sk/pub/pc/pack/
452*70e96360Ssthen0	string	xpa	XPA
453*70e96360Ssthen!:ext	xpa
454*70e96360Ssthen# XPA32
455*70e96360Ssthen# ftp://ftp.elf.stuba.sk/pub/pc/pack/xpa32.zip
456*70e96360Ssthen# created by XPA32.EXE version 1.0.2 for Windows
457*70e96360Ssthen>0	string	xpa\0\1 \b32 archive data
458*70e96360Ssthen# created by XPACK.COM version 1.67m or 1.67r with short 0x1800
459*70e96360Ssthen>3	ubeshort	!0x0001	\bck archive data
460380b5c7dSchl# XPack Single Data
461*70e96360Ssthen# changed by Joerg Jenderek Sep 2015 back to like in version 5.12
462*70e96360Ssthen# letter 'I'+ acute accent is equivalent to \xcd
463*70e96360Ssthen0	string	\xcd\ jm	Xpack single archive data
464*70e96360Ssthen#!:mime	application/x-xpa-compressed
465*70e96360Ssthen!:ext xpa
466380b5c7dSchl
467380b5c7dSchl# TODO: missing due to unknown magic/magic at end of file:
468380b5c7dSchl#DWC
469380b5c7dSchl#ARG
470380b5c7dSchl#ZAR
471380b5c7dSchl#PC/3270
472380b5c7dSchl#InstallIt
473380b5c7dSchl#RKive
474380b5c7dSchl#RK
475380b5c7dSchl#XPack Diskimage
476380b5c7dSchl
477380b5c7dSchl# These were inspired by idarc, but actually verified
478380b5c7dSchl# Dzip archiver (.dz)
479380b5c7dSchl0	string	DZ Dzip archive data
480380b5c7dSchl>2	byte	x \b, version %i
481380b5c7dSchl>3	byte	x \b.%i
482380b5c7dSchl# ZZip archiver (.zz)
483380b5c7dSchl0	string	ZZ\ \0\0 ZZip archive data
484380b5c7dSchl0	string	ZZ0 ZZip archive data
485380b5c7dSchl# PAQ archiver (.paq)
486380b5c7dSchl0	string	\xaa\x40\x5f\x77\x1f\xe5\x82\x0d PAQ archive data
487380b5c7dSchl0	string	PAQ PAQ archive data
488380b5c7dSchl>3	byte&0xf0	0x30
489380b5c7dSchl>>3	byte	x (v%c)
490380b5c7dSchl# JAR archiver (.j), this is the successor to ARJ, not Java's JAR (which is essentially ZIP)
491380b5c7dSchl0xe	string	\x1aJar\x1b JAR (ARJ Software, Inc.) archive data
492380b5c7dSchl0	string	JARCS JAR (ARJ Software, Inc.) archive data
493df930be7Sderaadt
494df930be7Sderaadt# ARJ archiver (jason@jarthur.Claremont.EDU)
495df930be7Sderaadt0	leshort		0xea60		ARJ archive data
4960ee74395Schl!:mime	application/x-arj
497df930be7Sderaadt>5	byte		x		\b, v%d,
498df930be7Sderaadt>8	byte		&0x04		multi-volume,
499df930be7Sderaadt>8	byte		&0x10		slash-switched,
500df930be7Sderaadt>8	byte		&0x20		backup,
501df930be7Sderaadt>34	string		x		original name: %s,
502df930be7Sderaadt>7	byte		0		os: MS-DOS
503df930be7Sderaadt>7	byte		1		os: PRIMOS
504df930be7Sderaadt>7	byte		2		os: Unix
505df930be7Sderaadt>7	byte		3		os: Amiga
506df930be7Sderaadt>7	byte		4		os: Macintosh
507df930be7Sderaadt>7	byte		5		os: OS/2
508df930be7Sderaadt>7	byte		6		os: Apple ][ GS
509df930be7Sderaadt>7	byte		7		os: Atari ST
510df930be7Sderaadt>7	byte		8		os: NeXT
511df930be7Sderaadt>7	byte		9		os: VAX/VMS
512df930be7Sderaadt>3	byte		>0		%d]
513380b5c7dSchl# [JW] idarc says this is also possible
514380b5c7dSchl2	leshort		0xea60		ARJ archive data
515df930be7Sderaadt
516df930be7Sderaadt# HA archiver (Greg Roelofs, newt@uchicago.edu)
517df930be7Sderaadt# This is a really bad format. A file containing HAWAII will match this...
518df930be7Sderaadt#0	string		HA		HA archive data,
519df930be7Sderaadt#>2	leshort		=1		1 file,
520*70e96360Ssthen#>2	leshort		>1		%hu files,
521df930be7Sderaadt#>4	byte&0x0f	=0		first is type CPY
522df930be7Sderaadt#>4	byte&0x0f	=1		first is type ASC
523df930be7Sderaadt#>4	byte&0x0f	=2		first is type HSC
524df930be7Sderaadt#>4	byte&0x0f	=0x0e		first is type DIR
525df930be7Sderaadt#>4	byte&0x0f	=0x0f		first is type SPECIAL
526380b5c7dSchl# suggestion: at least identify small archives (<1024 files)
527380b5c7dSchl0  belong&0xffff00fc 0x48410000 HA archive data
528380b5c7dSchl>2	leshort		=1		1 file,
529380b5c7dSchl>2	leshort		>1		%u files,
530380b5c7dSchl>4	byte&0x0f	=0		first is type CPY
531380b5c7dSchl>4	byte&0x0f	=1		first is type ASC
532380b5c7dSchl>4	byte&0x0f	=2		first is type HSC
533380b5c7dSchl>4	byte&0x0f	=0x0e		first is type DIR
534380b5c7dSchl>4	byte&0x0f	=0x0f		first is type SPECIAL
535df930be7Sderaadt
536df930be7Sderaadt# HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
537df930be7Sderaadt0	string		HPAK		HPACK archive data
538df930be7Sderaadt
539df930be7Sderaadt# JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
540df930be7Sderaadt0	string		\351,\001JAM\ 		JAM archive,
541df930be7Sderaadt>7	string		>\0			version %.4s
542df930be7Sderaadt>0x26	byte		=0x27			-
543df930be7Sderaadt>>0x2b	string          >\0			label %.11s,
544df930be7Sderaadt>>0x27	lelong		x			serial %08x,
545df930be7Sderaadt>>0x36	string		>\0			fstype %.8s
546df930be7Sderaadt
547df930be7Sderaadt# LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
548380b5c7dSchl2	string		-lh0-		LHarc 1.x/ARX archive data [lh0]
5490ee74395Schl!:mime	application/x-lharc
550380b5c7dSchl2	string		-lh1-		LHarc 1.x/ARX archive data [lh1]
5510ee74395Schl!:mime	application/x-lharc
552df930be7Sderaadt2	string		-lz4-		LHarc 1.x archive data [lz4]
5530ee74395Schl!:mime	application/x-lharc
554df930be7Sderaadt2	string		-lz5-		LHarc 1.x archive data [lz5]
5550ee74395Schl!:mime	application/x-lharc
556df930be7Sderaadt#	[never seen any but the last; -lh4- reported in comp.compression:]
557380b5c7dSchl2	string		-lzs-		LHa/LZS archive data [lzs]
5580ee74395Schl!:mime	application/x-lha
55936c0c0feStedu2	string		-lh\40-		LHa 2.x? archive data [lh ]
5600ee74395Schl!:mime	application/x-lha
561df930be7Sderaadt2	string		-lhd-		LHa 2.x? archive data [lhd]
5620ee74395Schl!:mime	application/x-lha
563df930be7Sderaadt2	string		-lh2-		LHa 2.x? archive data [lh2]
5640ee74395Schl!:mime	application/x-lha
565df930be7Sderaadt2	string		-lh3-		LHa 2.x? archive data [lh3]
5660ee74395Schl!:mime	application/x-lha
567df930be7Sderaadt2	string		-lh4-		LHa (2.x) archive data [lh4]
5680ee74395Schl!:mime	application/x-lha
569df930be7Sderaadt2	string		-lh5-		LHa (2.x) archive data [lh5]
5700ee74395Schl!:mime	application/x-lha
57136c0c0feStedu2	string		-lh6-		LHa (2.x) archive data [lh6]
5720ee74395Schl!:mime	application/x-lha
573380b5c7dSchl2	string		-lh7-		LHa (2.x)/LHark archive data [lh7]
5740ee74395Schl!:mime	application/x-lha
575df930be7Sderaadt>20	byte		x		- header level %d
576380b5c7dSchl# taken from idarc [JW]
577380b5c7dSchl2   string      -lZ         PUT archive data
578380b5c7dSchl2   string      -lz         LZS archive data
579380b5c7dSchl2   string      -sw1-       Swag archive data
580df930be7Sderaadt
581df930be7Sderaadt# RAR archiver (Greg Roelofs, newt@uchicago.edu)
582380b5c7dSchl0	string		Rar!		RAR archive data,
5830ee74395Schl!:mime	application/x-rar
584380b5c7dSchl>44	byte		x		v%0x,
585380b5c7dSchl>10	byte		>0		flags:
586380b5c7dSchl>>10	byte		&0x01		Archive volume,
587380b5c7dSchl>>10	byte		&0x02		Commented,
588380b5c7dSchl>>10	byte		&0x04		Locked,
589380b5c7dSchl>>10	byte		&0x08		Solid,
590380b5c7dSchl>>10	byte		&0x20		Authenticated,
591380b5c7dSchl>35	byte		0		os: MS-DOS
592380b5c7dSchl>35	byte		1		os: OS/2
593380b5c7dSchl>35	byte		2		os: Win32
594380b5c7dSchl>35	byte		3		os: Unix
595380b5c7dSchl# some old version? idarc says:
596380b5c7dSchl0   string      RE\x7e\x5e  RAR archive data
597df930be7Sderaadt
598df930be7Sderaadt# SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
599df930be7Sderaadt0	string		SQSH		squished archive data (Acorn RISCOS)
600df930be7Sderaadt
601df930be7Sderaadt# UC2 archiver (Greg Roelofs, newt@uchicago.edu)
602380b5c7dSchl# [JW] see exe section for self-extracting version
603df930be7Sderaadt0	string		UC2\x1a		UC2 archive data
604df930be7Sderaadt
605*70e96360Ssthen# PKZIP multi-volume archive
606*70e96360Ssthen0	string		PK\x07\x08PK\x03\x04	Zip multi-volume archive data, at least PKZIP v2.50 to extract
6070ee74395Schl!:mime	application/zip
608380b5c7dSchl
609*70e96360Ssthen# Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
610*70e96360Ssthen0	string		PK\005\006	Zip archive data (empty)
611*70e96360Ssthen0	string		PK\003\004
612*70e96360Ssthen
613*70e96360Ssthen# Specialised zip formats which start with a member named 'mimetype'
614*70e96360Ssthen# (stored uncompressed, with no 'extra field') containing the file's MIME type.
615*70e96360Ssthen# Check for have 8-byte name, 0-byte extra field, name "mimetype", and
616*70e96360Ssthen#  contents starting with "application/":
617*70e96360Ssthen>26	string		\x8\0\0\0mimetypeapplication/
618*70e96360Ssthen
619*70e96360Ssthen#  KOffice / OpenOffice & StarOffice / OpenDocument formats
620380b5c7dSchl#    From: Abel Cheung <abel@oaka.org>
621380b5c7dSchl
622380b5c7dSchl#   KOffice (1.2 or above) formats
623*70e96360Ssthen#    (mimetype contains "application/vnd.kde.<SUBTYPE>")
624*70e96360Ssthen>>50	string	vnd.kde.		KOffice (>=1.2)
625*70e96360Ssthen>>>58	string	karbon			Karbon document
626*70e96360Ssthen>>>58	string	kchart			KChart document
627*70e96360Ssthen>>>58	string	kformula		KFormula document
628*70e96360Ssthen>>>58	string	kivio			Kivio document
629*70e96360Ssthen>>>58	string	kontour			Kontour document
630*70e96360Ssthen>>>58	string	kpresenter		KPresenter document
631*70e96360Ssthen>>>58	string	kspread			KSpread document
632*70e96360Ssthen>>>58	string	kword			KWord document
633380b5c7dSchl
634380b5c7dSchl#   OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7)
635*70e96360Ssthen#    (mimetype contains "application/vnd.sun.xml.<SUBTYPE>")
636*70e96360Ssthen>>50	string	vnd.sun.xml.		OpenOffice.org 1.x
637*70e96360Ssthen>>>62	string	writer			Writer
638*70e96360Ssthen>>>>68	byte	!0x2e			document
639*70e96360Ssthen>>>>68	string	.template		template
640*70e96360Ssthen>>>>68	string	.global			global document
641*70e96360Ssthen>>>62	string	calc			Calc
642*70e96360Ssthen>>>>66	byte	!0x2e			spreadsheet
643*70e96360Ssthen>>>>66	string	.template		template
644*70e96360Ssthen>>>62	string	draw			Draw
645*70e96360Ssthen>>>>66	byte	!0x2e			document
646*70e96360Ssthen>>>>66	string	.template		template
647*70e96360Ssthen>>>62	string	impress			Impress
648*70e96360Ssthen>>>>69	byte	!0x2e			presentation
649*70e96360Ssthen>>>>69	string	.template		template
650*70e96360Ssthen>>>62	string	math			Math document
651*70e96360Ssthen>>>62	string	base			Database file
652380b5c7dSchl
653380b5c7dSchl#   OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
654380b5c7dSchl#    http://lists.oasis-open.org/archives/office/200505/msg00006.html
655*70e96360Ssthen#    (mimetype contains "application/vnd.oasis.opendocument.<SUBTYPE>")
656*70e96360Ssthen>>50	string	vnd.oasis.opendocument.	OpenDocument
657*70e96360Ssthen>>>73	string	text
658*70e96360Ssthen>>>>77	byte	!0x2d			Text
6590ee74395Schl!:mime	application/vnd.oasis.opendocument.text
660*70e96360Ssthen>>>>77	string	-template		Text Template
661*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.text-template
662*70e96360Ssthen>>>>77	string	-web			HTML Document Template
663*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.text-web
664*70e96360Ssthen>>>>77	string	-master			Master Document
665*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.text-master
666*70e96360Ssthen>>>73	string	graphics
667*70e96360Ssthen>>>>81	byte	!0x2d			Drawing
668*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.graphics
669*70e96360Ssthen>>>>81	string	-template		Template
670*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.graphics-template
671*70e96360Ssthen>>>73	string	presentation
672*70e96360Ssthen>>>>85	byte	!0x2d			Presentation
673*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.presentation
674*70e96360Ssthen>>>>85	string	-template		Template
675*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.presentation-template
676*70e96360Ssthen>>>73	string	spreadsheet
677*70e96360Ssthen>>>>84	byte	!0x2d			Spreadsheet
678*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.spreadsheet
679*70e96360Ssthen>>>>84	string	-template		Template
680*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.spreadsheet-template
681*70e96360Ssthen>>>73	string	chart
682*70e96360Ssthen>>>>78	byte	!0x2d			Chart
683*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.chart
684*70e96360Ssthen>>>>78	string	-template		Template
685*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.chart-template
686*70e96360Ssthen>>>73	string	formula
687*70e96360Ssthen>>>>80	byte	!0x2d			Formula
688*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.formula
689*70e96360Ssthen>>>>80	string	-template		Template
690*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.formula-template
691*70e96360Ssthen>>>73	string	database		Database
692*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.database
693*70e96360Ssthen>>>73	string	image
694*70e96360Ssthen>>>>78	byte	!0x2d			Image
695*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.image
696*70e96360Ssthen>>>>78	string	-template		Template
697*70e96360Ssthen!:mime	application/vnd.oasis.opendocument.image-template
698*70e96360Ssthen
699*70e96360Ssthen#  EPUB (OEBPS) books using OCF (OEBPS Container Format)
700*70e96360Ssthen#    http://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4.
701*70e96360Ssthen#    From: Ralf Brown <ralf.brown@gmail.com>
702*70e96360Ssthen>>50	string	epub+zip	EPUB document
703*70e96360Ssthen!:mime application/epub+zip
704*70e96360Ssthen
705*70e96360Ssthen#  Catch other ZIP-with-mimetype formats
706*70e96360Ssthen#	In a ZIP file, the bytes immediately after a member's contents are
707*70e96360Ssthen#	always "PK". The 2 regex rules here print the "mimetype" member's
708*70e96360Ssthen#	contents up to the first 'P'. Luckily, most MIME types don't contain
709*70e96360Ssthen#	any capital 'P's. This is a kludge.
710*70e96360Ssthen#    (mimetype contains "application/<OTHER>")
711*70e96360Ssthen>>50		string	!epub+zip
712*70e96360Ssthen>>>50		string	!vnd.oasis.opendocument.
713*70e96360Ssthen>>>>50		string	!vnd.sun.xml.
714*70e96360Ssthen>>>>>50		string	!vnd.kde.
715*70e96360Ssthen>>>>>>38	regex	[!-OQ-~]+		Zip data (MIME type "%s"?)
716*70e96360Ssthen!:mime	application/zip
717*70e96360Ssthen#    (mimetype contents other than "application/*")
718*70e96360Ssthen>26		string	\x8\0\0\0mimetype
719*70e96360Ssthen>>38		string	!application/
720*70e96360Ssthen>>>38		regex	[!-OQ-~]+		Zip data (MIME type "%s"?)
721*70e96360Ssthen!:mime	application/zip
722*70e96360Ssthen
723*70e96360Ssthen# Java Jar files
724*70e96360Ssthen>(26.s+30)	leshort	0xcafe		Java archive data (JAR)
725*70e96360Ssthen!:mime	application/java-archive
726*70e96360Ssthen
727*70e96360Ssthen# Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
728*70e96360Ssthen#   Next line excludes specialized formats:
729*70e96360Ssthen>(26.s+30)	leshort	!0xcafe
730*70e96360Ssthen>>26    string          !\x8\0\0\0mimetype	Zip archive data
731*70e96360Ssthen!:mime	application/zip
732*70e96360Ssthen>>>4	byte		0x09		\b, at least v0.9 to extract
733*70e96360Ssthen>>>4	byte		0x0a		\b, at least v1.0 to extract
734*70e96360Ssthen>>>4	byte		0x0b		\b, at least v1.1 to extract
735*70e96360Ssthen>>>4	byte		0x14		\b, at least v2.0 to extract
736*70e96360Ssthen>>>4	byte		0x2d		\b, at least v4.5 to extract
737*70e96360Ssthen>>>0x161	string		WINZIP		\b, WinZIP self-extracting
738*70e96360Ssthen
739*70e96360Ssthen# StarView Metafile
740*70e96360Ssthen# From Pierre Ducroquet <pinaraf@pinaraf.info>
741*70e96360Ssthen0	string	VCLMTF	StarView MetaFile
742*70e96360Ssthen>6	beshort	x	\b, version %d
743*70e96360Ssthen>8	belong	x	\b, size %d
744df930be7Sderaadt
745df930be7Sderaadt# Zoo archiver
746df930be7Sderaadt20	lelong		0xfdc4a7dc	Zoo archive data
7470ee74395Schl!:mime	application/x-zoo
748df930be7Sderaadt>4	byte		>48		\b, v%c.
749df930be7Sderaadt>>6	byte		>47		\b%c
750df930be7Sderaadt>>>7	byte		>47		\b%c
751df930be7Sderaadt>32	byte		>0		\b, modify: v%d
752df930be7Sderaadt>>33	byte		x		\b.%d+
753df930be7Sderaadt>42	lelong		0xfdc4a7dc	\b,
754df930be7Sderaadt>>70	byte		>0		extract: v%d
755df930be7Sderaadt>>>71	byte		x		\b.%d+
756df930be7Sderaadt
757df930be7Sderaadt# Shell archives
758df930be7Sderaadt10	string		#\ This\ is\ a\ shell\ archive	shell archive text
7590ee74395Schl!:mime	application/octet-stream
76036c0c0feStedu
76136c0c0feStedu#
76236c0c0feStedu# LBR. NB: May conflict with the questionable
76336c0c0feStedu#          "binary Computer Graphics Metafile" format.
76436c0c0feStedu#
76536c0c0feStedu0       string  \0\ \ \ \ \ \ \ \ \ \ \ \0\0    LBR archive data
76636c0c0feStedu#
76736c0c0feStedu# PMA (CP/M derivative of LHA)
76836c0c0feStedu#
76936c0c0feStedu2       string          -pm0-           PMarc archive data [pm0]
77036c0c0feStedu2       string          -pm1-           PMarc archive data [pm1]
77136c0c0feStedu2       string          -pm2-           PMarc archive data [pm2]
77236c0c0feStedu2       string          -pms-           PMarc SFX archive (CP/M, DOS)
77336c0c0feStedu5       string          -pc1-           PopCom compressed executable (CP/M)
77436c0c0feStedu
77536c0c0feStedu# From Rafael Laboissiere <rafael@laboissiere.net>
77636c0c0feStedu# The Project Revision Control System (see
77736c0c0feStedu# http://prcs.sourceforge.net) generates a packaged project
77836c0c0feStedu# file which is recognized by the following entry:
77936c0c0feStedu0	leshort		0xeb81	PRCS packaged project
78036c0c0feStedu
78136c0c0feStedu# Microsoft cabinets
78236c0c0feStedu# by David Necas (Yeti) <yeti@physics.muni.cz>
78336c0c0feStedu#0	string	MSCF\0\0\0\0	Microsoft cabinet file data,
78436c0c0feStedu#>25	byte	x		v%d
78536c0c0feStedu#>24	byte	x		\b.%d
78636c0c0feStedu# MPi: All CABs have version 1.3, so this is pointless.
78736c0c0feStedu# Better magic in debian-additions.
78836c0c0feStedu
78936c0c0feStedu# GTKtalog catalogs
79036c0c0feStedu# by David Necas (Yeti) <yeti@physics.muni.cz>
79136c0c0feStedu4	string	gtktalog\ 	GTKtalog catalog data,
79236c0c0feStedu>13	string	3		version 3
79336c0c0feStedu>>14	beshort	0x677a		(gzipped)
79436c0c0feStedu>>14	beshort	!0x677a		(not gzipped)
79536c0c0feStedu>13	string	>3		version %s
79636c0c0feStedu
79736c0c0feStedu############################################################################
79836c0c0feStedu# Parity archive reconstruction file, the 'par' file format now used on Usenet.
79936c0c0feStedu0       string          PAR\0	PARity archive data
80036c0c0feStedu>48	leshort		=0	- Index file
80136c0c0feStedu>48	leshort		>0	- file number %d
80236c0c0feStedu
80336c0c0feStedu# Felix von Leitner <felix-file@fefe.de>
80436c0c0feStedu0	string	d8:announce	BitTorrent file
8050ee74395Schl!:mime	application/x-bittorrent
80636c0c0feStedu
80736c0c0feStedu# Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
80836c0c0feStedu0	beshort 0x0e0f		Atari MSA archive data
80936c0c0feStedu>2	beshort x		\b, %d sectors per track
81036c0c0feStedu>4	beshort 0		\b, 1 sided
81136c0c0feStedu>4	beshort 1		\b, 2 sided
81236c0c0feStedu>6	beshort x		\b, starting track: %d
81336c0c0feStedu>8	beshort x		\b, ending track: %d
81436c0c0feStedu
81536c0c0feStedu# Alternate ZIP string (amc@arwen.cs.berkeley.edu)
81636c0c0feStedu0	string	PK00PK\003\004	Zip archive data
81736c0c0feStedu
81836c0c0feStedu# ACE archive (from http://www.wotsit.org/download.asp?f=ace)
81936c0c0feStedu# by Stefan `Sec` Zehl <sec@42.org>
820380b5c7dSchl7	string		**ACE**		ACE archive data
82136c0c0feStedu>15	byte	>0		version %d
82236c0c0feStedu>16	byte	=0x00		\b, from MS-DOS
82336c0c0feStedu>16	byte	=0x01		\b, from OS/2
82436c0c0feStedu>16	byte	=0x02		\b, from Win/32
82536c0c0feStedu>16	byte	=0x03		\b, from Unix
82636c0c0feStedu>16	byte	=0x04		\b, from MacOS
82736c0c0feStedu>16	byte	=0x05		\b, from WinNT
82836c0c0feStedu>16	byte	=0x06		\b, from Primos
82936c0c0feStedu>16	byte	=0x07		\b, from AppleGS
83036c0c0feStedu>16	byte	=0x08		\b, from Atari
83136c0c0feStedu>16	byte	=0x09		\b, from Vax/VMS
83236c0c0feStedu>16	byte	=0x0A		\b, from Amiga
83336c0c0feStedu>16	byte	=0x0B		\b, from Next
83436c0c0feStedu>14	byte	x		\b, version %d to extract
83536c0c0feStedu>5	leshort &0x0080		\b, multiple volumes,
83636c0c0feStedu>>17	byte	x		\b (part %d),
83736c0c0feStedu>5	leshort &0x0002		\b, contains comment
83836c0c0feStedu>5	leshort	&0x0200		\b, sfx
83936c0c0feStedu>5	leshort	&0x0400		\b, small dictionary
84036c0c0feStedu>5	leshort	&0x0800		\b, multi-volume
84136c0c0feStedu>5	leshort	&0x1000		\b, contains AV-String
84236c0c0feStedu>>30	string	\x16*UNREGISTERED\x20VERSION*	(unregistered)
84336c0c0feStedu>5	leshort &0x2000		\b, with recovery record
84436c0c0feStedu>5	leshort &0x4000		\b, locked
84536c0c0feStedu>5	leshort &0x8000		\b, solid
84636c0c0feStedu# Date in MS-DOS format (whatever that is)
84736c0c0feStedu#>18	lelong	x		Created on
848380b5c7dSchl
849380b5c7dSchl# sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
850380b5c7dSchl# <doj@cubic.org>
851380b5c7dSchl0x1A	string	sfArk		sfArk compressed Soundfont
852380b5c7dSchl>0x15	string	2
853380b5c7dSchl>>0x1	string	>\0		Version %s
854380b5c7dSchl>>0x2A	string	>\0		: %s
855380b5c7dSchl
856380b5c7dSchl# DR-DOS 7.03 Packed File *.??_
857380b5c7dSchl0	string	Packed\ File\ 	Personal NetWare Packed File
858380b5c7dSchl>12	string	x		\b, was "%.12s"
859380b5c7dSchl
860380b5c7dSchl# EET archive
861380b5c7dSchl# From: Tilman Sauerbeck <tilman@code-monkey.de>
862380b5c7dSchl0	belong	0x1ee7ff00	EET archive
8630ee74395Schl!:mime	application/x-eet
864380b5c7dSchl
865380b5c7dSchl# rzip archives
866380b5c7dSchl0	string	RZIP		rzip compressed data
867380b5c7dSchl>4	byte	x		- version %d
868380b5c7dSchl>5	byte	x		\b.%d
869380b5c7dSchl>6	belong	x		(%d bytes)
870380b5c7dSchl
871380b5c7dSchl# From: "Robert Dale" <robdale@gmail.com>
872380b5c7dSchl0	belong	123		dar archive,
873380b5c7dSchl>4	belong	x		label "%.8x
874380b5c7dSchl>>8	belong	x		%.8x
875380b5c7dSchl>>>12	beshort	x		%.4x"
876380b5c7dSchl>14	byte	0x54		end slice
877380b5c7dSchl>14	beshort	0x4e4e		multi-part
878380b5c7dSchl>14	beshort	0x4e53		multi-part, with -S
879380b5c7dSchl
880380b5c7dSchl# Symbian installation files
881380b5c7dSchl#  http://www.thouky.co.uk/software/psifs/sis.html
882380b5c7dSchl#  http://developer.symbian.com/main/downloads/papers/SymbianOSv91/softwareinstallsis.pdf
883380b5c7dSchl8	lelong	0x10000419	Symbian installation file
8840ee74395Schl!:mime	application/vnd.symbian.install
885380b5c7dSchl>4	lelong	0x1000006D	(EPOC release 3/4/5)
886380b5c7dSchl>4	lelong	0x10003A12	(EPOC release 6)
887380b5c7dSchl0	lelong	0x10201A7A	Symbian installation file (Symbian OS 9.x)
8880ee74395Schl!:mime	x-epoc/x-sisx-app
8890ee74395Schl
8900ee74395Schl# From "Nelson A. de Oliveira" <naoliv@gmail.com>
8910ee74395Schl0	string	MPQ\032		MoPaQ (MPQ) archive
8920ee74395Schl
8930ee74395Schl# From: Dirk Jagdmann <doj@cubic.org>
8940ee74395Schl# xar archive format: http://code.google.com/p/xar/
8950ee74395Schl0	string	xar!		xar archive
896*70e96360Ssthen>6	beshort	x		- version %d
8970ee74395Schl
8980ee74395Schl# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
8990ee74395Schl# .kgb
9000ee74395Schl0	string KGB_arch		KGB Archiver file
9010ee74395Schl>10	string x		with compression level %.1s
9020ee74395Schl
9030ee74395Schl# xar (eXtensible ARchiver) archive
9040ee74395Schl# From: "David Remahl" <dremahl@apple.com>
9050ee74395Schl0	string	xar!		xar archive
9060ee74395Schl#>4	beshort	x		header size %d
9070ee74395Schl>6	beshort	x		version %d,
9080ee74395Schl#>8	quad	x		compressed TOC: %d,
9090ee74395Schl#>16	quad	x		uncompressed TOC: %d,
9100ee74395Schl>24	belong	0		no checksum
9110ee74395Schl>24	belong	1		SHA-1 checksum
9120ee74395Schl>24	belong	2		MD5 checksum
9130ee74395Schl
914*70e96360Ssthen# Type: Parity Archive
915*70e96360Ssthen# From: Daniel van Eeden <daniel_e@dds.nl>
916*70e96360Ssthen0	string	PAR2		Parity Archive Volume Set
917*70e96360Ssthen
918*70e96360Ssthen# Bacula volume format. (Volumes always start with a block header.)
919*70e96360Ssthen# URL: http://bacula.org/3.0.x-manuals/en/developers/developers/Block_Header.html
920*70e96360Ssthen# From: Adam Buchbinder <adam.buchbinder@gmail.com>
921*70e96360Ssthen12	string	BB02		Bacula volume
922*70e96360Ssthen>20	bedate	x		\b, started %s
923*70e96360Ssthen
924*70e96360Ssthen# ePub is XHTML + XML inside a ZIP archive.  The first member of the
925*70e96360Ssthen#   archive must be an uncompressed file called 'mimetype' with contents
926*70e96360Ssthen#   'application/epub+zip'
927*70e96360Ssthen
928*70e96360Ssthen
929*70e96360Ssthen# From: "Michael Gorny" <mgorny@gentoo.org>
930*70e96360Ssthen# ZPAQ: http://mattmahoney.net/dc/zpaq.html
931*70e96360Ssthen0	string	zPQ	ZPAQ stream
932*70e96360Ssthen>3	byte	x	\b, level %d
933*70e96360Ssthen# From: Barry Carter <carter.barry@gmail.com>
934*70e96360Ssthen# http://encode.ru/threads/456-zpaq-updates/page32
935*70e96360Ssthen0	string	7kSt	ZPAQ file
936*70e96360Ssthen
937*70e96360Ssthen# BBeB ebook, unencrypted (LRF format)
938*70e96360Ssthen# URL: http://www.sven.de/librie/Librie/LrfFormat
939*70e96360Ssthen# From: Adam Buchbinder <adam.buchbinder@gmail.com>
940*70e96360Ssthen0	string	L\0R\0F\0\0\0	BBeB ebook data, unencrypted
941*70e96360Ssthen>8	beshort	x		\b, version %d
942*70e96360Ssthen>36	byte	1		\b, front-to-back
943*70e96360Ssthen>36	byte	16		\b, back-to-front
944*70e96360Ssthen>42	beshort	x		\b, (%dx,
945*70e96360Ssthen>44	beshort	x		%d)
946*70e96360Ssthen
947*70e96360Ssthen# Symantec GHOST image by Joerg Jenderek at May 2014
948*70e96360Ssthen# http://us.norton.com/ghost/
949*70e96360Ssthen# http://www.garykessler.net/library/file_sigs.html
950*70e96360Ssthen0		ubelong&0xFFFFf7f0	0xFEEF0100	Norton GHost image
951*70e96360Ssthen# *.GHO
952*70e96360Ssthen>2		ubyte&0x08		0x00		\b, first file
953*70e96360Ssthen# *.GHS or *.[0-9] with cns program option
954*70e96360Ssthen>2		ubyte&0x08		0x08		\b, split file
955*70e96360Ssthen# part of split index interesting for *.ghs
956*70e96360Ssthen>>4		ubyte			x		id=0x%x
957*70e96360Ssthen# compression tag minus one equals numeric compression command line switch z[1-9]
958*70e96360Ssthen>3		ubyte			0		\b, no compression
959*70e96360Ssthen>3		ubyte			2		\b, fast compression (Z1)
960*70e96360Ssthen>3		ubyte			3		\b, medium compression (Z2)
961*70e96360Ssthen>3		ubyte			>3
962*70e96360Ssthen>>3		ubyte			<11		\b, compression (Z%d-1)
963*70e96360Ssthen>2		ubyte&0x08		0x00
964*70e96360Ssthen# ~ 30 byte password field only for *.gho
965*70e96360Ssthen>>12		ubequad			!0		\b, password protected
966*70e96360Ssthen>>44		ubyte			!1
967*70e96360Ssthen# 1~Image All, sector-by-sector only for *.gho
968*70e96360Ssthen>>>10		ubyte			1		\b, sector copy
969*70e96360Ssthen# 1~Image Boot track only for *.gho
970*70e96360Ssthen>>>43		ubyte			1		\b, boot track
971*70e96360Ssthen# 1~Image Disc only for *.gho implies Image Boot track and sector copy
972*70e96360Ssthen>>44		ubyte			1		\b, disc sector copy
973*70e96360Ssthen# optional image description only *.gho
974*70e96360Ssthen>>0xff		string			>\0		"%-.254s"
975*70e96360Ssthen# look for DOS sector end sequence
976*70e96360Ssthen>0xE08	search/7776		\x55\xAA
977*70e96360Ssthen# XXX indirect not supported yet
978*70e96360Ssthen#>>&-512	indirect		x		\b; contains
979*70e96360Ssthen
980