xref: /freebsd/contrib/file/magic/Magdir/compress (revision 48c779cdecb5f803e5fe5d761987e976ca9609db)
1b6cee71dSXin LI#------------------------------------------------------------------------------
2*48c779cdSXin LI# $File: compress,v 1.75 2019/04/19 00:42:27 christos Exp $
3b6cee71dSXin LI# compress:  file(1) magic for pure-compression formats (no archives)
4b6cee71dSXin LI#
5b6cee71dSXin LI# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
6b6cee71dSXin LI#
7b6cee71dSXin LI# Formats for various forms of compressed data
8b6cee71dSXin LI# Formats for "compress" proper have been moved into "compress.c",
9b6cee71dSXin LI# because it tries to uncompress it to figure out what's inside.
10b6cee71dSXin LI
11b6cee71dSXin LI# standard unix compress
12b6cee71dSXin LI0	string		\037\235	compress'd data
13b6cee71dSXin LI!:mime	application/x-compress
14b6cee71dSXin LI!:apple	LZIVZIVU
15b6cee71dSXin LI>2	byte&0x80	>0		block compressed
16b6cee71dSXin LI>2	byte&0x1f	x		%d bits
17b6cee71dSXin LI
18b6cee71dSXin LI# gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
19*48c779cdSXin LI# URL: https://en.wikipedia.org/wiki/Gzip
20*48c779cdSXin LI# Reference: https://tools.ietf.org/html/rfc1952
21*48c779cdSXin LI# Update: Joerg Jenderek, Apr 2019
22b6cee71dSXin LI#   Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
23b6cee71dSXin LI#	* Original filename is only at offset 10 if "extra field" absent
24b6cee71dSXin LI#	* Produce shorter output - notably, only report compression methods
25b6cee71dSXin LI#         other than 8 ("deflate", the only method defined in RFC 1952).
26*48c779cdSXin LI# Note: find defs -iname '*.trid.xml' -exec grep -q '<Bytes>1F8B08' {} \; -ls
27*48c779cdSXin LI# TODO:
28*48c779cdSXin LI# FBR	Blueberry FlashBack screen Record	https://www.flashbackrecorder.com/
29*48c779cdSXin LI# KPR	KOffice/Calligra KPresenter		application/x-kpresenter
30*48c779cdSXin LI# KPT	KOffice/Calligra KPresenter template?	application/x-kpresenter
31*48c779cdSXin LI# SAV	Diggles Saved Game File			http://www.innonics.com
32*48c779cdSXin LI# SAV	FarCry (demo) saved game		http://www.farcry-thegame.com
33*48c779cdSXin LI# DAT	ZOAGZIP game data format		http://en.wikipedia.org/wiki/SD_Gundam_Capsule_Fighter
34*48c779cdSXin LI0       string          \037\213
35*48c779cdSXin LI# to display gzip compressed (strength=100=2*50) before other (strength=50)?
36*48c779cdSXin LI#!:strength * 2
37*48c779cdSXin LI# no FNAME and FCOMMENT bit implies no file name/comment. That means only binary
38*48c779cdSXin LI>3	byte&0x18	=0
39*48c779cdSXin LI# For binary gzipped no ASCII text should occur
40*48c779cdSXin LI#	mcd-monu-cad.trid.xml
41*48c779cdSXin LI>>10	string		MCD			Monu-Cad Drawing, Component or Font
42*48c779cdSXin LI#>>36	string		Created\ with\ MONU-CAD
43*48c779cdSXin LI#!:mime	application/octet-stream
44*48c779cdSXin LI# http://fileformats.archiveteam.org/wiki/Monu-CAD
45*48c779cdSXin LI#	http://www.monucad.com/downloads/FullDemo-2005.EXE
46*48c779cdSXin LI#	/HANDS96.MCC	Component
47*48c779cdSXin LI#	/DEMO_DD01.MCD	Drawing
48*48c779cdSXin LI#	/MCALF020.FNT	Font
49*48c779cdSXin LI!:ext	mcc/mcd/fnt
50*48c779cdSXin LI# http://www.generalcadd.com
51*48c779cdSXin LI>>10	string		GXD			General CADD, Drawing or Component
52*48c779cdSXin LI#!:mime	application/octet-stream
53*48c779cdSXin LI#	/gxc/BUILDINGEDGE.gxc			Component
54*48c779cdSXin LI#	/gxd/HOCKETT-STPAUL-WRHSE.gxd		Drawing
55*48c779cdSXin LI#	/gxd/POWERLAND-MILL-ADD-11.gxd		Drawing		v9.1.06
56*48c779cdSXin LI!:ext	gxc/gxd
57*48c779cdSXin LI#>>>13	ubyte		0			\b, version 0
58*48c779cdSXin LI>>>13	string		09			\b, version 9
59*48c779cdSXin LI# other gzipped binary like gzipped tar, VirtualBox extension package,...
60*48c779cdSXin LI>>10	default		x		gzip compressed data
61*48c779cdSXin LI>>>0	use	gzip-info
62*48c779cdSXin LI# size of the original (uncompressed) input data modulo 2^32
63*48c779cdSXin LI>>>-4	ulelong		x		\b, original size modulo 2^32 %u
64*48c779cdSXin LI# gzipped TAR or VirtualBox extension package
65*48c779cdSXin LI!:mime	application/gzip
66*48c779cdSXin LI#!:mime	application/x-compressed-tar
67*48c779cdSXin LI#!:mime	application/x-virtualbox-vbox-extpack
68*48c779cdSXin LI# https://www.w3.org/TR/SVG/mimereg.html
69*48c779cdSXin LI#!:mime	image/image/svg+xml-compressed
70*48c779cdSXin LI#	zlib.3.gz
71*48c779cdSXin LI#	microcode-20180312.tgz
72*48c779cdSXin LI#	tpz same as tgz
73*48c779cdSXin LI#	lua-md5_1.2-1_i386_i486.ipk	https://en.wikipedia.org/wiki/Opkg
74*48c779cdSXin LI#	Oracle_VM_VirtualBox_Extension_Pack-5.0.12-104815.vbox-extpack
75*48c779cdSXin LI!:ext	gz/tgz/tpz/ipk/vbox-extpack/svgz
76*48c779cdSXin LI# FNAME/FCOMMENT bit implies file name/comment as iso-8859-1 text
77*48c779cdSXin LI>3	byte&0x18	>0		gzip compressed data
78*48c779cdSXin LI!:mime	application/gzip
79*48c779cdSXin LI# gzipped tar, gzipped Abiword document
80*48c779cdSXin LI#!:mime	application/x-compressed-tar
81*48c779cdSXin LI#!:mime	application/x-abiword-compressed
82*48c779cdSXin LI#!:mime	image/image/svg+xml-compressed
83*48c779cdSXin LI#	kleopatra_splashscreen.svgz	gzipped .svg
84*48c779cdSXin LI!:ext	gz/tgz/tpz/zabw/svgz
85*48c779cdSXin LI>>0	use	gzip-info
86*48c779cdSXin LI# size of the original (uncompressed) input data modulo 2^32
87*48c779cdSXin LI>>-4	ulelong		x		\b, original size modulo 2^32 %u
88*48c779cdSXin LI#	display information of gzip compressed files
89*48c779cdSXin LI0	name				gzip-info
90*48c779cdSXin LI#>2	byte		x		THIS iS GZIP
91b6cee71dSXin LI>2	byte		<8		\b, reserved method
92b6cee71dSXin LI>2	byte		>8		\b, unknown method
93b6cee71dSXin LI>3	byte		&0x01		\b, ASCII
94b6cee71dSXin LI>3	byte		&0x02		\b, has CRC
95b6cee71dSXin LI>3	byte		&0x04		\b, extra field
96b6cee71dSXin LI>3	byte&0xC	=0x08
97b6cee71dSXin LI>>10	string		x		\b, was "%s"
98b6cee71dSXin LI>3	byte		&0x10		\b, has comment
99b6cee71dSXin LI>3	byte		&0x20		\b, encrypted
100b6cee71dSXin LI>4	ledate		>0		\b, last modified: %s
101b6cee71dSXin LI>8	byte		2		\b, max compression
102b6cee71dSXin LI>8	byte		4		\b, max speed
103b6cee71dSXin LI>9	byte		=0x00		\b, from FAT filesystem (MS-DOS, OS/2, NT)
104b6cee71dSXin LI>9	byte		=0x01		\b, from Amiga
105b6cee71dSXin LI>9	byte		=0x02		\b, from VMS
106b6cee71dSXin LI>9	byte		=0x03		\b, from Unix
107b6cee71dSXin LI>9	byte		=0x04		\b, from VM/CMS
108b6cee71dSXin LI>9	byte		=0x05		\b, from Atari
109b6cee71dSXin LI>9	byte		=0x06		\b, from HPFS filesystem (OS/2, NT)
110b6cee71dSXin LI>9	byte		=0x07		\b, from MacOS
111b6cee71dSXin LI>9	byte		=0x08		\b, from Z-System
112b6cee71dSXin LI>9	byte		=0x09		\b, from CP/M
113b6cee71dSXin LI>9	byte		=0x0A		\b, from TOPS/20
114b6cee71dSXin LI>9	byte		=0x0B		\b, from NTFS filesystem (NT)
115b6cee71dSXin LI>9	byte		=0x0C		\b, from QDOS
116b6cee71dSXin LI>9	byte		=0x0D		\b, from Acorn RISCOS
117*48c779cdSXin LI# size of the original (uncompressed) input data modulo 2^32
118*48c779cdSXin LI#>-4	ulelong		x		\b, original size modulo 2^32 %u
119*48c779cdSXin LI#ERROR: line 114: non zero offset 1048572 at level 1
120b6cee71dSXin LI
121b6cee71dSXin LI# packed data, Huffman (minimum redundancy) codes on a byte-by-byte basis
122b6cee71dSXin LI0	string		\037\036	packed data
123b6cee71dSXin LI!:mime	application/octet-stream
124b6cee71dSXin LI>2	belong		>1		\b, %d characters originally
125b6cee71dSXin LI>2	belong		=1		\b, %d character originally
126b6cee71dSXin LI#
127b6cee71dSXin LI# This magic number is byte-order-independent.
128b6cee71dSXin LI0	short		0x1f1f		old packed data
129b6cee71dSXin LI!:mime	application/octet-stream
130b6cee71dSXin LI
131b6cee71dSXin LI# XXX - why *two* entries for "compacted data", one of which is
132b6cee71dSXin LI# byte-order independent, and one of which is byte-order dependent?
133b6cee71dSXin LI#
134b6cee71dSXin LI0	short		0x1fff		compacted data
135b6cee71dSXin LI!:mime	application/octet-stream
136b6cee71dSXin LI# This string is valid for SunOS (BE) and a matching "short" is listed
137b6cee71dSXin LI# in the Ultrix (LE) magic file.
138b6cee71dSXin LI0	string		\377\037	compacted data
139b6cee71dSXin LI!:mime	application/octet-stream
140b6cee71dSXin LI0	short		0145405		huf output
141b6cee71dSXin LI!:mime	application/octet-stream
142b6cee71dSXin LI
143b6cee71dSXin LI# bzip2
144b6cee71dSXin LI0	string		BZh		bzip2 compressed data
145b6cee71dSXin LI!:mime	application/x-bzip2
146b6cee71dSXin LI>3	byte		>47		\b, block size = %c00k
147b6cee71dSXin LI
14858a0f0d0SEitan Adler# bzip	a block-sorting file compressor
14958a0f0d0SEitan Adler#	by Julian Seward <sewardj@cs.man.ac.uk> and others
15058a0f0d0SEitan Adler0	string		BZ0		bzip compressed data
15158a0f0d0SEitan Adler!:mime	application/x-bzip
15258a0f0d0SEitan Adler>3	byte		>47		\b, block size = %c00k
15358a0f0d0SEitan Adler
154b6cee71dSXin LI# lzip
155b6cee71dSXin LI0	string		LZIP		lzip compressed data
156b6cee71dSXin LI!:mime application/x-lzip
157b6cee71dSXin LI>4	byte		x		\b, version: %d
158b6cee71dSXin LI
159b6cee71dSXin LI# squeeze and crunch
160b6cee71dSXin LI# Michael Haardt <michael@cantor.informatik.rwth-aachen.de>
161b6cee71dSXin LI0	beshort		0x76FF		squeezed data,
162b6cee71dSXin LI>4	string		x		original name %s
163b6cee71dSXin LI0	beshort		0x76FE		crunched data,
164b6cee71dSXin LI>2	string		x		original name %s
165b6cee71dSXin LI0	beshort		0x76FD		LZH compressed data,
166b6cee71dSXin LI>2	string		x		original name %s
167b6cee71dSXin LI
168b6cee71dSXin LI# Freeze
169b6cee71dSXin LI0	string		\037\237	frozen file 2.1
170b6cee71dSXin LI0	string		\037\236	frozen file 1.0 (or gzip 0.5)
171b6cee71dSXin LI
172b6cee71dSXin LI# SCO compress -H (LZH)
173b6cee71dSXin LI0	string		\037\240	SCO compress -H (LZH) data
174b6cee71dSXin LI
175b6cee71dSXin LI# European GSM 06.10 is a provisional standard for full-rate speech
176b6cee71dSXin LI# transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
177b6cee71dSXin LI# excitation/long term prediction) coding at 13 kbit/s.
178b6cee71dSXin LI#
179b6cee71dSXin LI# There's only a magic nibble (4 bits); that nibble repeats every 33
180b6cee71dSXin LI# bytes.  This isn't suited for use, but maybe we can use it someday.
181b6cee71dSXin LI#
182b6cee71dSXin LI# This will cause very short GSM files to be declared as data and
183b6cee71dSXin LI# mismatches to be declared as data too!
184b6cee71dSXin LI#0	byte&0xF0	0xd0		data
185b6cee71dSXin LI#>33	byte&0xF0	0xd0
186b6cee71dSXin LI#>66	byte&0xF0	0xd0
187b6cee71dSXin LI#>99	byte&0xF0	0xd0
188b6cee71dSXin LI#>132	byte&0xF0	0xd0		GSM 06.10 compressed audio
189b6cee71dSXin LI
190b6cee71dSXin LI# lzop from <markus.oberhumer@jk.uni-linz.ac.at>
191b6cee71dSXin LI0	string		\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a	lzop compressed data
192b6cee71dSXin LI>9	beshort		<0x0940
193b6cee71dSXin LI>>9	byte&0xf0	=0x00		- version 0.
194b6cee71dSXin LI>>9	beshort&0x0fff	x		\b%03x,
195b6cee71dSXin LI>>13	byte		1		LZO1X-1,
196b6cee71dSXin LI>>13	byte		2		LZO1X-1(15),
197b6cee71dSXin LI>>13	byte		3		LZO1X-999,
198b6cee71dSXin LI## >>22	bedate		>0		last modified: %s,
199b6cee71dSXin LI>>14	byte		=0x00		os: MS-DOS
200b6cee71dSXin LI>>14	byte		=0x01		os: Amiga
201b6cee71dSXin LI>>14	byte		=0x02		os: VMS
202b6cee71dSXin LI>>14	byte		=0x03		os: Unix
203b6cee71dSXin LI>>14	byte		=0x05		os: Atari
204b6cee71dSXin LI>>14	byte		=0x06		os: OS/2
205b6cee71dSXin LI>>14	byte		=0x07		os: MacOS
206b6cee71dSXin LI>>14	byte		=0x0A		os: Tops/20
207b6cee71dSXin LI>>14	byte		=0x0B		os: WinNT
208b6cee71dSXin LI>>14	byte		=0x0E		os: Win32
209b6cee71dSXin LI>9	beshort		>0x0939
210b6cee71dSXin LI>>9	byte&0xf0	=0x00		- version 0.
211b6cee71dSXin LI>>9	byte&0xf0	=0x10		- version 1.
212b6cee71dSXin LI>>9	byte&0xf0	=0x20		- version 2.
213b6cee71dSXin LI>>9	beshort&0x0fff	x		\b%03x,
214b6cee71dSXin LI>>15	byte		1		LZO1X-1,
215b6cee71dSXin LI>>15	byte		2		LZO1X-1(15),
216b6cee71dSXin LI>>15	byte		3		LZO1X-999,
217b6cee71dSXin LI## >>25	bedate		>0		last modified: %s,
218b6cee71dSXin LI>>17	byte		=0x00		os: MS-DOS
219b6cee71dSXin LI>>17	byte		=0x01		os: Amiga
220b6cee71dSXin LI>>17	byte		=0x02		os: VMS
221b6cee71dSXin LI>>17	byte		=0x03		os: Unix
222b6cee71dSXin LI>>17	byte		=0x05		os: Atari
223b6cee71dSXin LI>>17	byte		=0x06		os: OS/2
224b6cee71dSXin LI>>17	byte		=0x07		os: MacOS
225b6cee71dSXin LI>>17	byte		=0x0A		os: Tops/20
226b6cee71dSXin LI>>17	byte		=0x0B		os: WinNT
227b6cee71dSXin LI>>17	byte		=0x0E		os: Win32
228b6cee71dSXin LI
229b6cee71dSXin LI# 4.3BSD-Quasijarus Strong Compression
230*48c779cdSXin LI# https://minnie.tuhs.org/Quasijarus/compress.html
231b6cee71dSXin LI0	string		\037\241	Quasijarus strong compressed data
232b6cee71dSXin LI
233b6cee71dSXin LI# From: Cory Dikkers <cdikkers@swbell.net>
234b6cee71dSXin LI0	string		XPKF		Amiga xpkf.library compressed data
235b6cee71dSXin LI0	string		PP11		Power Packer 1.1 compressed data
236b6cee71dSXin LI0	string		PP20		Power Packer 2.0 compressed data,
237b6cee71dSXin LI>4	belong		0x09090909	fast compression
238b6cee71dSXin LI>4	belong		0x090A0A0A	mediocre compression
239b6cee71dSXin LI>4	belong		0x090A0B0B	good compression
240b6cee71dSXin LI>4	belong		0x090A0C0C	very good compression
241b6cee71dSXin LI>4	belong		0x090A0C0D	best compression
242b6cee71dSXin LI
243b6cee71dSXin LI# 7-zip archiver, from Thomas Klausner (wiz@danbala.tuwien.ac.at)
244*48c779cdSXin LI# https://www.7-zip.org or DOC/7zFormat.txt
245b6cee71dSXin LI#
246b6cee71dSXin LI0	string		7z\274\257\047\034	7-zip archive data,
247b6cee71dSXin LI>6	byte		x			version %d
248b6cee71dSXin LI>7	byte		x			\b.%d
249b6cee71dSXin LI!:mime	application/x-7z-compressed
2503e41d09dSXin LI!:ext 7z/cb7
251b6cee71dSXin LI
252b6cee71dSXin LI# Type: LZMA
253b6cee71dSXin LI0	lelong&0xffffff	=0x5d
254b6cee71dSXin LI>12	leshort		0xff			LZMA compressed data,
255b6cee71dSXin LI!:mime	application/x-lzma
256b6cee71dSXin LI>>5	lequad		=0xffffffffffffffff	streamed
257b6cee71dSXin LI>>5	lequad		!0xffffffffffffffff	non-streamed, size %lld
258b6cee71dSXin LI>12	leshort		0			LZMA compressed data,
259b6cee71dSXin LI>>5	lequad		=0xffffffffffffffff	streamed
260b6cee71dSXin LI>>5	lequad		!0xffffffffffffffff	non-streamed, size %lld
261b6cee71dSXin LI
262b6cee71dSXin LI# http://tukaani.org/xz/xz-file-format.txt
263b6cee71dSXin LI0	ustring		\xFD7zXZ\x00		XZ compressed data
2645f0216bdSXin LI!:strength * 2
265b6cee71dSXin LI!:mime	application/x-xz
266b6cee71dSXin LI
267b6cee71dSXin LI# https://github.com/ckolivas/lrzip/blob/master/doc/magic.header.txt
268b6cee71dSXin LI0	string		LRZI			LRZIP compressed data
269b6cee71dSXin LI>4	byte		x			- version %d
270b6cee71dSXin LI>5	byte		x			\b.%d
271b6cee71dSXin LI!:mime	application/x-lrzip
272b6cee71dSXin LI
273*48c779cdSXin LI# https://fastcompression.blogspot.fi/2013/04/lz4-streaming-format-final.html
274b6cee71dSXin LI0	lelong		0x184d2204	LZ4 compressed data (v1.4+)
275b6cee71dSXin LI!:mime	application/x-lz4
276b6cee71dSXin LI# Added by osm0sis@xda-developers.com
277b6cee71dSXin LI0 	lelong		0x184c2103	LZ4 compressed data (v1.0-v1.3)
278b6cee71dSXin LI!:mime	application/x-lz4
279b6cee71dSXin LI0	lelong		0x184c2102	LZ4 compressed data (v0.1-v0.9)
280b6cee71dSXin LI!:mime	application/x-lz4
281b6cee71dSXin LI
282a5d223e6SXin LI# Zstandard/LZ4 skippable frames
283a5d223e6SXin LI# https://github.com/facebook/zstd/blob/dev/zstd_compression_format.md
284a5d223e6SXin LI0         lelong&0xFFFFFFF0  0x184D2A50
28540427ccaSGordon Tetlow>(4.l+8)  indirect	x
286a5d223e6SXin LI
287a5d223e6SXin LI# Zstandard Dictionary ID subroutine
288a5d223e6SXin LI0     name        zstd-dictionary-id
289a5d223e6SXin LI# Single Segment = True
290a5d223e6SXin LI>0    byte        &0x20   \b, Dictionary ID:
291a5d223e6SXin LI>>0   byte&0x03   0       None
292a5d223e6SXin LI>>0   byte&0x03   1
293a5d223e6SXin LI>>>1  byte        x       %u
294a5d223e6SXin LI>>0   byte&0x03   2
295a5d223e6SXin LI>>>1  leshort     x       %u
296a5d223e6SXin LI>>0   byte&0x03   3
297a5d223e6SXin LI>>>1  lelong      x       %u
298a5d223e6SXin LI# Single Segment = False
299a5d223e6SXin LI>0    byte        ^0x20   \b, Dictionary ID:
300a5d223e6SXin LI>>0   byte&0x03   0       None
301a5d223e6SXin LI>>0   byte&0x03   1
302a5d223e6SXin LI>>>2  byte        x       %u
303a5d223e6SXin LI>>0   byte&0x03   2
304a5d223e6SXin LI>>>2  leshort     x       %u
305a5d223e6SXin LI>>0   byte&0x03   3
306a5d223e6SXin LI>>>2  lelong      x       %u
307a5d223e6SXin LI
308a5d223e6SXin LI# Zstandard compressed data
309a5d223e6SXin LI# https://github.com/facebook/zstd/blob/dev/zstd_compression_format.md
310a5d223e6SXin LI0     lelong       0xFD2FB522  Zstandard compressed data (v0.2)
311a5d223e6SXin LI!:mime  application/x-zstd
312a5d223e6SXin LI0     lelong       0xFD2FB523  Zstandard compressed data (v0.3)
313a5d223e6SXin LI!:mime  application/x-zstd
314a5d223e6SXin LI0     lelong       0xFD2FB524  Zstandard compressed data (v0.4)
315a5d223e6SXin LI!:mime  application/x-zstd
316a5d223e6SXin LI0     lelong       0xFD2FB525  Zstandard compressed data (v0.5)
317a5d223e6SXin LI!:mime  application/x-zstd
318a5d223e6SXin LI0     lelong       0xFD2FB526  Zstandard compressed data (v0.6)
319a5d223e6SXin LI!:mime  application/x-zstd
320a5d223e6SXin LI0     lelong       0xFD2FB527  Zstandard compressed data (v0.7)
321a5d223e6SXin LI!:mime  application/x-zstd
322a5d223e6SXin LI>4    use          zstd-dictionary-id
323a5d223e6SXin LI0     lelong       0xFD2FB528  Zstandard compressed data (v0.8+)
324a5d223e6SXin LI!:mime  application/x-zstd
325a5d223e6SXin LI>4    use          zstd-dictionary-id
326a5d223e6SXin LI
327a5d223e6SXin LI# https://github.com/facebook/zstd/blob/dev/zstd_compression_format.md
328a5d223e6SXin LI0  lelong    0xEC30A437  Zstandard dictionary
329a5d223e6SXin LI!:mime  application/x-zstd-dictionary
330a5d223e6SXin LI>4 lelong    x           (ID %u)
331a5d223e6SXin LI
332b6cee71dSXin LI# AFX compressed files (Wolfram Kleff)
333b6cee71dSXin LI2	string		-afx-		AFX compressed file data
334b6cee71dSXin LI
335b6cee71dSXin LI# Supplementary magic data for the file(1) command to support
336b6cee71dSXin LI# rzip(1).  The format is described in magic(5).
337b6cee71dSXin LI#
338b6cee71dSXin LI# Copyright (C) 2003 by Andrew Tridgell.  You may do whatever you want with
339b6cee71dSXin LI# this file.
340b6cee71dSXin LI#
341b6cee71dSXin LI0	string		RZIP		rzip compressed data
342b6cee71dSXin LI>4	byte		x		- version %d
343b6cee71dSXin LI>5	byte		x		\b.%d
344b6cee71dSXin LI>6	belong		x		(%d bytes)
345b6cee71dSXin LI
346b6cee71dSXin LI0	string		ArC\x01		FreeArc archive <http://freearc.org>
347b6cee71dSXin LI
348b6cee71dSXin LI# Type:	DACT compressed files
349b6cee71dSXin LI0	long	0x444354C3	DACT compressed data
350b6cee71dSXin LI>4	byte	>-1		(version %i.
351b6cee71dSXin LI>5	byte	>-1		%i.
352b6cee71dSXin LI>6	byte	>-1		%i)
353b6cee71dSXin LI>7	long	>0		, original size: %i bytes
354b6cee71dSXin LI>15	long	>30		, block size: %i bytes
355b6cee71dSXin LI
356b6cee71dSXin LI# Valve Pack (VPK) files
357b6cee71dSXin LI0	lelong	0x55aa1234	Valve Pak file
358b6cee71dSXin LI>0x4	lelong	x		\b, version %u
359b6cee71dSXin LI>0x8	lelong	x		\b, %u entries
360b6cee71dSXin LI
361b6cee71dSXin LI# Snappy framing format
362*48c779cdSXin LI# https://code.google.com/p/snappy/source/browse/trunk/framing_format.txt
363b6cee71dSXin LI0	string	\377\006\0\0sNaPpY	snappy framed data
364b6cee71dSXin LI!:mime	application/x-snappy-framed
365c2931133SXin LI
366*48c779cdSXin LI# qpress, https://www.quicklz.com/
367c2931133SXin LI0	string	qpress10	qpress compressed data
368c2931133SXin LI!:mime	application/x-qpress
369c2931133SXin LI
370c2931133SXin LI# Zlib https://www.ietf.org/rfc/rfc6713.txt
3719ce06829SXin LI0	string/b	x
3729ce06829SXin LI>0	beshort%31	=0
3739ce06829SXin LI>>0	byte&0xf	=8
3749ce06829SXin LI>>>0	byte&0x80 	=0	zlib compressed data
375c2931133SXin LI!:mime	application/zlib
37658a0f0d0SEitan Adler
37758a0f0d0SEitan Adler# BWC compression
37858a0f0d0SEitan Adler0	string		BWC
37958a0f0d0SEitan Adler>3	byte		0	BWC compressed data
38058a0f0d0SEitan Adler
38158a0f0d0SEitan Adler# UCL compression
38258a0f0d0SEitan Adler0	bequad		0x00e955434cff011a	UCL compressed data
38358a0f0d0SEitan Adler
38458a0f0d0SEitan Adler# Softlib archive
38558a0f0d0SEitan Adler0	string		SLIB	Softlib archive
38658a0f0d0SEitan Adler>4	leshort		x	\b, version %d
38758a0f0d0SEitan Adler>6	leshort		x	(contains %d files)
38858a0f0d0SEitan Adler
38958a0f0d0SEitan Adler# URL:  https://github.com/lzfse/lzfse/blob/master/src/lzfse_internal.h#L276
39058a0f0d0SEitan Adler# From: Eric Hall <eric.hall@darkart.com>
39158a0f0d0SEitan Adler0	string	bvx-	lzfse encoded, no compression
39258a0f0d0SEitan Adler0	string	bvx1	lzfse compressed, uncompressed tables
39358a0f0d0SEitan Adler0	string	bvx2	lzfse compressed, compressed tables
39458a0f0d0SEitan Adler0	string	bvxn	lzfse encoded, lzvn compressed
395