localfile header signature 4bytes (0x04034b50) version needed to extract 2bytes general purpose bit flag 2bytes compression method 2bytes lastmodfiletime2bytes lastmodfiledate2bytes crc-324bytes compressed size 4bytes uncompressed size 4bytes file name length2bytes extra field length2bytes
file name (variable size) extra field (variable size)
The minimum supported ZIP specification version needed to extract the file, mapped as above. This value is based on the specific format features a ZIP program must support to be able to extract the file. If multiple features are applied to a file, the minimum version should be setto the feature having the highest value. New features or feature changes affecting the published format specification will be implemented using higher version numbers than the last published valueto avoid conflict.
Currentminimum feature versionsareas defined below:
1.0 - Defaultvalue 1.1 - Fileis a volume label 2.0 - Fileis a folder (directory) 2.0 - Fileis compressed using Deflate compression 2.0 - Fileis encrypted using traditional PKWARE encryption 2.1 - Fileis compressed using Deflate64(tm) 2.5 - Fileis compressed using PKWARE DCL Implode 2.7 - Fileis a patchdataset 4.5 - File uses ZIP64 format extensions 4.6 - Fileis compressed using BZIP2 compression* 5.0 - Fileis encrypted using DES 5.0 - Fileis encrypted using3DES 5.0 - Fileis encrypted using original RC2 encryption 5.0 - Fileis encrypted using RC4 encryption 5.1 - Fileis encrypted using AES encryption 5.1 - Fileis encrypted using corrected RC2 encryption** 5.2 - Fileis encrypted using corrected RC2-64 encryption** 6.1 - Fileis encrypted using non-OAEP key wrapping*** 6.2 - Central directory encryption
* Early 7.x (pre-7.2) versionsof PKZIP incorrectly set the version needed toextractfor BZIP2 compression to be 50 when it should have been 46.
** Refer to the sectionon Strong Encryption Specification for additional information regarding RC2 corrections.
*** Certificate encryption using non-OAEP key wrapping is the intended modeof operation forallversionsbeginningwith6.1. Support for OAEP key wrapping should only be used for backward compatibilitywhen sending ZIP files to be opened by versionsof PKZIP older than6.1 (5.0or6.0).
Whenusing ZIP64 extensions, the correspondingvaluein the Zip64 endof central directoryrecord should also be set. This field currently supports only the value45to indicate ZIP64 extensions are present.
(see accompanying documentation for algorithm descriptions)
0 - The file is stored (no compression) 1 - The file is Shrunk 2 - The file is Reduced with compression factor 1 3 - The file is Reduced with compression factor 2 4 - The file is Reduced with compression factor 3 5 - The file is Reduced with compression factor 4 6 - The file is Imploded 7 - Reserved for Tokenizing compression algorithm 8 - The file is Deflated 9 - Enhanced Deflating using Deflate64(tm) 10 - PKWARE Data Compression Library Imploding 11 - Reserved by PKWARE 12 - File is compressed using BZIP2 algorithm
压缩方式
last mod file time
文件最后修改时间
last mod file date
文件最后修改日期
crc-32
CRC-32校验码
compressed size
压缩后的大小
uncompressed size
未压缩的大小
file name length
文件名长度
extra field length
扩展区长度
file name (variable size)
文件名
extra field (variable size)
扩展区
End of central directory record
文件尾结构长度:22 bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
I. Endof central directoryrecord:
endof central dir signature 4bytes (0x06054b50) numberof this disk 2bytes numberof the disk with the startof the central directory2bytes total numberof entries in the central directoryon this disk 2bytes total numberof entries in the central directory2bytes sizeof the central directory4bytes offsetofstartof central directorywithrespectto the starting disk number4bytes .ZIP filecommentlength2bytes .ZIP filecomment (variablesize)
local file header signature
文件尾签名:50 4B 05 06
number of this disk
当前磁盘编号,现在都不用了
number of the disk with the start of the central directory
中央目录开始的磁盘编号,现在都不用了
total number of entries in the central directory on this disk
该磁盘的中央目录个数
total number of entries in the central directory
中央目录结构总数
size of the central directory
中央目录大小:BC 00 00 00
offset of start of central directory with respect to the starting disk number
central file header signature 4bytes (0x02014b50) version made by2bytes version needed to extract 2bytes general purpose bit flag 2bytes compression method 2bytes lastmodfiletime2bytes lastmodfiledate2bytes crc-324bytes compressed size 4bytes uncompressed size 4bytes file name length2bytes extra field length2bytes file comment length2bytes disk numberstart2bytes internal file attributes 2bytes external file attributes 4bytes relativeoffsetoflocal header 4bytes
file name (variable size) extra field (variable size) file comment (variable size)
Digital signature:
header signature 4bytes (0x05054b50) size of data 2bytes signature data (variable size)
With the introduction ofthe Central Directory Encryption feature inversion6.2of this specification, the Central Directory Structure may be stored both compressed and encrypted. Although not required, it is assumed when encrypting the Central Directory Structure, that it will be compressed for greater storage efficiency. Information onthe Central Directory Encryption feature can be found inthe section describing the Strong Encryption Specification. The Digital Signature record will be neither compressed nor encrypted.
central file header signature
文件头标识:50 4B 01 02
version made by
压缩时的版本,winrar压缩的是1F 00,7z压缩的是3F 00
version needed to extract
解压缩需要的最低版本
general purpose bit flag
通用位标记
compression method
压缩方式
last mod file time
文件最后修改时间
last mod file date
文件最后修改日期
crc-32
CRC-32校验码
compressed size
压缩后的大小
uncompressed size
未压缩的大小
file name length
文件名长度
extra field length
扩展区长度
file comment length
文件注释长度
disk number start
磁盘号开始,已经不用了
internal file attributes
内部文件属性
external file attributes
外部文件属性
relative offset of local header
本地文件头的相对偏移
Maybe you could buy me a cup of coffee.
Scan this qrcode
Open alipay app scan this qrcode, buy me a coffee!
Scan this qrcode
Open wechat app scan this qrcode, buy me a coffee!