xref: /freebsd/contrib/file/magic/Magdir/archive (revision 898496ee09ed2b7d25f6807edc4515628196ec0a)
1b6cee71dSXin LI#------------------------------------------------------------------------------
2*898496eeSXin LI# $File: archive,v 1.193 2023/07/27 17:55:58 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.
758a0f0d0SEitan Adler# pre-POSIX "tar" archives are also handled in the C code ../../src/is_tar.c.
8b6cee71dSXin LI
9b6cee71dSXin LI# POSIX tar archives
1058a0f0d0SEitan Adler# URL: https://en.wikipedia.org/wiki/Tar_(computing)
1158a0f0d0SEitan Adler# Reference: https://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5&manpath=FreeBSD+8-current
1258a0f0d0SEitan Adler# header mainly padded with nul bytes
1358a0f0d0SEitan Adler500	quad		0
142dc4dbb9SEitan Adler!:strength /2
1558a0f0d0SEitan Adler# filename or extended attribute printable strings in range space null til umlaut ue
1658a0f0d0SEitan Adler>0	ubeshort	>0x1F00
1758a0f0d0SEitan Adler>>0	ubeshort	<0xFCFD
1858a0f0d0SEitan Adler# last 4 header bytes often null but tar\0 in gtarfail2.tar gtarfail.tar-bad
1958a0f0d0SEitan Adler# at https://sourceforge.net/projects/s-tar/files/testscripts/
2058a0f0d0SEitan Adler>>>508	ubelong&0x8B9E8DFF	0
2158a0f0d0SEitan Adler# nul, space or ascii digit 0-7 at start of mode
2258a0f0d0SEitan Adler>>>>100	ubyte&0xC8	=0
2358a0f0d0SEitan Adler>>>>>101 ubyte&0xC8	=0
2458a0f0d0SEitan Adler# nul, space at end of check sum
2558a0f0d0SEitan Adler>>>>>>155 ubyte&0xDF	=0
2658a0f0d0SEitan Adler# space or ascii digit 0 at start of check sum
2758a0f0d0SEitan Adler>>>>>>>148	ubyte&0xEF	=0x20
28a2dfb722SXin LI# FOR DEBUGGING:
29a2dfb722SXin LI#>>>>>>>>0	regex		\^[0-9]{2,4}[.](png|jpg|jpeg|tif|tiff|gif|bmp)	NAME "%s"
30a2dfb722SXin LI# check for 1st image main name with digits used for sorting
31a2dfb722SXin LI# and for name extension case insensitive like: PNG JPG JPEG TIF TIFF GIF BMP
32a2dfb722SXin LI>>>>>>>>0	regex		\^[0-9]{2,4}[.](png|jpg|jpeg|tif|tiff|gif|bmp)
33a2dfb722SXin LI>>>>>>>>>0	use	tar-cbt
34*898496eeSXin LI# check for 1st member name with ovf suffix
35*898496eeSXin LI>>>>>>>>0	regex		\^.{1,96}[.](ovf)
36*898496eeSXin LI>>>>>>>>>0	use	tar-ova
37*898496eeSXin LI# if 1st member name without digits and without used image suffix and without *.ovf then it is a TAR archive
38a2dfb722SXin LI>>>>>>>>0	default		x
39a2dfb722SXin LI>>>>>>>>>0	use	tar-file
4058a0f0d0SEitan Adler#	minimal check and then display tar archive information which can also be
4158a0f0d0SEitan Adler#	embedded inside others like Android Backup, Clam AntiVirus database
4258a0f0d0SEitan Adler0	name		tar-file
4358a0f0d0SEitan Adler>257	string		!ustar
4458a0f0d0SEitan Adler# header padded with nuls
4558a0f0d0SEitan Adler>>257	ulong		=0
4658a0f0d0SEitan Adler# GNU tar version 1.29 with non pax format option without refusing
4758a0f0d0SEitan Adler# creates misleading V7 header for Long path, Multi-volume, Volume type
4858a0f0d0SEitan Adler>>>156	ubyte		0x4c		GNU tar archive
4958a0f0d0SEitan Adler!:mime	application/x-gtar
5058a0f0d0SEitan Adler!:ext	tar/gtar
5158a0f0d0SEitan Adler>>>156	ubyte		0x4d		GNU tar archive
5258a0f0d0SEitan Adler!:mime	application/x-gtar
5358a0f0d0SEitan Adler!:ext	tar/gtar
5458a0f0d0SEitan Adler>>>156	ubyte		0x56		GNU tar archive
5558a0f0d0SEitan Adler!:mime	application/x-gtar
5658a0f0d0SEitan Adler!:ext	tar/gtar
5758a0f0d0SEitan Adler>>>156	default		x		tar archive (V7)
5858a0f0d0SEitan Adler!:mime	application/x-tar
5958a0f0d0SEitan Adler!:ext	tar
6058a0f0d0SEitan Adler# other stuff in padding
6158a0f0d0SEitan Adler# some implementations add new fields to the blank area at the end of the header record
6258a0f0d0SEitan Adler# created for example by DOS TAR 3.20g 1994 Tim V.Shapore with -j option
6358a0f0d0SEitan Adler>>257	ulong		!0		tar archive (old)
6458a0f0d0SEitan Adler!:mime	application/x-tar
6558a0f0d0SEitan Adler!:ext	tar
6658a0f0d0SEitan Adler# magic in newer, GNU, posix variants
6758a0f0d0SEitan Adler>257	string		=ustar
6858a0f0d0SEitan Adler# 2 last char of magic and UStar version because string expression does not work
6958a0f0d0SEitan Adler# 2 space characters followed by a null for GNU variant
7058a0f0d0SEitan Adler>>261	ubelong		=0x72202000	POSIX tar archive (GNU)
7158a0f0d0SEitan Adler!:mime	application/x-gtar
7258a0f0d0SEitan Adler!:ext	tar/gtar
7358a0f0d0SEitan Adler# UStar version with ASCII "00"
7458a0f0d0SEitan Adler>>261	ubelong		0x72003030	POSIX
7558a0f0d0SEitan Adler# gLOBAL and ExTENSION type only found in POSIX.1-2001 format
7658a0f0d0SEitan Adler>>>156	ubyte		0x67		\b.1-2001
7758a0f0d0SEitan Adler>>>156	ubyte		0x78		\b.1-2001
7858a0f0d0SEitan Adler>>>156	ubyte		x		tar archive
7958a0f0d0SEitan Adler!:mime	application/x-ustar
8058a0f0d0SEitan Adler!:ext	tar/ustar
8158a0f0d0SEitan Adler# version with 2 binary nuls embedded in Android Backup like com.android.settings.ab
8258a0f0d0SEitan Adler>>261	ubelong		0x72000000	tar archive (ustar)
8358a0f0d0SEitan Adler!:mime	application/x-ustar
8458a0f0d0SEitan Adler!:ext	tar/ustar
8558a0f0d0SEitan Adler# not seen ustar variant with garbish version
8658a0f0d0SEitan Adler>>261	default		x		tar archive (unknown ustar)
8758a0f0d0SEitan Adler!:mime	application/x-ustar
8858a0f0d0SEitan Adler!:ext	tar/ustar
8958a0f0d0SEitan Adler# type flag of 1st tar archive member
9058a0f0d0SEitan Adler#>156	ubyte		x		\b, %c-type
9158a0f0d0SEitan Adler>156	ubyte		x
9258a0f0d0SEitan Adler>>156	ubyte		0		\b, file
9358a0f0d0SEitan Adler>>156	ubyte		0x30		\b, file
9458a0f0d0SEitan Adler>>156	ubyte		0x31		\b, hard link
9558a0f0d0SEitan Adler>>156	ubyte		0x32		\b, symlink
9658a0f0d0SEitan Adler>>156	ubyte		0x33		\b, char device
9758a0f0d0SEitan Adler>>156	ubyte		0x34		\b, block device
9858a0f0d0SEitan Adler>>156	ubyte		0x35		\b, directory
9958a0f0d0SEitan Adler>>156	ubyte		0x36		\b, fifo
10058a0f0d0SEitan Adler>>156	ubyte		0x37		\b, reserved
10158a0f0d0SEitan Adler>>156	ubyte		0x4c		\b, long path
10258a0f0d0SEitan Adler>>156	ubyte		0x4d		\b, multi volume
10358a0f0d0SEitan Adler>>156	ubyte		0x56		\b, volume
10458a0f0d0SEitan Adler>>156	ubyte		0x67		\b, global
10558a0f0d0SEitan Adler>>156	ubyte		0x78		\b, extension
10658a0f0d0SEitan Adler>>156	default		x		\b, type
10758a0f0d0SEitan Adler>>>156	ubyte		x		'%c'
10858a0f0d0SEitan Adler# name[100]
10958a0f0d0SEitan Adler>0	string		>\0		%-.60s
11058a0f0d0SEitan Adler# mode mainly stored as an octal number in ASCII null or space terminated
11158a0f0d0SEitan Adler>100	string		>\0		\b, mode %-.7s
11258a0f0d0SEitan Adler# user id mainly as octal numbers in ASCII null or space terminated
11358a0f0d0SEitan Adler>108	string		>\0		\b, uid %-.7s
11458a0f0d0SEitan Adler# group id mainly as octal numbers in ASCII null or space terminated
11558a0f0d0SEitan Adler>116	string		>\0		\b, gid %-.7s
11658a0f0d0SEitan Adler# size mainly as octal number in ASCII
11758a0f0d0SEitan Adler>124	ubyte		<0x38
11858a0f0d0SEitan Adler>>124	string		>\0		\b, size %-.12s
11958a0f0d0SEitan Adler# coding indicated by setting the high-order bit of the leftmost byte
12058a0f0d0SEitan Adler>124	ubyte		>0xEF		\b, size 0x
12158a0f0d0SEitan Adler>>124	ubyte		!0xff		\b%2.2x
12258a0f0d0SEitan Adler>>125	ubyte		!0xff		\b%2.2x
12358a0f0d0SEitan Adler>>126	ubyte		!0xff		\b%2.2x
12458a0f0d0SEitan Adler>>127	ubyte		!0xff		\b%2.2x
12558a0f0d0SEitan Adler>>128	ubyte		!0xff		\b%2.2x
12658a0f0d0SEitan Adler>>129	ubyte		!0xff		\b%2.2x
12758a0f0d0SEitan Adler>>130	ubyte		!0xff		\b%2.2x
12858a0f0d0SEitan Adler>>131	ubyte		!0xff		\b%2.2x
12958a0f0d0SEitan Adler>>132	ubyte		!0xff		\b%2.2x
13058a0f0d0SEitan Adler>>133	ubyte		!0xff		\b%2.2x
13158a0f0d0SEitan Adler>>134	ubyte		!0xff		\b%2.2x
13258a0f0d0SEitan Adler>>135	ubyte		!0xff		\b%2.2x
13358a0f0d0SEitan Adler# seconds since 0:0:0 1 jan 1970 UTC as octal number mainly in ASCII null or space terminated
13458a0f0d0SEitan Adler>136	string		>\0		\b, seconds %-.11s
13558a0f0d0SEitan Adler# header checksum stored as an octal number in ASCII null or space terminated
13658a0f0d0SEitan Adler#>148	string		x		\b, cksum %.7s
13758a0f0d0SEitan Adler# linkname[100]
13858a0f0d0SEitan Adler>157	string		>\0		\b, linkname %-.40s
13958a0f0d0SEitan Adler# additional fields for ustar
14058a0f0d0SEitan Adler>257	string		=ustar
14158a0f0d0SEitan Adler# owner user name null terminated
14258a0f0d0SEitan Adler>>265	string		>\0		\b, user %-.32s
14358a0f0d0SEitan Adler# group name null terminated
14458a0f0d0SEitan Adler>>297	string		>\0		\b, group %-.32s
14558a0f0d0SEitan Adler# device major minor if not zero
14658a0f0d0SEitan Adler>>329	ubequad&0xCFCFCFCFcFcFcFdf	!0
14758a0f0d0SEitan Adler>>>329	string		x		\b, devmaj %-.7s
14858a0f0d0SEitan Adler>>337	ubequad&0xCFCFCFCFcFcFcFdf	!0
14958a0f0d0SEitan Adler>>>337	string		x		\b, devmin %-.7s
15058a0f0d0SEitan Adler# prefix[155]
15158a0f0d0SEitan Adler>>345	string		>\0		\b, prefix %-.155s
15258a0f0d0SEitan Adler# old non ustar/POSIX tar
15358a0f0d0SEitan Adler>257	string		!ustar
15458a0f0d0SEitan Adler>>508	string		=tar\0
15558a0f0d0SEitan Adler# padding[255] in old star
15658a0f0d0SEitan Adler>>>257	string		>\0		\b, padding: %-.40s
15758a0f0d0SEitan Adler>>508	default		x
15858a0f0d0SEitan Adler# padding[255] in old tar sometimes comment field
15958a0f0d0SEitan Adler>>>257	string		>\0		\b, comment: %-.40s
160a2dfb722SXin LI# Summary:	Comic Book Archive *.CBT with TAR format
161a2dfb722SXin LI# URL:		https://en.wikipedia.org/wiki/Comic_book_archive
162a2dfb722SXin LI#		http://fileformats.archiveteam.org/wiki/Comic_Book_Archive
163a2dfb722SXin LI# Note:		there exist also RAR, ZIP, ACE and 7Z packed variants
164a2dfb722SXin LI0	name		tar-cbt
165a2dfb722SXin LI>0	string		x		Comic Book archive, tar archive
166a2dfb722SXin LI#!:mime	application/x-tar
167a2dfb722SXin LI!:mime	application/vnd.comicbook
168a2dfb722SXin LI#!:mime	application/vnd.comicbook+tar
169a2dfb722SXin LI!:ext	cbt
170a2dfb722SXin LI# name[100] probably like: 19.jpg 0001.png 0002.png
171a2dfb722SXin LI# or maybe like ComicInfo.xml
172a2dfb722SXin LI>0	string		>\0		\b, 1st image %-.60s
173*898496eeSXin LI# Summary:	Open Virtualization Format *.OVF with disk images and more packed as TAR archive *.OVA
174*898496eeSXin LI# From:		Joerg Jenderek
175*898496eeSXin LI# URL:		https://en.wikipedia.org/wiki/Open_Virtualization_Format
176*898496eeSXin LI#		http://fileformats.archiveteam.org/wiki/OVF_(Open_Virtualization_Format)
177*898496eeSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/o/ova.trid.xml
178*898496eeSXin LI# Note:		called "Open Virtualization Format package" by TrID
179*898496eeSXin LI#		assuming *.ovf comes first
180*898496eeSXin LI0	name		tar-ova
181*898496eeSXin LI>0	string		x		Open Virtualization Format Archive
182*898496eeSXin LI#!:mime	application/x-ustar
183*898496eeSXin LI# http://extension.nirsoft.net/ova
184*898496eeSXin LI!:mime	application/x-virtualbox-ova
185*898496eeSXin LI!:ext	ova
186*898496eeSXin LI# assuming name[100] like: DOS-0.9.ovf FreeDOS_1.ovf Win98SE_DE.ovf
187*898496eeSXin LI>0	string		>\0		\b, with %-.60s
188b6cee71dSXin LI
189b6cee71dSXin LI# Incremental snapshot gnu-tar format from:
19048c779cdSXin LI# https://www.gnu.org/software/tar/manual/html_node/Snapshot-Files.html
191b6cee71dSXin LI0	string		GNU\ tar-	GNU tar incremental snapshot data
192a4d6d3b8SXin LI>&0	regex		[0-9]\\.[0-9]+-[0-9]+	version %s
193b6cee71dSXin LI
194b6cee71dSXin LI# cpio archives
195b6cee71dSXin LI#
196b6cee71dSXin LI# Yes, the top two "cpio archive" formats *are* supposed to just be "short".
197b6cee71dSXin LI# The idea is to indicate archives produced on machines with the same
198b6cee71dSXin LI# byte order as the machine running "file" with "cpio archive", and
199b6cee71dSXin LI# to indicate archives produced on machines with the opposite byte order
200b6cee71dSXin LI# from the machine running "file" with "byte-swapped cpio archive".
201b6cee71dSXin LI#
202b6cee71dSXin LI# The SVR4 "cpio(4)" hints that there are additional formats, but they
203b6cee71dSXin LI# are defined as "short"s; I think all the new formats are
204b6cee71dSXin LI# character-header formats and thus are strings, not numbers.
205*898496eeSXin LI# URL:		http://fileformats.archiveteam.org/wiki/Cpio
206*898496eeSXin LI#		https://en.wikipedia.org/wiki/Cpio
207*898496eeSXin LI# Reference:	https://people.freebsd.org/~kientzle/libarchive/man/cpio.5.txt
208*898496eeSXin LI# Update:	Joerg Jenderek
209*898496eeSXin LI#
210*898496eeSXin LI# Reference:    http://mark0.net/download/triddefs_xml.7z/defs/a/ark-cpio-bin.trid.xml
211*898496eeSXin LI# Note:		called "CPIO archive (binary)" by TrID, "cpio/Binary LE" by 7-Zip and "CPIO" by DROID via PUID fmt/635
212*898496eeSXin LI0	short		070707
213*898496eeSXin LI# skip DROID fmt-635-signature-id-960.cpio by looking for pathname of 1st entry
214*898496eeSXin LI>26	string		>\0		cpio archive
215b6cee71dSXin LI!:mime	application/x-cpio
216*898496eeSXin LI# https://download.opensuse.org/distribution/leap/15.4/iso/openSUSE-Leap-15.4-NET-x86_64-Media.iso
217*898496eeSXin LI# boot/x86_64/loader/bootlogo
218*898496eeSXin LI# message.cpi
219*898496eeSXin LI!:ext	/cpio/cpi
220*898496eeSXin LI>>0	use	cpio-bin
221*898496eeSXin LI# Reference:    http://mark0.net/download/triddefs_xml.7z/defs/a/ark-cpio-bin-sw.trid.xml
222*898496eeSXin LI# Note:		called "CPIO archive (byte swapped binary)" by TrID and "Cpio/Binary BE" by 7-Zip
223b6cee71dSXin LI0	short		0143561		byte-swapped cpio archive
224b6cee71dSXin LI!:mime	application/x-cpio # encoding: swapped
225*898496eeSXin LI# https://telparia.com/fileFormatSamples/archive/cpio/skeleton2.cpio
226*898496eeSXin LI!:ext	cpio
227*898496eeSXin LI>0	use	cpio-bin-be
228*898496eeSXin LI# Reference:    http://mark0.net/download/triddefs_xml.7z/defs/a/ark-cpio.trid.xml
229*898496eeSXin LI# Note:		called "CPIO archive (portable)" by TrID, "cpio/Portable ASCII" by 7-Zip and "cpio/odc" by GNU cpio
230b6cee71dSXin LI0	string		070707		ASCII cpio archive (pre-SVR4 or odc)
23143a5ec4eSXin LI!:mime	application/x-cpio
232*898496eeSXin LI# https://telparia.com/fileFormatSamples/archive/cpio/ pthreads-1.60B5.osr5src.cpio cinema.cpi VOL.000.008 VOL.000.012
233*898496eeSXin LI!:ext	cpio/cpi/008/012
234*898496eeSXin LI# Note:		called "CPIO archive (portable)" by TrID, "cpio/New ASCII" by 7-Zip and "cpio/newc" by GNU cpio
235b6cee71dSXin LI0	string		070701		ASCII cpio archive (SVR4 with no CRC)
23643a5ec4eSXin LI!:mime	application/x-cpio
237*898496eeSXin LI# https://telparia.com/fileFormatSamples/archive/cpio/MainActor-2.06.3.cpio
238*898496eeSXin LI!:ext	cpio
239*898496eeSXin LI# Note:		called "CPIO archive (portable)" by TrID, "cpio/New CRC" by 7-Zip and "cpio/crc" by GNU cpio
240b6cee71dSXin LI0	string		070702		ASCII cpio archive (SVR4 with CRC)
24143a5ec4eSXin LI!:mime	application/x-cpio
242*898496eeSXin LI# http://ftp.gnu.org/gnu/tar/tar-1.27.cpio.gz
243*898496eeSXin LI# https://telparia.com/fileFormatSamples/archive/cpio/pcmcia
244*898496eeSXin LI!:ext	/cpio
245*898496eeSXin LI#	display information of old binary cpio archive
246*898496eeSXin LI# Note:	verfied by 7-Zip `7z l -tcpio -slt *.cpio` and
247*898496eeSXin LI#	`cpio -ivt --numeric-uid-gid --file=clam.bin-le.cpio`
248*898496eeSXin LI0	name	cpio-bin
249*898496eeSXin LI# c_dev; device number; WHAT IS THAT?
250*898496eeSXin LI>2	uleshort	x		\b; device %u
251*898496eeSXin LI# c_ino; truncated inode number; use `ls --inode`
252*898496eeSXin LI>4	uleshort	x		\b, inode %u
253*898496eeSXin LI# c_mode; mode specifies permissions and file type like: ?622~?rw-r--r-- by `ls -l`
254*898496eeSXin LI>6	uleshort	x		\b, mode %o
255*898496eeSXin LI# c_uid; numeric user id; use `ls --numeric-uid-gid`
256*898496eeSXin LI>8	uleshort	x		\b, uid %u
257*898496eeSXin LI# c_gid; numeric group id
258*898496eeSXin LI>10	uleshort	x		\b, gid %u
259*898496eeSXin LI# c_nlink; links to this file; directories at least 2
260*898496eeSXin LI>12	uleshort	>1		\b, %u links
261*898496eeSXin LI# c_rdev; device number for block and character entries; zero for all other entries by writers
262*898496eeSXin LI# like 0x0440 for /dev/ttyS0
263*898496eeSXin LI>14	uleshort	>0		\b, device %#4.4x
264*898496eeSXin LI# c_mtime[2]; modification time in seconds since 1 January 1970; most-significant 16 bits first
265*898496eeSXin LI>16	medate		x		\b, modified %s
266*898496eeSXin LI# c_filesize[2]; size of pathname; most-significant 16 bits first like: 544
267*898496eeSXin LI>22	melong		x		\b, %u bytes
268*898496eeSXin LI# c_namesize; bytes in the pathname that follows the header like: 9
269*898496eeSXin LI#>20	uleshort	x		\b, namesize %u
270*898496eeSXin LI# pathname of entry like: "clam.exe"
271*898496eeSXin LI>26	string		x		"%s"
272*898496eeSXin LI#	display information of old binary byte swapped cpio archive
273*898496eeSXin LI# Note:	verfied by 7-Zip `7z l -tcpio -slt *.cpio` and
274*898496eeSXin LI#	`LANGUAGE=C cpio -ivt --numeric-uid-gid --file=clam.bin-be.cpio`
275*898496eeSXin LI0	name	cpio-bin-be
276*898496eeSXin LI>2	ubeshort	x		\b; device %u
277*898496eeSXin LI>4	ubeshort	x		\b, inode %u
278*898496eeSXin LI>6	ubeshort	x		\b, mode %o
279*898496eeSXin LI>8	ubeshort	x		\b, uid %u
280*898496eeSXin LI>10	ubeshort	x		\b, gid %u
281*898496eeSXin LI>12	ubeshort	>1		\b, %u links
282*898496eeSXin LI>14	ubeshort	>0		\b, device %#4.4x
283*898496eeSXin LI>16	bedate		x		\b, modified %s
284*898496eeSXin LI>22	ubelong	 	x		\b, %u bytes
285*898496eeSXin LI#>20	ubeshort	x		\b, namesize %u
286*898496eeSXin LI>26	string		x		"%s"
287b6cee71dSXin LI
288b6cee71dSXin LI#
289b6cee71dSXin LI# Various archive formats used by various versions of the "ar"
290b6cee71dSXin LI# command.
291b6cee71dSXin LI#
292b6cee71dSXin LI
293b6cee71dSXin LI#
294b6cee71dSXin LI# Original UNIX archive formats.
295b6cee71dSXin LI# They were written with binary values in host byte order, and
296b6cee71dSXin LI# the magic number was a host "int", which might have been 16 bits
297b6cee71dSXin LI# or 32 bits.  We don't say "PDP-11" or "VAX", as there might have
298b6cee71dSXin LI# been ports to little-endian 16-bit-int or 32-bit-int platforms
299b6cee71dSXin LI# (x86?) using some of those formats; if none existed, feel free
300b6cee71dSXin LI# to use "PDP-11" for little-endian 16-bit and "VAX" for little-endian
301b6cee71dSXin LI# 32-bit.  There might have been big-endian ports of that sort as
302b6cee71dSXin LI# well.
303b6cee71dSXin LI#
304b6cee71dSXin LI0	leshort		0177555		very old 16-bit-int little-endian archive
305b6cee71dSXin LI0	beshort		0177555		very old 16-bit-int big-endian archive
306b6cee71dSXin LI0	lelong		0177555		very old 32-bit-int little-endian archive
307b6cee71dSXin LI0	belong		0177555		very old 32-bit-int big-endian archive
308b6cee71dSXin LI
309b6cee71dSXin LI0	leshort		0177545		old 16-bit-int little-endian archive
310b6cee71dSXin LI>2	string		__.SYMDEF	random library
311b6cee71dSXin LI0	beshort		0177545		old 16-bit-int big-endian archive
312b6cee71dSXin LI>2	string		__.SYMDEF	random library
313b6cee71dSXin LI0	lelong		0177545		old 32-bit-int little-endian archive
314b6cee71dSXin LI>4	string		__.SYMDEF	random library
315b6cee71dSXin LI0	belong		0177545		old 32-bit-int big-endian archive
316b6cee71dSXin LI>4	string		__.SYMDEF	random library
317b6cee71dSXin LI
318b6cee71dSXin LI#
319b6cee71dSXin LI# From "pdp" (but why a 4-byte quantity?)
320b6cee71dSXin LI#
321b6cee71dSXin LI0	lelong		0x39bed		PDP-11 old archive
322b6cee71dSXin LI0	lelong		0x39bee		PDP-11 4.0 archive
323b6cee71dSXin LI
324b6cee71dSXin LI#
325b6cee71dSXin LI# XXX - what flavor of APL used this, and was it a variant of
326b6cee71dSXin LI# some ar archive format?  It's similar to, but not the same
327b6cee71dSXin LI# as, the APL workspace magic numbers in pdp.
328b6cee71dSXin LI#
329b6cee71dSXin LI0	long		0100554		apl workspace
330b6cee71dSXin LI
331b6cee71dSXin LI#
332b6cee71dSXin LI# System V Release 1 portable(?) archive format.
333b6cee71dSXin LI#
334b6cee71dSXin LI0	string		=<ar>		System V Release 1 ar archive
335b6cee71dSXin LI!:mime	application/x-archive
336b6cee71dSXin LI
337b6cee71dSXin LI#
338b6cee71dSXin LI# Debian package; it's in the portable archive format, and needs to go
339b6cee71dSXin LI# before the entry for regular portable archives, as it's recognized as
340b6cee71dSXin LI# a portable archive whose first member has a name beginning with
341b6cee71dSXin LI# "debian".
342b6cee71dSXin LI#
34348c779cdSXin LI# Update: Joerg Jenderek
34448c779cdSXin LI# URL: https://en.wikipedia.org/wiki/Deb_(file_format)
345b6cee71dSXin LI0	string		=!<arch>\ndebian
34648c779cdSXin LI# https://manpages.debian.org/testing/dpkg/dpkg-split.1.en.html
34748c779cdSXin LI>14	string		-split	part of multipart Debian package
348b6cee71dSXin LI!:mime	application/vnd.debian.binary-package
34948c779cdSXin LI# udeb is used for stripped down deb file
35048c779cdSXin LI!:ext	deb/udeb
35148c779cdSXin LI>14	string		-binary	Debian binary package
352b6cee71dSXin LI!:mime	application/vnd.debian.binary-package
3532726a701SXin LI# For ipk packager see also https://en.wikipedia.org/wiki/Opkg
3542726a701SXin LI!:ext	deb/udeb/ipk
35548c779cdSXin LI# This should not happen
35648c779cdSXin LI>14	default		x	Unknown Debian package
35743a5ec4eSXin LI# NL terminated version; for most Debian cases this is 2.0 or 2.1 for split
358b6cee71dSXin LI>68	string		>\0		(format %s)
35948c779cdSXin LI#>68	string		!2.0\n
36048c779cdSXin LI#>>68	string		x		(format %.3s)
36148c779cdSXin LI>68	string		=2.0\n
36248c779cdSXin LI# 2nd archive name=control archive name like control.tar.gz or control.tar.xz
363*898496eeSXin LI# or control.tar.zst
364*898496eeSXin LI>>72	string		>\0		\b, with %.15s
36548c779cdSXin LI# look for 3rd archive name=data archive name like data.tar.{gz,xz,bz2,lzma}
36648c779cdSXin LI>>0	search/0x93e4f	data.tar.	\b, data compression
36748c779cdSXin LI# the above line only works if FILE_BYTES_MAX in ../../src/file.h is raised
36848c779cdSXin LI# for example like libreoffice-dev-doc_1%3a5.2.7-1+rpi1+deb9u3_all.deb
3692726a701SXin LI>>>&0	string		x		%.2s
3702726a701SXin LI# skip space (0x20 BSD) and slash (0x2f System V) character marking end of name
3712726a701SXin LI>>>&2	ubyte		!0x20
3722726a701SXin LI>>>>&-1	ubyte		!0x2f
3732726a701SXin LI# display 3rd character of file name extension like 2 of bz2 or m of lzma
3742726a701SXin LI>>>>>&-1	ubyte	x		\b%c
3752726a701SXin LI>>>>>>&0	ubyte	!0x20
3762726a701SXin LI>>>>>>>&-1	ubyte	!0x2f
3772726a701SXin LI# display 4th character of file name extension like a of lzma
3782726a701SXin LI>>>>>>>>&-1	ubyte	x		\b%c
37943a5ec4eSXin LI# split debian package case
38048c779cdSXin LI>68	string		=2.1\n
38148c779cdSXin LI# dpkg-1.18.25/dpkg-split/info.c
38248c779cdSXin LI# NL terminated ASCII package name like ckermit
38348c779cdSXin LI>>&0	string		x		\b, %s
38448c779cdSXin LI# NL terminated package version like 302-5.3
38548c779cdSXin LI>>>&1	string		x		%s
38648c779cdSXin LI# NL terminated MD5 checksum
38748c779cdSXin LI>>>>&1	string		x		\b, MD5 %s
38848c779cdSXin LI# NL terminated original package length
38948c779cdSXin LI>>>>>&1	string		x		\b, unsplitted size %s
39048c779cdSXin LI# NL terminated part length
391d38c30c0SXin LI>>>>>>&1	string	x		\b, part length %s
39248c779cdSXin LI# NL terminated package part like n/m
39348c779cdSXin LI>>>>>>>&1	string	x		\b, part %s
39448c779cdSXin LI# NL terminated package architecture like armhf since dpkg 1.16.1 or later
39548c779cdSXin LI>>>>>>>>&1	string	x		\b, %s
396b6cee71dSXin LI
397b6cee71dSXin LI#
398b6cee71dSXin LI# MIPS archive; they're in the portable archive format, and need to go
399b6cee71dSXin LI# before the entry for regular portable archives, as it's recognized as
400b6cee71dSXin LI# a portable archive whose first member has a name beginning with
401b6cee71dSXin LI# "__________E".
402b6cee71dSXin LI#
403b6cee71dSXin LI0	string	=!<arch>\n__________E	MIPS archive
404b6cee71dSXin LI!:mime	application/x-archive
405b6cee71dSXin LI>20	string	U			with MIPS Ucode members
406b6cee71dSXin LI>21	string	L			with MIPSEL members
407b6cee71dSXin LI>21	string	B			with MIPSEB members
408b6cee71dSXin LI>19	string	L			and an EL hash table
409b6cee71dSXin LI>19	string	B			and an EB hash table
410b6cee71dSXin LI>22	string	X			-- out of date
411b6cee71dSXin LI
412b6cee71dSXin LI#
413b6cee71dSXin LI# BSD/SVR2-and-later portable archive formats.
414b6cee71dSXin LI#
41548c779cdSXin LI# Update: Joerg Jenderek
41648c779cdSXin LI# URL:		http://fileformats.archiveteam.org/wiki/AR
41748c779cdSXin LI# Reference:	https://www.unix.com/man-page/opensolaris/3HEAD/ar.h/
41848c779cdSXin LI# Note:		Mach-O universal binary in ./cafebabe is dependent
41948c779cdSXin LI# TODO:		unify current ar archive, MIPS archive, Debian package
42048c779cdSXin LI#		distinguish BSD, SVR; 32, 64 bit; HP from other 32-bit SVR;
42148c779cdSXin LI#		*.ar packages from *.a libraries. handle empty archive
4222dc4dbb9SEitan Adler0	string		=!<arch>\n		current ar archive
42348c779cdSXin LI# print first and possibly second ar_name[16] for debugging purpose
42448c779cdSXin LI#>8			string	x	\b, 1st "%.16s"
42548c779cdSXin LI#>68			string	x	\b, 2nd "%.16s"
426b6cee71dSXin LI!:mime	application/x-archive
42748c779cdSXin LI# a in most case for libraries; lib for Microsoft libraries; ar else cases
42848c779cdSXin LI!:ext	a/lib/ar
429b6cee71dSXin LI>8	string		__.SYMDEF	random library
43048c779cdSXin LI# first member with long marked name __.SYMDEF SORTED implies BSD library
431b6cee71dSXin LI>68	string		__.SYMDEF\ SORTED	random library
43248c779cdSXin LI# Reference: https://parisc.wiki.kernel.org/images-parisc/b/b2/Rad_11_0_32.pdf
43348c779cdSXin LI# "archive file" entry moved from ./hp
43448c779cdSXin LI# LST header system_id 0210h~PA-RISC 1.1,... identifies the target architecture
43548c779cdSXin LI# LST header a_magic 0619h~relocatable library
43648c779cdSXin LI>68	belong 		0x020b0619	- PA-RISC1.0 relocatable library
43748c779cdSXin LI>68	belong	 	0x02100619	- PA-RISC1.1 relocatable library
43848c779cdSXin LI>68	belong 		0x02110619	- PA-RISC1.2 relocatable library
43948c779cdSXin LI>68	belong 		0x02140619	- PA-RISC2.0 relocatable library
44048c779cdSXin LI#EOF for common ar archives
441b6cee71dSXin LI
442b6cee71dSXin LI#
443b6cee71dSXin LI# "Thin" archive, as can be produced by GNU ar.
444b6cee71dSXin LI#
445b6cee71dSXin LI0	string		=!<thin>\n	thin archive with
446b6cee71dSXin LI>68	belong		0		no symbol entries
447b6cee71dSXin LI>68	belong		1		%d symbol entry
448b6cee71dSXin LI>68	belong		>1		%d symbol entries
449b6cee71dSXin LI
45048c779cdSXin LI0	search/1	-h-		Software Tools format archive text
45148c779cdSXin LI
452b6cee71dSXin LI# ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
453b6cee71dSXin LI#
454b6cee71dSXin LI# The first byte is the magic (0x1a), byte 2 is the compression type for
455b6cee71dSXin LI# the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
456b6cee71dSXin LI# filename of the first file (null terminated).  Since some types collide
457b6cee71dSXin LI# we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
458b6cee71dSXin LI# 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%).  0x01 collides with terminfo.
459b6cee71dSXin LI0	lelong&0x8080ffff	0x0000081a	ARC archive data, dynamic LZW
460b6cee71dSXin LI!:mime	application/x-arc
461b6cee71dSXin LI0	lelong&0x8080ffff	0x0000091a	ARC archive data, squashed
462b6cee71dSXin LI!:mime	application/x-arc
463b6cee71dSXin LI0	lelong&0x8080ffff	0x0000021a	ARC archive data, uncompressed
464b6cee71dSXin LI!:mime	application/x-arc
465b6cee71dSXin LI0	lelong&0x8080ffff	0x0000031a	ARC archive data, packed
466b6cee71dSXin LI!:mime	application/x-arc
467b6cee71dSXin LI0	lelong&0x8080ffff	0x0000041a	ARC archive data, squeezed
468b6cee71dSXin LI!:mime	application/x-arc
469b6cee71dSXin LI0	lelong&0x8080ffff	0x0000061a	ARC archive data, crunched
470b6cee71dSXin LI!:mime	application/x-arc
471b6cee71dSXin LI# [JW] stuff taken from idarc, obviously ARC successors:
472b6cee71dSXin LI0	lelong&0x8080ffff	0x00000a1a	PAK archive data
473b6cee71dSXin LI!:mime	application/x-arc
474b6cee71dSXin LI0	lelong&0x8080ffff	0x0000141a	ARC+ archive data
475b6cee71dSXin LI!:mime	application/x-arc
476b6cee71dSXin LI0	lelong&0x8080ffff	0x0000481a	HYP archive data
477b6cee71dSXin LI!:mime	application/x-arc
478b6cee71dSXin LI
479b6cee71dSXin LI# Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
480b6cee71dSXin LI# I can't create either SPARK or ArcFS archives so I have not tested this stuff
481b6cee71dSXin LI# [GRR:  the original entries collide with ARC, above; replaced with combined
482b6cee71dSXin LI#  version (not tested)]
483b6cee71dSXin LI#0	byte		0x1a		RISC OS archive (spark format)
484b6cee71dSXin LI0	string		\032archive	RISC OS archive (ArcFS format)
485b6cee71dSXin LI0       string          Archive\000     RISC OS archive (ArcFS format)
486b6cee71dSXin LI
487b6cee71dSXin LI# All these were taken from idarc, many could not be verified. Unfortunately,
488b6cee71dSXin LI# there were many low-quality sigs, i.e. easy to trigger false positives.
489b6cee71dSXin LI# Please notify me of any real-world fishy/ambiguous signatures and I'll try
490b6cee71dSXin LI# to get my hands on the actual archiver and see if I find something better. [JW]
491b6cee71dSXin LI# probably many can be enhanced by finding some 0-byte or control char near the start
492b6cee71dSXin LI
493b6cee71dSXin LI# idarc calls this Crush/Uncompressed... *shrug*
494b6cee71dSXin LI0	string	CRUSH Crush archive data
495b6cee71dSXin LI# Squeeze It (.sqz)
496b6cee71dSXin LI0	string	HLSQZ Squeeze It archive data
497b6cee71dSXin LI# SQWEZ
498b6cee71dSXin LI0	string	SQWEZ SQWEZ archive data
499b6cee71dSXin LI# HPack (.hpk)
500b6cee71dSXin LI0	string	HPAK HPack archive data
501b6cee71dSXin LI# HAP
502b6cee71dSXin LI0	string	\x91\x33HF HAP archive data
503b6cee71dSXin LI# MD/MDCD
504b6cee71dSXin LI0	string	MDmd MDCD archive data
505b6cee71dSXin LI# LIM
506b6cee71dSXin LI0	string	LIM\x1a LIM archive data
507b6cee71dSXin LI# SAR
508b6cee71dSXin LI3	string	LH5 SAR archive data
509b6cee71dSXin LI# BSArc/BS2
510b6cee71dSXin LI0	string	\212\3SB\020\0	BSArc/BS2 archive data
511b6cee71dSXin LI# Bethesda Softworks Archive (Oblivion)
512b6cee71dSXin LI0	string	BSA\0 		BSArc archive data
513b6cee71dSXin LI>4	lelong	x		version %d
514b6cee71dSXin LI# MAR
515b6cee71dSXin LI2	string	=-ah MAR archive data
516b6cee71dSXin LI# ACB
517b6cee71dSXin LI#0	belong&0x00f800ff	0x00800000 ACB archive data
518b6cee71dSXin LI# CPZ
519b6cee71dSXin LI# TODO, this is what idarc says: 0	string	\0\0\0 CPZ archive data
520b6cee71dSXin LI# JRC
521b6cee71dSXin LI0	string	JRchive JRC archive data
522b6cee71dSXin LI# Quantum
523b6cee71dSXin LI0	string	DS\0 Quantum archive data
524b6cee71dSXin LI# ReSOF
525b6cee71dSXin LI0	string	PK\3\6 ReSOF archive data
526b6cee71dSXin LI# QuArk
527b6cee71dSXin LI0	string	7\4 QuArk archive data
528b6cee71dSXin LI# YAC
529b6cee71dSXin LI14	string	YC YAC archive data
530b6cee71dSXin LI# X1
531b6cee71dSXin LI0	string	X1 X1 archive data
532b6cee71dSXin LI0	string	XhDr X1 archive data
533b6cee71dSXin LI# CDC Codec (.dqt)
534b6cee71dSXin LI0	belong&0xffffe000	0x76ff2000 CDC Codec archive data
535b6cee71dSXin LI# AMGC
536b6cee71dSXin LI0	string	\xad6" AMGC archive data
537b6cee71dSXin LI# NuLIB
538b6cee71dSXin LI0	string	N\xc3\xb5F\xc3\xa9lx\xc3\xa5 NuLIB archive data
539b6cee71dSXin LI# PakLeo
540b6cee71dSXin LI0	string	LEOLZW PAKLeo archive data
541b6cee71dSXin LI# ChArc
542b6cee71dSXin LI0	string	SChF ChArc archive data
543b6cee71dSXin LI# PSA
544b6cee71dSXin LI0	string	PSA PSA archive data
545b6cee71dSXin LI# CrossePAC
546b6cee71dSXin LI0	string	DSIGDCC CrossePAC archive data
547b6cee71dSXin LI# Freeze
548b6cee71dSXin LI0	string	\x1f\x9f\x4a\x10\x0a Freeze archive data
549b6cee71dSXin LI# KBoom
550b6cee71dSXin LI0	string	\xc2\xa8MP\xc2\xa8 KBoom archive data
551b6cee71dSXin LI# NSQ, must go after CDC Codec
552b6cee71dSXin LI0	string	\x76\xff NSQ archive data
553b6cee71dSXin LI# DPA
554b6cee71dSXin LI0	string	Dirk\ Paehl DPA archive data
555b6cee71dSXin LI# BA
556b6cee71dSXin LI# TODO: idarc says "bytes 0-2 == bytes 3-5"
557b6cee71dSXin LI# TTComp
5583e41d09dSXin LI# URL: http://fileformats.archiveteam.org/wiki/TTComp_archive
5593e41d09dSXin LI# Update: Joerg Jenderek
5603e41d09dSXin LI# GRR: line below is too general as it matches also Panorama database "TCDB 2003-10 demo.pan", others
5613e41d09dSXin LI0	string	\0\6
5623e41d09dSXin LI# look for first keyword of Panorama database *.pan
5633e41d09dSXin LI>12	search/261	DESIGN
5643e41d09dSXin LI# skip keyword with low entropy
56543a5ec4eSXin LI>12	default		x
56643a5ec4eSXin LI# skip DOS 2.0 backup id file, sequence 6 with many nils like BACKUPID_xx6.@@@ handled by ./msdos
56743a5ec4eSXin LI>>8	quad		!0
56843a5ec4eSXin LI>>>0	use	ttcomp
56943a5ec4eSXin LI# variant ASCII, 4K dictionary (strength=48=50-2). With strength=49 wrong order! WHY?
57043a5ec4eSXin LI0	string	\1\6
57143a5ec4eSXin LI# TODO:
57243a5ec4eSXin LI# skip VAX-order 68k Blit mpx/mux executable (strength=50) handled by ./blit
57343a5ec4eSXin LI!:strength	-2
57443a5ec4eSXin LI>0	use	ttcomp
57543a5ec4eSXin LI0	string	\0\5
57643a5ec4eSXin LI# skip some DOS 2.0 backup id file, sequence 5 with many nils like BACKUPID_075.@@@ handled by ./msdos
57743a5ec4eSXin LI>8	quad	!0
57843a5ec4eSXin LI>>0	use	ttcomp
57943a5ec4eSXin LI0	string	\1\5
58043a5ec4eSXin LI# TODO:
58143a5ec4eSXin LI# variant ASCII, 2K dictionary (strength=48=50-2). With strength=49 wrong order! WHY?
58243a5ec4eSXin LI# skip ctab data (strength=50) handled by ./ibm6000
58343a5ec4eSXin LI# skip locale data table (strength=50) handled by ./digital
58443a5ec4eSXin LI!:strength	-2
58543a5ec4eSXin LI>0	use	ttcomp
58643a5ec4eSXin LI0	string	\0\4
58743a5ec4eSXin LI# skip many Maple help database *.hdb with version tag handled by ./maple
58843a5ec4eSXin LI>1028	string	!version
58943a5ec4eSXin LI# skip veclib maple.hdb by looking for Mable keyword
59043a5ec4eSXin LI>>4	search/1091	Maple\040
59143a5ec4eSXin LI#>4	search/34090	Maple\040
59243a5ec4eSXin LI>>4	default		x
59343a5ec4eSXin LI# skip DOS 2.0-3.2 backed up sequence 4 with many nils like LOTUS5.RAR handled by ./msdos
59443a5ec4eSXin LI# skip xBASE Compound Index file *.CDX with many nils
59543a5ec4eSXin LI>>>0x54	quad		!0
59643a5ec4eSXin LI>>>>0	use	ttcomp
59743a5ec4eSXin LI0	string	\1\4
59843a5ec4eSXin LI# TODO:
59943a5ec4eSXin LI# skip shared library (strength=50) handled by ./ibm6000
60043a5ec4eSXin LI!:strength	-2
601*898496eeSXin LI# skip Commodore PET BASIC programs (Mastermind.prg) with last 3 nil bytes (\0~end of line followed by 0000h line offset)
602*898496eeSXin LI#>-4	ubelong		x	LAST_BYTES=%8.8x
603*898496eeSXin LI>-4	ubelong&0x00FFffFF	!0
604*898496eeSXin LI>>0	use	ttcomp
60543a5ec4eSXin LI#	display information of TTComp archive
60643a5ec4eSXin LI0	name	ttcomp
60743a5ec4eSXin LI# (version 5.25) labeled the entry as "TTComp archive data"
60843a5ec4eSXin LI>0	ubyte	x	TTComp archive data
60943a5ec4eSXin LI!:mime	application/x-compress-ttcomp
61043a5ec4eSXin LI# PBACKSCR.PI1
61143a5ec4eSXin LI!:ext	$xe/$ts/pi1/__d
61243a5ec4eSXin LI# compression type: 0~binary compression 1~ASCII compression
61343a5ec4eSXin LI>0	ubyte	0	\b, binary
61443a5ec4eSXin LI>0	ubyte	1	\b, ASCII
61543a5ec4eSXin LI# size of the dictionary:  4~1024 bytes 5~2048 bytes 6~4096 bytes
61643a5ec4eSXin LI>1	ubyte	4	\b, 1K
61743a5ec4eSXin LI>1	ubyte	5	\b, 2K
61843a5ec4eSXin LI>1	ubyte	6	\b, 4K
61943a5ec4eSXin LI>1	ubyte	x	dictionary
62043a5ec4eSXin LI#	https://mark0.net/forum/index.php?topic=848
62143a5ec4eSXin LI# last 3 bytes probably have only 8 possible bit sequences
62243a5ec4eSXin LI# xxxxxxxx 0000000x 11111111	____FFh
62343a5ec4eSXin LI# xxxxxxxx 10000000 01111111	__807Fh
62443a5ec4eSXin LI# 0xxxxxxx 11000000 00111111	__C03Fh
62543a5ec4eSXin LI# 00xxxxxx 11100000 00011111	__E01Fh
62643a5ec4eSXin LI# 000xxxxx 11110000 00001111	__F00Fh
62743a5ec4eSXin LI# 0000xxxx 11111000 00000111	__F807h
62843a5ec4eSXin LI# 00000xxx 11111100 00000011	__FC03h
62943a5ec4eSXin LI# 000000xx 11111110 00000001	__FE01h
63043a5ec4eSXin LI# but for quickgif.__d 0A7DD4h
63143a5ec4eSXin LI#>-3	ubyte		x	\b, last 3 bytes 0x%2.2x
63243a5ec4eSXin LI#>-2	ubeshort	x	\b%4.4x
633d38c30c0SXin LI# From:		Joerg Jenderek
634a4d6d3b8SXin LI# URL:		https://en.wikipedia.org/wiki/Disk_Copy
635d38c30c0SXin LI# reference:	http://nulib.com/library/FTN.e00005.htm
636d38c30c0SXin LI0x52	ubeshort	0x0100
63743a5ec4eSXin LI# test for disk image size equal or above 400k
63843a5ec4eSXin LI>0x40	ubelong		>409599
63943a5ec4eSXin LI# test also for disk image size equal or below 1440k to skip
64043a5ec4eSXin LI# windows7en.mbr UNICODE.DAT
641a4d6d3b8SXin LI#>>0x40	ubelong		<1474561
642a4d6d3b8SXin LI# test now for "low" disk image size equal or below 64 MiB to skip
643a4d6d3b8SXin LI# windows7en.mbr (B441BBAAh) UNICODE.DAT (0400AF05h)
644a4d6d3b8SXin LI>>0x40	ubelong		<0x04000001
645a4d6d3b8SXin LI# To skip Flags$StringJoiner.class with size 00106A61h test also for valid disk image sizes
646a4d6d3b8SXin LI# 00064000 for  400k GCR disks	dc42-400k-gcr.trid.xml
647a4d6d3b8SXin LI# 000c8000 for  800k GCR disks	dc42-800k-gcr.trid.xml
648a4d6d3b8SXin LI# 000b4000 for  720k MFM disks	dc42-720k-mfm.trid.xml
649a4d6d3b8SXin LI# 00168000 for 1440k MFM disks	dc42-1440k-mfm.trid.xml
650a4d6d3b8SXin LI#	https://lisaem.sunder.net/LisaProjectDocs.txt
651a4d6d3b8SXin LI# 00500000	05M	available
652a4d6d3b8SXin LI# 00A00000	10M	available
653a4d6d3b8SXin LI# 01800000	24M	possible
654a4d6d3b8SXin LI# 02000000	32M	uncertain
655a4d6d3b8SXin LI# 04000000	64M	uncertain
656a4d6d3b8SXin LI>>>0x40	ubelong&0xf8003fFF	0
657a4d6d3b8SXin LI# skip samples with invalid disk name length like:
658a4d6d3b8SXin LI# 181 (biosmd80.rom) 202 (Flags$StringJoiner.class) 90 (UNICODE.DAT)
659a4d6d3b8SXin LI>>>>0x0	ubyte			<64
660a4d6d3b8SXin LI>>>>>0	use			dc42-floppy
66143a5ec4eSXin LI#	display information of Apple DiskCopy 4.2 floppy image
66243a5ec4eSXin LI0	name		dc42-floppy
663a4d6d3b8SXin LI# disk name length; maximal 63
664a4d6d3b8SXin LI#>0	ubyte	    	x	DISK NAME LENGTH %u
665a4d6d3b8SXin LI# ASCII image pascal (maximal 63 bytes) name padded with NULs like:
666a4d6d3b8SXin LI# "Microsoft Mail" "Disquette 2" "IIe Installer Disk"
667a4d6d3b8SXin LI# "-lisaem.sunder.net hd-" (dc42-lisaem.trid.xml) "-not a Macintosh disk" (dc42-nonmac.trid.xml)
66843a5ec4eSXin LI>00	pstring/B	x	Apple DiskCopy 4.2 image %s
669d38c30c0SXin LI#!:mime	application/octet-stream
67043a5ec4eSXin LI!:mime	application/x-dc42-floppy-image
671d38c30c0SXin LI!:apple	dCpydImg
672a4d6d3b8SXin LI# probably also img like: "Utilitaires 2.img" "Installation 7.img"
673a4d6d3b8SXin LI!:ext	image/dc42/img
674a4d6d3b8SXin LI# data size in bytes like: 409600 737280 819200 1474560
67543a5ec4eSXin LI>0x40	ubelong		x	\b, %u bytes
67643a5ec4eSXin LI# for debugging purpose size in hexadecimal
67743a5ec4eSXin LI#>0x40	ubelong		x	(%#8.8x)
678a4d6d3b8SXin LI# tag size in bytes like: 0 (often) 2580h (PUID fmt/625) 4B00h (Microsoft Mail.image)
67943a5ec4eSXin LI>0x44	ubelong		>0	\b, %#x tag size
680d38c30c0SXin LI# data checksum
68143a5ec4eSXin LI#>0x48	ubelong		x	\b, %#x checksum
682d38c30c0SXin LI# tag checksum
68343a5ec4eSXin LI#>0x4c	ubelong		x	\b, %#x tag checksum
684a4d6d3b8SXin LI# disk encoding like: 0 1 2 3 (PUID: fmt/625)
68543a5ec4eSXin LI>0x50	ubyte		0	\b, GCR CLV ssdd (400k)
68643a5ec4eSXin LI>0x50	ubyte		1	\b, GCR CLV dsdd (800k)
68743a5ec4eSXin LI>0x50	ubyte		2	\b, MFM CAV dsdd (720k)
68843a5ec4eSXin LI>0x50	ubyte		3	\b, MFM CAV dshd (1440k)
68943a5ec4eSXin LI>0x50	ubyte		>3	\b, %#x encoding
690a4d6d3b8SXin LI# format byte like: 12h (Lisa 400K) 24h (400K Macintosh) 96h (800K Apple II disk)
691a4d6d3b8SXin LI# 2 (Mac 400k "Disquette Installation 13.image")
692a4d6d3b8SXin LI# 22h (double-sided MFM or Mac 800k "Disco 12.image" "IIe Installer Disk.image")
69343a5ec4eSXin LI>0x51	ubyte		x	\b, %#x format
69443a5ec4eSXin LI#>0x54	ubequad		x	\b, data %#16.16llx
695b6cee71dSXin LI# ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
696b6cee71dSXin LI0	string	ESP ESP archive data
697b6cee71dSXin LI# ZPack
698b6cee71dSXin LI0	string	\1ZPK\1 ZPack archive data
699b6cee71dSXin LI# Sky
700b6cee71dSXin LI0	string	\xbc\x40 Sky archive data
701b6cee71dSXin LI# UFA
702b6cee71dSXin LI0	string	UFA UFA archive data
703b6cee71dSXin LI# Dry
704b6cee71dSXin LI0	string	=-H2O DRY archive data
705b6cee71dSXin LI# FoxSQZ
706b6cee71dSXin LI0	string	FOXSQZ FoxSQZ archive data
707b6cee71dSXin LI# AR7
708b6cee71dSXin LI0	string	,AR7 AR7 archive data
709b6cee71dSXin LI# PPMZ
710b6cee71dSXin LI0	string	PPMZ PPMZ archive data
711b6cee71dSXin LI# MS Compress
71258a0f0d0SEitan Adler# Update: Joerg Jenderek
71358a0f0d0SEitan Adler# URL: http://fileformats.archiveteam.org/wiki/MS-DOS_installation_compression
71458a0f0d0SEitan Adler# Reference: https://hwiegman.home.xs4all.nl/fileformats/compress/szdd_kwaj_format.html
71558a0f0d0SEitan Adler# Note: use correct version of extracting tool like EXPAND, UNPACK, DECOMP or 7Z
71658a0f0d0SEitan Adler4	string	\x88\xf0\x27
71758a0f0d0SEitan Adler#		KWAJ variant
71858a0f0d0SEitan Adler>0	string	KWAJ		MS Compress archive data, KWAJ variant
71958a0f0d0SEitan Adler!:mime	application/x-ms-compress-kwaj
72058a0f0d0SEitan Adler# extension not working in version 5.32
72158a0f0d0SEitan Adler# magic/Magdir/archive, 284: Warning: EXTENSION type ` ??_' has bad char '?'
72258a0f0d0SEitan Adler# file: line 284: Bad magic entry '   ??_'
72358a0f0d0SEitan Adler!:ext	??_
72458a0f0d0SEitan Adler# compression method (0-4)
72558a0f0d0SEitan Adler>>8	uleshort	x	\b, %u method
72658a0f0d0SEitan Adler# offset of compressed data
72743a5ec4eSXin LI>>10	uleshort	x	\b, %#x offset
72858a0f0d0SEitan Adler#>>(10.s)	uleshort	x
72958a0f0d0SEitan Adler#>>>&-6		string	x	\b, TEST extension %-.3s
73058a0f0d0SEitan Adler# header flags to mark header extensions
73143a5ec4eSXin LI>>12	uleshort	>0	\b, %#x flags
73258a0f0d0SEitan Adler# 4 bytes: decompressed length of file
73358a0f0d0SEitan Adler>>12	uleshort	&0x01
73458a0f0d0SEitan Adler>>>14	ulelong		x	\b, original size: %u bytes
73558a0f0d0SEitan Adler# 2 bytes: unknown purpose
73658a0f0d0SEitan Adler# 2 bytes: length of unknown data + mentioned bytes
73758a0f0d0SEitan Adler# 1-9 bytes: null-terminated file name
73858a0f0d0SEitan Adler# 1-4 bytes: null-terminated file extension
73958a0f0d0SEitan Adler>>12	uleshort	&0x08
74058a0f0d0SEitan Adler>>>12	uleshort				^0x01
74158a0f0d0SEitan Adler>>>>12		uleshort			^0x02
74258a0f0d0SEitan Adler>>>>>12			uleshort		^0x04
74358a0f0d0SEitan Adler>>>>>>12			uleshort	^0x10
74458a0f0d0SEitan Adler>>>>>>>14				string	x	\b, %-.8s
74558a0f0d0SEitan Adler>>>>>>12			uleshort	&0x10
74658a0f0d0SEitan Adler>>>>>>>14				string	x	\b, %-.8s
74758a0f0d0SEitan Adler>>>>>>>>&1				string	x	\b.%-.3s
74858a0f0d0SEitan Adler>>>>>12			uleshort		&0x04
74958a0f0d0SEitan Adler>>>>>>12			uleshort	^0x10
75058a0f0d0SEitan Adler>>>>>>>(14.s)			uleshort	x
75158a0f0d0SEitan Adler>>>>>>>>&14				string	x	\b, %-.8s
75258a0f0d0SEitan Adler>>>>>>12			uleshort	&0x10
75358a0f0d0SEitan Adler>>>>>>>(14.s)			uleshort	x
75458a0f0d0SEitan Adler>>>>>>>>&14				string	x	\b, %-.8s
75558a0f0d0SEitan Adler>>>>>>>>>&1				string	x	\b.%-.3s
75658a0f0d0SEitan Adler>>>>12		uleshort			&0x02
75758a0f0d0SEitan Adler>>>>>12			uleshort		^0x04
75858a0f0d0SEitan Adler>>>>>>12			uleshort	^0x10
75958a0f0d0SEitan Adler>>>>>>>16				string	x	\b, %-.8s
76058a0f0d0SEitan Adler>>>>>>12			uleshort	&0x10
76158a0f0d0SEitan Adler>>>>>>>16				string	x	\b, %-.8s
76258a0f0d0SEitan Adler>>>>>>>>&1				string	x	\b.%-.3s
76358a0f0d0SEitan Adler>>>>>12			uleshort		&0x04
76458a0f0d0SEitan Adler>>>>>>12			uleshort	^0x10
76558a0f0d0SEitan Adler>>>>>>>(16.s)			uleshort	x
76658a0f0d0SEitan Adler>>>>>>>>&16				string	x	\b, %-.8s
76758a0f0d0SEitan Adler>>>>>>12			uleshort	&0x10
76858a0f0d0SEitan Adler>>>>>>>(16.s)			uleshort	x
76958a0f0d0SEitan Adler>>>>>>>&16				string	x	%-.8s
77058a0f0d0SEitan Adler>>>>>>>>&1				string	x	\b.%-.3s
77158a0f0d0SEitan Adler>>>12	uleshort				&0x01
77258a0f0d0SEitan Adler>>>>12		uleshort			^0x02
77358a0f0d0SEitan Adler>>>>>12			uleshort		^0x04
77458a0f0d0SEitan Adler>>>>>>12			uleshort	^0x10
77558a0f0d0SEitan Adler>>>>>>>18				string	x	\b, %-.8s
77658a0f0d0SEitan Adler>>>>>>12			uleshort	&0x10
77758a0f0d0SEitan Adler>>>>>>>18				string	x	\b, %-.8s
77858a0f0d0SEitan Adler>>>>>>>>&1				string	x	\b.%-.3s
77958a0f0d0SEitan Adler>>>>>12			uleshort		&0x04
78058a0f0d0SEitan Adler>>>>>>12			uleshort	^0x10
78158a0f0d0SEitan Adler>>>>>>>(18.s)			uleshort	x
78258a0f0d0SEitan Adler>>>>>>>>&18				string	x	\b, %-.8s
78358a0f0d0SEitan Adler>>>>>>12			uleshort	&0x10
78458a0f0d0SEitan Adler>>>>>>>(18.s)			uleshort	x
78558a0f0d0SEitan Adler>>>>>>>>&18				string	x	\b, %-.8s
78658a0f0d0SEitan Adler>>>>>>>>>&1				string	x	\b.%-.3s
78758a0f0d0SEitan Adler>>>>12		uleshort			&0x02
78858a0f0d0SEitan Adler>>>>>12			uleshort		^0x04
78958a0f0d0SEitan Adler>>>>>>12			uleshort	^0x10
79058a0f0d0SEitan Adler>>>>>>>20				string	x	\b, %-.8s
79158a0f0d0SEitan Adler>>>>>>12			uleshort	&0x10
79258a0f0d0SEitan Adler>>>>>>>20				string	x	\b, %-.8s
79358a0f0d0SEitan Adler>>>>>>>>&1				string	x	\b.%-.3s
79458a0f0d0SEitan Adler>>>>>12			uleshort		&0x04
79558a0f0d0SEitan Adler>>>>>>12			uleshort	^0x10
79658a0f0d0SEitan Adler>>>>>>>(20.s)			uleshort	x
79758a0f0d0SEitan Adler>>>>>>>>&20				string	x	\b, %-.8s
79858a0f0d0SEitan Adler>>>>>>12			uleshort	&0x10
79958a0f0d0SEitan Adler>>>>>>>(20.s)			uleshort	x
80058a0f0d0SEitan Adler>>>>>>>>&20				string	x	\b, %-.8s
80158a0f0d0SEitan Adler>>>>>>>>>&1				string	x	\b.%-.3s
80258a0f0d0SEitan Adler# 2 bytes: length of data + mentioned bytes
80358a0f0d0SEitan Adler#
80458a0f0d0SEitan Adler#		SZDD variant Haruhiko Okumura's LZSS or 7z type MsLZ
805a4d6d3b8SXin LI# URL:		http://fileformats.archiveteam.org/wiki/MS-DOS_installation_compression
806a4d6d3b8SXin LI# Reference:	http://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html
807a4d6d3b8SXin LI#		http://mark0.net/download/triddefs_xml.7z/defs/s/szdd.trid.xml
808a4d6d3b8SXin LI# Note:		called "Microsoft SZDD compressed (Haruhiko Okumura's LZSS)" by TrID
809a4d6d3b8SXin LI#		verfied by 7-Zip `7z l -tMsLZ -slt *.??_` as MsLZ
810a4d6d3b8SXin LI#		`deark -l -m lzss_oku -d2 setup-1-41.bin` as "LZSS.C by Haruhiko Okumura"
81158a0f0d0SEitan Adler>0	string	SZDD		MS Compress archive data, SZDD variant
812a4d6d3b8SXin LI# 2nd part of signature
813a4d6d3b8SXin LI#>>4	ubelong	0x88F02733	\b, SIGNATURE OK
81458a0f0d0SEitan Adler!:mime	application/x-ms-compress-szdd
81558a0f0d0SEitan Adler!:ext	??_
81658a0f0d0SEitan Adler# The character missing from the end of the filename (0=unknown)
81758a0f0d0SEitan Adler>>9	string	>\0		\b, %-.1s is last character of original name
81858a0f0d0SEitan Adler# https://www.betaarchive.com/forum/viewtopic.php?t=26161
81958a0f0d0SEitan Adler# Compression mode: "A" (0x41) found but sometimes "B" in Windows 3.1 builds 026 and 034e
82058a0f0d0SEitan Adler>>8	string	!A		\b, %-.1s method
82158a0f0d0SEitan Adler>>10	ulelong	>0		\b, original size: %u bytes
822a4d6d3b8SXin LI# Summary:	InstallShield archive with SZDD compressed
823a4d6d3b8SXin LI# URL:		https://community.flexera.com/t5/InstallShield-Knowledge-Base/InstallShield-Redistributable-Files/ta-p/5647
824a4d6d3b8SXin LI# From:		Joerg Jenderek
825a4d6d3b8SXin LI1	search/48/bs	SZDD\x88\xF0\x27\x33	InstallShield archive
826a4d6d3b8SXin LI#!:mime	application/octet-stream
827a4d6d3b8SXin LI!:mime	application/x-installshield-compress-szdd
828a4d6d3b8SXin LI!:ext	ibt
829a4d6d3b8SXin LI# name of compressed archive member like: setup.dl_ _setup7int.dl_ _setup2k.dl_ _igdi.dl_ cabinet.dl_
830a4d6d3b8SXin LI>0	string	x		%s
831a4d6d3b8SXin LI# name of uncompressed archive member like: setup.dll _Setup.dll IGdi.dll CABINET.DLL
832a4d6d3b8SXin LI>>&1	string	x		(%s)
833a4d6d3b8SXin LI# probably version like: 9.0.0.333 9.1.0.429 11.50.0.42618
834a4d6d3b8SXin LI>>>&1	string	x		\b, version %s
835a4d6d3b8SXin LI# SZDD member length like: 168048 169333 181842
836a4d6d3b8SXin LI>>>>&1	string	x		\b, %s bytes
837a4d6d3b8SXin LI# MS Compress archive data
838a4d6d3b8SXin LI#>&0	string		SZDD	\b, SIGNATURE FOUND
839a4d6d3b8SXin LI>&0	indirect	x
84058a0f0d0SEitan Adler#		QBasic SZDD variant
84158a0f0d0SEitan Adler3	string	\x88\xf0\x27
84258a0f0d0SEitan Adler>0	string	SZ\x20		MS Compress archive data, QBasic variant
84358a0f0d0SEitan Adler!:mime	application/x-ms-compress-sz
84458a0f0d0SEitan Adler!:ext	??$
84558a0f0d0SEitan Adler>>8	ulelong	>0		\b, original size: %u bytes
84658a0f0d0SEitan Adler
847*898496eeSXin LI# Summary:	lzss compressed/EDI Pack
848*898496eeSXin LI# From:		Joerg Jenderek
849*898496eeSXin LI# URL:		http://fileformats.archiveteam.org/wiki/EDI_Install_packed_file
850*898496eeSXin LI# Note:		called "EDI Install LZS compressed data" by TrID and verified by
851*898496eeSXin LI#		command like `deark -l -m edi_pack -d2 BOOK01A.IC$` as "EDI Pack LZSS1"
852*898496eeSXin LI0	string					EDILZSS
853*898496eeSXin LI>7	string					1
854*898496eeSXin LI# look for point character before orginal file name extension
855*898496eeSXin LI>>8	search/9/b				.
856*898496eeSXin LI# check suffix of possible orginal file anme
857*898496eeSXin LI#>>>&0		ubelong				x	SUFFIX=%8.8x
858*898496eeSXin LI# samples without valid character after point in original file name field like: FENNEL.LZS PLANTAIN.LZS
859*898496eeSXin LI>>>&0		ubyte				<0x20
860*898496eeSXin LI>>>>0			use				edi-lzs
861*898496eeSXin LI# samples with valid character after point in original file name field
862*898496eeSXin LI>>>&0		ubyte				>0x1F
863*898496eeSXin LI# check 2nd charcter of suffix
864*898496eeSXin LI#>>>>&0			ubyte	x			2ND_SUFFIX=%x
865*898496eeSXin LI# sample with one valid character after point followed by \0 in original file name field like: SPELMATE.H$
866*898496eeSXin LI>>>>&0			ubyte			=0
867*898496eeSXin LI>>>>>0				use			edi-pack
868*898496eeSXin LI>>>>&0			ubyte			>0x1F
869*898496eeSXin LI# check 3rd charcter of suffix
870*898496eeSXin LI#>>>>>&0				ubyte		x	3RD_SUFFIX=%x
871*898496eeSXin LI# no sample with 2 valid characters after point followed by \0 in original file name field
872*898496eeSXin LI>>>>>&0				ubyte		=0
873*898496eeSXin LI>>>>>>0					use		edi-pack
874*898496eeSXin LI# samples with valid 3rd character after point in original file name field
875*898496eeSXin LI>>>>>&0				ubyte		>0x1F
876*898496eeSXin LI# sample with 3 valid character after point followed by \0 in original file name field like: BOOK01A.IC$ CTL3D.DL$
877*898496eeSXin LI>>>>>>&0				ubyte	=0
878*898496eeSXin LI>>>>>>>0					use	edi-pack
879*898496eeSXin LI# sample with 3 valid character after point followed by no \0 in original file name field like: HERBTEXT.LZS
880*898496eeSXin LI>>>>>>&0				ubyte	!0
881*898496eeSXin LI>>>>>>>0					use	edi-lzs
882*898496eeSXin LI# no sample with invalid 3rd character after point in original file name field
883*898496eeSXin LI>>>>>&0				default		x
884*898496eeSXin LI>>>>>>0					use		edi-lzs
885*898496eeSXin LI# sample with invalid 2nd character after point in original file name field like: LACERATE.LZS SPLINTER.LZS
886*898496eeSXin LI>>>>&0			default			x
887*898496eeSXin LI>>>>>0	use						edi-lzs
888*898496eeSXin LI# sample without point character in original file name field like GUNSHOT.LZS
889*898496eeSXin LI>>8	default					x
890*898496eeSXin LI>>>0		use					edi-lzs
891*898496eeSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/e/edi-lzss2.trid.xml
892*898496eeSXin LI# Note:		called "EDI Install Pro LZSS2 compressed data" by TrID and verified by
893*898496eeSXin LI#		command like `deark -l -m edi_pack -d2 4WAY.WA$` as "EDI Pack LZSS2"
894*898496eeSXin LI>7	string			2			EDI LZSS2 packed
895*898496eeSXin LI#!:mime	application/octet-stream
896*898496eeSXin LI!:mime	application/x-edi-pack-lzss
897*898496eeSXin LI# the name of a compressed file often ends in character '$' or '_'
898*898496eeSXin LI!:ext	??$/??_
899*898496eeSXin LI# original filename, NUL-terminated, padded to 13 bytes like: mci.vbx 4way.wav skymap.exe cmdialog.vbx
900*898496eeSXin LI>>8		string		x			"%-0.13s"
901*898496eeSXin LI# original file size, as a 4-byte integer.
902*898496eeSXin LI>>21		ulelong		x			\b, %u bytes
903*898496eeSXin LI# compressed data like: ff5249464606ec00 ff4d5aa601010000
904*898496eeSXin LI>>>25		ubequad		x			\b, data %#16.16llx...
905*898496eeSXin LI0	name		edi-pack
906*898496eeSXin LI# Note:		verified by command like `deark -l -d2 SPELMATE.H$` as "EDI Pack LZSS1"
907*898496eeSXin LI# original filename, NUL-terminated, padded to 13 bytes like: ctl3d.dll spelmate.h filemenu.rc owl.def index-it.exe
908*898496eeSXin LI# but not like \377Aloe.lzs\273 (HERBTEXT.LZS)
909*898496eeSXin LI>8	string		x				EDI LZSS packed "%-.13s"
910*898496eeSXin LI#!:mime	application/octet-stream
911*898496eeSXin LI!:mime	application/x-edi-pack-lzss
912*898496eeSXin LI# the name of a compressed file often ends in character '$' or '_'
913*898496eeSXin LI!:ext	??$/?$
914*898496eeSXin LI# compressed data like: f7000001eff02020 ff4d5aa900020000 ff2f2a207370656c
915*898496eeSXin LI>21	ubequad		x				\b, data %#16.16llx...
916*898496eeSXin LI# URL:		http://fileformats.archiveteam.org/wiki/EDI_LZSSLib
917*898496eeSXin LI# Note:		verified partly by command like `deark -l -m edi_pack -d2 GUNSHOT.LZS` as "EDI LZSSLib"
918*898496eeSXin LI0	name		edi-lzs
919*898496eeSXin LI# Note:		verified by command like `deark -l -d2 GUNSHOT.LZS` as "EDI LZSSLib"
920*898496eeSXin LI# no original filename looks like: \277BM\226.\0 \277BM.n\001 \277BM\226.\0 \277BM.g\001 \377Aloe.lzs\273
921*898496eeSXin LI>8	string		x				EDI LZSSLib packed
922*898496eeSXin LI#!:mime	application/octet-stream
923*898496eeSXin LI!:mime	application/x-edi-pack-lzss
924*898496eeSXin LI# The name of a compressed file ends with LZS suffix
925*898496eeSXin LI!:ext	lzs
926*898496eeSXin LI# compressed data like: bf424df6e10100f3 ff416c6f652e6c7a ff416c6f652e6c7a
927*898496eeSXin LI>8	ubequad		x				\b, data %#16.16llx...
928*898496eeSXin LI
929a4d6d3b8SXin LI# Summary:	CAZIP compressed file
930a4d6d3b8SXin LI# From:		Joerg Jenderek
931a4d6d3b8SXin LI# URL:		http://fileformats.archiveteam.org/wiki/CAZIP
932a4d6d3b8SXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/c/caz.trid.xml
933a4d6d3b8SXin LI# Note:		Format is distinct from CAZIPXP compressed
934a4d6d3b8SXin LI0	string	\x0D\x0A\x1ACAZIP	CAZIP compressed file
935a4d6d3b8SXin LI#!:mime	application/octet-stream
936a4d6d3b8SXin LI!:mime	application/x-compress-cazip
937a4d6d3b8SXin LI# like: BLINKER.WR_ CLIPDEFS._ CAOSETUP.EX_ CLIPPER.EX_ FILEIO.C_
938a4d6d3b8SXin LI!:ext	??_/?_/_
939a4d6d3b8SXin LI
94043a5ec4eSXin LI# Summary:	FTCOMP compressed archive
94143a5ec4eSXin LI# From:		Joerg Jenderek
94243a5ec4eSXin LI# URL:		http://fileformats.archiveteam.org/wiki/FTCOMP
94343a5ec4eSXin LI# Reference:    http://mark0.net/download/triddefs_xml.7z/defs/a/ark-ftcomp.trid.xml
94443a5ec4eSXin LI# Note:		called by TrID "FTCOMP compressed archive"
94543a5ec4eSXin LI#		extracted by `unpack seahelp.hl_`
94643a5ec4eSXin LI24	string/b	FTCOMP		FTCOMP compressed archive
94743a5ec4eSXin LI#!:mime	application/octet-stream
94843a5ec4eSXin LI!:mime	application/x-compress-ftcomp
94943a5ec4eSXin LI!:ext	??_/??@/dll/drv/pk2/
95043a5ec4eSXin LI# probably A596FDFF magic at the beginning
95143a5ec4eSXin LI>0	ubelong		!0xA596FDFF	\b, at beginning %#x
95243a5ec4eSXin LI# probably original file name with directory like: \OS2\unpack.exe \SYSTEM\8514.DRV MAHJONGG.EXE
95343a5ec4eSXin LI>41	string		x		"%s"
95443a5ec4eSXin LI
955b6cee71dSXin LI# MP3 (archiver, not lossy audio compression)
956b6cee71dSXin LI0	string	MP3\x1a MP3-Archiver archive data
957b6cee71dSXin LI# ZET
958b6cee71dSXin LI0	string	OZ\xc3\x9d ZET archive data
959b6cee71dSXin LI# TSComp
960b6cee71dSXin LI0	string	\x65\x5d\x13\x8c\x08\x01\x03\x00 TSComp archive data
961b6cee71dSXin LI# ARQ
962b6cee71dSXin LI0	string	gW\4\1 ARQ archive data
963b6cee71dSXin LI# Squash
964b6cee71dSXin LI3	string	OctSqu Squash archive data
965b6cee71dSXin LI# Terse
966b6cee71dSXin LI0	string	\5\1\1\0 Terse archive data
967b6cee71dSXin LI# UHarc
968b6cee71dSXin LI0	string	UHA UHarc archive data
969b6cee71dSXin LI# ABComp
970b6cee71dSXin LI0	string	\2AB ABComp archive data
971b6cee71dSXin LI0	string	\3AB2 ABComp archive data
972b6cee71dSXin LI# CMP
973b6cee71dSXin LI0	string	CO\0 CMP archive data
974b6cee71dSXin LI# Splint
975b6cee71dSXin LI0	string	\x93\xb9\x06 Splint archive data
976b6cee71dSXin LI# InstallShield
977b6cee71dSXin LI0	string	\x13\x5d\x65\x8c InstallShield Z archive Data
978b6cee71dSXin LI# Gather
979b6cee71dSXin LI1	string	GTH Gather archive data
980b6cee71dSXin LI# BOA
981b6cee71dSXin LI0	string	BOA BOA archive data
982b6cee71dSXin LI# RAX
983b6cee71dSXin LI0	string	ULEB\xa RAX archive data
984b6cee71dSXin LI# Xtreme
985b6cee71dSXin LI0	string	ULEB\0 Xtreme archive data
986b6cee71dSXin LI# Pack Magic
987b6cee71dSXin LI0	string	@\xc3\xa2\1\0 Pack Magic archive data
988b6cee71dSXin LI# BTS
989b6cee71dSXin LI0	belong&0xfeffffff	0x1a034465 BTS archive data
990b6cee71dSXin LI# ELI 5750
991b6cee71dSXin LI0	string	Ora\  ELI 5750 archive data
992b6cee71dSXin LI# QFC
993b6cee71dSXin LI0	string	\x1aFC\x1a QFC archive data
994b6cee71dSXin LI0	string	\x1aQF\x1a QFC archive data
995*898496eeSXin LI# PRO-PACK https://www.segaretro.org/Rob_Northen_compression
996*898496eeSXin LI0	string	RNC
997*898496eeSXin LI>3	byte	1	PRO-PACK archive data (compression 1)
998*898496eeSXin LI>3	byte	2	PRO-PACK archive data (compression 2)
999b6cee71dSXin LI# 777
1000b6cee71dSXin LI0	string	777 777 archive data
1001b6cee71dSXin LI# LZS221
1002b6cee71dSXin LI0	string	sTaC LZS221 archive data
1003b6cee71dSXin LI# HPA
1004b6cee71dSXin LI0	string	HPA HPA archive data
1005b6cee71dSXin LI# Arhangel
1006b6cee71dSXin LI0	string	LG Arhangel archive data
1007b6cee71dSXin LI# EXP1, uses bzip2
1008b6cee71dSXin LI0	string	0123456789012345BZh EXP1 archive data
1009b6cee71dSXin LI# IMP
1010b6cee71dSXin LI0	string	IMP\xa IMP archive data
1011b6cee71dSXin LI# NRV
1012b6cee71dSXin LI0	string	\x00\x9E\x6E\x72\x76\xFF NRV archive data
1013b6cee71dSXin LI# Squish
1014b6cee71dSXin LI0	string	\x73\xb2\x90\xf4 Squish archive data
1015b6cee71dSXin LI# Par
1016b6cee71dSXin LI0	string	PHILIPP Par archive data
1017b6cee71dSXin LI0	string	PAR Par archive data
1018b6cee71dSXin LI# HIT
1019b6cee71dSXin LI0	string	UB HIT archive data
1020b6cee71dSXin LI# SBX
1021b6cee71dSXin LI0	belong&0xfffff000	0x53423000 SBX archive data
1022b6cee71dSXin LI# NaShrink
1023b6cee71dSXin LI0	string	NSK NaShrink archive data
1024b6cee71dSXin LI# SAPCAR
1025b6cee71dSXin LI0	string	#\ CAR\ archive\ header SAPCAR archive data
1026a4d6d3b8SXin LI0	string	CAR\ 2.00 SAPCAR archive data
1027a4d6d3b8SXin LI0	string	CAR\ 2.01 SAPCAR archive data
1028a4d6d3b8SXin LI#!:mime	application/octet-stream
1029a4d6d3b8SXin LI!:mime	application/vnd.sar
1030a4d6d3b8SXin LI!:ext	sar
1031b6cee71dSXin LI# Disintegrator
1032b6cee71dSXin LI0	string	DST Disintegrator archive data
1033b6cee71dSXin LI# ASD
1034b6cee71dSXin LI0	string	ASD ASD archive data
1035b6cee71dSXin LI# InstallShield CAB
1036a4d6d3b8SXin LI# Update:	Joerg Jenderek at Nov 2021
1037a4d6d3b8SXin LI# URL:		https://en.wikipedia.org/wiki/InstallShield
1038a4d6d3b8SXin LI# Reference:	https://github.com/twogood/unshield/blob/master/lib/cabfile.h
1039a4d6d3b8SXin LI# Note:		Not compatible with Microsoft CAB files
1040a4d6d3b8SXin LI# http://mark0.net/download/triddefs_xml.7z/defs/a/ark-cab-ishield.trid.xml
1041a4d6d3b8SXin LI# CAB_SIGNATURE 0x28635349
1042a4d6d3b8SXin LI0	string	ISc( InstallShield
1043a4d6d3b8SXin LI#!:mime		application/octet-stream
1044a4d6d3b8SXin LI!:mime		application/x-installshield
1045a4d6d3b8SXin LI# http://mark0.net/download/triddefs_xml.7z/defs/a/ark-cab-ishield-hdr.trid.xml
1046a4d6d3b8SXin LI>16	ulelong	!0	setup header
1047a4d6d3b8SXin LI# like: _SYS1.HDR _USER1.HDR data1.hdr
1048a4d6d3b8SXin LI!:ext	hdr
1049a4d6d3b8SXin LI>16	ulelong	=0	CAB
1050a4d6d3b8SXin LI# like: _SYS1.CAB _USER1.CAB DATA1.CAB  data2.cab
1051a4d6d3b8SXin LI!:ext	cab
1052a4d6d3b8SXin LI# https://github.com/twogood/unshield/blob/master/lib/helper.c
1053a4d6d3b8SXin LI# version like:	0x1005201 0x100600c 0x1007000 0x1009500
1054a4d6d3b8SXin LI#		0x2000578 0x20005dc 0x2000640 0x40007d0 0x4000834
1055a4d6d3b8SXin LI>4	ulelong	x	\b, version %#x
1056a4d6d3b8SXin LI# volume_info like: 0
1057a4d6d3b8SXin LI>8	ulelong	!0	\b, volume_info %#x
1058a4d6d3b8SXin LI# cab_descriptor_offset like: 0x200
1059a4d6d3b8SXin LI>12	ulelong	!0x200	\b, offset %#x
1060a4d6d3b8SXin LI#>0x200	ubequad	x	\b, at 0x200 %#16.16llx
1061a4d6d3b8SXin LI# cab_descriptor_size like: 0 (*.cab) BD5 C8B DA5 E2A E36 116C 251D 4DA9 56F0 5CC2 6E4B 777D 779E 1F7C2
1062a4d6d3b8SXin LI>16	ulelong	!0	\b, descriptor size %#x
1063b6cee71dSXin LI# TOP4
1064b6cee71dSXin LI0	string	T4\x1a TOP4 archive data
1065b6cee71dSXin LI# BatComp left out: sig looks like COM executable
1066b6cee71dSXin LI# so TODO: get real 4dos batcomp file and find sig
1067b6cee71dSXin LI# BlakHole
1068b6cee71dSXin LI0	string	BH\5\7 BlakHole archive data
1069b6cee71dSXin LI# BIX
1070b6cee71dSXin LI0	string	BIX0 BIX archive data
1071b6cee71dSXin LI# ChiefLZA
1072b6cee71dSXin LI0	string	ChfLZ ChiefLZA archive data
1073b6cee71dSXin LI# Blink
1074b6cee71dSXin LI0	string	Blink Blink archive data
1075b6cee71dSXin LI# Logitech Compress
1076b6cee71dSXin LI0	string	\xda\xfa Logitech Compress archive data
1077b6cee71dSXin LI# ARS-Sfx (FIXME: really a SFX? then goto COM/EXE)
1078b6cee71dSXin LI1	string	(C)\ STEPANYUK ARS-Sfx archive data
1079b6cee71dSXin LI# AKT/AKT32
1080b6cee71dSXin LI0	string	AKT32 AKT32 archive data
1081b6cee71dSXin LI0	string	AKT AKT archive data
1082b6cee71dSXin LI# NPack
1083b6cee71dSXin LI0	string	MSTSM NPack archive data
1084b6cee71dSXin LI# PFT
1085b6cee71dSXin LI0	string	\0\x50\0\x14 PFT archive data
1086b6cee71dSXin LI# SemOne
1087b6cee71dSXin LI0	string	SEM SemOne archive data
1088b6cee71dSXin LI# PPMD
1089b6cee71dSXin LI0	string	\x8f\xaf\xac\x84 PPMD archive data
1090b6cee71dSXin LI# FIZ
1091b6cee71dSXin LI0	string	FIZ FIZ archive data
1092b6cee71dSXin LI# MSXiE
1093b6cee71dSXin LI0	belong&0xfffff0f0	0x4d530000 MSXiE archive data
1094b6cee71dSXin LI# DeepFreezer
1095b6cee71dSXin LI0	belong&0xfffffff0	0x797a3030 DeepFreezer archive data
1096b6cee71dSXin LI# DC
1097b6cee71dSXin LI0	string	=<DC- DC archive data
1098b6cee71dSXin LI# TPac
1099b6cee71dSXin LI0	string	\4TPAC\3 TPac archive data
1100b6cee71dSXin LI# Ai
1101*898496eeSXin LI# Update:	Joerg Jenderek
1102*898496eeSXin LI# URL:		http://fileformats.archiveteam.org/wiki/Ai_Archiver
1103b6cee71dSXin LI0	string	Ai\1\1\0 Ai archive data
1104*898496eeSXin LI#!:mime	application/octet-stream
1105*898496eeSXin LI!:mime	application/x-compress-ai
1106*898496eeSXin LI!:ext	ai
1107b6cee71dSXin LI0	string	Ai\1\0\0 Ai archive data
1108*898496eeSXin LI#!:mime	application/octet-stream
1109*898496eeSXin LI!:mime	application/x-compress-ai
1110*898496eeSXin LI!:ext	ai
1111b6cee71dSXin LI# Ai32
1112*898496eeSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/a/ark-ai.trid.xml
1113*898496eeSXin LI# Note:		called "Ai Archivator compressed archive" by TrID
1114b6cee71dSXin LI0	string	Ai\2\0 Ai32 archive data
1115*898496eeSXin LI#!:mime	application/octet-stream
1116*898496eeSXin LI!:mime	application/x-compress-ai
1117*898496eeSXin LI!:ext	ai
1118*898496eeSXin LI# original file name
1119*898496eeSXin LI>8	pstring/h x	"%s"
1120*898496eeSXin LI# according to TrID the next 3 bytes are nil
1121*898496eeSXin LI>5	ubyte	!0	\b, at 5 %#x
1122*898496eeSXin LI>6	ubyte	!0	\b, at 6 %#x
1123*898496eeSXin LI>7	ubyte	!0	\b, at 7 %#x
1124*898496eeSXin LI# the fourth byte with value 0 is probably a flag for "non solid" mode
1125*898496eeSXin LI#>3	ubyte	=0x00	\b, unsolid mode
1126b6cee71dSXin LI0	string	Ai\2\1 Ai32 archive data
1127*898496eeSXin LI#!:mime	application/octet-stream
1128*898496eeSXin LI!:mime	application/x-compress-ai
1129*898496eeSXin LI!:ext	ai
1130*898496eeSXin LI# original file name
1131*898496eeSXin LI>8	pstring/h x	"%s"
1132*898496eeSXin LI# the fourth byte with value 0x01 is probably a flag for "solid" mode; this is not the default
1133*898496eeSXin LI>3	ubyte	=0x01	\b, solid mode
1134b6cee71dSXin LI# SBC
1135b6cee71dSXin LI0	string	SBC SBC archive data
1136b6cee71dSXin LI# Ybs
1137b6cee71dSXin LI0	string	YBS Ybs archive data
1138b6cee71dSXin LI# DitPack
1139b6cee71dSXin LI0	string	\x9e\0\0 DitPack archive data
1140b6cee71dSXin LI# DMS
1141b6cee71dSXin LI0	string	DMS! DMS archive data
1142b6cee71dSXin LI# EPC
1143b6cee71dSXin LI0	string	\x8f\xaf\xac\x8c EPC archive data
1144b6cee71dSXin LI# VSARC
1145b6cee71dSXin LI0	string	VS\x1a VSARC archive data
1146b6cee71dSXin LI# PDZ
1147b6cee71dSXin LI0	string	PDZ PDZ archive data
1148b6cee71dSXin LI# ReDuq
1149b6cee71dSXin LI0	string	rdqx ReDuq archive data
1150b6cee71dSXin LI# GCA
1151b6cee71dSXin LI0	string	GCAX GCA archive data
1152b6cee71dSXin LI# PPMN
1153b6cee71dSXin LI0	string	pN PPMN archive data
1154b6cee71dSXin LI# WinImage
1155b6cee71dSXin LI3	string	WINIMAGE WinImage archive data
1156b6cee71dSXin LI# Compressia
1157b6cee71dSXin LI0	string	CMP0CMP Compressia archive data
1158b6cee71dSXin LI# UHBC
1159b6cee71dSXin LI0	string	UHB UHBC archive data
1160b6cee71dSXin LI# WinHKI
1161b6cee71dSXin LI0	string	\x61\x5C\x04\x05 WinHKI archive data
1162b6cee71dSXin LI# WWPack data file
1163b6cee71dSXin LI0	string	WWP WWPack archive data
1164b6cee71dSXin LI# BSN (BSA, PTS-DOS)
1165b6cee71dSXin LI0	string	\xffBSG BSN archive data
1166b6cee71dSXin LI1	string	\xffBSG BSN archive data
1167b6cee71dSXin LI3	string	\xffBSG BSN archive data
1168b6cee71dSXin LI1	string	\0\xae\2 BSN archive data
1169b6cee71dSXin LI1	string	\0\xae\3 BSN archive data
1170b6cee71dSXin LI1	string	\0\xae\7 BSN archive data
1171b6cee71dSXin LI# AIN
1172b6cee71dSXin LI0	string	\x33\x18 AIN archive data
1173b6cee71dSXin LI0	string	\x33\x17 AIN archive data
11749ce06829SXin LI# XPA32 test moved and merged with XPA by Joerg Jenderek at Sep 2015
1175b6cee71dSXin LI# SZip (TODO: doesn't catch all versions)
1176b6cee71dSXin LI0	string	SZ\x0a\4 SZip archive data
1177b6cee71dSXin LI# XPack DiskImage
11789ce06829SXin LI# *.XDI updated by Joerg Jenderek Sep 2015
11799ce06829SXin LI# ftp://ftp.sac.sk/pub/sac/pack/0index.txt
11809ce06829SXin LI# GRR: this test is still too general as it catches also text files starting with jm
11819ce06829SXin LI0	string	jm
11829ce06829SXin LI# only found examples with this additional characteristic 2 bytes
11839ce06829SXin LI>2	string	\x2\x4	Xpack DiskImage archive data
11849ce06829SXin LI#!:ext xdi
1185b6cee71dSXin LI# XPack Data
11869ce06829SXin LI# *.xpa updated by Joerg Jenderek Sep 2015
11879ce06829SXin LI# ftp://ftp.elf.stuba.sk/pub/pc/pack/
11889ce06829SXin LI0	string	xpa	XPA
11899ce06829SXin LI!:ext	xpa
11909ce06829SXin LI# XPA32
11919ce06829SXin LI# ftp://ftp.elf.stuba.sk/pub/pc/pack/xpa32.zip
11929ce06829SXin LI# created by XPA32.EXE version 1.0.2 for Windows
11939ce06829SXin LI>0	string	xpa\0\1 \b32 archive data
11949ce06829SXin LI# created by XPACK.COM version 1.67m or 1.67r with short 0x1800
11959ce06829SXin LI>3	ubeshort	!0x0001	\bck archive data
1196b6cee71dSXin LI# XPack Single Data
11979ce06829SXin LI# changed by Joerg Jenderek Sep 2015 back to like in version 5.12
11989ce06829SXin LI# letter 'I'+ acute accent is equivalent to \xcd
11999ce06829SXin LI0	string	\xcd\ jm	Xpack single archive data
12009ce06829SXin LI#!:mime	application/x-xpa-compressed
12019ce06829SXin LI!:ext xpa
1202b6cee71dSXin LI
1203b6cee71dSXin LI# TODO: missing due to unknown magic/magic at end of file:
1204b6cee71dSXin LI#DWC
1205b6cee71dSXin LI#ARG
1206b6cee71dSXin LI#ZAR
1207b6cee71dSXin LI#PC/3270
1208b6cee71dSXin LI#InstallIt
1209b6cee71dSXin LI#RKive
1210b6cee71dSXin LI#RK
1211b6cee71dSXin LI#XPack Diskimage
1212b6cee71dSXin LI
1213b6cee71dSXin LI# These were inspired by idarc, but actually verified
1214b6cee71dSXin LI# Dzip archiver (.dz)
121558a0f0d0SEitan Adler# Update: Joerg Jenderek
121658a0f0d0SEitan Adler# URL: http://speeddemosarchive.com/dzip/
121758a0f0d0SEitan Adler# reference: http://speeddemosarchive.com/dzip/dz29src.zip/main.c
121858a0f0d0SEitan Adler# GRR: line below is too general as it matches also ASCII texts like Doszip commander help dz.txt
121958a0f0d0SEitan Adler0	string	DZ
122058a0f0d0SEitan Adler# latest version is 2.9 dated 7 may 2003
122158a0f0d0SEitan Adler>2	byte	<4 Dzip archive data
122258a0f0d0SEitan Adler!:mime	application/x-dzip
122358a0f0d0SEitan Adler!:ext	dz
122458a0f0d0SEitan Adler>>2	byte	x \b, version %i
122558a0f0d0SEitan Adler>>3	byte	x \b.%i
122643a5ec4eSXin LI>>4	ulelong	x \b, offset %#x
122758a0f0d0SEitan Adler>>8	ulelong	x \b, %u files
1228b6cee71dSXin LI# ZZip archiver (.zz)
1229b6cee71dSXin LI0	string	ZZ\ \0\0 ZZip archive data
1230b6cee71dSXin LI0	string	ZZ0 ZZip archive data
1231b6cee71dSXin LI# PAQ archiver (.paq)
1232b6cee71dSXin LI0	string	\xaa\x40\x5f\x77\x1f\xe5\x82\x0d PAQ archive data
1233b6cee71dSXin LI0	string	PAQ PAQ archive data
1234b6cee71dSXin LI>3	byte&0xf0	0x30
1235b6cee71dSXin LI>>3	byte	x (v%c)
1236b6cee71dSXin LI# JAR archiver (.j), this is the successor to ARJ, not Java's JAR (which is essentially ZIP)
1237a4d6d3b8SXin LI# Update:	Joerg Jenderek
1238a4d6d3b8SXin LI# URL:		http://fileformats.archiveteam.org/wiki/JAR_(ARJ_Software)
1239a4d6d3b8SXin LI# reference:	http://mark0.net/download/triddefs_xml.7z/defs/a/ark-jar.trid.xml
1240a4d6d3b8SXin LI#		https://www.sac.sk/download/pack/jar102x.exe/TECHNOTE.DOC
1241a4d6d3b8SXin LI# Note:		called "JAR compressed archive" by TrID
1242b6cee71dSXin LI0xe	string	\x1aJar\x1b JAR (ARJ Software, Inc.) archive data
1243a4d6d3b8SXin LI#!:mime	application/octet-stream
1244a4d6d3b8SXin LI!:mime	application/x-compress-j
1245a4d6d3b8SXin LI>0	ulelong	x		\b, CRC32 %#x
1246a4d6d3b8SXin LI# standard suffix is ".j"; for multi volumes following order j01 j02 ... j99 100 ... 990
1247a4d6d3b8SXin LI!:ext	j/j01/j02
1248a4d6d3b8SXin LI# URL:		http://fileformats.archiveteam.org/wiki/JARCS
1249a4d6d3b8SXin LI# reference:	http://mark0.net/download/triddefs_xml.7z/defs/a/ark-jarcs.trid.xml
1250a4d6d3b8SXin LI# Note:		called "JARCS compressed archive" by TrID
1251b6cee71dSXin LI0	string	JARCS JAR (ARJ Software, Inc.) archive data
1252a4d6d3b8SXin LI#!:mime	application/octet-stream
1253a4d6d3b8SXin LI!:mime	application/x-compress-jar
1254a4d6d3b8SXin LI!:ext	jar
1255b6cee71dSXin LI
1256b6cee71dSXin LI# ARJ archiver (jason@jarthur.Claremont.EDU)
1257a4d6d3b8SXin LI# URL:		http://fileformats.archiveteam.org/wiki/ARJ
1258a4d6d3b8SXin LI# reference:	http://mark0.net/download/triddefs_xml.7z/defs/a/ark-arj.trid.xml
1259a4d6d3b8SXin LI#		https://github.com/FarGroup/FarManager/
1260a4d6d3b8SXin LI#		blob/master/plugins/multiarc/arc.doc/arj.txt
1261a4d6d3b8SXin LI# Note:		called "ARJ compressed archive" by TrID and
1262a4d6d3b8SXin LI#		"ARJ File Format" by DROID via PUID fmt/610
1263a4d6d3b8SXin LI#		verified by `7z l -tarj PHRACK1.ARJ` and
1264a4d6d3b8SXin LI#		`arj.exe l TEST-hk9.ARJ`
1265a4d6d3b8SXin LI0	leshort		0xea60
1266a4d6d3b8SXin LI# skip DROID fmt-610-signature-id-946.arj by check for valid file type of main header
1267a4d6d3b8SXin LI>0xA	ubyte		2
1268a4d6d3b8SXin LI>>0	use		arj-archive
1269a4d6d3b8SXin LI0	name		arj-archive
1270a4d6d3b8SXin LI>0	leshort		x		ARJ archive
1271b6cee71dSXin LI!:mime	application/x-arj
1272a4d6d3b8SXin LI# look for terminating 0-character of filename
1273a4d6d3b8SXin LI>0x26	search/1024	\0
1274a4d6d3b8SXin LI# file name extension is normally .arj but not for parts of multi volume
1275a4d6d3b8SXin LI#>>&-5	string		x		extension %.4s
1276a4d6d3b8SXin LI>>&-5	string/c	.arj		data
1277a4d6d3b8SXin LI!:ext	arj
1278a4d6d3b8SXin LI>>&-5	default		x
1279a4d6d3b8SXin LI# for multi volume first name is archive.arj then following parts archive.a01 archive.a02 ...
1280a4d6d3b8SXin LI>>>8	byte		&0x04		data
1281a4d6d3b8SXin LI!:ext	a01/a02
1282a4d6d3b8SXin LI# for SFX first name is archive.exe then following parts archive.e01 archive.e02 ...
1283a4d6d3b8SXin LI>>>8	byte		^0x04		data, SFX multi-volume
1284a4d6d3b8SXin LI!:ext	e01/e02
1285a4d6d3b8SXin LI# basic header size like: 0x002b 0x002c 0x04e0 0x04e3 0x04e7
1286a4d6d3b8SXin LI#>2	uleshort	x		basic header size %#4.4x
1287a4d6d3b8SXin LI# next fragment content like: 0x0a200a003a8fc713 0x524a000010bb3471 0x524a0000c73c70f9
1288a4d6d3b8SXin LI#>(2.s)	ubequad		x		NEXT FRAGMENT CONTENT %#16.16llx
1289a4d6d3b8SXin LI# first_hdr_size; seems to be same as basic header size
1290a4d6d3b8SXin LI#>2	uleshort	x		1st header size %#x
1291a4d6d3b8SXin LI# archiver version number like: 3 4 6 11 102
1292a4d6d3b8SXin LI>5	byte		x		\b, v%d
1293a4d6d3b8SXin LI# minimum archiver version to extract like: 1
1294a4d6d3b8SXin LI>6	ubyte		!1		\b, minimum %u to extract
1295a4d6d3b8SXin LI# FOR DEBUGGING
1296a4d6d3b8SXin LI#>8	byte		x		\b, FLAGS %#x
1297a4d6d3b8SXin LI# GARBLED_FLAG1; garble with password; g switch
1298a4d6d3b8SXin LI>8	byte		&0x01		\b, password-protected
1299a4d6d3b8SXin LI# encryption version: 0~old  1~old 2~new 3~reserved 4~40 bit key GOST
1300a4d6d3b8SXin LI>>0x20	ubyte		x		(v%u)
1301a4d6d3b8SXin LI#>8	byte		&0x02		\b, secured
1302a4d6d3b8SXin LI# ANSIPAGE_FLAG; indicates ANSI codepage used by ARJ32; hy switch
1303a4d6d3b8SXin LI>8	byte		&0x02		\b, ANSI codepage
1304a4d6d3b8SXin LI# VOLUME_FLAG indicates presence of succeeding volume; but apparently not for SFX
1305a4d6d3b8SXin LI>8	byte		&0x04		\b, multi-volume
1306a4d6d3b8SXin LI#>8	byte		&0x08		\b, file-offset
1307a4d6d3b8SXin LI# ARJPROT_FLAG; build with data protection record; hk switch
1308a4d6d3b8SXin LI>8	byte		&0x08		\b, recoverable
1309a4d6d3b8SXin LI# arj protection factor; maximal 10; switch hky -> factor=y+1
1310a4d6d3b8SXin LI>>0x22	byte		x		(factor %u)
1311a4d6d3b8SXin LI>8	byte		&0x10		\b, slash-switched
1312a4d6d3b8SXin LI# BACKUP_FLAG; obsolete
1313a4d6d3b8SXin LI>8	byte		&0x20		\b, backup
1314a4d6d3b8SXin LI# SECURED_FLAG;
1315a4d6d3b8SXin LI>8	byte		&0x40		\b, secured,
1316a4d6d3b8SXin LI# ALTNAME_FLAG; indicates dual-name archive
1317a4d6d3b8SXin LI>8	byte		&0x80		\b, dual-name
1318a4d6d3b8SXin LI# security version; 0~old 2~current
1319a4d6d3b8SXin LI>9	ubyte		!0
1320a4d6d3b8SXin LI>>9	ubyte		!2		\b, security version %u
1321a4d6d3b8SXin LI# file type; 2 in main header; 0~binary 1~7-bitText 2~comment 3~directory 4~VolumeLabel 5=ChapterLabel
1322a4d6d3b8SXin LI>0xA	ubyte		!2		\b, file type %u
1323a4d6d3b8SXin LI# date+time when original archive was created in MS-DOS format via ./msdos
1324a4d6d3b8SXin LI>0xC	ulelong		x		\b, created
1325a4d6d3b8SXin LI>0xC	use		dos-date
1326a4d6d3b8SXin LI# or date and time by new internal function
1327a4d6d3b8SXin LI#>0xE	lemsdosdate	x		%s
1328a4d6d3b8SXin LI#>0xC	lemsdostime	x		%s
1329a4d6d3b8SXin LI# FOR DEBUGGING
1330a4d6d3b8SXin LI#>0x12	uleshort	x		RAW DATE %#4.4x
1331a4d6d3b8SXin LI#>0x10	uleshort	x		RAW TIME %#4.4x
1332a4d6d3b8SXin LI# date+time when archive was last modified; sometimes nil or
1333a4d6d3b8SXin LI# maybe wrong like in HP4DRVR.ARJ
1334a4d6d3b8SXin LI#>0x10	ulelong		>0		\b, modified
1335a4d6d3b8SXin LI#>>0x10	use		dos-date
1336a4d6d3b8SXin LI# or date and time by new internal function
1337a4d6d3b8SXin LI#>>0x12	lemsdosdate	x		%s
1338a4d6d3b8SXin LI#>>0x10	lemsdostime	x		%s
1339a4d6d3b8SXin LI# archive size (currently used only for secured archives); MAYBE?
1340a4d6d3b8SXin LI#>0x14	ulelong		!0		\b, file size %u
1341a4d6d3b8SXin LI# security envelope file position; MAYBE?
1342a4d6d3b8SXin LI#>0x18	ulelong		!0		\b, at %#x security envelope
1343a4d6d3b8SXin LI# filespec position in filename; WHAT IS THAT?
1344a4d6d3b8SXin LI#>0x1C	uleshort	>0		\b, filespec position %#x
1345a4d6d3b8SXin LI# length in bytes of security envelope data like: 2CAh 301h 364h 471h
1346a4d6d3b8SXin LI>0x1E	uleshort	!0		\b, security envelope length %#x
1347a4d6d3b8SXin LI# last chapter like: 0 1
1348a4d6d3b8SXin LI>0x21	ubyte		!0		\b, last chapter %u
1349a4d6d3b8SXin LI# filename (null-terminated string); sometimes at 0x26 when 4 bytes for extra data
1350a4d6d3b8SXin LI>34	byte		x		\b, original name:
1351a4d6d3b8SXin LI# with extras data
1352a4d6d3b8SXin LI>34	byte		<0x0B
1353a4d6d3b8SXin LI>>38	string		x		%s
1354a4d6d3b8SXin LI# without extras data
1355a4d6d3b8SXin LI>34	byte		>0x0A
1356a4d6d3b8SXin LI>>34	string		x		%s
1357a4d6d3b8SXin LI# host OS: 0~MSDOS ... 11~WIN32
1358a4d6d3b8SXin LI>7	byte		0		\b, os: MS-DOS
1359a4d6d3b8SXin LI>7	byte		1		\b, os: PRIMOS
1360a4d6d3b8SXin LI>7	byte		2		\b, os: Unix
1361a4d6d3b8SXin LI>7	byte		3		\b, os: Amiga
1362a4d6d3b8SXin LI>7	byte		4		\b, os: Macintosh
1363a4d6d3b8SXin LI>7	byte		5		\b, os: OS/2
1364a4d6d3b8SXin LI>7	byte		6		\b, os: Apple ][ GS
1365a4d6d3b8SXin LI>7	byte		7		\b, os: Atari ST
1366a4d6d3b8SXin LI>7	byte		8		\b, os: NeXT
1367a4d6d3b8SXin LI>7	byte		9		\b, os: VAX/VMS
1368a4d6d3b8SXin LI>7	byte		10		\b, os: WIN95
1369a4d6d3b8SXin LI>7	byte		11		\b, os: WIN32
1370b6cee71dSXin LI# [JW] idarc says this is also possible
1371b6cee71dSXin LI2	leshort		0xea60		ARJ archive data
1372a4d6d3b8SXin LI#2	leshort		0xea60
1373a4d6d3b8SXin LI#>2	use		arj-archive
1374b6cee71dSXin LI
1375b6cee71dSXin LI# HA archiver (Greg Roelofs, newt@uchicago.edu)
1376b6cee71dSXin LI# This is a really bad format. A file containing HAWAII will match this...
1377b6cee71dSXin LI#0	string		HA		HA archive data,
1378b6cee71dSXin LI#>2	leshort		=1		1 file,
1379b6cee71dSXin LI#>2	leshort		>1		%hu files,
1380b6cee71dSXin LI#>4	byte&0x0f	=0		first is type CPY
1381b6cee71dSXin LI#>4	byte&0x0f	=1		first is type ASC
1382b6cee71dSXin LI#>4	byte&0x0f	=2		first is type HSC
1383b6cee71dSXin LI#>4	byte&0x0f	=0x0e		first is type DIR
1384b6cee71dSXin LI#>4	byte&0x0f	=0x0f		first is type SPECIAL
1385b6cee71dSXin LI# suggestion: at least identify small archives (<1024 files)
1386b6cee71dSXin LI0  belong&0xffff00fc 0x48410000 HA archive data
1387b6cee71dSXin LI>2	leshort		=1		1 file,
1388b6cee71dSXin LI>2	leshort		>1		%u files,
1389b6cee71dSXin LI>4	byte&0x0f	=0		first is type CPY
1390b6cee71dSXin LI>4	byte&0x0f	=1		first is type ASC
1391b6cee71dSXin LI>4	byte&0x0f	=2		first is type HSC
1392b6cee71dSXin LI>4	byte&0x0f	=0x0e		first is type DIR
1393b6cee71dSXin LI>4	byte&0x0f	=0x0f		first is type SPECIAL
1394b6cee71dSXin LI
1395b6cee71dSXin LI# HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
1396b6cee71dSXin LI0	string		HPAK		HPACK archive data
1397b6cee71dSXin LI
1398b6cee71dSXin LI# JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
1399b6cee71dSXin LI0	string		\351,\001JAM\ 		JAM archive,
1400b6cee71dSXin LI>7	string		>\0			version %.4s
1401b6cee71dSXin LI>0x26	byte		=0x27			-
1402b6cee71dSXin LI>>0x2b	string          >\0			label %.11s,
1403b6cee71dSXin LI>>0x27	lelong		x			serial %08x,
1404b6cee71dSXin LI>>0x36	string		>\0			fstype %.8s
1405b6cee71dSXin LI
1406b6cee71dSXin LI# LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
14073e41d09dSXin LI# Update: Joerg Jenderek
14083e41d09dSXin LI# URL: https://en.wikipedia.org/wiki/LHA_(file_format)
140948c779cdSXin LI# Reference: https://web.archive.org/web/20021005080911/http://www.osirusoft.com/joejared/lzhformat.html
14103e41d09dSXin LI#
14113e41d09dSXin LI#	check and display information of lharc (LHa,PMarc) file
14123e41d09dSXin LI0	name				lharc-file
14133e41d09dSXin LI# check 1st character of method id like -lz4- -lh5- or -pm2-
14143e41d09dSXin LI>2	string		-
14153e41d09dSXin LI# check 5th character of method id
14163e41d09dSXin LI>>6	string		-
14173e41d09dSXin LI# check header level 0 1 2 3
14183e41d09dSXin LI>>>20	ubyte		<4
14193e41d09dSXin LI# check 2nd, 3th and 4th character of method id
14203e41d09dSXin LI>>>>3	regex		\^(lh[0-9a-ex]|lz[s2-8]|pm[012]|pc1)		\b
14213e41d09dSXin LI!:mime	application/x-lzh-compressed
14223e41d09dSXin LI# creator type "LHA "
14233e41d09dSXin LI!:apple	????LHA
14243e41d09dSXin LI# display archive type name like "LHa/LZS archive data" or "LArc archive"
14253e41d09dSXin LI>>>>>2	string		-lz		\b
14263e41d09dSXin LI!:ext	lzs
14273e41d09dSXin LI# already known  -lzs- -lz4- -lz5- with old names
14283e41d09dSXin LI>>>>>>2	string	-lzs		LHa/LZS archive data
14293e41d09dSXin LI>>>>>>3	regex	\^lz[45]	LHarc 1.x archive data
14303e41d09dSXin LI# missing -lz?- with wikipedia names
14313e41d09dSXin LI>>>>>>3	regex	\^lz[2378]	LArc archive
14323e41d09dSXin LI# display archive type name like "LHa (2.x) archive data"
14333e41d09dSXin LI>>>>>2	string		-lh		\b
14343e41d09dSXin LI# already known -lh0- -lh1- -lh2- -lh3-  -lh4- -lh5- -lh6- -lh7- -lhd- variants with old names
14353e41d09dSXin LI>>>>>>3	regex		\^lh[01]	LHarc 1.x/ARX archive data
14363e41d09dSXin LI# LHice archiver use ".ICE" as name extension instead usual one ".lzh"
14373e41d09dSXin LI# FOOBAR archiver use ".foo" as name extension instead usual one
1438*898496eeSXin LI# "Florian Orjanov's and Olga Bachetska's ARchiver" not found at the moment
14393e41d09dSXin LI>>>>>>>2	string	-lh1		\b
14403e41d09dSXin LI!:ext lha/lzh/ice
14413e41d09dSXin LI>>>>>>3	regex		\^lh[23d]	LHa 2.x? archive data
14423e41d09dSXin LI>>>>>>3	regex		\^lh[7]		LHa (2.x)/LHark archive data
14433e41d09dSXin LI>>>>>>3	regex		\^lh[456]	LHa (2.x) archive data
14443e41d09dSXin LI>>>>>>>2	string	-lh5		\b
14453e41d09dSXin LI# https://en.wikipedia.org/wiki/BIOS
144643a5ec4eSXin LI# Some mainboard BIOS like Award use LHa compression. So archives with unusual extension are found like
14473e41d09dSXin LI# bios.rom , kd7_v14.bin, 1010.004, ...
14483e41d09dSXin LI!:ext lha/lzh/rom/bin
14493e41d09dSXin LI# missing -lh?- variants (Joe Jared)
14503e41d09dSXin LI>>>>>>3	regex		\^lh[89a-ce]	LHa (Joe Jared) archive
14513e41d09dSXin LI# UNLHA32 2.67a
14523e41d09dSXin LI>>>>>>2	string		-lhx		LHa (UNLHA32) archive
14533e41d09dSXin LI# lha archives with standard file name extensions ".lha" ".lzh"
14543e41d09dSXin LI>>>>>>3	regex		!\^(lh1|lh5)	\b
14553e41d09dSXin LI!:ext lha/lzh
14563e41d09dSXin LI# this should not happen if all -lh variants are described
14573e41d09dSXin LI>>>>>>2	default		x		LHa (unknown) archive
14583e41d09dSXin LI#!:ext	lha
14593e41d09dSXin LI# PMarc
14603e41d09dSXin LI>>>>>3	regex		\^pm[012]	PMarc archive data
14613e41d09dSXin LI!:ext pma
14623e41d09dSXin LI# append method id without leading and trailing minus character
14633e41d09dSXin LI>>>>>3	string		x		[%3.3s]
14643e41d09dSXin LI>>>>>>0	use	lharc-header
14653e41d09dSXin LI#
14663e41d09dSXin LI#	check and display information of lharc header
14673e41d09dSXin LI0	name				lharc-header
14683e41d09dSXin LI# header size 0x4 , 0x1b-0x61
14693e41d09dSXin LI>0	ubyte		x
14703e41d09dSXin LI# compressed data size != compressed file size
14713e41d09dSXin LI#>7	ulelong		x		\b, data size %d
14723e41d09dSXin LI# attribute: 0x2~?? 0x10~symlink|target 0x20~normal
147343a5ec4eSXin LI#>19	ubyte		x		\b, 19_%#x
14743e41d09dSXin LI# level identifier 0 1 2 3
14753e41d09dSXin LI#>20	ubyte		x		\b, level %d
14763e41d09dSXin LI# time stamp
147743a5ec4eSXin LI#>15		ubelong	x		DATE %#8.8x
14783e41d09dSXin LI# OS ID for level 1
14793e41d09dSXin LI>20	ubyte		1
14803e41d09dSXin LI# 0x20 types find for *.rom files
148143a5ec4eSXin LI>>(21.b+24)	ubyte	<0x21		\b, %#x OS
14823e41d09dSXin LI# ascii type like M for MSDOS
14833e41d09dSXin LI>>(21.b+24)	ubyte	>0x20		\b, '%c' OS
14843e41d09dSXin LI# OS ID for level 2
14853e41d09dSXin LI>20	ubyte		2
148643a5ec4eSXin LI#>>23	ubyte		x		\b, OS ID %#x
148743a5ec4eSXin LI>>23	ubyte		<0x21		\b, %#x OS
14883e41d09dSXin LI>>23	ubyte		>0x20		\b, '%c' OS
14893e41d09dSXin LI# filename only for level 0 and 1
14903e41d09dSXin LI>20	ubyte		<2
14913e41d09dSXin LI# length of filename
14923e41d09dSXin LI>>21		ubyte	>0		\b, with
14933e41d09dSXin LI# filename
14943e41d09dSXin LI>>>21		pstring	x		"%s"
14953e41d09dSXin LI#
14963e41d09dSXin LI#2	string		-lh0-		LHarc 1.x/ARX archive data [lh0]
14973e41d09dSXin LI#!:mime	application/x-lharc
14983e41d09dSXin LI2	string		-lh0-
14993e41d09dSXin LI>0	use	lharc-file
15003e41d09dSXin LI#2	string		-lh1-		LHarc 1.x/ARX archive data [lh1]
15013e41d09dSXin LI#!:mime	application/x-lharc
15023e41d09dSXin LI2	string		-lh1-
15033e41d09dSXin LI>0	use	lharc-file
15043e41d09dSXin LI# NEW -lz2- ... -lz8-
15053e41d09dSXin LI2	string		-lz2-
15063e41d09dSXin LI>0	use	lharc-file
15073e41d09dSXin LI2	string		-lz3-
15083e41d09dSXin LI>0	use	lharc-file
15093e41d09dSXin LI2	string		-lz4-
15103e41d09dSXin LI>0	use	lharc-file
15113e41d09dSXin LI2	string		-lz5-
15123e41d09dSXin LI>0	use	lharc-file
15133e41d09dSXin LI2	string		-lz7-
15143e41d09dSXin LI>0	use	lharc-file
15153e41d09dSXin LI2	string		-lz8-
15163e41d09dSXin LI>0	use	lharc-file
1517b6cee71dSXin LI#	[never seen any but the last; -lh4- reported in comp.compression:]
15183e41d09dSXin LI#2	string		-lzs-		LHa/LZS archive data [lzs]
15193e41d09dSXin LI2	string		-lzs-
15203e41d09dSXin LI>0	use	lharc-file
15213e41d09dSXin LI# According to wikipedia and others such a version does not exist
15223e41d09dSXin LI#2	string		-lh\40-		LHa 2.x? archive data [lh ]
15233e41d09dSXin LI#2	string		-lhd-		LHa 2.x? archive data [lhd]
15243e41d09dSXin LI2	string		-lhd-
15253e41d09dSXin LI>0	use	lharc-file
15263e41d09dSXin LI#2	string		-lh2-		LHa 2.x? archive data [lh2]
15273e41d09dSXin LI2	string		-lh2-
15283e41d09dSXin LI>0	use	lharc-file
15293e41d09dSXin LI#2	string		-lh3-		LHa 2.x? archive data [lh3]
15303e41d09dSXin LI2	string		-lh3-
15313e41d09dSXin LI>0	use	lharc-file
15323e41d09dSXin LI#2	string		-lh4-		LHa (2.x) archive data [lh4]
15333e41d09dSXin LI2	string		-lh4-
15343e41d09dSXin LI>0	use	lharc-file
15353e41d09dSXin LI#2	string		-lh5-		LHa (2.x) archive data [lh5]
15363e41d09dSXin LI2	string		-lh5-
15373e41d09dSXin LI>0	use	lharc-file
15383e41d09dSXin LI#2	string		-lh6-		LHa (2.x) archive data [lh6]
15393e41d09dSXin LI2	string		-lh6-
15403e41d09dSXin LI>0	use	lharc-file
15413e41d09dSXin LI#2	string		-lh7-		LHa (2.x)/LHark archive data [lh7]
15423e41d09dSXin LI2	string		-lh7-
15433e41d09dSXin LI# !:mime	application/x-lha
15443e41d09dSXin LI# >20	byte		x		- header level %d
15453e41d09dSXin LI>0	use	lharc-file
15463e41d09dSXin LI# NEW -lh8- ... -lhe- , -lhx-
15473e41d09dSXin LI2	string		-lh8-
15483e41d09dSXin LI>0	use	lharc-file
15493e41d09dSXin LI2	string		-lh9-
15503e41d09dSXin LI>0	use	lharc-file
15513e41d09dSXin LI2	string		-lha-
15523e41d09dSXin LI>0	use	lharc-file
15533e41d09dSXin LI2	string		-lhb-
15543e41d09dSXin LI>0	use	lharc-file
15553e41d09dSXin LI2	string		-lhc-
15563e41d09dSXin LI>0	use	lharc-file
15573e41d09dSXin LI2	string		-lhe-
15583e41d09dSXin LI>0	use	lharc-file
15593e41d09dSXin LI2	string		-lhx-
15603e41d09dSXin LI>0	use	lharc-file
1561b6cee71dSXin LI# taken from idarc [JW]
1562b6cee71dSXin LI2   string      -lZ         PUT archive data
15633e41d09dSXin LI# already done by LHarc magics
15643e41d09dSXin LI# this should never happen if all sub types of LZS archive are identified
15653e41d09dSXin LI#2   string      -lz         LZS archive data
1566b6cee71dSXin LI2   string      -sw1-       Swag archive data
1567b6cee71dSXin LI
15683e41d09dSXin LI0	name		rar-file-header
15693e41d09dSXin LI>24	byte		15		\b, v1.5
15703e41d09dSXin LI>24	byte		20		\b, v2.0
15713e41d09dSXin LI>24	byte		29		\b, v4
15723e41d09dSXin LI>15	byte		0		\b, os: MS-DOS
15733e41d09dSXin LI>15	byte		1		\b, os: OS/2
15743e41d09dSXin LI>15	byte		2		\b, os: Win32
15753e41d09dSXin LI>15	byte		3		\b, os: Unix
15763e41d09dSXin LI>15	byte		4		\b, os: Mac OS
15773e41d09dSXin LI>15	byte		5		\b, os: BeOS
15783e41d09dSXin LI
15793e41d09dSXin LI0	name		rar-archive-header
15803e41d09dSXin LI>3	leshort&0x1ff	>0		\b, flags:
15813e41d09dSXin LI>>3	leshort		&0x01		ArchiveVolume
15823e41d09dSXin LI>>3	leshort		&0x02		Commented
15833e41d09dSXin LI>>3	leshort		&0x04		Locked
15843e41d09dSXin LI>>3	leshort		&0x10		NewVolumeNaming
15853e41d09dSXin LI>>3	leshort		&0x08		Solid
15863e41d09dSXin LI>>3	leshort		&0x20		Authenticated
15873e41d09dSXin LI>>3	leshort		&0x40		RecoveryRecordPresent
15883e41d09dSXin LI>>3	leshort		&0x80		EncryptedBlockHeader
15893e41d09dSXin LI>>3	leshort		&0x100		FirstVolume
15903e41d09dSXin LI
15913e41d09dSXin LI# RAR (Roshal Archive) archive
15923e41d09dSXin LI0	string		Rar!\x1a\7\0		RAR archive data
1593b6cee71dSXin LI!:mime	application/x-rar
15943e41d09dSXin LI!:ext	rar/cbr
15953e41d09dSXin LI# file header
15963e41d09dSXin LI>(0xc.l+9)	byte	0x74
15973e41d09dSXin LI>>(0xc.l+7)	use	rar-file-header
15983e41d09dSXin LI# subblock seems to share information with file header
15993e41d09dSXin LI>(0xc.l+9)	byte	0x7a
16003e41d09dSXin LI>>(0xc.l+7)	use	rar-file-header
16013e41d09dSXin LI>9		byte	0x73
16023e41d09dSXin LI>>7		use	rar-archive-header
16033e41d09dSXin LI
16043e41d09dSXin LI0	string		Rar!\x1a\7\1\0		RAR archive data, v5
16053e41d09dSXin LI!:mime	application/x-rar
16063e41d09dSXin LI!:ext	rar
16073e41d09dSXin LI
16083e41d09dSXin LI# Very old RAR archive
160948c779cdSXin LI# https://jasonblanks.com/wp-includes/images/papers/KnowyourarchiveRAR.pdf
16103e41d09dSXin LI0	string		RE\x7e\x5e  RAR archive data (<v1.5)
16113e41d09dSXin LI!:mime	application/x-rar
16123e41d09dSXin LI!:ext	rar/cbr
1613b6cee71dSXin LI
1614b6cee71dSXin LI# SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
1615b6cee71dSXin LI0	string		SQSH		squished archive data (Acorn RISCOS)
1616b6cee71dSXin LI
1617b6cee71dSXin LI# UC2 archiver (Greg Roelofs, newt@uchicago.edu)
1618b6cee71dSXin LI# [JW] see exe section for self-extracting version
1619b6cee71dSXin LI0	string		UC2\x1a		UC2 archive data
1620b6cee71dSXin LI
1621b6cee71dSXin LI# PKZIP multi-volume archive
1622b6cee71dSXin LI0	string		PK\x07\x08PK\x03\x04	Zip multi-volume archive data, at least PKZIP v2.50 to extract
1623b6cee71dSXin LI!:mime	application/zip
16243e41d09dSXin LI!:ext zip/cbz
1625b6cee71dSXin LI
1626*898496eeSXin LI# Android APK file (Zip archive)
1627*898496eeSXin LI0	string		PK\003\004
1628*898496eeSXin LI!:strength +1
1629*898496eeSXin LI# Starts with AndroidManifest.xml (file name length = 19)
1630*898496eeSXin LI>26	uleshort	19
1631*898496eeSXin LI>>30	string	AndroidManifest.xml	Android package (APK), with AndroidManifest.xml
1632*898496eeSXin LI!:mime	application/vnd.android.package-archive
1633*898496eeSXin LI!:ext	apk
1634*898496eeSXin LI>>>-22	string	PK\005\006
1635*898496eeSXin LI>>>>(-6.l-16)	string	APK\x20Sig\x20Block\x2042	\b, with APK Signing Block
1636*898496eeSXin LI# Starts with META-INF/com/android/build/gradle/app-metadata.properties
1637*898496eeSXin LI>26	uleshort	57
1638*898496eeSXin LI>>30	string	META-INF/com/android/build/gradle/
1639*898496eeSXin LI>>>&0	string	app-metadata.properties	Android package (APK), with gradle app-metadata.properties
1640*898496eeSXin LI!:mime	application/vnd.android.package-archive
1641*898496eeSXin LI!:ext	apk
1642*898496eeSXin LI>>>>-22	string	PK\005\006
1643*898496eeSXin LI>>>>>(-6.l-16)	string	APK\x20Sig\x20Block\x2042	\b, with APK Signing Block
1644*898496eeSXin LI# Starts with classes.dex (file name length = 11)
1645*898496eeSXin LI>26	uleshort	11
1646*898496eeSXin LI>>30	string	classes.dex	Android package (APK), with classes.dex
1647*898496eeSXin LI!:mime	application/vnd.android.package-archive
1648*898496eeSXin LI!:ext	apk
1649*898496eeSXin LI>>>-22	string	PK\005\006
1650*898496eeSXin LI>>>>(-6.l-16)	string	APK\x20Sig\x20Block\x2042	\b, with APK Signing Block
1651*898496eeSXin LI# Starts with META-INF/MANIFEST.MF (file name length = 20)
1652*898496eeSXin LI# NB: checks for resources.arsc, classes.dex, etc. as well to avoid matching JAR files
1653*898496eeSXin LI>26	uleshort	20
1654*898496eeSXin LI>>30	string	META-INF/MANIFEST.MF
1655*898496eeSXin LI# Contains resources.arsc (near the end, in the central directory)
1656*898496eeSXin LI>>>-512	search	resources.arsc	Android package (APK), with MANIFEST.MF and resources.arsc
1657*898496eeSXin LI!:mime	application/vnd.android.package-archive
1658*898496eeSXin LI!:ext	apk
1659*898496eeSXin LI>>>>-22	string	PK\005\006
1660*898496eeSXin LI>>>>>(-6.l-16)	string	APK\x20Sig\x20Block\x2042	\b, with APK Signing Block
1661*898496eeSXin LI>>>-512	default x
1662*898496eeSXin LI# Contains classes.dex (near the end, in the central directory)
1663*898496eeSXin LI>>>>-512	search	classes.dex	Android package (APK), with MANIFEST.MF and classes.dex
1664*898496eeSXin LI!:mime	application/vnd.android.package-archive
1665*898496eeSXin LI!:ext	apk
1666*898496eeSXin LI>>>>>-22	string	PK\005\006
1667*898496eeSXin LI>>>>>>(-6.l-16)	string	APK\x20Sig\x20Block\x2042	\b, with APK Signing Block
1668*898496eeSXin LI>>>>-512	default x
1669*898496eeSXin LI# Contains lib/armeabi (near the end, in the central directory)
1670*898496eeSXin LI>>>>>-512	search	lib/armeabi	Android package (APK), with MANIFEST.MF and armeabi lib
1671*898496eeSXin LI!:mime	application/vnd.android.package-archive
1672*898496eeSXin LI!:ext	apk
1673*898496eeSXin LI>>>>>>-22	string	PK\005\006
1674*898496eeSXin LI>>>>>>>(-6.l-16)	string	APK\x20Sig\x20Block\x2042	\b, with APK Signing Block
1675*898496eeSXin LI>>>>>-512	default x
1676*898496eeSXin LI# Contains drawables (near the end, in the central directory)
1677*898496eeSXin LI>>>>>>-512	search	res/drawable	Android package (APK), with MANIFEST.MF and drawables
1678*898496eeSXin LI!:mime	application/vnd.android.package-archive
1679*898496eeSXin LI!:ext	apk
1680*898496eeSXin LI>>>>>>>-22	string	PK\005\006
1681*898496eeSXin LI>>>>>>>>(-6.l-16)	string	APK\x20Sig\x20Block\x2042	\b, with APK Signing Block
1682*898496eeSXin LI# It may or may not be an APK file, but it's definitely a Java JAR file
1683*898496eeSXin LI>>>>>>-512	default x	Java archive data (JAR)
1684*898496eeSXin LI!:mime	application/java-archive
1685*898496eeSXin LI!:ext	jar
1686*898496eeSXin LI# Starts with zipflinger virtual entry (28 + 104 = 132 bytes)
1687*898496eeSXin LI# See https://github.com/obfusk/apksigcopier/blob/666f5b7/apksigcopier/__init__.py#L230
1688*898496eeSXin LI>4	string	\x00\x00\x00\x00\x00\x00
1689*898496eeSXin LI>>&0	string	\x21\x08\x21\x02
1690*898496eeSXin LI>>>&0	string	\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
1691*898496eeSXin LI>>>>&0	string	\x00\x00	Android package (APK), with zipflinger virtual entry
1692*898496eeSXin LI!:mime	application/vnd.android.package-archive
1693*898496eeSXin LI!:ext	apk
1694*898496eeSXin LI>>>>>-22	string	PK\005\006
1695*898496eeSXin LI>>>>>>(-6.l-16)	string	APK\x20Sig\x20Block\x2042	\b, with APK Signing Block
1696*898496eeSXin LI# APK Signing Block
1697*898496eeSXin LI>0	default	x
1698*898496eeSXin LI>>-22	string	PK\005\006
1699*898496eeSXin LI>>>(-6.l-16)	string	APK\x20Sig\x20Block\x2042	Android package (APK), with APK Signing Block
1700*898496eeSXin LI!:mime	application/vnd.android.package-archive
1701*898496eeSXin LI!:ext	apk
1702*898496eeSXin LI
1703b6cee71dSXin LI# Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
1704b6cee71dSXin LI0	string		PK\005\006	Zip archive data (empty)
17053e41d09dSXin LI!:mime application/zip
17063e41d09dSXin LI!:ext zip/cbz
170748c779cdSXin LI!:strength +1
1708b6cee71dSXin LI0	string		PK\003\004
170948c779cdSXin LI!:strength +1
1710b6cee71dSXin LI
1711b6cee71dSXin LI# Specialised zip formats which start with a member named 'mimetype'
1712b6cee71dSXin LI# (stored uncompressed, with no 'extra field') containing the file's MIME type.
1713b6cee71dSXin LI# Check for have 8-byte name, 0-byte extra field, name "mimetype", and
1714b6cee71dSXin LI#  contents starting with "application/":
1715b6cee71dSXin LI>26	string		\x8\0\0\0mimetypeapplication/
1716b6cee71dSXin LI
1717b6cee71dSXin LI#  KOffice / OpenOffice & StarOffice / OpenDocument formats
1718b6cee71dSXin LI#    From: Abel Cheung <abel@oaka.org>
1719b6cee71dSXin LI
1720b6cee71dSXin LI#   KOffice (1.2 or above) formats
1721b6cee71dSXin LI#    (mimetype contains "application/vnd.kde.<SUBTYPE>")
1722b6cee71dSXin LI>>50	string	vnd.kde.		KOffice (>=1.2)
1723b6cee71dSXin LI>>>58	string	karbon			Karbon document
1724b6cee71dSXin LI>>>58	string	kchart			KChart document
1725b6cee71dSXin LI>>>58	string	kformula		KFormula document
1726b6cee71dSXin LI>>>58	string	kivio			Kivio document
1727b6cee71dSXin LI>>>58	string	kontour			Kontour document
1728b6cee71dSXin LI>>>58	string	kpresenter		KPresenter document
1729b6cee71dSXin LI>>>58	string	kspread			KSpread document
1730b6cee71dSXin LI>>>58	string	kword			KWord document
1731b6cee71dSXin LI
1732b6cee71dSXin LI#   OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7)
1733b6cee71dSXin LI#    (mimetype contains "application/vnd.sun.xml.<SUBTYPE>")
17342726a701SXin LI# URL:		https://en.wikipedia.org/wiki/OpenOffice.org_XML
17352726a701SXin LI# reference:	http://fileformats.archiveteam.org/wiki/OpenOffice.org_XML
1736b6cee71dSXin LI>>50	string	vnd.sun.xml.		OpenOffice.org 1.x
1737b6cee71dSXin LI>>>62	string	writer			Writer
1738b6cee71dSXin LI>>>>68	byte	!0x2e			document
17392726a701SXin LI!:mime	application/vnd.sun.xml.writer
17402726a701SXin LI!:ext	sxw
1741b6cee71dSXin LI>>>>68	string	.template		template
17422726a701SXin LI!:mime	application/vnd.sun.xml.writer.template
17432726a701SXin LI!:ext	stw
17442726a701SXin LI>>>>68	string	.web			Web template
17452726a701SXin LI!:mime	application/vnd.sun.xml.writer.web
17462726a701SXin LI!:ext	stw
1747b6cee71dSXin LI>>>>68	string	.global			global document
17482726a701SXin LI!:mime	application/vnd.sun.xml.writer.global
17492726a701SXin LI!:ext	sxg
1750b6cee71dSXin LI>>>62	string	calc			Calc
1751b6cee71dSXin LI>>>>66	byte	!0x2e			spreadsheet
17522726a701SXin LI!:mime	application/vnd.sun.xml.calc
17532726a701SXin LI!:ext	sxc
1754b6cee71dSXin LI>>>>66	string	.template		template
17552726a701SXin LI!:mime	application/vnd.sun.xml.calc.template
17562726a701SXin LI!:ext	stc
1757b6cee71dSXin LI>>>62	string	draw			Draw
1758b6cee71dSXin LI>>>>66	byte	!0x2e			document
17592726a701SXin LI!:mime	application/vnd.sun.xml.draw
17602726a701SXin LI!:ext	sxd
1761b6cee71dSXin LI>>>>66	string	.template		template
17622726a701SXin LI!:mime	application/vnd.sun.xml.draw.template
17632726a701SXin LI!:ext	std
1764b6cee71dSXin LI>>>62	string	impress			Impress
1765b6cee71dSXin LI>>>>69	byte	!0x2e			presentation
17662726a701SXin LI!:mime	application/vnd.sun.xml.impress
17672726a701SXin LI!:ext	sxi
1768b6cee71dSXin LI>>>>69	string	.template		template
17692726a701SXin LI!:mime	application/vnd.sun.xml.impress.template
17702726a701SXin LI!:ext	sti
1771b6cee71dSXin LI>>>62	string	math			Math document
17722726a701SXin LI!:mime	application/vnd.sun.xml.math
17732726a701SXin LI!:ext	sxm
1774b6cee71dSXin LI>>>62	string	base			Database file
17752726a701SXin LI!:mime	application/vnd.sun.xml.base
17762726a701SXin LI!:ext	sdb
1777b6cee71dSXin LI
1778a4d6d3b8SXin LI# URL:	https://wiki.openoffice.org/wiki/Documentation/DevGuide/Extensions/File_Format
1779a4d6d3b8SXin LI# From:	Joerg Jenderek
1780a4d6d3b8SXin LI# Note:	only few OXT samples are detected here by mimetype member
1781a4d6d3b8SXin LI#	is used by OpenOffice and LibreOffice and probably also NeoOffice
1782a4d6d3b8SXin LI#	verified by `unzip -Zv *.oxt` or `7z l -slt *.oxt`
1783a4d6d3b8SXin LI>>50	string	vnd.openofficeorg.		OpenOffice
1784a4d6d3b8SXin LI>>>68	string	extension			\b/LibreOffice Extension
1785a4d6d3b8SXin LI# http://extension.nirsoft.net/oxt
1786a4d6d3b8SXin LI!:mime	application/vnd.openofficeorg.extension
1787a4d6d3b8SXin LI# like: Gallery-Puzzle.2.1.0.1.oxt
1788a4d6d3b8SXin LI!:ext	oxt
1789a4d6d3b8SXin LI
1790b6cee71dSXin LI#   OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
17912726a701SXin LI#   URL: http://fileformats.archiveteam.org/wiki/OpenDocument
179248c779cdSXin LI#    https://lists.oasis-open.org/archives/office/200505/msg00006.html
1793b6cee71dSXin LI#    (mimetype contains "application/vnd.oasis.opendocument.<SUBTYPE>")
1794b6cee71dSXin LI>>50	string	vnd.oasis.opendocument.	OpenDocument
1795b6cee71dSXin LI>>>73	string	text
1796b6cee71dSXin LI>>>>77	byte	!0x2d			Text
1797b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.text
17982726a701SXin LI!:ext	odt
1799b6cee71dSXin LI>>>>77	string	-template		Text Template
1800b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.text-template
18012726a701SXin LI!:ext	ott
1802b6cee71dSXin LI>>>>77	string	-web			HTML Document Template
1803b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.text-web
18042726a701SXin LI!:ext	oth
1805*898496eeSXin LI>>>>77	string	-master
1806*898496eeSXin LI>>>>>84	byte	!0x2d			Master Document
1807b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.text-master
18082726a701SXin LI!:ext	odm
1809*898496eeSXin LI>>>>>84	string	-template		Master Template
1810*898496eeSXin LI!:mime	application/vnd.oasis.opendocument.text-master-template
1811*898496eeSXin LI!:ext	otm
1812b6cee71dSXin LI>>>73	string	graphics
1813b6cee71dSXin LI>>>>81	byte	!0x2d			Drawing
1814b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.graphics
18152726a701SXin LI!:ext	odg
18162726a701SXin LI>>>>81	string	-template		Drawing Template
1817b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.graphics-template
18182726a701SXin LI!:ext	otg
1819b6cee71dSXin LI>>>73	string	presentation
1820b6cee71dSXin LI>>>>85	byte	!0x2d			Presentation
1821b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.presentation
18222726a701SXin LI!:ext	odp
18232726a701SXin LI>>>>85	string	-template		Presentation Template
1824b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.presentation-template
18252726a701SXin LI!:ext	otp
1826b6cee71dSXin LI>>>73	string	spreadsheet
1827b6cee71dSXin LI>>>>84	byte	!0x2d			Spreadsheet
1828b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.spreadsheet
18292726a701SXin LI!:ext	ods
18302726a701SXin LI>>>>84	string	-template		Spreadsheet Template
1831b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.spreadsheet-template
18322726a701SXin LI!:ext	ots
1833b6cee71dSXin LI>>>73	string	chart
1834b6cee71dSXin LI>>>>78	byte	!0x2d			Chart
1835b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.chart
18362726a701SXin LI!:ext	odc
18372726a701SXin LI>>>>78	string	-template		Chart Template
1838b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.chart-template
18392726a701SXin LI!:ext	otc
1840b6cee71dSXin LI>>>73	string	formula
1841b6cee71dSXin LI>>>>80	byte	!0x2d			Formula
1842b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.formula
18432726a701SXin LI!:ext	odf
18442726a701SXin LI>>>>80	string	-template		Formula Template
1845b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.formula-template
18462726a701SXin LI!:ext	otf
18472726a701SXin LI# https://www.loc.gov/preservation/digital/formats/fdd/fdd000441.shtml
1848b6cee71dSXin LI>>>73	string	database		Database
1849b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.database
18502726a701SXin LI!:ext	odb
185158a0f0d0SEitan Adler# Valid for LibreOffice Base 6.0.1.1 at least
185258a0f0d0SEitan Adler>>>73	string	base 			Database
18532726a701SXin LI# https://bugs.documentfoundation.org/show_bug.cgi?id=45854
1854*898496eeSXin LI!:mime	application/vnd.oasis.opendocument.base
18552726a701SXin LI!:ext	odb
1856b6cee71dSXin LI>>>73	string	image
1857b6cee71dSXin LI>>>>78	byte	!0x2d			Image
1858b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.image
18592726a701SXin LI!:ext	odi
18602726a701SXin LI>>>>78	string	-template		Image Template
1861b6cee71dSXin LI!:mime	application/vnd.oasis.opendocument.image-template
18622726a701SXin LI!:ext	oti
1863b6cee71dSXin LI
1864b6cee71dSXin LI#  EPUB (OEBPS) books using OCF (OEBPS Container Format)
186548c779cdSXin LI#    https://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4.
1866b6cee71dSXin LI#    From: Ralf Brown <ralf.brown@gmail.com>
1867b6cee71dSXin LI>>50	string	epub+zip	EPUB document
1868b6cee71dSXin LI!:mime application/epub+zip
1869b6cee71dSXin LI
1870*898496eeSXin LI# From: Hajin Jang <jb6804@naver.com>
1871*898496eeSXin LI# hwpx (OWPML) document format follows OCF specification.
1872*898496eeSXin LI# Hangul Word Processor 2010+ supports HWPX format.
1873*898496eeSXin LI# URL: https://www.hancom.com/etc/hwpDownload.do
1874*898496eeSXin LI#      https://standard.go.kr/KSCI/standardIntro/getStandardSearchView.do?menuId=503&topMenuId=502&ksNo=KSX6101
1875*898496eeSXin LI#      https://e-ks.kr/streamdocs/view/sd;streamdocsId=72059197557727331
1876*898496eeSXin LI>>50	string	hwp+zip     Hancom HWP (Hangul Word Processor) file, HWPX
1877*898496eeSXin LI!:mime application/x-hwp+zip
1878*898496eeSXin LI!:ext	hwpx
1879*898496eeSXin LI
1880d38c30c0SXin LI# From:	Joerg Jenderek
1881d38c30c0SXin LI# URL:	http://en.wikipedia.org/wiki/CorelDRAW
1882d38c30c0SXin LI# NOTE:	version; til 2 WL-based; from 3 til 13 by ./riff; from 14 zip based
1883d38c30c0SXin LI>>50	string	x-vnd.corel.	 Corel
1884d38c30c0SXin LI>>>62	string	draw.document+zip	Draw drawing, version 14-16
1885d38c30c0SXin LI!:mime	application/x-vnd.corel.draw.document+zip
1886d38c30c0SXin LI!:ext	cdr
1887d38c30c0SXin LI>>>62	string	draw.template+zip	Draw template, version 14-16
1888d38c30c0SXin LI!:mime	application/x-vnd.corel.draw.template+zip
1889d38c30c0SXin LI!:ext	cdrt
18902726a701SXin LI>>>62	string	zcf.draw.document+zip	Draw drawing, version 17-22
1891d38c30c0SXin LI!:mime	application/x-vnd.corel.zcf.draw.document+zip
1892d38c30c0SXin LI!:ext	cdr
18932726a701SXin LI>>>62	string	zcf.draw.template+zip	Draw template, version 17-22
1894d38c30c0SXin LI!:mime	application/x-vnd.corel.zcf.draw.template+zip
1895d38c30c0SXin LI!:ext	cdt/cdrt
18962726a701SXin LI# URL:	http://product.corel.com/help/CorelDRAW/540240626/Main/EN/Doc/CorelDRAW-Other-file-formats.html
18972726a701SXin LI>>>62	string	zcf.pattern+zip		Draw pattern, version 22
18982726a701SXin LI!:mime	application/x-vnd.corel.zcf.pattern+zip
18992726a701SXin LI!:ext	pat
19002726a701SXin LI# URL:		https://en.wikipedia.org/wiki/Corel_Designer
19012726a701SXin LI# Reference:	http://fileformats.archiveteam.org/wiki/Corel_Designer
19022726a701SXin LI# Note:		called by TrID "Corel DESIGN graphics"
19032726a701SXin LI>>>62	string	designer.document+zip		DESIGNER graphics, version 14-16
19042726a701SXin LI!:mime	application/x-vnd.corel.designer.document+zip
19052726a701SXin LI!:ext	des
19062726a701SXin LI>>>62	string	zcf.designer.document+zip	DESIGNER graphics, version 17-21
19072726a701SXin LI!:mime	application/x-vnd.corel.zcf.designer.document+zip
19082726a701SXin LI!:ext	des
19092726a701SXin LI# URL:	http://product.corel.com/help/CorelDRAW/540223850/Main/EN/Documentation/
19102726a701SXin LI#	CorelDRAW-Corel-Symbol-Library-CSL.html
19112726a701SXin LI>>>62	string	symbol.library+zip		Symbol Library, version 6-16.3
19122726a701SXin LI!:mime	application/x-vnd.corel.symbol.library+zip
19132726a701SXin LI!:ext	csl
19142726a701SXin LI>>>62	string	zcf.symbol.library+zip		Symbol Library, version 17-22
19152726a701SXin LI!:mime	application/x-vnd.corel.zcf.symbol.library+zip
19162726a701SXin LI!:ext	csl
1917d38c30c0SXin LI
1918b6cee71dSXin LI#  Catch other ZIP-with-mimetype formats
1919b6cee71dSXin LI#	In a ZIP file, the bytes immediately after a member's contents are
1920b6cee71dSXin LI#	always "PK". The 2 regex rules here print the "mimetype" member's
1921b6cee71dSXin LI#	contents up to the first 'P'. Luckily, most MIME types don't contain
1922b6cee71dSXin LI#	any capital 'P's. This is a kludge.
1923b6cee71dSXin LI#    (mimetype contains "application/<OTHER>")
1924d38c30c0SXin LI>>50		default	x			Zip data
1925d38c30c0SXin LI>>>38		regex	[!-OQ-~]+		(MIME type "%s"?)
1926b6cee71dSXin LI!:mime	application/zip
1927b6cee71dSXin LI#    (mimetype contents other than "application/*")
1928b6cee71dSXin LI>26		string	\x8\0\0\0mimetype
1929b6cee71dSXin LI>>38		string	!application/
1930b6cee71dSXin LI>>>38		regex	[!-OQ-~]+		Zip data (MIME type "%s"?)
1931b6cee71dSXin LI!:mime	application/zip
1932b6cee71dSXin LI
1933*898496eeSXin LI# Java Jar files (see also APK files above)
1934b6cee71dSXin LI>(26.s+30)	leshort	0xcafe		Java archive data (JAR)
1935b6cee71dSXin LI!:mime	application/java-archive
1936*898496eeSXin LI!:ext	jar
1937b6cee71dSXin LI
193820f8619dSXin LI# iOS App
193920f8619dSXin LI>(26.s+30)	leshort	!0xcafe
194020f8619dSXin LI>>26		string	!\x8\0\0\0mimetype
194120f8619dSXin LI>>>30		string	Payload/
194220f8619dSXin LI>>>>38		search/64       .app/   iOS App
194320f8619dSXin LI!:mime application/x-ios-app
194420f8619dSXin LI
194543a5ec4eSXin LI# Dup, see above.
194643a5ec4eSXin LI#>30	search/100/b application/epub+zip	EPUB document
194743a5ec4eSXin LI#!:mime application/epub+zip
194820f8619dSXin LI
1949b6cee71dSXin LI# Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
1950b6cee71dSXin LI#   Next line excludes specialized formats:
1951b6cee71dSXin LI>(26.s+30)	leshort	!0xcafe
19522726a701SXin LI>>30	search/100/b !application/epub+zip
19532726a701SXin LI>>>26    string          !\x8\0\0\0mimetype	Zip archive data
1954b6cee71dSXin LI!:mime	application/zip
19552726a701SXin LI>>>>4	beshort		x			\b, at least
19562726a701SXin LI>>>>4	use		zipversion
19572726a701SXin LI>>>>4	beshort		x			to extract
195843a5ec4eSXin LI>>>>8	beshort		x			\b, compression method=
195943a5ec4eSXin LI>>>>8	use		zipcompression
19602726a701SXin LI>>>>0x161	string		WINZIP		\b, WinZIP self-extracting
1961b6cee71dSXin LI
1962b6cee71dSXin LI# StarView Metafile
1963b6cee71dSXin LI# From Pierre Ducroquet <pinaraf@pinaraf.info>
1964b6cee71dSXin LI0	string	VCLMTF	StarView MetaFile
1965b6cee71dSXin LI>6	beshort	x	\b, version %d
1966b6cee71dSXin LI>8	belong	x	\b, size %d
1967b6cee71dSXin LI
1968b6cee71dSXin LI# Zoo archiver
1969*898496eeSXin LI# Update: Joerg Jenderek
1970*898496eeSXin LI# URL:		https://en.wikipedia.org/wiki/Zoo_(file_format)
1971*898496eeSXin LI#		http://fileformats.archiveteam.org/wiki/Zoo
1972*898496eeSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/a/ark-zoo-strict.trid.xml
1973*898496eeSXin LI#		http://distcache.freebsd.org/ports-distfiles/zoo-2.10pl1.tar.gz/zoo.h
1974*898496eeSXin LI# Note:		called "ZOO compressed archive (strict)" by TrID and "ZOO Compressed Archive" by DROID via PUID x-fmt/269
1975*898496eeSXin LI#		verified by command like `deark -m zoo -l -d2 WHRCGA.ZOO`
1976*898496eeSXin LI20	lelong		0xfdc4a7dc
1977*898496eeSXin LI# skip DROID x-fmt-269-signature-id-621.zoo by looking for valid major version to manipulate archive
1978*898496eeSXin LI>32	byte		>0		Zoo archive data
1979b6cee71dSXin LI!:mime	application/x-zoo
1980*898496eeSXin LI# bak is extension of backup-ed zoo
1981*898496eeSXin LI!:ext	zoo/bak
1982*898496eeSXin LI# version in text form like: 1.50 2.00 2.10
1983*898496eeSXin LI>>4	byte		>48		\b, v%c.
1984*898496eeSXin LI>>>6	byte		>47		\b%c
1985*898496eeSXin LI>>>>7	byte		>47		\b%c
1986*898496eeSXin LI# ZOO files typically start with "ZOO ?.?? Archive.", followed by the bytes 0x1a 0x0 0x0; not used by Zoo and they may be anything
1987*898496eeSXin LI>>8	string		!\040Archive.\032 \b, at 8
1988*898496eeSXin LI>>>8	string		x		text "%0.10s"
1989*898496eeSXin LI# major_ver.minor_ver; minimum version needed to manipulate archive like: 1.0 2.0
1990*898496eeSXin LI>>32	byte		>0		\b, modify: v%d
1991*898496eeSXin LI>>>33	byte		x		\b.%d+
1992*898496eeSXin LI# major_ver.minor_ver; minimum version needed to extract after modify like in old versions
1993*898496eeSXin LI>>(24.l+28)	ubyte	x		\b, extract: v%u
1994*898496eeSXin LI>>(24.l+29)	ubyte	x		\b.%u+
1995*898496eeSXin LI# with zoo 2.00 additional fields have been added in the archive header
1996*898496eeSXin LI>>32	byte		>1
1997*898496eeSXin LI# type; type of archive header like: 1 2
1998*898496eeSXin LI>>>34		ubyte	!1		\b, header type %u
1999*898496eeSXin LI# acmt_pos; position of archive comment like: 6258 30599 61369 149501
2000*898496eeSXin LI>>>35		lelong	>0		\b, at %d
2001*898496eeSXin LI# acmt_len; length of archive comment like: 258
2002*898496eeSXin LI>>>>39			uleshort x	%u bytes comment
2003*898496eeSXin LI#>>>>(35.l)		ubequad	x	COMMENT=%16.16llx
2004*898496eeSXin LI# 1st character of comment maybe is CarriageReturn (0x0d)
2005*898496eeSXin LI>>>>(35.l) 		ubyte	<040
2006*898496eeSXin LI# 2nd character of comment maybe is LineFeed (0x0a)
2007*898496eeSXin LI>>>>>(35.l+1) 		ubyte	<040
2008*898496eeSXin LI# comment string after CRLF like "Anonymous ftp site garbo.uwasa.fi 128.214.87.1 moderated by"
2009*898496eeSXin LI>>>>>>(35.l+2)		string	x	%s
2010*898496eeSXin LI# next character of remaining comment maybe is CarriageReturn (0x0d)
2011*898496eeSXin LI>>>>>>>&0		ubyte	<040
2012*898496eeSXin LI>>>>>>>>&0		ubyte	<040
2013*898496eeSXin LI# 2nd comment part like: Timo Salmi ts@chyde.uwasa.fi      PC directories and uploads\015\012Harri Valkama hv@chyde.uwasa.fi   PC, Mac, Unix files, and upload
2014*898496eeSXin LI>>>>>>>>>&0		string	>037	%s
2015*898496eeSXin LI# vdata; archive-level versioning byte like: 1 3
2016*898496eeSXin LI>>>41		ubyte	!1		\b, vdata %#x
2017*898496eeSXin LI# zoo_start; pointer to 1st entry header
2018*898496eeSXin LI>>24	lelong		x		\b; at %u
2019*898496eeSXin LI# zoo_minus; zoo_start -1 for consistency checking
2020*898496eeSXin LI#>>28	lelong		x		\b, zoo_minus %#x
2021*898496eeSXin LI# zoo_tag; tag for check
2022*898496eeSXin LI#>>(24.l+0) ulelong	!0xfdc4a7dc	\b, zoo_tag=%8.8x
2023*898496eeSXin LI# type; type of directory entry like: 1 2
2024*898496eeSXin LI>>(24.l+4)	ubyte	!2		type=%u
2025*898496eeSXin LI# packing_method; 0~no packing 1~normal LZW 2~lzh
2026*898496eeSXin LI>>(24.l+5)	ubyte		x	method=
2027*898496eeSXin LI>>>(24.l+5)	ubyte		0	\bnot-compressed
2028*898496eeSXin LI>>>(24.l+5)	ubyte		1	\blzd
2029*898496eeSXin LI>>>(24.l+5)	ubyte		2	\blzh
2030*898496eeSXin LI# next; position of next directory entry
2031*898496eeSXin LI>>(24.l+6)	ulelong		x	\b, next entry at %u
2032*898496eeSXin LI# offset; position of file data for this entry
2033*898496eeSXin LI#>>(24.l+10) ulelong		x	\b, data at %u
2034*898496eeSXin LI# file_crc; CRC-16 of file data
2035*898496eeSXin LI>>(24.l+18)	uleshort	x	\b, CRC %#4.4x
2036*898496eeSXin LI# comment; zero if none or points to entry comment like ADD9h (WHRCGA.ZOO)
2037*898496eeSXin LI>>(24.l+32)	lelong		>0	\b, at %#x
2038*898496eeSXin LI# cmt_size; if not 0 for none then length of entry comment like: 46
2039*898496eeSXin LI>>>(24.l+36)	uleshort	>0	%u bytes comment
2040*898496eeSXin LI# entry comment itself like: "CGA .GL file showing menu input from keyboard"
2041*898496eeSXin LI>>>>(&-6.l)	string		x	"%s"
2042*898496eeSXin LI# org_size; original size of file
2043*898496eeSXin LI>>(24.l+20)	ulelong		x	\b, size %u
2044*898496eeSXin LI# size_now; compressed size of file
2045*898496eeSXin LI>>(24.l+24)	ulelong		x	(%u compressed)
2046*898496eeSXin LI# major_ver.minor_ver; minimum version needed to extract already done
2047*898496eeSXin LI# deleted; will be 1 if deleted, 0 if not
2048*898496eeSXin LI>>(24.l+30)	ubyte		=1	\b, deleted
2049*898496eeSXin LI# struc; file structure if any; WHAT IS THAT?
2050*898496eeSXin LI>>(24.l+31)	ubyte		!0	\b, structured
2051*898496eeSXin LI# fname[13]; short/DOS file name like 12345678.012
2052*898496eeSXin LI>>(24.l+38)	string	x		\b, %0.13s
2053*898496eeSXin LI# for directory entry type 2 with variable part
2054*898496eeSXin LI>>(24.l+4)	ubyte	=2
2055*898496eeSXin LI# var_dir_len; length of variable part of dir entry
2056*898496eeSXin LI>>>(24.l+51)		uleshort >0
2057*898496eeSXin LI#>>>(24.l+51)		uleshort >0	\b, variable part length %u
2058*898496eeSXin LI# namlen; length of long filename
2059*898496eeSXin LI#>>>>(24.l+56)		ubyte	x	\b, namlen %u
2060*898496eeSXin LI# dirlen; length of directory name
2061*898496eeSXin LI#>>>>(24.l+57)		ubyte	x	\b, dirlen %u
2062*898496eeSXin LI# if file length positive then show long file name
2063*898496eeSXin LI>>>>(24.l+56)		ubyte	>0
2064*898496eeSXin LI# lfname[256]; long file name \0-terminated
2065*898496eeSXin LI>>>>>(24.l+58)		string	x	"%s"
2066*898496eeSXin LI# if directory length positive then jump before file name field and then jump this addtional length plus 2 (\0-terminator + dirlen field) to following directory name
2067*898496eeSXin LI>>>>(24.l+57)		ubyte	>0
2068*898496eeSXin LI>>>>>(24.l+55)		ubyte	x
2069*898496eeSXin LI# dirname[256]; directory name \0-terminated
2070*898496eeSXin LI>>>>>>&(&0.b+2)		string	x	in "%s"
2071*898496eeSXin LI# dir_crc; CRC of directory entry
2072*898496eeSXin LI#>>>(24.l+54)		uleshort x	\b, entry CRC %#4.4x
2073*898496eeSXin LI# tz; timezone where file was archived; 7Fh~unknown 4~1.00hoursWestOfUTC 12 16 20~5.00hoursWestOfUTC -107~26.75hoursEastOfUTC -4~1.00hoursEastOfUTC
2074*898496eeSXin LI>>>(24.l+53)		byte	!0x7f	\b, time zone %d/4
2075*898496eeSXin LI# date; last mod file date in DOS format
2076*898496eeSXin LI>>>(24.l+14)		lemsdosdate x	\b, modified %s
2077*898496eeSXin LI# time; last mod file time in DOS format
2078*898496eeSXin LI>>>(24.l+16)		lemsdostime x	%s
2079b6cee71dSXin LI
2080b6cee71dSXin LI# Shell archives
2081b6cee71dSXin LI10	string		#\ This\ is\ a\ shell\ archive	shell archive text
2082b6cee71dSXin LI!:mime	application/octet-stream
2083b6cee71dSXin LI
2084b6cee71dSXin LI#
2085b6cee71dSXin LI# LBR. NB: May conflict with the questionable
2086b6cee71dSXin LI#          "binary Computer Graphics Metafile" format.
2087b6cee71dSXin LI#
2088b6cee71dSXin LI0       string  \0\ \ \ \ \ \ \ \ \ \ \ \0\0    LBR archive data
2089b6cee71dSXin LI#
2090b6cee71dSXin LI# PMA (CP/M derivative of LHA)
20913e41d09dSXin LI# Update: Joerg Jenderek
20923e41d09dSXin LI# URL: https://en.wikipedia.org/wiki/LHA_(file_format)
2093b6cee71dSXin LI#
20943e41d09dSXin LI#2       string          -pm0-           PMarc archive data [pm0]
20953e41d09dSXin LI2	string		-pm0-
20963e41d09dSXin LI>0	use	lharc-file
20973e41d09dSXin LI#2       string          -pm1-           PMarc archive data [pm1]
20983e41d09dSXin LI2	string		-pm1-
20993e41d09dSXin LI>0	use	lharc-file
21003e41d09dSXin LI#2       string          -pm2-           PMarc archive data [pm2]
21013e41d09dSXin LI2	string		-pm2-
21023e41d09dSXin LI>0	use	lharc-file
2103b6cee71dSXin LI2       string          -pms-           PMarc SFX archive (CP/M, DOS)
21043e41d09dSXin LI#!:mime	application/x-foobar-exec
21053e41d09dSXin LI!:ext com
2106b6cee71dSXin LI5       string          -pc1-           PopCom compressed executable (CP/M)
21073e41d09dSXin LI#!:mime	application/x-
21083e41d09dSXin LI#!:ext com
2109b6cee71dSXin LI
2110b6cee71dSXin LI# From Rafael Laboissiere <rafael@laboissiere.net>
2111b6cee71dSXin LI# The Project Revision Control System (see
2112b6cee71dSXin LI# http://prcs.sourceforge.net) generates a packaged project
2113b6cee71dSXin LI# file which is recognized by the following entry:
2114b6cee71dSXin LI0	leshort		0xeb81	PRCS packaged project
2115b6cee71dSXin LI
2116b6cee71dSXin LI# Microsoft cabinets
2117b6cee71dSXin LI# by David Necas (Yeti) <yeti@physics.muni.cz>
2118b6cee71dSXin LI#0	string	MSCF\0\0\0\0	Microsoft cabinet file data,
2119b6cee71dSXin LI#>25	byte	x		v%d
2120b6cee71dSXin LI#>24	byte	x		\b.%d
2121b6cee71dSXin LI# MPi: All CABs have version 1.3, so this is pointless.
2122b6cee71dSXin LI# Better magic in debian-additions.
2123b6cee71dSXin LI
2124b6cee71dSXin LI# GTKtalog catalogs
2125b6cee71dSXin LI# by David Necas (Yeti) <yeti@physics.muni.cz>
2126b6cee71dSXin LI4	string	gtktalog\ 	GTKtalog catalog data,
2127b6cee71dSXin LI>13	string	3		version 3
2128b6cee71dSXin LI>>14	beshort	0x677a		(gzipped)
2129b6cee71dSXin LI>>14	beshort	!0x677a		(not gzipped)
2130b6cee71dSXin LI>13	string	>3		version %s
2131b6cee71dSXin LI
2132b6cee71dSXin LI############################################################################
2133b6cee71dSXin LI# Parity archive reconstruction file, the 'par' file format now used on Usenet.
2134b6cee71dSXin LI0       string          PAR\0	PARity archive data
2135b6cee71dSXin LI>48	leshort		=0	- Index file
2136b6cee71dSXin LI>48	leshort		>0	- file number %d
2137b6cee71dSXin LI
2138b6cee71dSXin LI# Felix von Leitner <felix-file@fefe.de>
2139b6cee71dSXin LI0	string	d8:announce	BitTorrent file
2140b6cee71dSXin LI!:mime	application/x-bittorrent
2141a2dfb722SXin LI!:ext	torrent
21423e41d09dSXin LI# Durval Menezes, <jmgthbfile at durval dot com>
21433e41d09dSXin LI0	string	d13:announce-list	BitTorrent file
21443e41d09dSXin LI!:mime	application/x-bittorrent
2145a2dfb722SXin LI!:ext	torrent
2146d38c30c0SXin LI0	string	d7:comment	BitTorrent file
2147d38c30c0SXin LI!:mime	application/x-bittorrent
2148a2dfb722SXin LI!:ext	torrent
2149d38c30c0SXin LI0	string	d4:info		BitTorrent file
2150d38c30c0SXin LI!:mime	application/x-bittorrent
2151a2dfb722SXin LI!:ext	torrent
2152b6cee71dSXin LI
2153b6cee71dSXin LI# Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
2154a4d6d3b8SXin LI# URL:		http://fileformats.archiveteam.org/wiki/MSA_(Magic_Shadow_Archiver)
2155a4d6d3b8SXin LI# Reference:	http://info-coach.fr/atari/documents/_mydoc/FD_Image_File_Format.pdf
2156a4d6d3b8SXin LI#		http://mark0.net/download/triddefs_xml.7z/defs/m/msa.trid.xml
2157a4d6d3b8SXin LI# Update:	Joerg Jenderek
2158a4d6d3b8SXin LI# Note:		called by TrID "Atari MSA Disk Image" and verified by
2159a4d6d3b8SXin LI#		command like `deark -l -m msa -d2 PDATS578.msa` as " Atari ST floppy disk image"
2160a4d6d3b8SXin LI# GRR: line below is too general as it matches setup.skin
2161a4d6d3b8SXin LI0	beshort 0x0e0f
2162a4d6d3b8SXin LI# skip foo setup.skin with unrealistic high number 52255 of sides by check for valid "low" value
2163a4d6d3b8SXin LI>4	ubeshort <2		Atari MSA archive data
2164a4d6d3b8SXin LI#!:mime	application/octet-stream
2165a4d6d3b8SXin LI!:mime	application/x-atari-msa
2166a4d6d3b8SXin LI!:ext	msa
2167a4d6d3b8SXin LI# sectors per track like: 9 10
2168a4d6d3b8SXin LI>>2	beshort x		\b, %d sectors per track
2169a4d6d3b8SXin LI# sides (0 or 1; add 1 to this to get correct number of sides)
2170a4d6d3b8SXin LI>>4	beshort 0		\b, 1 sided
2171a4d6d3b8SXin LI>>4	beshort 1		\b, 2 sided
2172a4d6d3b8SXin LI# starting track like: 0
2173a4d6d3b8SXin LI>>6	beshort x		\b, starting track: %d
2174a4d6d3b8SXin LI# ending track like: 39 79 80 81
2175a4d6d3b8SXin LI>>8	beshort x		\b, ending track: %d
2176a4d6d3b8SXin LI# tracks content
2177a4d6d3b8SXin LI#>>10	ubequad x		\b, track content %#16.16llx
2178b6cee71dSXin LI
2179b6cee71dSXin LI# Alternate ZIP string (amc@arwen.cs.berkeley.edu)
2180b6cee71dSXin LI0	string	PK00PK\003\004	Zip archive data
218158a0f0d0SEitan Adler!:mime	application/zip
218258a0f0d0SEitan Adler!:ext zip/cbz
2183b6cee71dSXin LI
2184*898496eeSXin LI# Recognize ZIP archives with prepended data by end-of-central-directory record
2185*898496eeSXin LI# https://en.wikipedia.org/wiki/ZIP_(file_format)#End_of_central_directory_record_(EOCD)
2186*898496eeSXin LI# by Michal Gorny <mgorny@gentoo.org>
2187*898496eeSXin LI-2	uleshort	0
2188*898496eeSXin LI>&-22	string	PK\005\006
2189*898496eeSXin LI# without #!
2190*898496eeSXin LI>>0	string	!#!	Zip archive, with extra data prepended
2191*898496eeSXin LI!:mime	application/zip
2192*898496eeSXin LI!:ext zip/cbz
2193*898496eeSXin LI# with #!
2194*898496eeSXin LI>>0	string/w	#!\ 	a
2195*898496eeSXin LI>>>&-1	string/T	x	%s script executable (Zip archive)
2196*898496eeSXin LI
2197b6cee71dSXin LI# ACE archive (from http://www.wotsit.org/download.asp?f=ace)
2198b6cee71dSXin LI# by Stefan `Sec` Zehl <sec@42.org>
2199b6cee71dSXin LI7	string		**ACE**		ACE archive data
2200a4d6d3b8SXin LI!:mime	application/x-ace-compressed
2201a4d6d3b8SXin LI!:ext	ace
2202b6cee71dSXin LI>15	byte	>0		version %d
2203b6cee71dSXin LI>16	byte	=0x00		\b, from MS-DOS
2204b6cee71dSXin LI>16	byte	=0x01		\b, from OS/2
2205b6cee71dSXin LI>16	byte	=0x02		\b, from Win/32
2206b6cee71dSXin LI>16	byte	=0x03		\b, from Unix
2207b6cee71dSXin LI>16	byte	=0x04		\b, from MacOS
2208b6cee71dSXin LI>16	byte	=0x05		\b, from WinNT
2209b6cee71dSXin LI>16	byte	=0x06		\b, from Primos
2210b6cee71dSXin LI>16	byte	=0x07		\b, from AppleGS
2211b6cee71dSXin LI>16	byte	=0x08		\b, from Atari
2212b6cee71dSXin LI>16	byte	=0x09		\b, from Vax/VMS
2213b6cee71dSXin LI>16	byte	=0x0A		\b, from Amiga
2214b6cee71dSXin LI>16	byte	=0x0B		\b, from Next
2215b6cee71dSXin LI>14	byte	x		\b, version %d to extract
2216b6cee71dSXin LI>5	leshort &0x0080		\b, multiple volumes,
2217b6cee71dSXin LI>>17	byte	x		\b (part %d),
2218b6cee71dSXin LI>5	leshort &0x0002		\b, contains comment
2219b6cee71dSXin LI>5	leshort	&0x0200		\b, sfx
2220b6cee71dSXin LI>5	leshort	&0x0400		\b, small dictionary
2221b6cee71dSXin LI>5	leshort	&0x0800		\b, multi-volume
2222b6cee71dSXin LI>5	leshort	&0x1000		\b, contains AV-String
2223b6cee71dSXin LI>>30	string	\x16*UNREGISTERED\x20VERSION*	(unregistered)
2224b6cee71dSXin LI>5	leshort &0x2000		\b, with recovery record
2225b6cee71dSXin LI>5	leshort &0x4000		\b, locked
2226b6cee71dSXin LI>5	leshort &0x8000		\b, solid
2227b6cee71dSXin LI# Date in MS-DOS format (whatever that is)
2228b6cee71dSXin LI#>18	lelong	x		Created on
2229b6cee71dSXin LI
2230b6cee71dSXin LI# sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
2231b6cee71dSXin LI# <doj@cubic.org>
2232b6cee71dSXin LI0x1A	string	sfArk		sfArk compressed Soundfont
2233b6cee71dSXin LI>0x15	string	2
2234b6cee71dSXin LI>>0x1	string	>\0		Version %s
2235b6cee71dSXin LI>>0x2A	string	>\0		: %s
2236b6cee71dSXin LI
2237b6cee71dSXin LI# DR-DOS 7.03 Packed File *.??_
223843a5ec4eSXin LI# Reference: http://www.antonis.de/dos/dos-tuts/mpdostip/html/nwdostip.htm
223943a5ec4eSXin LI# Note:	unpacked by PNUNPACK.EXE
224043a5ec4eSXin LI0	string	Packed\ File\
224143a5ec4eSXin LI# by looking for Control-Z skip ASCII text starting with Packed File
224243a5ec4eSXin LI>0x18	ubyte	0x1a		Personal NetWare Packed File
224343a5ec4eSXin LI!:mime	application/x-novell-compress
224443a5ec4eSXin LI!:ext	??_
224543a5ec4eSXin LI>>12	string	x		\b, was "%.12s"
224643a5ec4eSXin LI# 1 or 2
224743a5ec4eSXin LI#>>0x19	ubyte	x		\b, at 0x19 %u
224843a5ec4eSXin LI>>0x1b	ulelong	x		with %u bytes
2249b6cee71dSXin LI
2250b6cee71dSXin LI# EET archive
2251b6cee71dSXin LI# From: Tilman Sauerbeck <tilman@code-monkey.de>
2252b6cee71dSXin LI0	belong	0x1ee7ff00	EET archive
2253b6cee71dSXin LI!:mime	application/x-eet
2254b6cee71dSXin LI
2255b6cee71dSXin LI# rzip archives
2256b6cee71dSXin LI0	string	RZIP		rzip compressed data
2257b6cee71dSXin LI>4	byte	x		- version %d
2258b6cee71dSXin LI>5	byte	x		\b.%d
2259b6cee71dSXin LI>6	belong	x		(%d bytes)
2260b6cee71dSXin LI
226148c779cdSXin LI# From:		Joerg Jenderek
226248c779cdSXin LI# URL:		https://help.foxitsoftware.com/kb/install-fzip-file.php
226348c779cdSXin LI# reference:	http://mark0.net/download/triddefs_xml.7z/
226448c779cdSXin LI#		defs/f/fzip.trid.xml
226548c779cdSXin LI# Note: unknown compression; No "PK" zip magic; normally in directory like
226648c779cdSXin LI#	"%APPDATA%\Foxit Software\Addon\Foxit Reader\Install"
226748c779cdSXin LI0	ubequad	0x2506781901010000	Foxit add-on/update
226848c779cdSXin LI!:mime	application/x-fzip
226948c779cdSXin LI!:ext	fzip
227048c779cdSXin LI
2271b6cee71dSXin LI# From: "Robert Dale" <robdale@gmail.com>
2272b6cee71dSXin LI0	belong	123		dar archive,
2273b6cee71dSXin LI>4	belong	x		label "%.8x
2274b6cee71dSXin LI>>8	belong	x		%.8x
2275b6cee71dSXin LI>>>12	beshort	x		%.4x"
2276b6cee71dSXin LI>14	byte	0x54		end slice
2277b6cee71dSXin LI>14	beshort	0x4e4e		multi-part
2278b6cee71dSXin LI>14	beshort	0x4e53		multi-part, with -S
2279b6cee71dSXin LI
2280b6cee71dSXin LI# Symbian installation files
228148c779cdSXin LI#  https://www.thouky.co.uk/software/psifs/sis.html
2282b6cee71dSXin LI#  http://developer.symbian.com/main/downloads/papers/SymbianOSv91/softwareinstallsis.pdf
2283b6cee71dSXin LI8	lelong	0x10000419	Symbian installation file
2284b6cee71dSXin LI!:mime	application/vnd.symbian.install
2285b6cee71dSXin LI>4	lelong	0x1000006D	(EPOC release 3/4/5)
2286b6cee71dSXin LI>4	lelong	0x10003A12	(EPOC release 6)
2287b6cee71dSXin LI0	lelong	0x10201A7A	Symbian installation file (Symbian OS 9.x)
2288b6cee71dSXin LI!:mime	x-epoc/x-sisx-app
2289b6cee71dSXin LI
2290b6cee71dSXin LI# From "Nelson A. de Oliveira" <naoliv@gmail.com>
2291b6cee71dSXin LI0	string	MPQ\032		MoPaQ (MPQ) archive
2292b6cee71dSXin LI
2293b6cee71dSXin LI# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
2294b6cee71dSXin LI# .kgb
2295b6cee71dSXin LI0	string KGB_arch		KGB Archiver file
2296b6cee71dSXin LI>10	string x		with compression level %.1s
2297b6cee71dSXin LI
2298b6cee71dSXin LI# xar (eXtensible ARchiver) archive
229948c779cdSXin LI# URL: https://en.wikipedia.org/wiki/Xar_(archiver)
230048c779cdSXin LI# xar archive format: https://code.google.com/p/xar/
2301b6cee71dSXin LI# From: "David Remahl" <dremahl@apple.com>
230248c779cdSXin LI# Update: Joerg Jenderek
230348c779cdSXin LI# TODO: lzma compression; X509Data for pkg and xip
230448c779cdSXin LI# Note: verified by `xar --dump-header -f FullBundleUpdate.xar` or
230548c779cdSXin LI# 7z t -txar Xcode_10.2_beta_4.xip`
2306b6cee71dSXin LI0	string	xar!		xar archive
23073e41d09dSXin LI!:mime	application/x-xar
230848c779cdSXin LI# pkg for Mac OSX installer package like FullBundleUpdate.pkg
230948c779cdSXin LI# xip for signed Apple software like Xcode_10.2_beta_4.xip
231048c779cdSXin LI!:ext	xar/pkg/xip
231148c779cdSXin LI# always 28 in older archives
231248c779cdSXin LI>4	ubeshort >28		\b, header size %u
231348c779cdSXin LI# currently there exit only version 1 since about 2014
231448c779cdSXin LI>6	ubeshort >1		version %u,
231548c779cdSXin LI>8	ubequad	x		compressed TOC: %llu,
231648c779cdSXin LI#>16	ubequad	x		uncompressed TOC: %llu,
231748c779cdSXin LI# cksum_alg 0-2 in older and also 3-4 in newer
2318b6cee71dSXin LI>24	belong	0		no checksum
2319b6cee71dSXin LI>24	belong	1		SHA-1 checksum
2320b6cee71dSXin LI>24	belong	2		MD5 checksum
232148c779cdSXin LI>24	belong	3		SHA-256 checksum
232248c779cdSXin LI>24	belong	4		SHA-512 checksum
232343a5ec4eSXin LI>24	belong	>4		unknown %#x checksum
232448c779cdSXin LI#>24	belong	>4		checksum
232548c779cdSXin LI#			For no compression jump 0 bytes
232648c779cdSXin LI>24	belong	0
232748c779cdSXin LI>>0		ubyte	x
232848c779cdSXin LI# jump more bytes forward by header size
232948c779cdSXin LI>>>&(4.S)	ubyte	x
233048c779cdSXin LI# jump more bytes forward by compressed table of contents size
233143a5ec4eSXin LI#>>>>&(8.Q)	ubequad	x	\b, heap data %#llx
233248c779cdSXin LI>>>>&(8.Q)	ubyte	x
233348c779cdSXin LI# look for data by ./compress after message with 1 space at end
233448c779cdSXin LI>>>>>&-3	indirect x	\b, contains
233548c779cdSXin LI#			For SHA-1 jump 20 minus 2 bytes
233648c779cdSXin LI>24	belong	1
233748c779cdSXin LI>>18		ubyte	x
233848c779cdSXin LI# jump more bytes forward by header size
233948c779cdSXin LI>>>&(4.S)	ubyte	x
234048c779cdSXin LI# jump more bytes forward by compressed table of contents size
234148c779cdSXin LI>>>>&(8.Q)	ubyte	x
234248c779cdSXin LI# data compressed by gzip, bzip, lzma or none
234348c779cdSXin LI>>>>>&-1	indirect x	\b, contains
234448c779cdSXin LI#			For SHA-256 jump 32 minus 2 bytes
234548c779cdSXin LI>24	belong	3
234648c779cdSXin LI>>30		ubyte	x
234748c779cdSXin LI# jump more bytes forward by header size
234848c779cdSXin LI>>>&(4.S)	ubyte	x
234948c779cdSXin LI# jump more bytes forward by compressed table of contents size
235048c779cdSXin LI>>>>&(8.Q)	ubyte	x
235148c779cdSXin LI>>>>>&-1	indirect x	\b, contains
235248c779cdSXin LI#			For SHA-512 jump 64 minus 2 bytes
235348c779cdSXin LI>24	belong	4
235448c779cdSXin LI>>62		ubyte	x
235548c779cdSXin LI# jump more bytes forward by header size
235648c779cdSXin LI>>>&(4.S)	ubyte	x
235748c779cdSXin LI# jump more bytes forward by compressed table of contents size
235848c779cdSXin LI>>>>&(8.Q)	ubyte	x
235948c779cdSXin LI>>>>>&-1	indirect x	\b, contains
2360b6cee71dSXin LI
2361b6cee71dSXin LI# Type: Parity Archive
2362b6cee71dSXin LI# From: Daniel van Eeden <daniel_e@dds.nl>
2363b6cee71dSXin LI0	string	PAR2		Parity Archive Volume Set
2364b6cee71dSXin LI
2365b6cee71dSXin LI# Bacula volume format. (Volumes always start with a block header.)
236648c779cdSXin LI# URL: https://bacula.org/3.0.x-manuals/en/developers/developers/Block_Header.html
2367b6cee71dSXin LI# From: Adam Buchbinder <adam.buchbinder@gmail.com>
2368b6cee71dSXin LI12	string	BB02		Bacula volume
2369b6cee71dSXin LI>20	bedate	x		\b, started %s
2370b6cee71dSXin LI
2371b6cee71dSXin LI# ePub is XHTML + XML inside a ZIP archive.  The first member of the
2372b6cee71dSXin LI#   archive must be an uncompressed file called 'mimetype' with contents
2373b6cee71dSXin LI#   'application/epub+zip'
2374b6cee71dSXin LI
2375b6cee71dSXin LI
2376b6cee71dSXin LI# From: "Michael Gorny" <mgorny@gentoo.org>
2377b6cee71dSXin LI# ZPAQ: http://mattmahoney.net/dc/zpaq.html
2378b6cee71dSXin LI0	string	zPQ	ZPAQ stream
2379b6cee71dSXin LI>3	byte	x	\b, level %d
23805f0216bdSXin LI# From: Barry Carter <carter.barry@gmail.com>
238148c779cdSXin LI# https://encode.ru/threads/456-zpaq-updates/page32
23825f0216bdSXin LI0	string	7kSt	ZPAQ file
2383b6cee71dSXin LI
2384b6cee71dSXin LI# BBeB ebook, unencrypted (LRF format)
238548c779cdSXin LI# URL: https://www.sven.de/librie/Librie/LrfFormat
2386b6cee71dSXin LI# From: Adam Buchbinder <adam.buchbinder@gmail.com>
2387b6cee71dSXin LI0	string	L\0R\0F\0\0\0	BBeB ebook data, unencrypted
2388b6cee71dSXin LI>8	beshort	x		\b, version %d
2389b6cee71dSXin LI>36	byte	1		\b, front-to-back
2390b6cee71dSXin LI>36	byte	16		\b, back-to-front
2391b6cee71dSXin LI>42	beshort	x		\b, (%dx,
2392b6cee71dSXin LI>44	beshort	x		%d)
2393b6cee71dSXin LI
2394b6cee71dSXin LI# Symantec GHOST image by Joerg Jenderek at May 2014
239548c779cdSXin LI# https://us.norton.com/ghost/
239648c779cdSXin LI# https://www.garykessler.net/library/file_sigs.html
2397b6cee71dSXin LI0		ubelong&0xFFFFf7f0	0xFEEF0100	Norton GHost image
2398b6cee71dSXin LI# *.GHO
2399b6cee71dSXin LI>2		ubyte&0x08		0x00		\b, first file
2400b6cee71dSXin LI# *.GHS or *.[0-9] with cns program option
2401b6cee71dSXin LI>2		ubyte&0x08		0x08		\b, split file
2402b6cee71dSXin LI# part of split index interesting for *.ghs
240343a5ec4eSXin LI>>4		ubyte			x		id=%#x
2404b6cee71dSXin LI# compression tag minus one equals numeric compression command line switch z[1-9]
2405b6cee71dSXin LI>3		ubyte			0		\b, no compression
2406b6cee71dSXin LI>3		ubyte			2		\b, fast compression (Z1)
2407b6cee71dSXin LI>3		ubyte			3		\b, medium compression (Z2)
2408b6cee71dSXin LI>3		ubyte			>3
2409b6cee71dSXin LI>>3		ubyte			<11		\b, compression (Z%d-1)
2410b6cee71dSXin LI>2		ubyte&0x08		0x00
2411b6cee71dSXin LI# ~ 30 byte password field only for *.gho
2412b6cee71dSXin LI>>12		ubequad			!0		\b, password protected
2413b6cee71dSXin LI>>44		ubyte			!1
2414b6cee71dSXin LI# 1~Image All, sector-by-sector only for *.gho
2415b6cee71dSXin LI>>>10		ubyte			1		\b, sector copy
2416b6cee71dSXin LI# 1~Image Boot track only for *.gho
2417b6cee71dSXin LI>>>43		ubyte			1		\b, boot track
2418b6cee71dSXin LI# 1~Image Disc only for *.gho implies Image Boot track and sector copy
2419b6cee71dSXin LI>>44		ubyte			1		\b, disc sector copy
2420b6cee71dSXin LI# optional image description only *.gho
2421b6cee71dSXin LI>>0xff		string			>\0		"%-.254s"
2422b6cee71dSXin LI# look for DOS sector end sequence
2423b6cee71dSXin LI>0xE08	search/7776		\x55\xAA
2424b6cee71dSXin LI>>&-512	indirect		x		\b; contains
2425b6cee71dSXin LI
24263e41d09dSXin LI# Google Chrome extensions
24273e41d09dSXin LI# https://developer.chrome.com/extensions/crx
24283e41d09dSXin LI# https://developer.chrome.com/extensions/hosting
24293e41d09dSXin LI0	string	Cr24	Google Chrome extension
24303e41d09dSXin LI!:mime	application/x-chrome-extension
24313e41d09dSXin LI>4	ulong	x	\b, version %u
243240427ccaSGordon Tetlow
243340427ccaSGordon Tetlow# SeqBox - Sequenced container
243440427ccaSGordon Tetlow# ext: sbx, seqbox
243540427ccaSGordon Tetlow# Marco Pontello marcopon@gmail.com
243640427ccaSGordon Tetlow# reference: https://github.com/MarcoPon/SeqBox
243740427ccaSGordon Tetlow0	string	SBx	SeqBox,
243840427ccaSGordon Tetlow>3	byte	x	version %d
243958a0f0d0SEitan Adler
244058a0f0d0SEitan Adler# LyNX archive
2441*898496eeSXin LI# Update:	Joerg Jenderek
2442*898496eeSXin LI# URL:		http://fileformats.archiveteam.org/wiki/Lynx_archive
2443*898496eeSXin LI# Reference:	http://ist.uwaterloo.ca/~schepers/formats/LNX.TXT
2444*898496eeSXin LI#		http://mark0.net/download/triddefs_xml.7z/defs/a/ark-lnx.trid.xml
2445*898496eeSXin LI# Note:		called "Lynx archive" by TrID and "Commodore C64 BASIC program" with "POKE 53280" by ./c64
2446*898496eeSXin LI# TODO:		merge and unify with Commodore C64 BASIC program
244758a0f0d0SEitan Adler56	string	USE\040LYNX\040TO\040DISSOLVE\040THIS\040FILE	 LyNX archive
2448*898496eeSXin LI# display "Lynx archive" (strength=330) before Commodore C64 BASIC program (strength=50) handled by ./c64
2449*898496eeSXin LI#!:strength +0
2450*898496eeSXin LI#!:mime	application/octet-stream
2451*898496eeSXin LI!:mime	application/x-commodore-lnx
2452*898496eeSXin LI!:ext	lnx
2453*898496eeSXin LI# afterwards look for BASIC tokenized GOTO (89h) 10, line terminator \0, end of programm tag \0\0 and CarriageReturn
2454*898496eeSXin LI>86		search/10	\x8910\0\0\0\r	\b,
2455*898496eeSXin LI# for DEBUGGING
2456*898496eeSXin LI#>>&0		string		x	STRING="%s"
2457*898496eeSXin LI# number in ASCII of directory blocks with spaces on both sides like: 1 2 3 5
2458*898496eeSXin LI>>&0		regex		[0-9]{1,5}	%s directory blocks
2459*898496eeSXin LI# signature like: "*LYNX XII BY WILL CORLEY" " LYNX IX  BY WILL CORLEY" "*LYNX BY CBMCONVERT 2.0*"
2460*898496eeSXin LI>>>&2		regex		[^\r]{1,24}	\b, signature "%s"
2461*898496eeSXin LI# number of files in ASCII surrounded by spaces and delimited by CR like: 2 3 6 13 69 144 (maximum?)
2462*898496eeSXin LI>>>>&1		regex		[0-9]{1,3}	\b, %s files
246348c779cdSXin LI
246448c779cdSXin LI# From: Joerg Jenderek
246548c779cdSXin LI# URL: https://www.acronis.com/
246648c779cdSXin LI# Reference: https://en.wikipedia.org/wiki/TIB_(file_format)
246748c779cdSXin LI# Note: only tested with True Image 2013 Build 5962 and 2019 Build 14110
246848c779cdSXin LI0	ubequad		0xce24b9a220000000	Acronis True Image backup
246948c779cdSXin LI!:mime	application/x-acronis-tib
247048c779cdSXin LI!:ext	tib
247148c779cdSXin LI# 01000000
247243a5ec4eSXin LI#>20	ubelong		x			\b, at 20 %#x
247348c779cdSXin LI# 20000000
247443a5ec4eSXin LI#>28	ubelong		x			\b, at 28 %#x
247548c779cdSXin LI# strings like "Generic- SD/MMC 1.00" "Unknown Disk" "Msft Virtual Disk 1.0"
247648c779cdSXin LI# ???
247748c779cdSXin LI# strings like "\Device\0000011e" "\Device\0000015a"
247848c779cdSXin LI#>0	search/0x6852300/cs	\\Device\\
247948c779cdSXin LI#>>&-1	pstring		x			\b, %s
248048c779cdSXin LI# "\Device\HarddiskVolume30" "\Device\HarddiskVolume39"
248148c779cdSXin LI#>>>&1	search/180/cs	\\Device\\
248248c779cdSXin LI#>>>>&-1	pstring		x			\b, %s
248348c779cdSXin LI#>>>>>&0	search/29/cs	\0\0\xc8\0
248448c779cdSXin LI# disk label
248548c779cdSXin LI#>>>>>>&10	lestring16	x		\b, disk label %11.11s
248648c779cdSXin LI#>>>>>>&9	plestring16	x		\b, disk label "%11.11s"
248748c779cdSXin LI#>>>>>>&10	ubequad	x			%16.16llx
248848c779cdSXin LI
248948c779cdSXin LI
249048c779cdSXin LI# Gentoo XPAK binary package
249148c779cdSXin LI# by Michal Gorny <mgorny@gentoo.org>
249248c779cdSXin LI# https://gitweb.gentoo.org/proj/portage.git/tree/man/xpak.5
249348c779cdSXin LI-4	string	STOP
249448c779cdSXin LI>-16	string	XPAKSTOP	Gentoo binary package (XPAK)
2495*898496eeSXin LI!:mime	application/vnd.gentoo.xpak
249648c779cdSXin LI
249748c779cdSXin LI# From:		Joerg Jenderek
249848c779cdSXin LI# URL:		https://kodi.wiki/view/TexturePacker
249948c779cdSXin LI# Reference:	https://mirrors.kodi.tv/releases/source/17.3-Krypton.tar.gz
250048c779cdSXin LI# /xbmc-Krypton/xbmc/guilib/XBTF.h
250148c779cdSXin LI# /xbmc-Krypton/xbmc/guilib/XBTF.cpp
250248c779cdSXin LI0	string	XBTF
250348c779cdSXin LI# skip ASCII text by looking for terminating \0 of path
250448c779cdSXin LI>264	ubyte	0		XBMC texture package
250548c779cdSXin LI!:mime	application/x-xbmc-xbt
250648c779cdSXin LI!:ext	xbt
250748c779cdSXin LI# XBTF_VERSION 2
250848c779cdSXin LI>>4	string	!2		\b, version %-.1s
250948c779cdSXin LI# nofFiles /xbmc-Krypton/xbmc/guilib/XBTFReader.cpp
251048c779cdSXin LI>>5	ulelong	x		\b, %u file
251148c779cdSXin LI# plural s
251248c779cdSXin LI>>5	ulelong	>1		\bs
251348c779cdSXin LI# path[CXBTFFile[MaximumPathLength=256]
251448c779cdSXin LI>>9	string	x		\b, 1st %s
251548c779cdSXin LI
251643a5ec4eSXin LI# ALZIP archive
251743a5ec4eSXin LI# by Hyungjun Park <hyungjun.park@worksmobile.com>, Hajin Jang <hajin_jang@worksmobile.com>
251843a5ec4eSXin LI# http://kippler.com/win/unalz/
251943a5ec4eSXin LI# https://salsa.debian.org/l10n-korean-team/unalz
252043a5ec4eSXin LI0	string	ALZ\001		ALZ archive data
252143a5ec4eSXin LI!:ext   alz
252243a5ec4eSXin LI
252343a5ec4eSXin LI# https://cf-aldn.altools.co.kr/setup/EGG_Specification.zip
252443a5ec4eSXin LI0	string	EGGA		EGG archive data,
252543a5ec4eSXin LI!:ext   egg
252643a5ec4eSXin LI>5	byte	x		version %u
252743a5ec4eSXin LI>4	byte	x		\b.%u
252843a5ec4eSXin LI>>0x0E	ulelong	=0x08E28222
252943a5ec4eSXin LI>>0x0E	ulelong	=0x24F5A262	\b, split
253043a5ec4eSXin LI>>0x0E	ulelong	=0x24E5A060	\b, solid
253143a5ec4eSXin LI>>0x0E	default	x		\b, unknown
253243a5ec4eSXin LI
253343a5ec4eSXin LI# PAQ9A archive
253443a5ec4eSXin LI# URL: http://mattmahoney.net/dc/#paq9a
253543a5ec4eSXin LI# Note: Line 1186 of paq9a.cpp gives the magic bytes
253643a5ec4eSXin LI0	string	pQ9\001		PAQ9A archive
2537a2dfb722SXin LI
2538a2dfb722SXin LI# From wof (wof@stachelkaktus.net)
2539a2dfb722SXin LI0	string	Unison\ archive\ format	Unison archive format
2540*898496eeSXin LI
2541*898496eeSXin LI# https://ankiweb.net
2542*898496eeSXin LI30	string	collection.anki2	Anki APKG file
2543*898496eeSXin LI#!:ext	.apkg
2544*898496eeSXin LI
2545*898496eeSXin LI# Synology archive (DiskStation Manager 7.0+)
2546*898496eeSXin LI# From: Alexandre Iooss <erdnaxe@crans.org>
2547*898496eeSXin LI# Note: These archives are signed and encrypted.
2548*898496eeSXin LI0		ulelong&0xFFFFFF00	0xEFBEAD00
2549*898496eeSXin LI# MessagePack header (fixarray of 5 elements starting with a bin of 32 bytes)
2550*898496eeSXin LI>8  	ulelong&0x00FFFFFF	0x20C495	Synology archive
2551*898496eeSXin LI!:ext	spk
2552*898496eeSXin LI# Extract some properties from MessagePack third item
2553*898496eeSXin LI>>43	search/0x10000		package=
2554*898496eeSXin LI>>>&0	string				x			\b, package %s
2555*898496eeSXin LI>>43	search/0x10000		arch=
2556*898496eeSXin LI>>>&0	string				x			%s
2557*898496eeSXin LI>>43	search/0x10000		version=
2558*898496eeSXin LI>>>&0	string				x			%s
2559*898496eeSXin LI>>43	search/0x10000		create_time=
2560*898496eeSXin LI>>>&0	string				x			\b, created on %s
2561*898496eeSXin LI
2562*898496eeSXin LI# MonoGame/XNA processed assets archive
2563*898496eeSXin LI# From: Alexandre Iooss <erdnaxe@crans.org>
2564*898496eeSXin LI# URL: https://github.com/MonoGame/MonoGame/blob/v3.8.1/MonoGame.Framework/Content/ContentManager.cs
2565*898496eeSXin LI0	string	XNB
2566*898496eeSXin LI# XNB must be version 4 or 5
2567*898496eeSXin LI>4	byte	<6
2568*898496eeSXin LI>>4	byte	>3
2569*898496eeSXin LI# Size must be positive
2570*898496eeSXin LI>>>6	lelong	>0	MonoGame/XNA processed assets
2571*898496eeSXin LI!:ext	xnb
2572*898496eeSXin LI>>>>3	string	=w	\b, for Windows
2573*898496eeSXin LI>>>>3	string	=x	\b, for Xbox360
2574*898496eeSXin LI>>>>3	string	=i	\b, for iOS
2575*898496eeSXin LI>>>>3	string	=a	\b, for Android
2576*898496eeSXin LI>>>>3	string	=d	\b, for DesktopGL
2577*898496eeSXin LI>>>>3	string	=X	\b, for MacOSX
2578*898496eeSXin LI>>>>3	string	=W	\b, for WindowsStoreApp
2579*898496eeSXin LI>>>>3	string	=n	\b, for NativeClient
2580*898496eeSXin LI>>>>3	string	=M	\b, for WindowsPhone8
2581*898496eeSXin LI>>>>3	string	=r	\b, for RaspberryPi
2582*898496eeSXin LI>>>>3	string	=P	\b, for PlayStation4
2583*898496eeSXin LI>>>>3	string	=5	\b, for PlayStation5
2584*898496eeSXin LI>>>>3	string	=O	\b, for XboxOne
2585*898496eeSXin LI>>>>3	string	=S	\b, for Nintendo Switch
2586*898496eeSXin LI>>>>3	string	=G	\b, for Google Stadia
2587*898496eeSXin LI>>>>3	string	=b	\b, for WebAssembly and Bridge.NET
2588*898496eeSXin LI>>>>3	string	=m	\b, for WindowsPhone7.0 (XNA)
2589*898496eeSXin LI>>>>3	string	=p	\b, for PlayStationMobile
2590*898496eeSXin LI>>>>3	string	=v	\b, for PSVita
2591*898496eeSXin LI>>>>3	string	=g	\b, for Windows (OpenGL)
2592*898496eeSXin LI>>>>3	string	=l	\b, for Linux
2593*898496eeSXin LI>>>>4	byte	x	\b, version %d
2594*898496eeSXin LI>>>>5	byte	&0x80	\b, LZX compressed
2595*898496eeSXin LI>>>>>10	lelong	x	\b, decompressed size: %d bytes
2596*898496eeSXin LI>>>>5	byte	&0x40	\b, LZ4 compressed
2597*898496eeSXin LI>>>>>10	lelong	x	\b, decompressed size: %d bytes
2598*898496eeSXin LI
2599*898496eeSXin LI# Electron ASAR archive
2600*898496eeSXin LI# From: Alexandre Iooss <erdnaxe@crans.org>
2601*898496eeSXin LI# URL: https://github.com/electron/asar
2602*898496eeSXin LI0		ulelong	4
2603*898496eeSXin LI# Match JSON header start and end
2604*898496eeSXin LI>16		string	{"files":{"
2605*898496eeSXin LI>>(12.l+12)	string }}}}		Electron ASAR archive
2606*898496eeSXin LI!:ext	asar
2607*898496eeSXin LI>>>12		ulelong	x		\b, header length: %d bytes
2608