221 lines
10 KiB
Plaintext
221 lines
10 KiB
Plaintext
|
ARC file header structure
|
||
|
|
||
|
Byte number Value(s) Meaning
|
||
|
--------------------------------------------------------------
|
||
|
0 $1A Header Flag
|
||
|
1 0-9 Compression method
|
||
|
2-14 --- Filename.
|
||
|
15-18 --- Compressed file size.
|
||
|
19-20 bits Date format
|
||
|
15-9 Year
|
||
|
8-5 Month
|
||
|
4-0 Day
|
||
|
21-22 bits Time format
|
||
|
15-11 Hours (military)
|
||
|
10-5 Minutes
|
||
|
4-0 Seconds
|
||
|
23-24 --- CRC-16
|
||
|
25-28 --- Original file size
|
||
|
|
||
|
Compression method
|
||
|
------------------
|
||
|
1 unpacked (obsolete)
|
||
|
2 unpacked
|
||
|
3 packed
|
||
|
4 squeezed (after packing)
|
||
|
5 crunched (obsolete)
|
||
|
6 crunched (after packing) (obsolete)
|
||
|
7 crunched (after packing, using faster hash algorithm)
|
||
|
8 crunched (after packing, using dynamic LZW variations)
|
||
|
9 Squashed c/o Phil Katz (no packing) (var. on crunching)
|
||
|
|
||
|
NOTE: LZW is Lempel-Ziv-Welch compression algorithm
|
||
|
|
||
|
LZH
|
||
|
---
|
||
|
LZH file header structure
|
||
|
|
||
|
Byte number Value(s) Meaning
|
||
|
--------------------------------------------------------------
|
||
|
0 --- Header size
|
||
|
1 --- Cksum of remaining bytes
|
||
|
2-6 --- Method
|
||
|
7-10 --- Compressed size
|
||
|
11-14 --- Uncompressed size
|
||
|
15-16 --- Time format
|
||
|
17-18 --- Date format
|
||
|
19-20 --- File attribute
|
||
|
21-22 --- Filename/path length
|
||
|
23-XX --- Filename/path
|
||
|
XX+1-XX+2 --- CRC-16
|
||
|
|
||
|
Compression method
|
||
|
------------------
|
||
|
-lh0- No compression used
|
||
|
-lh1- LZW, 4K buffer, Huffman for upper 6 bits of pos
|
||
|
-lz4- LZW, Arithmetic Encoding
|
||
|
-lz5- LZW, Arithmetic Encoding
|
||
|
|
||
|
ZIP
|
||
|
---
|
||
|
ZIP file header structures
|
||
|
|
||
|
Local File Header
|
||
|
-----------------
|
||
|
Byte number Value(s) Meaning
|
||
|
--------------------------------------------------------------
|
||
|
0-3 $04034B50 Local File Header Signature
|
||
|
4-5 --- Version needed to extract
|
||
|
6-7 --- General purpose bit flag
|
||
|
8-9 0-6 Compression method
|
||
|
10-11 --- Time
|
||
|
12-13 --- Date
|
||
|
14-17 --- CRC-32
|
||
|
18-21 --- Compressed size
|
||
|
22-25 --- Uncompressed size
|
||
|
26-27 --- Filename length
|
||
|
28-29 --- Extra field length
|
||
|
30-XX --- path/filename
|
||
|
XX+1-YY --- extra field
|
||
|
|
||
|
Central Directory Structure
|
||
|
---------------------------
|
||
|
Byte number Value(s) Meaning
|
||
|
--------------------------------------------------------------
|
||
|
0-3 $02014B50 Central file header signature
|
||
|
4 --- Version made by
|
||
|
5 --- Host operating system
|
||
|
6 --- Version needed to extract
|
||
|
7 --- O/S of version needed for extraction
|
||
|
8-9 --- General purpose bit flag
|
||
|
10-11 0-6 Compression method
|
||
|
12-13 --- Time
|
||
|
14-15 --- Date
|
||
|
16-19 --- CRC-32
|
||
|
20-23 --- Compressed size
|
||
|
24-27 --- Uncompressed size
|
||
|
28-29 --- Filename length
|
||
|
30-31 --- Extra field length
|
||
|
32-33 --- File comment length
|
||
|
34-35 --- Disk number start
|
||
|
36-37 bit Internal file attributes
|
||
|
0 if = 1, file is apparently an ASCII
|
||
|
or text file
|
||
|
0 if = 0, file apparently contains
|
||
|
binary data
|
||
|
1-7 unused in version 1.0.
|
||
|
38-41 --- External file attributes, host
|
||
|
system dependent
|
||
|
42-45 --- Relative offset of local header
|
||
|
from the start of the first disk
|
||
|
on which this file appears
|
||
|
46-XX --- Filename or path - should not
|
||
|
contain a drive or device letter,
|
||
|
or a leading slash. All slashes
|
||
|
should be forward slashes '/'
|
||
|
XX+1-YY --- extra field
|
||
|
YY+1-ZZ --- file comment
|
||
|
|
||
|
End of Central Directory Structure
|
||
|
----------------------------------
|
||
|
Byte number Value(s) Meaning
|
||
|
--------------------------------------------------------------
|
||
|
0-3 $06064B50 End of central dir signature
|
||
|
4-5 --- Number of this disk
|
||
|
6-7 --- Number of disk with start central dir
|
||
|
8-9 --- Total number of entries in central dir
|
||
|
on this disk
|
||
|
10-11 --- total number entries in central dir
|
||
|
12-15 --- Size of the central directory
|
||
|
16-19 --- Offset of start of central directory
|
||
|
with respect to the starting disk
|
||
|
number
|
||
|
20-21 --- zipfile comment length
|
||
|
22-XX --- zipfile comment
|
||
|
|
||
|
ZIP Values
|
||
|
----------
|
||
|
|
||
|
Host O/S
|
||
|
|
||
|
Value Description Value Description
|
||
|
----- -------------------------- ----- ------------------------
|
||
|
0 MS-DOS and OS/2 (FAT) 5 Atari ST
|
||
|
1 Amiga 6 OS/2 1.2 extended file sys
|
||
|
2 VMS 7 Macintosh
|
||
|
3 *nix 8 thru
|
||
|
4 VM/CMS 255 unused
|
||
|
|
||
|
General Purpose Bit Flag
|
||
|
|
||
|
Bit Description
|
||
|
--------- -----------------------------------------
|
||
|
0 If set, file is encrypted
|
||
|
1 If file Imploded and this bit is set, 8K
|
||
|
sliding dictionary was used. If clear, 4K
|
||
|
sliding dictionary was used.
|
||
|
2 If file Imploded and this bit is set, 3
|
||
|
Shannon-Fano trees were used. If clear, 2
|
||
|
Shannon-Fano trees were used.
|
||
|
3-4 unused
|
||
|
5-7 used internally by ZIP
|
||
|
|
||
|
Note: Bits 1 and 2 are undefined if the compression method is
|
||
|
other than type 6 (Imploding).
|
||
|
|
||
|
Compression Method
|
||
|
|
||
|
Name Method Description
|
||
|
----------- ------ --------------------------------------------
|
||
|
Stored 0 No compression
|
||
|
Shrunk 1 LZW, 8K buffer, 9-13 bits with partial clearing
|
||
|
Reduced-1 2 Probalistic compression, lower 7 bits
|
||
|
Reduced-2 3 Probalistic compression, lower 6 bits
|
||
|
Reduced-3 4 Probalistic compression, lower 5 bits
|
||
|
Reduced-4 5 Probalistic compression, lower 4 bits
|
||
|
Imploded 6 2/3 Shanno-Fano trees, 4K/8K sliding dictionary
|
||
|
|
||
|
ZOO
|
||
|
---
|
||
|
ZOO file header sturtures
|
||
|
|
||
|
Master Header
|
||
|
-------------
|
||
|
Byte number Value(s) Meaning
|
||
|
--------------------------------------------------------------
|
||
|
0-19 --- Archive header text
|
||
|
20-23 $A7DCFDC4 File signature
|
||
|
24-27 --- pointer to 1st header
|
||
|
28-31 --- pointer to 1st header - 1
|
||
|
32 --- version making archive
|
||
|
33 --- minimum version needed to extract
|
||
|
|
||
|
File Header
|
||
|
-----------
|
||
|
Byte number Value(s) Meaning
|
||
|
--------------------------------------------------------------
|
||
|
0-3 $A7DCFDC4 signature
|
||
|
4 --- type of directory entry
|
||
|
5 0-1 Compression method
|
||
|
6-9 --- position of next dir entry
|
||
|
10-13 --- position of header
|
||
|
14-15 --- Date
|
||
|
16-17 --- Time
|
||
|
18-19 --- CRC-16
|
||
|
20-23 --- Uncompressed size
|
||
|
24-27 --- Compressed size
|
||
|
28 --- version that made this file
|
||
|
29 --- minimum version needed to extract
|
||
|
30 0-1 1 if file deleted from archive
|
||
|
31-34 --- pointer to comment, 0 if none
|
||
|
35-36 --- length of comment
|
||
|
37-XX --- path/filename
|
||
|
|
||
|
Compression Method
|
||
|
|
||
|
NAME DESCRIPTION
|
||
|
----------- --------------------------------------------
|
||
|
Stored No compression used
|
||
|
Crunched Packing, LZW, 4K buffer, var len (9-13 bits)
|
||
|
|