< zip 파일 구조 >
*출처: http://en.wikipedia.org/wiki/ZIP_(file_format)
ZIP 구조는 크게 Local File Header, Central File Header, End Of Center Header 3개의 파일 구조로되어 있습니다.
2. 아래는 HEXA 값으로 폰 ZIP 파일 구조입니다.
< Zip 파일의 내부 구조 분석 >
1. Local File Header(30byte: 가변값 제외)
local file header signature - 4 bytes - (0x04034b50) : 고유 값
version needed to extract - 2 bytes
general purpose bit flag - 2 bytes
compression method - 2 bytes
last mod file time - 2 bytes
last mod file date - 2 bytes
crc-32 - 4 bytes
compressed size - 4 bytes
uncompressed size - 4 bytes
file name length - 2 bytes
extra field length - 2 bytes
file name (variable size)
extra field (variable size)
2. Central File Header(46byte: 가변값 제외)
central file header signature - 4 bytes - (0x02014b50) : 고유 값
version made by - 2 bytes
version needed to extract - 2 bytes
general purpose bit flag - 2 bytes
compression method - 2 bytes
last mod file time - 2 bytes
last mod file date - 2 bytes
crc-32 - 4 bytes
compressed size - 4 bytes
uncompressed size - 4 bytes
file name length - 2 bytes
extra field length - 2 bytes
file comment length - 2 bytes
disk number start - 2 bytes
internal file attributes - 2 bytes
external file attributes - 4 bytes
relative offset of local header 4 bytes
file name (variable size)
extra field (variable size)
file comment (variable size)
3. End Header(22byte: comment 제외)
end of central dir signature - 4 bytes - (0x06054b50) : 고유값
number of this disk - 2 bytes
number of the disk with the start of the central directory - 2 bytes
total number of entries in the central directory on this disk - 2 bytes
total number of entries in the central directory - 2 bytes
size of the central directory - 4 bytes
offset of start of central directory with respect to the starting disk number - 4 bytes
.ZIP file comment length - 2 bytes
.ZIP file comment (variable size)
*참고 사이트:
zip 알고리즘(Deflate) - http://ko.wikipedia.org/wiki/DEFLATE, http://en.wikipedia.org/wiki/DEFLATE
LZ 77 알고리즘 - http://home.postech.ac.kr/~ehoto/lz77.htm
ZIP File Format Specification - http://www.pkware.com/documents/casestudies/APPNOTE.TXT
zlib Home page - http://www.zlib.net/
Winimage.com minizip - http://www.winimage.com/zLibDll/minizip.html
Zlib Library Manual - http://kaistizen.net/project/Zip/Index.htm
Zlib 활용(글쓴이: 윤상배) - http://www.joinc.co.kr/modules/moniwiki/wiki.php/article/zlib_prog
ZLIB 사용하여 메모리에 압축 풀기 (0) | 2021.01.06 |
---|---|
Lempel-Ziv 알고리즘 (0) | 2018.09.04 |
GZIP 구조 (0) | 2017.10.14 |
Run Length Encoding(1) (0) | 2017.10.14 |
PKZIP 구조(1) (0) | 2016.01.19 |
댓글 영역