xref: /freebsd/contrib/file/magic/Magdir/compress (revision ae316d1d1cffd71ab7751f94e10118777a88e027)
1b6cee71dSXin LI#------------------------------------------------------------------------------
2*ae316d1dSXin LI# $File: compress,v 1.96 2024/11/09 23:47:04 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
15898496eeSXin LI!:ext	Z
16b6cee71dSXin LI>2	byte&0x80	>0		block compressed
17b6cee71dSXin LI>2	byte&0x1f	x		%d bits
18b6cee71dSXin LI
19b6cee71dSXin LI# gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
2048c779cdSXin LI# URL: https://en.wikipedia.org/wiki/Gzip
2148c779cdSXin LI# Reference: https://tools.ietf.org/html/rfc1952
22898496eeSXin LI# Update: Joerg Jenderek, Apr 2019, Dec 2022
23b6cee71dSXin LI#   Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
24b6cee71dSXin LI#	* Original filename is only at offset 10 if "extra field" absent
25b6cee71dSXin LI#	* Produce shorter output - notably, only report compression methods
26b6cee71dSXin LI#         other than 8 ("deflate", the only method defined in RFC 1952).
2748c779cdSXin LI# Note: find defs -iname '*.trid.xml' -exec grep -q '<Bytes>1F8B08' {} \; -ls
2848c779cdSXin LI# TODO:
2948c779cdSXin LI# FBR	Blueberry FlashBack screen Record	https://www.flashbackrecorder.com/
3048c779cdSXin LI# KPR	KOffice/Calligra KPresenter		application/x-kpresenter
3148c779cdSXin LI# KPT	KOffice/Calligra KPresenter template?	application/x-kpresenter
3248c779cdSXin LI# SAV	Diggles Saved Game File			http://www.innonics.com
3348c779cdSXin LI# SAV	FarCry (demo) saved game		http://www.farcry-thegame.com
3448c779cdSXin LI# DAT	ZOAGZIP game data format		http://en.wikipedia.org/wiki/SD_Gundam_Capsule_Fighter
3548c779cdSXin LI0       string          \037\213
3648c779cdSXin LI# to display gzip compressed (strength=100=2*50) before other (strength=50)?
3748c779cdSXin LI#!:strength * 2
3848c779cdSXin LI# no FNAME and FCOMMENT bit implies no file name/comment. That means only binary
3948c779cdSXin LI>3	byte&0x18	=0
4048c779cdSXin LI# For binary gzipped no ASCII text should occur
4148c779cdSXin LI#	mcd-monu-cad.trid.xml
4248c779cdSXin LI>>10	string		MCD			Monu-Cad Drawing, Component or Font
4348c779cdSXin LI#>>36	string		Created\ with\ MONU-CAD
4448c779cdSXin LI#!:mime	application/octet-stream
4548c779cdSXin LI# http://fileformats.archiveteam.org/wiki/Monu-CAD
4648c779cdSXin LI#	http://www.monucad.com/downloads/FullDemo-2005.EXE
4748c779cdSXin LI#	/HANDS96.MCC	Component
4848c779cdSXin LI#	/DEMO_DD01.MCD	Drawing
4948c779cdSXin LI#	/MCALF020.FNT	Font
5048c779cdSXin LI!:ext	mcc/mcd/fnt
5148c779cdSXin LI# http://www.generalcadd.com
5248c779cdSXin LI>>10	string		GXD			General CADD, Drawing or Component
5348c779cdSXin LI#!:mime	application/octet-stream
5448c779cdSXin LI#	/gxc/BUILDINGEDGE.gxc			Component
5548c779cdSXin LI#	/gxd/HOCKETT-STPAUL-WRHSE.gxd		Drawing
5648c779cdSXin LI#	/gxd/POWERLAND-MILL-ADD-11.gxd		Drawing		v9.1.06
5748c779cdSXin LI!:ext	gxc/gxd
5848c779cdSXin LI#>>>13	ubyte		0			\b, version 0
5948c779cdSXin LI>>>13	string		09			\b, version 9
6048c779cdSXin LI# other gzipped binary like gzipped tar, VirtualBox extension package,...
6148c779cdSXin LI>>10	default		x		gzip compressed data
62d38c30c0SXin LI!:mime	application/gzip
6348c779cdSXin LI>>>0	use	gzip-info
6448c779cdSXin LI# size of the original (uncompressed) input data modulo 2^32
65898496eeSXin LI# TODO: check for GXD MCD cad the reported size
6648c779cdSXin LI>>>-4	ulelong		x		\b, original size modulo 2^32 %u
6748c779cdSXin LI# gzipped TAR or VirtualBox extension package
6848c779cdSXin LI#!:mime	application/x-compressed-tar
6948c779cdSXin LI#!:mime	application/x-virtualbox-vbox-extpack
7048c779cdSXin LI# https://www.w3.org/TR/SVG/mimereg.html
71898496eeSXin LI#!:mime	image/svg+xml-compressed
7248c779cdSXin LI#	zlib.3.gz
7348c779cdSXin LI#	microcode-20180312.tgz
7448c779cdSXin LI#	tpz same as tgz
7548c779cdSXin LI#	lua-md5_1.2-1_i386_i486.ipk	https://en.wikipedia.org/wiki/Opkg
7648c779cdSXin LI#	Oracle_VM_VirtualBox_Extension_Pack-5.0.12-104815.vbox-extpack
77898496eeSXin LI#	trees.blend			http://fileformats.archiveteam.org/wiki/BLEND
78898496eeSXin LI#	2020-07-19-Note-16-24.xoj	https://xournal.sourceforge.net/manual.html
79898496eeSXin LI#	MYgnucash-gz.gnucash		https://wiki.gnucash.org/wiki/GnuCash_XML_format
80898496eeSXin LI#	text-rotate.dia			https://en.wikipedia.org/wiki/Dia_(software)
81898496eeSXin LI#	MYrdata.RData			https://en.wikipedia.org/wiki/R_(programming_language)
82898496eeSXin LI!:ext	gz/tgz/tpz/ipk/vbox-extpack/svgz/blend/dia/gnucash/rdata/xoj
8348c779cdSXin LI# FNAME/FCOMMENT bit implies file name/comment as iso-8859-1 text
8448c779cdSXin LI>3	byte&0x18	>0		gzip compressed data
8548c779cdSXin LI!:mime	application/gzip
8648c779cdSXin LI# gzipped tar, gzipped Abiword document
8748c779cdSXin LI#!:mime	application/x-compressed-tar
8848c779cdSXin LI#!:mime	application/x-abiword-compressed
8948c779cdSXin LI#!:mime	image/image/svg+xml-compressed
9048c779cdSXin LI#	kleopatra_splashscreen.svgz	gzipped .svg
91898496eeSXin LI#	RSI-Mega-Demo_Disk1.adz		gzipped .adf	http://fileformats.archiveteam.org/wiki/ADF_(Amiga)
92898496eeSXin LI#	PostbankTest.kmy		gzipped XML	https://docs.kde.org/stable5/en/kmymoney/kmymoney/details.formats.compressed.html
93898496eeSXin LI#	Logo.xcfgz			gzipped .xcf	http://fileformats.archiveteam.org/wiki/XCF
94898496eeSXin LI!:ext	gz/tgz/tpz/zabw/svgz/adz/kmy/xcfgz
9548c779cdSXin LI>>0	use	gzip-info
9648c779cdSXin LI# size of the original (uncompressed) input data modulo 2^32
97898496eeSXin LI>>-4	ulelong		x		\b, original size modulo 2^32 %u
9848c779cdSXin LI#	display information of gzip compressed files
9948c779cdSXin LI0	name				gzip-info
10048c779cdSXin LI#>2	byte		x		THIS iS GZIP
101b6cee71dSXin LI>2	byte		<8		\b, reserved method
102b6cee71dSXin LI>2	byte		>8		\b, unknown method
103b6cee71dSXin LI>3	byte		&0x01		\b, ASCII
104b6cee71dSXin LI>3	byte		&0x02		\b, has CRC
105b6cee71dSXin LI>3	byte		&0x04		\b, extra field
106b6cee71dSXin LI>3	byte&0xC	=0x08
107b6cee71dSXin LI>>10	string		x		\b, was "%s"
108b6cee71dSXin LI>3	byte		&0x10		\b, has comment
109b6cee71dSXin LI>3	byte		&0x20		\b, encrypted
110b6cee71dSXin LI>4	ledate		>0		\b, last modified: %s
111b6cee71dSXin LI>8	byte		2		\b, max compression
112b6cee71dSXin LI>8	byte		4		\b, max speed
113b6cee71dSXin LI>9	byte		=0x00		\b, from FAT filesystem (MS-DOS, OS/2, NT)
114b6cee71dSXin LI>9	byte		=0x01		\b, from Amiga
115b6cee71dSXin LI>9	byte		=0x02		\b, from VMS
116b6cee71dSXin LI>9	byte		=0x03		\b, from Unix
117b6cee71dSXin LI>9	byte		=0x04		\b, from VM/CMS
118b6cee71dSXin LI>9	byte		=0x05		\b, from Atari
119b6cee71dSXin LI>9	byte		=0x06		\b, from HPFS filesystem (OS/2, NT)
120b6cee71dSXin LI>9	byte		=0x07		\b, from MacOS
121b6cee71dSXin LI>9	byte		=0x08		\b, from Z-System
122b6cee71dSXin LI>9	byte		=0x09		\b, from CP/M
123b6cee71dSXin LI>9	byte		=0x0A		\b, from TOPS/20
124b6cee71dSXin LI>9	byte		=0x0B		\b, from NTFS filesystem (NT)
125b6cee71dSXin LI>9	byte		=0x0C		\b, from QDOS
126b6cee71dSXin LI>9	byte		=0x0D		\b, from Acorn RISCOS
12748c779cdSXin LI# size of the original (uncompressed) input data modulo 2^32
12848c779cdSXin LI#>-4	ulelong		x		\b, original size modulo 2^32 %u
12948c779cdSXin LI#ERROR: line 114: non zero offset 1048572 at level 1
130b6cee71dSXin LI
131b6cee71dSXin LI# packed data, Huffman (minimum redundancy) codes on a byte-by-byte basis
132b6cee71dSXin LI0	string		\037\036	packed data
133b6cee71dSXin LI!:mime	application/octet-stream
134898496eeSXin LI!:ext	z
135b6cee71dSXin LI>2	belong		>1		\b, %d characters originally
136b6cee71dSXin LI>2	belong		=1		\b, %d character originally
137b6cee71dSXin LI#
138b6cee71dSXin LI# This magic number is byte-order-independent.
139b6cee71dSXin LI0	short		0x1f1f		old packed data
140b6cee71dSXin LI!:mime	application/octet-stream
141b6cee71dSXin LI
142b6cee71dSXin LI# XXX - why *two* entries for "compacted data", one of which is
143b6cee71dSXin LI# byte-order independent, and one of which is byte-order dependent?
144b6cee71dSXin LI#
145b6cee71dSXin LI0	short		0x1fff		compacted data
146b6cee71dSXin LI!:mime	application/octet-stream
147b6cee71dSXin LI# This string is valid for SunOS (BE) and a matching "short" is listed
148b6cee71dSXin LI# in the Ultrix (LE) magic file.
149b6cee71dSXin LI0	string		\377\037	compacted data
150b6cee71dSXin LI!:mime	application/octet-stream
151b6cee71dSXin LI0	short		0145405		huf output
152b6cee71dSXin LI!:mime	application/octet-stream
153b6cee71dSXin LI
154b6cee71dSXin LI# bzip2
155b6cee71dSXin LI0	string		BZh		bzip2 compressed data
156b6cee71dSXin LI!:mime	application/x-bzip2
157a2dfb722SXin LI!:ext	bz2
158b6cee71dSXin LI>3	byte		>47		\b, block size = %c00k
159b6cee71dSXin LI
16058a0f0d0SEitan Adler# bzip	a block-sorting file compressor
16158a0f0d0SEitan Adler#	by Julian Seward <sewardj@cs.man.ac.uk> and others
16258a0f0d0SEitan Adler0	string		BZ0		bzip compressed data
16358a0f0d0SEitan Adler!:mime	application/x-bzip
16458a0f0d0SEitan Adler>3	byte		>47		\b, block size = %c00k
16558a0f0d0SEitan Adler
166b6cee71dSXin LI# lzip
167b6cee71dSXin LI0	string		LZIP		lzip compressed data
168b6cee71dSXin LI!:mime application/x-lzip
169898496eeSXin LI!:ext lz
170b6cee71dSXin LI>4	byte		x		\b, version: %d
171b6cee71dSXin LI
172b6cee71dSXin LI# squeeze and crunch
173b6cee71dSXin LI# Michael Haardt <michael@cantor.informatik.rwth-aachen.de>
174b6cee71dSXin LI0	beshort		0x76FF		squeezed data,
175b6cee71dSXin LI>4	string		x		original name %s
176b6cee71dSXin LI0	beshort		0x76FE		crunched data,
177b6cee71dSXin LI>2	string		x		original name %s
178b6cee71dSXin LI0	beshort		0x76FD		LZH compressed data,
179b6cee71dSXin LI>2	string		x		original name %s
180b6cee71dSXin LI
181b6cee71dSXin LI# Freeze
182b6cee71dSXin LI0	string		\037\237	frozen file 2.1
183b6cee71dSXin LI0	string		\037\236	frozen file 1.0 (or gzip 0.5)
184b6cee71dSXin LI
185b6cee71dSXin LI# SCO compress -H (LZH)
186b6cee71dSXin LI0	string		\037\240	SCO compress -H (LZH) data
187b6cee71dSXin LI
188b6cee71dSXin LI# European GSM 06.10 is a provisional standard for full-rate speech
189b6cee71dSXin LI# transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
190b6cee71dSXin LI# excitation/long term prediction) coding at 13 kbit/s.
191b6cee71dSXin LI#
192b6cee71dSXin LI# There's only a magic nibble (4 bits); that nibble repeats every 33
193b6cee71dSXin LI# bytes.  This isn't suited for use, but maybe we can use it someday.
194b6cee71dSXin LI#
195b6cee71dSXin LI# This will cause very short GSM files to be declared as data and
196b6cee71dSXin LI# mismatches to be declared as data too!
197b6cee71dSXin LI#0	byte&0xF0	0xd0		data
198b6cee71dSXin LI#>33	byte&0xF0	0xd0
199b6cee71dSXin LI#>66	byte&0xF0	0xd0
200b6cee71dSXin LI#>99	byte&0xF0	0xd0
201b6cee71dSXin LI#>132	byte&0xF0	0xd0		GSM 06.10 compressed audio
202b6cee71dSXin LI
203b6cee71dSXin LI# lzop from <markus.oberhumer@jk.uni-linz.ac.at>
204b6cee71dSXin LI0	string		\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a	lzop compressed data
205898496eeSXin LI!:ext	lzo
206*ae316d1dSXin LI!:mime	application/x-lzop
207b6cee71dSXin LI>9	beshort		<0x0940
208b6cee71dSXin LI>>9	byte&0xf0	=0x00		- version 0.
209b6cee71dSXin LI>>9	beshort&0x0fff	x		\b%03x,
210b6cee71dSXin LI>>13	byte		1		LZO1X-1,
211b6cee71dSXin LI>>13	byte		2		LZO1X-1(15),
212b6cee71dSXin LI>>13	byte		3		LZO1X-999,
213b6cee71dSXin LI## >>22	bedate		>0		last modified: %s,
214b6cee71dSXin LI>>14	byte		=0x00		os: MS-DOS
215b6cee71dSXin LI>>14	byte		=0x01		os: Amiga
216b6cee71dSXin LI>>14	byte		=0x02		os: VMS
217b6cee71dSXin LI>>14	byte		=0x03		os: Unix
218b6cee71dSXin LI>>14	byte		=0x05		os: Atari
219b6cee71dSXin LI>>14	byte		=0x06		os: OS/2
220b6cee71dSXin LI>>14	byte		=0x07		os: MacOS
221b6cee71dSXin LI>>14	byte		=0x0A		os: Tops/20
222b6cee71dSXin LI>>14	byte		=0x0B		os: WinNT
223b6cee71dSXin LI>>14	byte		=0x0E		os: Win32
224b6cee71dSXin LI>9	beshort		>0x0939
225b6cee71dSXin LI>>9	byte&0xf0	=0x00		- version 0.
226b6cee71dSXin LI>>9	byte&0xf0	=0x10		- version 1.
227b6cee71dSXin LI>>9	byte&0xf0	=0x20		- version 2.
228b6cee71dSXin LI>>9	beshort&0x0fff	x		\b%03x,
229b6cee71dSXin LI>>15	byte		1		LZO1X-1,
230b6cee71dSXin LI>>15	byte		2		LZO1X-1(15),
231b6cee71dSXin LI>>15	byte		3		LZO1X-999,
232b6cee71dSXin LI## >>25	bedate		>0		last modified: %s,
233b6cee71dSXin LI>>17	byte		=0x00		os: MS-DOS
234b6cee71dSXin LI>>17	byte		=0x01		os: Amiga
235b6cee71dSXin LI>>17	byte		=0x02		os: VMS
236b6cee71dSXin LI>>17	byte		=0x03		os: Unix
237b6cee71dSXin LI>>17	byte		=0x05		os: Atari
238b6cee71dSXin LI>>17	byte		=0x06		os: OS/2
239b6cee71dSXin LI>>17	byte		=0x07		os: MacOS
240b6cee71dSXin LI>>17	byte		=0x0A		os: Tops/20
241b6cee71dSXin LI>>17	byte		=0x0B		os: WinNT
242b6cee71dSXin LI>>17	byte		=0x0E		os: Win32
243b6cee71dSXin LI
244b6cee71dSXin LI# 4.3BSD-Quasijarus Strong Compression
24548c779cdSXin LI# https://minnie.tuhs.org/Quasijarus/compress.html
246b6cee71dSXin LI0	string		\037\241	Quasijarus strong compressed data
247b6cee71dSXin LI
248b6cee71dSXin LI# From: Cory Dikkers <cdikkers@swbell.net>
249b6cee71dSXin LI0	string		XPKF		Amiga xpkf.library compressed data
250b6cee71dSXin LI0	string		PP11		Power Packer 1.1 compressed data
251b6cee71dSXin LI0	string		PP20		Power Packer 2.0 compressed data,
252b6cee71dSXin LI>4	belong		0x09090909	fast compression
253b6cee71dSXin LI>4	belong		0x090A0A0A	mediocre compression
254b6cee71dSXin LI>4	belong		0x090A0B0B	good compression
255b6cee71dSXin LI>4	belong		0x090A0C0C	very good compression
256b6cee71dSXin LI>4	belong		0x090A0C0D	best compression
257b6cee71dSXin LI
258b6cee71dSXin LI# 7-zip archiver, from Thomas Klausner (wiz@danbala.tuwien.ac.at)
25948c779cdSXin LI# https://www.7-zip.org or DOC/7zFormat.txt
260b6cee71dSXin LI#
261b6cee71dSXin LI0	string		7z\274\257\047\034	7-zip archive data,
262b6cee71dSXin LI>6	byte		x			version %d
263b6cee71dSXin LI>7	byte		x			\b.%d
264b6cee71dSXin LI!:mime	application/x-7z-compressed
2653e41d09dSXin LI!:ext 7z/cb7
266b6cee71dSXin LI
267898496eeSXin LI0	name		lzma			LZMA compressed data,
268898496eeSXin LI!:mime	application/x-lzma
269898496eeSXin LI!:ext	lzma
270898496eeSXin LI>5	lequad		=0xffffffffffffffff	streamed
271898496eeSXin LI>5	lequad		!0xffffffffffffffff	non-streamed, size %lld
272898496eeSXin LI
273b6cee71dSXin LI# Type: LZMA
274b6cee71dSXin LI0	lelong&0xffffff	=0x5d
275898496eeSXin LI>12	leshort		0xff
276898496eeSXin LI>>0	use		lzma
277898496eeSXin LI>12	leshort		0
278898496eeSXin LI>>0	use		lzma
279b6cee71dSXin LI
280b6cee71dSXin LI# http://tukaani.org/xz/xz-file-format.txt
28143a5ec4eSXin LI0	ustring		\xFD7zXZ\x00		XZ compressed data, checksum
2825f0216bdSXin LI!:strength * 2
283b6cee71dSXin LI!:mime	application/x-xz
284898496eeSXin LI!:ext	xz
28543a5ec4eSXin LI>7	byte&0xf	0x0			NONE
28643a5ec4eSXin LI>7	byte&0xf	0x1			CRC32
28743a5ec4eSXin LI>7	byte&0xf	0x4			CRC64
28843a5ec4eSXin LI>7	byte&0xf	0xa			SHA-256
289b6cee71dSXin LI
290b6cee71dSXin LI# https://github.com/ckolivas/lrzip/blob/master/doc/magic.header.txt
291b6cee71dSXin LI0	string		LRZI			LRZIP compressed data
292898496eeSXin LI!:mime  application/x-lrzip
293b6cee71dSXin LI>4	byte		x			- version %d
294b6cee71dSXin LI>5	byte		x			\b.%d
29543a5ec4eSXin LI>22	byte		1			\b, encrypted
296b6cee71dSXin LI
29748c779cdSXin LI# https://fastcompression.blogspot.fi/2013/04/lz4-streaming-format-final.html
298b6cee71dSXin LI0	lelong		0x184d2204	LZ4 compressed data (v1.4+)
299b6cee71dSXin LI!:mime	application/x-lz4
300898496eeSXin LI!:ext	lz4
301b6cee71dSXin LI# Added by osm0sis@xda-developers.com
302b6cee71dSXin LI0 	lelong		0x184c2103	LZ4 compressed data (v1.0-v1.3)
303b6cee71dSXin LI!:mime	application/x-lz4
304b6cee71dSXin LI0	lelong		0x184c2102	LZ4 compressed data (v0.1-v0.9)
305b6cee71dSXin LI!:mime	application/x-lz4
306b6cee71dSXin LI
307a5d223e6SXin LI# Zstandard/LZ4 skippable frames
308a5d223e6SXin LI# https://github.com/facebook/zstd/blob/dev/zstd_compression_format.md
309a5d223e6SXin LI0         lelong&0xFFFFFFF0  0x184D2A50
31040427ccaSGordon Tetlow>(4.l+8)  indirect	x
311a5d223e6SXin LI
312a5d223e6SXin LI# Zstandard Dictionary ID subroutine
313a5d223e6SXin LI0     name        zstd-dictionary-id
314a5d223e6SXin LI# Single Segment = True
315a5d223e6SXin LI>0    byte        &0x20   \b, Dictionary ID:
316a5d223e6SXin LI>>0   byte&0x03   0       None
317a5d223e6SXin LI>>0   byte&0x03   1
318a5d223e6SXin LI>>>1  byte        x       %u
319a5d223e6SXin LI>>0   byte&0x03   2
320a5d223e6SXin LI>>>1  leshort     x       %u
321a5d223e6SXin LI>>0   byte&0x03   3
322a5d223e6SXin LI>>>1  lelong      x       %u
323a5d223e6SXin LI# Single Segment = False
324a5d223e6SXin LI>0    byte        ^0x20   \b, Dictionary ID:
325a5d223e6SXin LI>>0   byte&0x03   0       None
326a5d223e6SXin LI>>0   byte&0x03   1
327a5d223e6SXin LI>>>2  byte        x       %u
328a5d223e6SXin LI>>0   byte&0x03   2
329a5d223e6SXin LI>>>2  leshort     x       %u
330a5d223e6SXin LI>>0   byte&0x03   3
331a5d223e6SXin LI>>>2  lelong      x       %u
332a5d223e6SXin LI
333a5d223e6SXin LI# Zstandard compressed data
334a5d223e6SXin LI# https://github.com/facebook/zstd/blob/dev/zstd_compression_format.md
335a5d223e6SXin LI0     lelong       0xFD2FB522  Zstandard compressed data (v0.2)
336d38c30c0SXin LI!:mime  application/zstd
337898496eeSXin LI!:ext zst
338a5d223e6SXin LI0     lelong       0xFD2FB523  Zstandard compressed data (v0.3)
339d38c30c0SXin LI!:mime  application/zstd
340898496eeSXin LI!:ext zst
341a5d223e6SXin LI0     lelong       0xFD2FB524  Zstandard compressed data (v0.4)
342d38c30c0SXin LI!:mime  application/zstd
343898496eeSXin LI!:ext zst
344a5d223e6SXin LI0     lelong       0xFD2FB525  Zstandard compressed data (v0.5)
345d38c30c0SXin LI!:mime  application/zstd
346898496eeSXin LI!:ext zst
347a5d223e6SXin LI0     lelong       0xFD2FB526  Zstandard compressed data (v0.6)
348d38c30c0SXin LI!:mime  application/zstd
349898496eeSXin LI!:ext zst
350a5d223e6SXin LI0     lelong       0xFD2FB527  Zstandard compressed data (v0.7)
351d38c30c0SXin LI!:mime  application/zstd
352898496eeSXin LI!:ext zst
353a5d223e6SXin LI>4    use          zstd-dictionary-id
354a5d223e6SXin LI0     lelong       0xFD2FB528  Zstandard compressed data (v0.8+)
355d38c30c0SXin LI!:mime  application/zstd
356898496eeSXin LI!:ext zst
357a5d223e6SXin LI>4    use          zstd-dictionary-id
358a5d223e6SXin LI
359a5d223e6SXin LI# https://github.com/facebook/zstd/blob/dev/zstd_compression_format.md
360a5d223e6SXin LI0  lelong    0xEC30A437  Zstandard dictionary
361d38c30c0SXin LI!:mime  application/x-std-dictionary
362a5d223e6SXin LI>4 lelong    x           (ID %u)
363a5d223e6SXin LI
364b6cee71dSXin LI# AFX compressed files (Wolfram Kleff)
365b6cee71dSXin LI2	string		-afx-		AFX compressed file data
366b6cee71dSXin LI
367b6cee71dSXin LI# Supplementary magic data for the file(1) command to support
368b6cee71dSXin LI# rzip(1).  The format is described in magic(5).
369b6cee71dSXin LI#
370b6cee71dSXin LI# Copyright (C) 2003 by Andrew Tridgell.  You may do whatever you want with
371b6cee71dSXin LI# this file.
372b6cee71dSXin LI#
373b6cee71dSXin LI0	string		RZIP		rzip compressed data
374b6cee71dSXin LI>4	byte		x		- version %d
375b6cee71dSXin LI>5	byte		x		\b.%d
376b6cee71dSXin LI>6	belong		x		(%d bytes)
377b6cee71dSXin LI
378b6cee71dSXin LI0	string		ArC\x01		FreeArc archive <http://freearc.org>
379b6cee71dSXin LI
380b6cee71dSXin LI# Valve Pack (VPK) files
381*ae316d1dSXin LI# https://developer.valvesoftware.com/wiki/VPK_(file_format)#File_Format
382b6cee71dSXin LI0	lelong	0x55aa1234	Valve Pak file
383b6cee71dSXin LI>0x4	lelong	x		\b, version %u
384*ae316d1dSXin LI>0x8	lelong	x		\b, tree size %u
385*ae316d1dSXin LI>0x12	lelong	x		\b, file data size %u
386*ae316d1dSXin LI>0x16	lelong	x		\b, archive MD5 size %u
387*ae316d1dSXin LI>0x20	lelong	x		\b, other MD5 size %u
388*ae316d1dSXin LI>0x24	lelong	x		\b, signature size %u
389b6cee71dSXin LI
390b6cee71dSXin LI# Snappy framing format
39148c779cdSXin LI# https://code.google.com/p/snappy/source/browse/trunk/framing_format.txt
392b6cee71dSXin LI0	string	\377\006\0\0sNaPpY	snappy framed data
393b6cee71dSXin LI!:mime	application/x-snappy-framed
394c2931133SXin LI
39548c779cdSXin LI# qpress, https://www.quicklz.com/
396c2931133SXin LI0	string	qpress10	qpress compressed data
397c2931133SXin LI!:mime	application/x-qpress
398c2931133SXin LI
399c2931133SXin LI# Zlib https://www.ietf.org/rfc/rfc6713.txt
4009ce06829SXin LI0	string/b	x
4019ce06829SXin LI>0	beshort%31	=0
4029ce06829SXin LI>>0	byte&0xf	=8
4039ce06829SXin LI>>>0	byte&0x80 	=0	zlib compressed data
404c2931133SXin LI!:mime	application/zlib
40558a0f0d0SEitan Adler
40658a0f0d0SEitan Adler# BWC compression
40758a0f0d0SEitan Adler0	string		BWC
40858a0f0d0SEitan Adler>3	byte		0	BWC compressed data
40958a0f0d0SEitan Adler
41058a0f0d0SEitan Adler# UCL compression
41158a0f0d0SEitan Adler0	bequad		0x00e955434cff011a	UCL compressed data
41258a0f0d0SEitan Adler
41358a0f0d0SEitan Adler# Softlib archive
41458a0f0d0SEitan Adler0	string		SLIB	Softlib archive
41558a0f0d0SEitan Adler>4	leshort		x	\b, version %d
41658a0f0d0SEitan Adler>6	leshort		x	(contains %d files)
41758a0f0d0SEitan Adler
41858a0f0d0SEitan Adler# URL:  https://github.com/lzfse/lzfse/blob/master/src/lzfse_internal.h#L276
41958a0f0d0SEitan Adler# From: Eric Hall <eric.hall@darkart.com>
42058a0f0d0SEitan Adler0	string	bvx-	lzfse encoded, no compression
42158a0f0d0SEitan Adler0	string	bvx1	lzfse compressed, uncompressed tables
42258a0f0d0SEitan Adler0	string	bvx2	lzfse compressed, compressed tables
42358a0f0d0SEitan Adler0	string	bvxn	lzfse encoded, lzvn compressed
4242726a701SXin LI
425898496eeSXin LI# https://support-docs.illumina.com/SW/ORA_Format_Specification/Content/SW/ORA/ORAFormatSpecification.htm
426898496eeSXin LI0	uleshort	0x7c49
427898496eeSXin LI>2	lelong		0x80	ORA FASTQ compressed file
428898496eeSXin LI>>6	ulelong		x	\b, DNA size %u
429898496eeSXin LI>>10	ulelong		x	\b, read names size %u
430898496eeSXin LI>>14	ulelong		x	\b, quality buffer 1 size %u
431898496eeSXin LI>>18	ulelong		x	\b, quality buffer 2 size %u
432898496eeSXin LI>>22	ulelong		x	\b, sequence buffer size %u
433898496eeSXin LI>>26	ulelong		x	\b, N-position buffer size %u
434898496eeSXin LI>>30	ulelong		x	\b, crypto buffer size %u
435898496eeSXin LI>>34	ulelong		x	\b, misc  buffer 1 size %u
436898496eeSXin LI>>38	ulelong		x	\b, misc  buffer 2 size %u
437898496eeSXin LI>>42	ulelong		x	\b, flags %#x
438898496eeSXin LI>>46	lelong		x	\b, read size %d
439898496eeSXin LI>>50	lelong		x	\b, number of reads %d
440898496eeSXin LI>>54	leshort		x	\b, version %d
441898496eeSXin LI
442898496eeSXin LI# https://github.com/kspalaiologos/bzip3/blob/master/doc/file_format.md
443898496eeSXin LI0	string/b	BZ3v1	bzip3 compressed data
444898496eeSXin LI>5	ulelong		x	\b, blocksize %u
445898496eeSXin LI
446898496eeSXin LI
447898496eeSXin LI# https://support-docs.illumina.com/SW/ORA_Format_Specification/Content/\
448898496eeSXin LI# SW/ORA/ORAFormatSpecification.htm
449898496eeSXin LI# From Guillaume Rizk
450898496eeSXin LI0	short	=0x7C49 DRAGEN ORA file,
451898496eeSXin LI>-261	short	=0x7C49 with metadata:
452898496eeSXin LI>-125	u8	x	NB reads: %llu,
453898496eeSXin LI>-109	u8	x	NB bases: %llu.
454898496eeSXin LI>-219	u4&0x02	2	File contains interleaved paired reads
455*ae316d1dSXin LI
456*ae316d1dSXin LI# https://github.com/xamarin/xamarin-android/pull/4686
457*ae316d1dSXin LI0	string	XALZ	Xamarin LZ4-compressed assembly
458*ae316d1dSXin LI>8	ulelong	x	\b, uncompressed size %u
459