2 #------------------------------------------------------------------------------
3 # compress: file(1) magic for pure-compression formats (no archives)
5 # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
7 # Formats for various forms of compressed data
8 # Formats for "compress" proper have been moved into "compress.c",
9 # because it tries to uncompress it to figure out what's inside.
11 # standard unix compress
12 0 string \037\235 compress'd data
13 >2 byte&0x80 >0 block compressed
14 >2 byte&0x1f x %d bits
16 # gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
17 0 string \037\213 gzip compressed data
18 >2 byte <8 \b, reserved method,
19 >2 byte 8 \b, deflated,
21 >3 byte &0x02 continuation,
22 >3 byte &0x04 extra field,
23 >3 byte &0x08 original filename,
25 >3 byte &0x10 comment,
26 >3 byte &0x20 encrypted,
27 >4 ledate x last modified: %s,
28 >8 byte 2 max compression,
30 >9 byte =0x00 os: MS-DOS
31 >9 byte =0x01 os: Amiga
33 >9 byte =0x03 os: Unix
34 >9 byte =0x05 os: Atari
35 >9 byte =0x06 os: OS/2
36 >9 byte =0x07 os: MacOS
37 >9 byte =0x0A os: Tops/20
38 >9 byte =0x0B os: Win/32
40 # packed data, Huffman (minimum redundancy) codes on a byte-by-byte basis
41 0 string \037\036 packed data
42 >2 belong >1 \b, %d characters originally
43 >2 belong =1 \b, %d character originally
45 # This magic number is byte-order-independent. XXX - Does that mean this
46 # is big-endian, little-endian, either, or that you can't tell?
47 # this short is valid for SunOS
48 0 short 017437 old packed data
50 # XXX - why *two* entries for "compacted data", one of which is
51 # byte-order independent, and one of which is byte-order dependent?
53 0 short 0x1fff compacted data
54 # This string is valid for SunOS (BE) and a matching "short" is listed
55 # in the Ultrix (LE) magic file.
56 0 string \377\037 compacted data
57 0 short 0145405 huf output
60 0 string BZh bzip2 compressed data
61 >3 byte >47 \b, block size = %c00k
64 # Michael Haardt <michael@cantor.informatik.rwth-aachen.de>
65 0 beshort 0x76FF squeezed data,
66 >4 string x original name %s
67 0 beshort 0x76FE crunched data,
68 >2 string x original name %s
69 0 beshort 0x76FD LZH compressed data,
70 >2 string x original name %s
73 0 string \037\237 frozen file 2.1
74 0 string \037\236 frozen file 1.0 (or gzip 0.5)
76 # SCO compress -H (LZH)
77 0 string \037\240 SCO compress -H (LZH) data
79 # European GSM 06.10 is a provisional standard for full-rate speech
80 # transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
81 # excitation/long term prediction) coding at 13 kbit/s.
83 # There's only a magic nibble (4 bits); that nibble repeats every 33
84 # bytes. This isn't suited for use, but maybe we can use it someday.
86 # This will cause very short GSM files to be declared as data and
87 # mismatches to be declared as data too!
88 #0 byte&0xF0 0xd0 data
92 #>132 byte&0xF0 0xd0 GSM 06.10 compressed audio
94 # bzip a block-sorting file compressor
95 # by Julian Seward <sewardj@cs.man.ac.uk> and others
97 0 string BZ bzip compressed data
98 >2 byte x \b, version: %c
99 >3 string =1 \b, compression block size 100k
100 >3 string =2 \b, compression block size 200k
101 >3 string =3 \b, compression block size 300k
102 >3 string =4 \b, compression block size 400k
103 >3 string =5 \b, compression block size 500k
104 >3 string =6 \b, compression block size 600k
105 >3 string =7 \b, compression block size 700k
106 >3 string =8 \b, compression block size 800k
107 >3 string =9 \b, compression block size 900k
109 # lzop from <markus.oberhumer@jk.uni-linz.ac.at>
110 0 string \x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a lzop compressed data
112 >>9 byte&0xf0 =0x00 - version 0.
113 >>9 beshort&0x0fff x \b%03x,
115 >>13 byte 2 LZO1X-1(15),
116 >>13 byte 3 LZO1X-999,
117 ## >>22 bedate >0 last modified: %s,
118 >>14 byte =0x00 os: MS-DOS
119 >>14 byte =0x01 os: Amiga
120 >>14 byte =0x02 os: VMS
121 >>14 byte =0x03 os: Unix
122 >>14 byte =0x05 os: Atari
123 >>14 byte =0x06 os: OS/2
124 >>14 byte =0x07 os: MacOS
125 >>14 byte =0x0A os: Tops/20
126 >>14 byte =0x0B os: WinNT
127 >>14 byte =0x0E os: Win32
129 >>9 byte&0xf0 =0x00 - version 0.
130 >>9 byte&0xf0 =0x10 - version 1.
131 >>9 byte&0xf0 =0x20 - version 2.
132 >>9 beshort&0x0fff x \b%03x,
134 >>15 byte 2 LZO1X-1(15),
135 >>15 byte 3 LZO1X-999,
136 ## >>25 bedate >0 last modified: %s,
137 >>17 byte =0x00 os: MS-DOS
138 >>17 byte =0x01 os: Amiga
139 >>17 byte =0x02 os: VMS
140 >>17 byte =0x03 os: Unix
141 >>17 byte =0x05 os: Atari
142 >>17 byte =0x06 os: OS/2
143 >>17 byte =0x07 os: MacOS
144 >>17 byte =0x0A os: Tops/20
145 >>17 byte =0x0B os: WinNT
146 >>17 byte =0x0E os: Win32