33 #if (ZLIB_VERNUM < 0x1270)
56 # define VERSIONMADEBY (0x031e)
60 #define Z_BUFSIZE (64*1024)
63 #ifndef Z_MAXFILENAMEINZIP
64 #define Z_MAXFILENAMEINZIP (256)
68 # define ALLOC(size) (malloc(size))
71 # define TRYFREE(p) {if (p) free(p);}
83 #define MAKEULONG64(a, b) ((ZPOS64_T)(((unsigned long)(a)) | ((ZPOS64_T)((unsigned long)(b))) << 32))
98 #if MAX_MEM_LEVEL >= 8
99 # define DEF_MEM_LEVEL 8
101 # define DEF_MEM_LEVEL MAX_MEM_LEVEL
104 const char zip_copyright[] =
" zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
107 #define SIZEDATA_INDATABLOCK (4096-(4*4))
109 #define LOCALHEADERMAGIC (0x04034b50)
110 #define DESCRIPTORHEADERMAGIC (0x08074b50)
111 #define CENTRALHEADERMAGIC (0x02014b50)
112 #define ENDHEADERMAGIC (0x06054b50)
113 #define ZIP64ENDHEADERMAGIC (0x6064b50)
114 #define ZIP64ENDLOCHEADERMAGIC (0x7064b50)
116 #define FLAG_LOCALHEADER_OFFSET (0x06)
117 #define CRC_LOCALHEADER_OFFSET (0x0e)
119 #define SIZECENTRALHEADER (0x2e)
166 unsigned long keys[3];
184 #ifndef NO_ADDFILEINEXISTINGZIP
194 #define INCLUDECRYPTINGCODE_IFCRYPTALLOWED
237 const unsigned char* from_copy;
250 from_copy = (
unsigned char*)buf;
256 unsigned char* to_copy;
270 copy_this = (uInt)len;
274 for (i=0;i<copy_this;i++)
275 *(to_copy+i)=*(from_copy+i);
279 from_copy += copy_this ;
289 #ifndef NO_ADDFILEINEXISTINGZIP
298 unsigned char buf[8];
300 for (n = 0; n < nbByte; n++)
302 buf[n] = (
unsigned char)(x & 0xff);
307 for (n = 0; n < nbByte; n++)
313 if (
ZWRITE64(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte)
322 unsigned char* buf=(
unsigned char*)dest;
324 for (n = 0; n < nbByte; n++) {
325 buf[n] = (
unsigned char)(x & 0xff);
331 for (n = 0; n < nbByte; n++)
343 uLong year = (uLong)ptm->
tm_year;
349 (uLong) (((ptm->
tm_mday) + (32 * (ptm->
tm_mon+1)) + (512 * year)) << 16) |
361 int err = (int)
ZREAD64(*pzlib_filefunc_def,filestream,&c,1);
369 if (
ZERROR64(*pzlib_filefunc_def,filestream))
480 #ifndef BUFREADCOMMENT
481 #define BUFREADCOMMENT (0x400)
501 uSizeFile =
ZTELL64(*pzlib_filefunc_def,filestream);
503 if (uMaxBack>uSizeFile)
504 uMaxBack = uSizeFile;
511 while (uBackRead<uMaxBack)
517 uBackRead = uMaxBack;
520 uReadPos = uSizeFile-uBackRead ;
527 if (
ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
530 for (i=(
int)uReadSize-3; (i--)>0;)
531 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
532 ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
534 uPosFound = uReadPos+i;
564 uSizeFile =
ZTELL64(*pzlib_filefunc_def,filestream);
566 if (uMaxBack>uSizeFile)
567 uMaxBack = uSizeFile;
574 while (uBackRead<uMaxBack)
580 uBackRead = uMaxBack;
583 uReadPos = uSizeFile-uBackRead ;
590 if (
ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
593 for (i=(
int)uReadSize-3; (i--)>0;)
596 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
598 uPosFound = uReadPos+i;
643 if (uL != 0x06064b50)
646 return relativeOffset;
661 uLong number_disk_with_CD;
671 int hasZIP64Record = 0;
679 else if(central_pos == 0)
727 if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0))
773 number_entry_CD = uL;
775 if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0))
779 size_central_dir = 0;
783 size_central_dir = uL;
786 offset_central_dir = 0;
790 offset_central_dir = uL;
798 if ((central_pos<offset_central_dir+size_central_dir) &&
822 byte_before_the_zipfile = central_pos - (offset_central_dir+size_central_dir);
826 ZPOS64_T size_central_dir_to_read = size_central_dir;
828 void* buf_read = (
void*)
ALLOC(buf_size);
832 while ((size_central_dir_to_read>0) && (err==
ZIP_OK))
835 if (read_this > size_central_dir_to_read)
836 read_this = size_central_dir_to_read;
844 size_central_dir_to_read-=read_this;
848 pziinit->
begin_pos = byte_before_the_zipfile;
869 ziinit.
flags = flags;
872 if (pzlib_filefunc64_32_def==NULL)
910 # ifndef NO_ADDFILEINEXISTINGZIP
926 # ifndef NO_ADDFILEINEXISTINGZIP
941 if (pzlib_filefunc32_def != NULL)
953 if (pzlib_filefunc_def != NULL)
956 zlib_filefunc64_32_def_fill.
zfile_func64 = *pzlib_filefunc_def;
978 uInt size_extrafield_local,
979 const void* extrafield_local,
980 uLong version_to_extract)
984 uInt size_filename = (uInt)strlen(filename);
985 uInt size_extrafield = size_extrafield_local;
1029 size_extrafield += 20;
1035 if ((err==
ZIP_OK) && (size_filename > 0))
1041 if ((err==
ZIP_OK) && (size_extrafield_local > 0))
1052 short DataSize = 16;
1078 const void* extrafield_local, uInt size_extrafield_local,
1079 const void* extrafield_global, uInt size_extrafield_global,
1080 const char* comment,
int method,
int level,
int raw,
1081 int windowBits,
int memLevel,
int strategy,
1082 const char* password, uLong crcForCrypting,
1083 uLong versionMadeBy, uLong flagBase,
int zip64)
1090 uLong version_to_extract;
1093 if (password != NULL)
1101 if ((method!=0) && (method!=Z_DEFLATED) && (method!=
Z_BZIP2ED))
1104 if ((method!=0) && (method!=Z_DEFLATED))
1121 version_to_extract = 10;
1125 version_to_extract = 20;
1134 size_comment = (uInt)strlen(comment);
1136 size_filename = (uInt)strlen(filename);
1149 if ((level==8) || (level==9))
1155 if (password != NULL)
1157 if (version_to_extract >= 20
1206 for (i=0;i<size_filename;i++)
1209 for (i=0;i<size_extrafield_global;i++)
1211 *(((
const char*)extrafield_global)+i);
1213 for (i=0;i<size_comment;i++)
1215 size_extrafield_global+i) = *(comment+i);
1225 extrafield_local, version_to_extract);
1228 zi->
ci.bstream.avail_in = (uInt)0;
1231 zi->
ci.bstream.total_in_hi32 = 0;
1232 zi->
ci.bstream.total_in_lo32 = 0;
1233 zi->
ci.bstream.total_out_hi32 = 0;
1234 zi->
ci.bstream.total_out_lo32 = 0;
1242 zi->
ci.
stream.data_type = Z_BINARY;
1252 zi->
ci.
stream.zalloc = (alloc_func)0;
1253 zi->
ci.
stream.zfree = (free_func)0;
1257 windowBits = -windowBits;
1259 err = deflateInit2(&zi->
ci.
stream, level, Z_DEFLATED, windowBits, memLevel, strategy);
1268 zi->
ci.bstream.bzalloc = 0;
1269 zi->
ci.bstream.bzfree = 0;
1270 zi->
ci.bstream.opaque = (voidpf)0;
1272 err = BZ2_bzCompressInit(&zi->
ci.bstream, level, 0,35);
1282 if ((err==Z_OK) && (password != NULL))
1284 unsigned char bufHead[RAND_HEAD_LEN];
1285 unsigned int sizeHead;
1289 if (crcForCrypting == 0) {
1290 crcForCrypting = (uLong)zi->
ci.
dosDate << 16;
1292 sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->
ci.
keys,zi->
ci.
pcrc_32_tab,crcForCrypting);
1306 const void* extrafield_local, uInt size_extrafield_local,
1307 const void* extrafield_global, uInt size_extrafield_global,
1308 const char* comment,
int method,
int level,
int raw,
1309 int windowBits,
int memLevel,
int strategy,
1310 const char* password, uLong crcForCrypting,
1311 uLong versionMadeBy, uLong flagBase)
1314 extrafield_local, size_extrafield_local,
1315 extrafield_global, size_extrafield_global,
1316 comment, method, level, raw,
1317 windowBits, memLevel, strategy,
1318 password, crcForCrypting, versionMadeBy, flagBase, 0);
1322 const void* extrafield_local, uInt size_extrafield_local,
1323 const void* extrafield_global, uInt size_extrafield_global,
1324 const char* comment,
int method,
int level,
int raw,
1325 int windowBits,
int memLevel,
int strategy,
1326 const char* password, uLong crcForCrypting)
1329 extrafield_local, size_extrafield_local,
1330 extrafield_global, size_extrafield_global,
1331 comment, method, level, raw,
1332 windowBits, memLevel, strategy,
1337 const void* extrafield_local, uInt size_extrafield_local,
1338 const void* extrafield_global, uInt size_extrafield_global,
1339 const char* comment,
int method,
int level,
int raw,
1340 int windowBits,
int memLevel,
int strategy,
1341 const char* password, uLong crcForCrypting,
int zip64)
1344 extrafield_local, size_extrafield_local,
1345 extrafield_global, size_extrafield_global,
1346 comment, method, level, raw,
1347 windowBits, memLevel, strategy,
1352 const void* extrafield_local, uInt size_extrafield_local,
1353 const void* extrafield_global, uInt size_extrafield_global,
1354 const char* comment,
int method,
int level,
int raw)
1357 extrafield_local, size_extrafield_local,
1358 extrafield_global, size_extrafield_global,
1359 comment, method, level, raw,
1365 const void* extrafield_local, uInt size_extrafield_local,
1366 const void* extrafield_global, uInt size_extrafield_global,
1367 const char* comment,
int method,
int level,
int raw,
int zip64)
1370 extrafield_local, size_extrafield_local,
1371 extrafield_global, size_extrafield_global,
1372 comment, method, level, raw,
1378 const void* extrafield_local, uInt size_extrafield_local,
1379 const void*extrafield_global, uInt size_extrafield_global,
1380 const char* comment,
int method,
int level,
int zip64)
1383 extrafield_local, size_extrafield_local,
1384 extrafield_global, size_extrafield_global,
1385 comment, method, level, 0,
1391 const void* extrafield_local, uInt size_extrafield_local,
1392 const void*extrafield_global, uInt size_extrafield_global,
1393 const char* comment,
int method,
int level)
1396 extrafield_local, size_extrafield_local,
1397 extrafield_global, size_extrafield_global,
1398 comment, method, level, 0,
1426 zi->
ci.bstream.total_in_lo32 = 0;
1427 zi->
ci.bstream.total_in_hi32 = 0;
1459 zi->
ci.bstream.next_in = (
void*)buf;
1460 zi->
ci.bstream.avail_in = len;
1463 while ((err==BZ_RUN_OK) && (zi->
ci.bstream.avail_in>0))
1465 if (zi->
ci.bstream.avail_out == 0)
1474 if(err != BZ_RUN_OK)
1479 uLong uTotalOutBefore_lo = zi->
ci.bstream.total_out_lo32;
1481 err=BZ2_bzCompress(&zi->
ci.bstream, BZ_RUN);
1487 if(err == BZ_RUN_OK)
1493 zi->
ci.
stream.next_in = (Bytef*)buf;
1512 uLong uTotalOutBefore = zi->
ci.
stream.total_out;
1513 err=deflate(&zi->
ci.
stream, Z_NO_FLUSH);
1514 if(uTotalOutBefore > zi->
ci.
stream.total_out)
1526 copy_this = zi->
ci.
stream.avail_in;
1528 copy_this = zi->
ci.
stream.avail_out;
1530 for (i = 0; i < copy_this; i++)
1531 *(((
char*)zi->
ci.
stream.next_out)+i) =
1532 *(((
const char*)zi->
ci.
stream.next_in)+i);
1534 zi->
ci.
stream.avail_in -= copy_this;
1535 zi->
ci.
stream.avail_out-= copy_this;
1537 zi->
ci.
stream.next_out+= copy_this;
1538 zi->
ci.
stream.total_in+= copy_this;
1539 zi->
ci.
stream.total_out+= copy_this;
1558 uLong invalidValue = 0xffffffff;
1574 uLong uTotalOutBefore;
1582 uTotalOutBefore = zi->
ci.
stream.total_out;
1583 err=deflate(&zi->
ci.
stream, Z_FINISH);
1591 while (err==BZ_FINISH_OK)
1593 uLong uTotalOutBefore;
1594 if (zi->
ci.bstream.avail_out == 0)
1601 uTotalOutBefore = zi->
ci.bstream.total_out_lo32;
1602 err=BZ2_bzCompress(&zi->
ci.bstream, BZ_FINISH);
1603 if(err == BZ_STREAM_END)
1609 if(err == BZ_FINISH_OK)
1614 if (err==Z_STREAM_END)
1625 int tmp_err = deflateEnd(&zi->
ci.
stream);
1633 int tmperr = BZ2_bzCompressEnd(&zi->
ci.bstream);
1652 if(compressed_size >= 0xffffffff || uncompressed_size >= 0xffffffff || zi->
ci.
pos_local_header >= 0xffffffff)
1664 if(compressed_size >= 0xffffffff)
1670 if (zi->
ci.
stream.data_type == Z_ASCII)
1673 if(uncompressed_size >= 0xffffffff)
1679 if(uncompressed_size >= 0xffffffff)
1683 if(compressed_size >= 0xffffffff)
1708 if(uncompressed_size >= 0xffffffff)
1714 if(compressed_size >= 0xffffffff)
1755 if(uncompressed_size >= 0xffffffff || compressed_size >= 0xffffffff)
1783 if ((zi->
ci.
flag & 8) != 0) {
1841 uLong Zip64DataSize = 44;
1913 if(pos >= 0xffffffff)
1927 uInt size_global_comment = 0;
1929 if(global_comment != NULL)
1930 size_global_comment = (uInt)strlen(global_comment);
1934 if (err ==
ZIP_OK && size_global_comment > 0)
1946 uLong size_centraldir = 0;
1960 #ifndef NO_ADDFILEINEXISTINGZIP
1961 if (global_comment==NULL)
2011 #ifndef NO_ADDFILEINEXISTINGZIP
2030 if(pData == NULL || *dataLen < 4)
2033 pNewHeader = (
char*)
ALLOC(*dataLen);
2036 while(p < (pData + *dataLen))
2038 header = *(
short*)p;
2039 dataSize = *(((
short*)p)+1);
2041 if( header == sHeader )
2048 memcpy(pTmp, p, dataSize + 4);
2050 size += dataSize + 4;
2058 memset(pData,0, *dataLen);
2062 memcpy(pData, pNewHeader, size);
2097 zi->
flags &= ~flags;
zipFile ZEXPORT zipOpen64(voidpf file, int append)
unsigned char data[(4096-(4 *4))]
struct linkedlist_datablock_internal_s linkedlist_datablock_internal
static void zip64local_putValue_inmemory(void *dest, ZPOS64_T x, int nbByte)
static int zip64local_getLong64(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)
Byte buffered_data[(64 *1024)]
#define ZIP64ENDLOCHEADERMAGIC
#define ZIP_WRITE_DATA_DESCRIPTOR
static int zip64local_getShort(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
linkedlist_datablock_internal * last_block
#define ZIP_INTERNALERROR
static int zip64local_getByte(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi)
void fill_qiodevice64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def)
#define SIZEDATA_INDATABLOCK
static void free_datablock(linkedlist_datablock_internal *ldi)
int ZEXPORT zipCloseFileInZipRaw64(zipFile file, ZPOS64_T uncompressed_size, uLong crc32)
int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw)
#define SIZECENTRALHEADER
int ZEXPORT zipOpenNewFileInZip3(zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting)
#define ZERROR64(filefunc, filestream)
#define APPEND_STATUS_CREATEAFTER
#define ZLIB_FILEFUNC_MODE_READ
int Write_EndOfCentralDirectoryRecord(zip64_internal *zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
ZPOS64_T pos_zip64extrainfo
int ZEXPORT zipRemoveExtraInfoBlock(char *pData, int *dataLen, short sHeader)
static linkedlist_datablock_internal * allocate_new_datablock()
ZPOS64_T totalCompressedData
struct linkedlist_data_s linkedlist_data
#define ZIP_DEFAULT_FLAGS
uLong size_centralExtraFree
zlib_filefunc64_def zfile_func64
tell_file_func ztell32_file
zipFile ZEXPORT zipOpen2_64(voidpf file, int append, zipcharpc *globalcomment, zlib_filefunc64_def *pzlib_filefunc_def)
int ZEXPORT zipCloseFileInZipRaw(zipFile file, uLong uncompressed_size, uLong crc32)
int ZEXPORT zipOpenNewFileInZip64(zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int zip64)
uLong filled_in_this_block
uInt pos_in_buffered_data
void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def *p_filefunc64_32, const zlib_filefunc_def *p_filefunc32)
int ZEXPORT zipWriteInFileInZip(zipFile file, const void *buf, unsigned int len)
zipFile ZEXPORT zipOpen3(voidpf file, int append, zipcharpc *globalcomment, zlib_filefunc64_32_def *pzlib_filefunc64_32_def, unsigned flags)
int ZEXPORT zipSetFlags(zipFile file, unsigned flags)
#define DESCRIPTORHEADERMAGIC
static void free_linkedlist(linkedlist_data *ll)
static ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
static int zip64local_getLong(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
#define ZCLOSE64(filefunc, filestream)
#define ZFAKECLOSE64(filefunc, filestream)
const z_crc_t FAR * pcrc_32_tab
#define ZREAD64(filefunc, filestream, buf, size)
#define ZOPEN64(filefunc, filename, mode)
ZPOS64_T add_position_when_writting_offset
static uLong zip64local_TmzDateToDosDate(const tm_zip *ptm)
int LoadCentralDirectoryRecord(zip64_internal *pziinit)
int Write_LocalFileHeader(zip64_internal *zi, const char *filename, uInt size_extrafield_local, const void *extrafield_local, uLong version_to_extract)
linkedlist_data central_dir
uLong avail_in_this_block
#define zencode(pkeys, pcrc_32_tab, c, t)
#define ZLIB_FILEFUNC_MODE_CREATE
unsigned long long int ZPOS64_T
#define ZLIB_FILEFUNC_MODE_EXISTING
#define ZIP64ENDHEADERMAGIC
zlib_filefunc64_32_def z_filefunc
#define ZTELL64(filefunc, filestream)
static void init_linkedlist(linkedlist_data *ll)
int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal *zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
int ZEXPORT zipOpenNewFileInZip(zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level)
int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting, int zip64)
zipFile ZEXPORT zipOpen(voidpf file, int append)
int Write_GlobalComment(zip64_internal *zi, const char *global_comment)
static int zip64FlushWriteBuffer(zip64_internal *zi)
seek_file_func zseek32_file
int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal *zi, ZPOS64_T zip64eocd_pos_inzip)
zipFile ZEXPORT zipOpen2(voidpf file, int append, zipcharpc *globalcomment, zlib_filefunc_def *pzlib_filefunc32_def)
int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int zip64)
#define ZLIB_FILEFUNC_MODE_WRITE
#define ZSEEK64(filefunc, filestream, pos, mode)
int ZEXPORT zipCloseFileInZip(zipFile file)
struct linkedlist_datablock_internal_s * next_datablock
#define ZLIB_FILEFUNC_SEEK_END
int ZEXPORT zipOpenNewFileInZip4(zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase)
static ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase, int zip64)
static int add_data_in_datablock(linkedlist_data *ll, const void *buf, uLong len)
#define APPEND_STATUS_ADDINZIP
ZPOS64_T totalUncompressedData
linkedlist_datablock_internal * first_block
const char zip_copyright[]
#define ZLIB_FILEFUNC_SEEK_SET
int ZEXPORT zipClearFlags(zipFile file, unsigned flags)
#define APPEND_STATUS_CREATE
int ZEXPORT zipClose(zipFile file, const char *global_comment)
#define ZWRITE64(filefunc, filestream, buf, size)
#define CENTRALHEADERMAGIC
static int zip64local_putValue(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte)
ZPOS64_T pos_local_header