extrafld.txt 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372
  1. The following are the known types of zipfile extra fields as of this
  2. writing. Extra fields are documented in PKWARE's appnote.txt and are
  3. intended to allow for backward- and forward-compatible extensions to
  4. the zipfile format. Multiple extra-field types may be chained together,
  5. provided that the total length of all extra-field data is less than 64KB.
  6. (In fact, PKWARE requires that the total length of the entire file header,
  7. including timestamp, file attributes, filename, comment, extra field, etc.,
  8. be no more than 64KB.)
  9. Each extra-field type (or subblock) must contain a four-byte header con-
  10. sisting of a two-byte header ID and a two-byte length (little-endian) for
  11. the remaining data in the subblock. If there are additional subblocks
  12. within the extra field, the header for each one will appear immediately
  13. following the data for the previous subblock (i.e., with no padding for
  14. alignment).
  15. All integer fields in the descriptions below are in little-endian (Intel)
  16. format unless otherwise specified. Note that "Short" means two bytes,
  17. "Long" means four bytes, and "Long-Long" means eight bytes, regardless
  18. of their native sizes. Unless specifically noted, all integer fields should
  19. be interpreted as unsigned (non-negative) numbers.
  20. Christian Spieler, 20010517
  21. Updated to include the Unicode extra fields. Added new Unix extra field.
  22. Ed Gordon, 20060819, 20070607, 20070909, 20080426, 20080509
  23. -------------------------
  24. Header ID's of 0 thru 31 are reserved for use by PKWARE.
  25. The remaining ID's can be used by third party vendors for
  26. proprietary usage.
  27. The current Header ID mappings defined by PKWARE are:
  28. 0x0001 ZIP64 extended information extra field
  29. 0x0007 AV Info
  30. 0x0009 OS/2 extended attributes (also Info-ZIP)
  31. 0x000a NTFS (Win9x/WinNT FileTimes)
  32. 0x000c OpenVMS (also Info-ZIP)
  33. 0x000d Unix
  34. 0x000f Patch Descriptor
  35. 0x0014 PKCS#7 Store for X.509 Certificates
  36. 0x0015 X.509 Certificate ID and Signature for
  37. individual file
  38. 0x0016 X.509 Certificate ID for Central Directory
  39. The Header ID mappings defined by Info-ZIP and third parties are:
  40. 0x0065 IBM S/390 attributes - uncompressed
  41. 0x0066 IBM S/390 attributes - compressed
  42. 0x07c8 Info-ZIP Macintosh (old, J. Lee)
  43. 0x2605 ZipIt Macintosh (first version)
  44. 0x2705 ZipIt Macintosh v 1.3.5 and newer (w/o full filename)
  45. 0x334d Info-ZIP Macintosh (new, D. Haase's 'Mac3' field )
  46. 0x4154 Tandem NSK
  47. 0x4341 Acorn/SparkFS (David Pilling)
  48. 0x4453 Windows NT security descriptor (binary ACL)
  49. 0x4704 VM/CMS
  50. 0x470f MVS
  51. 0x4854 Theos, old inofficial port
  52. 0x4b46 FWKCS MD5 (see below)
  53. 0x4c41 OS/2 access control list (text ACL)
  54. 0x4d49 Info-ZIP OpenVMS (obsolete)
  55. 0x4d63 Macintosh SmartZIP, by Macro Bambini
  56. 0x4f4c Xceed original location extra field
  57. 0x5356 AOS/VS (binary ACL)
  58. 0x5455 extended timestamp
  59. 0x5855 Info-ZIP Unix (original; also OS/2, NT, etc.)
  60. 0x554e Xceed unicode extra field
  61. 0x6375 Info-ZIP Unicode Comment
  62. 0x6542 BeOS (BeBox, PowerMac, etc.)
  63. 0x6854 Theos
  64. 0x7075 Info-ZIP Unicode Path
  65. 0x756e ASi Unix
  66. 0x7855 Info-ZIP Unix (previous new)
  67. 0x7875 Info-ZIP Unix (new)
  68. 0xfb4a SMS/QDOS
  69. The following are detailed descriptions of the known extra-field block types:
  70. -OS/2 Extended Attributes Extra Field:
  71. ====================================
  72. The following is the layout of the OS/2 extended attributes "extra"
  73. block. (Last Revision 19960922)
  74. Note: all fields stored in Intel low-byte/high-byte order.
  75. Local-header version:
  76. Value Size Description
  77. ----- ---- -----------
  78. (OS/2) 0x0009 Short tag for this extra block type
  79. TSize Short total data size for this block
  80. BSize Long uncompressed EA data size
  81. CType Short compression type
  82. EACRC Long CRC value for uncompressed EA data
  83. (var.) variable compressed EA data
  84. Central-header version:
  85. Value Size Description
  86. ----- ---- -----------
  87. (OS/2) 0x0009 Short tag for this extra block type
  88. TSize Short total data size for this block (4)
  89. BSize Long size of uncompressed local EA data
  90. The value of CType is interpreted according to the "compression
  91. method" section above; i.e., 0 for stored, 8 for deflated, etc.
  92. The OS/2 extended attribute structure (FEA2LIST) is compressed and
  93. then stored in its entirety within this structure. There will only
  94. ever be one block of data in the variable-length field.
  95. -OS/2 Access Control List Extra Field:
  96. ====================================
  97. The following is the layout of the OS/2 ACL extra block.
  98. (Last Revision 19960922)
  99. Local-header version:
  100. Value Size Description
  101. ----- ---- -----------
  102. (ACL) 0x4c41 Short tag for this extra block type ("AL")
  103. TSize Short total data size for this block
  104. BSize Long uncompressed ACL data size
  105. CType Short compression type
  106. EACRC Long CRC value for uncompressed ACL data
  107. (var.) variable compressed ACL data
  108. Central-header version:
  109. Value Size Description
  110. ----- ---- -----------
  111. (ACL) 0x4c41 Short tag for this extra block type ("AL")
  112. TSize Short total data size for this block (4)
  113. BSize Long size of uncompressed local ACL data
  114. The value of CType is interpreted according to the "compression
  115. method" section above; i.e., 0 for stored, 8 for deflated, etc.
  116. The uncompressed ACL data consist of a text header of the form
  117. "ACL1:%hX,%hd\n", where the first field is the OS/2 ACCINFO acc_attr
  118. member and the second is acc_count, followed by acc_count strings
  119. of the form "%s,%hx\n", where the first field is acl_ugname (user
  120. group name) and the second acl_access. This block type will be
  121. extended for other operating systems as needed.
  122. -Windows NT Security Descriptor Extra Field:
  123. ==========================================
  124. The following is the layout of the NT Security Descriptor (another
  125. type of ACL) extra block. (Last Revision 19960922)
  126. Local-header version:
  127. Value Size Description
  128. ----- ---- -----------
  129. (SD) 0x4453 Short tag for this extra block type ("SD")
  130. TSize Short total data size for this block
  131. BSize Long uncompressed SD data size
  132. Version Byte version of uncompressed SD data format
  133. CType Short compression type
  134. EACRC Long CRC value for uncompressed SD data
  135. (var.) variable compressed SD data
  136. Central-header version:
  137. Value Size Description
  138. ----- ---- -----------
  139. (SD) 0x4453 Short tag for this extra block type ("SD")
  140. TSize Short total data size for this block (4)
  141. BSize Long size of uncompressed local SD data
  142. The value of CType is interpreted according to the "compression
  143. method" section above; i.e., 0 for stored, 8 for deflated, etc.
  144. Version specifies how the compressed data are to be interpreted
  145. and allows for future expansion of this extra field type. Currently
  146. only version 0 is defined.
  147. For version 0, the compressed data are to be interpreted as a single
  148. valid Windows NT SECURITY_DESCRIPTOR data structure, in self-relative
  149. format.
  150. -PKWARE Win95/WinNT Extra Field:
  151. ==============================
  152. The following description covers PKWARE's "NTFS" attributes
  153. "extra" block, introduced with the release of PKZIP 2.50 for
  154. Windows. (Last Revision 20001118)
  155. (Note: At this time the Mtime, Atime and Ctime values may
  156. be used on any WIN32 system.)
  157. [Info-ZIP note: In the current implementations, this field has
  158. a fixed total data size of 32 bytes and is only stored as local
  159. extra field.]
  160. Value Size Description
  161. ----- ---- -----------
  162. (NTFS) 0x000a Short Tag for this "extra" block type
  163. TSize Short Total Data Size for this block
  164. Reserved Long for future use
  165. Tag1 Short NTFS attribute tag value #1
  166. Size1 Short Size of attribute #1, in bytes
  167. (var.) SubSize1 Attribute #1 data
  168. .
  169. .
  170. .
  171. TagN Short NTFS attribute tag value #N
  172. SizeN Short Size of attribute #N, in bytes
  173. (var.) SubSize1 Attribute #N data
  174. For NTFS, values for Tag1 through TagN are as follows:
  175. (currently only one set of attributes is defined for NTFS)
  176. Tag Size Description
  177. ----- ---- -----------
  178. 0x0001 2 bytes Tag for attribute #1
  179. Size1 2 bytes Size of attribute #1, in bytes (24)
  180. Mtime 8 bytes 64-bit NTFS file last modification time
  181. Atime 8 bytes 64-bit NTFS file last access time
  182. Ctime 8 bytes 64-bit NTFS file creation time
  183. The total length for this block is 28 bytes, resulting in a
  184. fixed size value of 32 for the TSize field of the NTFS block.
  185. The NTFS filetimes are 64-bit unsigned integers, stored in Intel
  186. (least significant byte first) byte order. They determine the
  187. number of 1.0E-07 seconds (1/10th microseconds!) past WinNT "epoch",
  188. which is "01-Jan-1601 00:00:00 UTC".
  189. -PKWARE OpenVMS Extra Field:
  190. ==========================
  191. The following is the layout of PKWARE's OpenVMS attributes "extra"
  192. block. (Last Revision 12/17/91)
  193. Note: all fields stored in Intel low-byte/high-byte order.
  194. Value Size Description
  195. ----- ---- -----------
  196. (VMS) 0x000c Short Tag for this "extra" block type
  197. TSize Short Total Data Size for this block
  198. CRC Long 32-bit CRC for remainder of the block
  199. Tag1 Short OpenVMS attribute tag value #1
  200. Size1 Short Size of attribute #1, in bytes
  201. (var.) Size1 Attribute #1 data
  202. .
  203. .
  204. .
  205. TagN Short OpenVMS attribute tage value #N
  206. SizeN Short Size of attribute #N, in bytes
  207. (var.) SizeN Attribute #N data
  208. Rules:
  209. 1. There will be one or more of attributes present, which
  210. will each be preceded by the above TagX & SizeX values.
  211. These values are identical to the ATR$C_XXXX and
  212. ATR$S_XXXX constants which are defined in ATR.H under
  213. OpenVMS C. Neither of these values will ever be zero.
  214. 2. No word alignment or padding is performed.
  215. 3. A well-behaved PKZIP/OpenVMS program should never produce
  216. more than one sub-block with the same TagX value. Also,
  217. there will never be more than one "extra" block of type
  218. 0x000c in a particular directory record.
  219. -Info-ZIP VMS Extra Field:
  220. ========================
  221. The following is the layout of Info-ZIP's VMS attributes extra
  222. block for VAX or Alpha AXP. The local-header and central-header
  223. versions are identical. (Last Revision 19960922)
  224. Value Size Description
  225. ----- ---- -----------
  226. (VMS2) 0x4d49 Short tag for this extra block type ("JM")
  227. TSize Short total data size for this block
  228. ID Long block ID
  229. Flags Short info bytes
  230. BSize Short uncompressed block size
  231. Reserved Long (reserved)
  232. (var.) variable compressed VMS file-attributes block
  233. The block ID is one of the following unterminated strings:
  234. "VFAB" struct FAB
  235. "VALL" struct XABALL
  236. "VFHC" struct XABFHC
  237. "VDAT" struct XABDAT
  238. "VRDT" struct XABRDT
  239. "VPRO" struct XABPRO
  240. "VKEY" struct XABKEY
  241. "VMSV" version (e.g., "V6.1"; truncated at hyphen)
  242. "VNAM" reserved
  243. The lower three bits of Flags indicate the compression method. The
  244. currently defined methods are:
  245. 0 stored (not compressed)
  246. 1 simple "RLE"
  247. 2 deflated
  248. The "RLE" method simply replaces zero-valued bytes with zero-valued
  249. bits and non-zero-valued bytes with a "1" bit followed by the byte
  250. value.
  251. The variable-length compressed data contains only the data corre-
  252. sponding to the indicated structure or string. Typically multiple
  253. VMS2 extra fields are present (each with a unique block type).
  254. -Info-ZIP Macintosh Extra Field:
  255. ==============================
  256. The following is the layout of the (old) Info-ZIP resource-fork extra
  257. block for Macintosh. The local-header and central-header versions
  258. are identical. (Last Revision 19960922)
  259. Value Size Description
  260. ----- ---- -----------
  261. (Mac) 0x07c8 Short tag for this extra block type
  262. TSize Short total data size for this block
  263. "JLEE" beLong extra-field signature
  264. FInfo 16 bytes Macintosh FInfo structure
  265. CrDat beLong HParamBlockRec fileParam.ioFlCrDat
  266. MdDat beLong HParamBlockRec fileParam.ioFlMdDat
  267. Flags beLong info bits
  268. DirID beLong HParamBlockRec fileParam.ioDirID
  269. VolName 28 bytes volume name (optional)
  270. All fields but the first two are in native Macintosh format
  271. (big-endian Motorola order, not little-endian Intel). The least
  272. significant bit of Flags is 1 if the file is a data fork, 0 other-
  273. wise. In addition, if this extra field is present, the filename
  274. has an extra 'd' or 'r' appended to indicate data fork or resource
  275. fork. The 28-byte VolName field may be omitted.
  276. -ZipIt Macintosh Extra Field (long):
  277. ==================================
  278. The following is the layout of the ZipIt extra block for Macintosh.
  279. The local-header and central-header versions are identical.
  280. (Last Revision 19970130)
  281. Value Size Description
  282. ----- ---- -----------
  283. (Mac2) 0x2605 Short tag for this extra block type
  284. TSize Short total data size for this block
  285. "ZPIT" beLong extra-field signature
  286. FnLen Byte length of FileName
  287. FileName variable full Macintosh filename
  288. FileType Byte[4] four-byte Mac file type string
  289. Creator Byte[4] four-byte Mac creator string
  290. -ZipIt Macintosh Extra Field (short):
  291. ===================================
  292. The following is the layout of a shortened variant of the
  293. ZipIt extra block for Macintosh (without "full name" entry).
  294. This variant is used by ZipIt 1.3.5 and newer for entries that
  295. do not need a "full Mac filename" record.
  296. The local-header and central-header versions are identical.
  297. (Last Revision 19980903)
  298. Value Size Description
  299. ----- ---- -----------
  300. (Mac2b) 0x2705 Short tag for this extra block type
  301. TSize Short total data size for this block (12)
  302. "ZPIT" beLong extra-field signature
  303. FileType Byte[4] four-byte Mac file type string
  304. Creator Byte[4] four-byte Mac creator string
  305. -Info-ZIP Macintosh Extra Field (new):
  306. ====================================
  307. The following is the layout of the (new) Info-ZIP extra
  308. block for Macintosh, designed by Dirk Haase.
  309. All values are in little-endian.
  310. (Last Revision 19981005)
  311. Local-header version:
  312. Value Size Description
  313. ----- ---- -----------
  314. (Mac3) 0x334d Short tag for this extra block type ("M3")
  315. TSize Short total data size for this block
  316. BSize Long uncompressed finder attribute data size
  317. Flags Short info bits
  318. fdType Byte[4] Type of the File (4-byte string)
  319. fdCreator Byte[4] Creator of the File (4-byte string)
  320. (CType) Short compression type
  321. (CRC) Long CRC value for uncompressed MacOS data
  322. Attribs variable finder attribute data (see below)
  323. Central-header version:
  324. Value Size Description
  325. ----- ---- -----------
  326. (Mac3) 0x334d Short tag for this extra block type ("M3")
  327. TSize Short total data size for this block
  328. BSize Long uncompressed finder attribute data size
  329. Flags Short info bits
  330. fdType Byte[4] Type of the File (4-byte string)
  331. fdCreator Byte[4] Creator of the File (4-byte string)
  332. The third bit of Flags in both headers indicates whether
  333. the LOCAL extra field is uncompressed (and therefore whether CType
  334. and CRC are omitted):
  335. Bits of the Flags:
  336. bit 0 if set, file is a data fork; otherwise unset
  337. bit 1 if set, filename will be not changed
  338. bit 2 if set, Attribs is uncompressed (no CType, CRC)
  339. bit 3 if set, date and times are in 64 bit
  340. if zero date and times are in 32 bit.
  341. bit 4 if set, timezone offsets fields for the native
  342. Mac times are omitted (UTC support deactivated)
  343. bits 5-15 reserved;
  344. Attributes:
  345. Attribs is a Mac-specific block of data in little-endian format with
  346. the following structure (if compressed, uncompress it first):
  347. Value Size Description
  348. ----- ---- -----------
  349. fdFlags Short Finder Flags
  350. fdLocation.v Short Finder Icon Location
  351. fdLocation.h Short Finder Icon Location
  352. fdFldr Short Folder containing file
  353. FXInfo 16 bytes Macintosh FXInfo structure
  354. FXInfo-Structure:
  355. fdIconID Short
  356. fdUnused[3] Short unused but reserved 6 bytes
  357. fdScript Byte Script flag and number
  358. fdXFlags Byte More flag bits
  359. fdComment Short Comment ID
  360. fdPutAway Long Home Dir ID
  361. FVersNum Byte file version number
  362. may be not used by MacOS
  363. ACUser Byte directory access rights
  364. FlCrDat ULong date and time of creation
  365. FlMdDat ULong date and time of last modification
  366. FlBkDat ULong date and time of last backup
  367. These time numbers are original Mac FileTime values (local time!).
  368. Currently, date-time width is 32-bit, but future version may
  369. support be 64-bit times (see flags)
  370. CrGMTOffs Long(signed!) difference "local Creat. time - UTC"
  371. MdGMTOffs Long(signed!) difference "local Modif. time - UTC"
  372. BkGMTOffs Long(signed!) difference "local Backup time - UTC"
  373. These "local time - UTC" differences (stored in seconds) may be
  374. used to support timestamp adjustment after inter-timezone transfer.
  375. These fields are optional; bit 4 of the flags word controls their
  376. presence.
  377. Charset Short TextEncodingBase (Charset)
  378. valid for the following two fields
  379. FullPath variable Path of the current file.
  380. Zero terminated string (C-String)
  381. Currently coded in the native Charset.
  382. Comment variable Finder Comment of the current file.
  383. Zero terminated string (C-String)
  384. Currently coded in the native Charset.
  385. -SmartZIP Macintosh Extra Field:
  386. ====================================
  387. The following is the layout of the SmartZIP extra
  388. block for Macintosh, designed by Marco Bambini.
  389. Local-header version:
  390. Value Size Description
  391. ----- ---- -----------
  392. 0x4d63 Short tag for this extra block type ("cM")
  393. TSize Short total data size for this block (64)
  394. "dZip" beLong extra-field signature
  395. fdType Byte[4] Type of the File (4-byte string)
  396. fdCreator Byte[4] Creator of the File (4-byte string)
  397. fdFlags beShort Finder Flags
  398. fdLocation.v beShort Finder Icon Location
  399. fdLocation.h beShort Finder Icon Location
  400. fdFldr beShort Folder containing file
  401. CrDat beLong HParamBlockRec fileParam.ioFlCrDat
  402. MdDat beLong HParamBlockRec fileParam.ioFlMdDat
  403. frScroll.v Byte vertical pos. of folder's scroll bar
  404. fdScript Byte Script flag and number
  405. frScroll.h Byte horizontal pos. of folder's scroll bar
  406. fdXFlags Byte More flag bits
  407. FileName Byte[32] full Macintosh filename (pascal string)
  408. All fields but the first two are in native Macintosh format
  409. (big-endian Motorola order, not little-endian Intel).
  410. The extra field size is fixed to 64 bytes.
  411. The local-header and central-header versions are identical.
  412. -Acorn SparkFS Extra Field:
  413. =========================
  414. The following is the layout of David Pilling's SparkFS extra block
  415. for Acorn RISC OS. The local-header and central-header versions are
  416. identical. (Last Revision 19960922)
  417. Value Size Description
  418. ----- ---- -----------
  419. (Acorn) 0x4341 Short tag for this extra block type ("AC")
  420. TSize Short total data size for this block (20)
  421. "ARC0" Long extra-field signature
  422. LoadAddr Long load address or file type
  423. ExecAddr Long exec address
  424. Attr Long file permissions
  425. Zero Long reserved; always zero
  426. The following bits of Attr are associated with the given file
  427. permissions:
  428. bit 0 user-writable ('W')
  429. bit 1 user-readable ('R')
  430. bit 2 reserved
  431. bit 3 locked ('L')
  432. bit 4 publicly writable ('w')
  433. bit 5 publicly readable ('r')
  434. bit 6 reserved
  435. bit 7 reserved
  436. -VM/CMS Extra Field:
  437. ==================
  438. The following is the layout of the file-attributes extra block for
  439. VM/CMS. The local-header and central-header versions are
  440. identical. (Last Revision 19960922)
  441. Value Size Description
  442. ----- ---- -----------
  443. (VM/CMS) 0x4704 Short tag for this extra block type
  444. TSize Short total data size for this block
  445. flData variable file attributes data
  446. flData is an uncompressed fldata_t struct.
  447. -MVS Extra Field:
  448. ===============
  449. The following is the layout of the file-attributes extra block for
  450. MVS. The local-header and central-header versions are identical.
  451. (Last Revision 19960922)
  452. Value Size Description
  453. ----- ---- -----------
  454. (MVS) 0x470f Short tag for this extra block type
  455. TSize Short total data size for this block
  456. flData variable file attributes data
  457. flData is an uncompressed fldata_t struct.
  458. -PKWARE Unix Extra Field:
  459. ========================
  460. The following is the layout of PKWARE's Unix "extra" block.
  461. It was introduced with the release of PKZIP for Unix 2.50.
  462. Note: all fields are stored in Intel low-byte/high-byte order.
  463. (Last Revision 19980901)
  464. This field has a minimum data size of 12 bytes and is only stored
  465. as local extra field.
  466. Value Size Description
  467. ----- ---- -----------
  468. (Unix0) 0x000d Short Tag for this "extra" block type
  469. TSize Short Total Data Size for this block
  470. AcTime Long time of last access (UTC/GMT)
  471. ModTime Long time of last modification (UTC/GMT)
  472. UID Short Unix user ID
  473. GID Short Unix group ID
  474. (var) variable Variable length data field
  475. The variable length data field will contain file type
  476. specific data. Currently the only values allowed are
  477. the original "linked to" file names for hard or symbolic
  478. links, and the major and minor device node numbers for
  479. character and block device nodes. Since device nodes
  480. cannot be either symbolic or hard links, only one set of
  481. variable length data is stored. Link files will have the
  482. name of the original file stored. This name is NOT NULL
  483. terminated. Its size can be determined by checking TSize -
  484. 12. Device entries will have eight bytes stored as two 4
  485. byte entries (in little-endian format). The first entry
  486. will be the major device number, and the second the minor
  487. device number.
  488. [Info-ZIP note: The fixed part of this field has the same layout as
  489. Info-ZIP's abandoned "Unix1 timestamps & owner ID info" extra field;
  490. only the two tag bytes are different.]
  491. -PATCH Descriptor Extra Field:
  492. ============================
  493. The following is the layout of the Patch Descriptor "extra"
  494. block.
  495. Note: all fields stored in Intel low-byte/high-byte order.
  496. Value Size Description
  497. ----- ---- -----------
  498. (Patch) 0x000f Short Tag for this "extra" block type
  499. TSize Short Size of the total "extra" block
  500. Version Short Version of the descriptor
  501. Flags Long Actions and reactions (see below)
  502. OldSize Long Size of the file about to be patched
  503. OldCRC Long 32-bit CRC of the file about to be patched
  504. NewSize Long Size of the resulting file
  505. NewCRC Long 32-bit CRC of the resulting file
  506. Actions and reactions
  507. Bits Description
  508. ---- ----------------
  509. 0 Use for autodetection
  510. 1 Treat as selfpatch
  511. 2-3 RESERVED
  512. 4-5 Action (see below)
  513. 6-7 RESERVED
  514. 8-9 Reaction (see below) to absent file
  515. 10-11 Reaction (see below) to newer file
  516. 12-13 Reaction (see below) to unknown file
  517. 14-15 RESERVED
  518. 16-31 RESERVED
  519. Actions
  520. Action Value
  521. ------ -----
  522. none 0
  523. add 1
  524. delete 2
  525. patch 3
  526. Reactions
  527. Reaction Value
  528. -------- -----
  529. ask 0
  530. skip 1
  531. ignore 2
  532. fail 3
  533. -PKCS#7 Store for X.509 Certificates:
  534. ===================================
  535. This field is contains the information about each
  536. certificate a file is signed with. This field should only
  537. appear in the first central directory record, and will be
  538. ignored in any other record.
  539. Note: all fields stored in Intel low-byte/high-byte order.
  540. Value Size Description
  541. ----- ---- -----------
  542. (Store) 0x0014 2 bytes Tag for this "extra" block type
  543. SSize 2 bytes Size of the store data
  544. SData (variable) Data about the store
  545. SData
  546. Value Size Description
  547. ----- ---- -----------
  548. Version 2 bytes Version number, 0x0001 for now
  549. StoreD (variable) Actual store data
  550. The StoreD member is suitable for passing as the pbData
  551. member of a CRYPT_DATA_BLOB to the CertOpenStore() function
  552. in Microsoft's CryptoAPI. The SSize member above will be
  553. cbData + 6, where cbData is the cbData member of the same
  554. CRYPT_DATA_BLOB. The encoding type to pass to
  555. CertOpenStore() should be
  556. PKCS_7_ANS_ENCODING | X509_ASN_ENCODING.
  557. -X.509 Certificate ID and Signature for individual file:
  558. ======================================================
  559. This field contains the information about which certificate
  560. in the PKCS#7 Store was used to sign the particular file.
  561. It also contains the signature data. This field can appear
  562. multiple times, but can only appear once per certificate.
  563. Note: all fields stored in Intel low-byte/high-byte order.
  564. Value Size Description
  565. ----- ---- -----------
  566. (CID) 0x0015 2 bytes Tag for this "extra" block type
  567. CSize 2 bytes Size of Method
  568. Method (variable)
  569. Method
  570. Value Size Description
  571. ----- ---- -----------
  572. Version 2 bytes Version number, for now 0x0001
  573. AlgID 2 bytes Algorithm ID used for signing
  574. IDSize 2 bytes Size of Certificate ID data
  575. CertID (variable) Certificate ID data
  576. SigSize 2 bytes Size of Signature data
  577. Sig (variable) Signature data
  578. CertID
  579. Value Size Description
  580. ----- ---- -----------
  581. Size1 4 bytes Size of CertID, should be (IDSize - 4)
  582. Size1 4 bytes A bug in version one causes this value
  583. to appear twice.
  584. IssSize 4 bytes Issuer data size
  585. Issuer (variable) Issuer data
  586. SerSize 4 bytes Serial Number size
  587. Serial (variable) Serial Number data
  588. The Issuer and IssSize members are suitable for creating a
  589. CRYPT_DATA_BLOB to be the Issuer member of a CERT_INFO
  590. struct. The Serial and SerSize members would be the
  591. SerialNumber member of the same CERT_INFO struct. This
  592. struct would be used to find the certificate in the store
  593. the file was signed with. Those structures are from the MS
  594. CryptoAPI.
  595. Sig and SigSize are the actual signature data and size
  596. generated by signing the file with the MS CryptoAPI using a
  597. hash created with the given AlgID.
  598. -X.509 Certificate ID and Signature for central directory:
  599. ========================================================
  600. This field contains the information about which certificate
  601. in the PKCS#7 Store was used to sign the central directory.
  602. It should only appear with the first central directory
  603. record, along with the store. The data structure is the
  604. same as the CID, except that SigSize will be 0, and there
  605. will be no Sig member.
  606. This field is also kept after the last central directory
  607. record, as the signature data (ID 0x05054b50, it looks like
  608. a central directory record of a different type). This
  609. second copy of the data is the Signature Data member of the
  610. record, and will have a SigSize that is non-zero, and will
  611. have Sig data.
  612. Note: all fields stored in Intel low-byte/high-byte order.
  613. Value Size Description
  614. ----- ---- -----------
  615. (CDID) 0x0016 2 bytes Tag for this "extra" block type
  616. CSize 2 bytes Size of Method
  617. Method (variable)
  618. -ZIP64 Extended Information Extra Field:
  619. ======================================
  620. The following is the layout of the ZIP64 extended
  621. information "extra" block. If one of the size or
  622. offset fields in the Local or Central directory
  623. record is too small to hold the required data,
  624. a ZIP64 extended information record is created.
  625. The order of the fields in the ZIP64 extended
  626. information record is fixed, but the fields will
  627. only appear if the corresponding Local or Central
  628. directory record field is set to 0xFFFF or 0xFFFFFFFF.
  629. Note: all fields stored in Intel low-byte/high-byte order.
  630. Value Size Description
  631. ----- ---- -----------
  632. (ZIP64) 0x0001 2 bytes Tag for this "extra" block type
  633. Size 2 bytes Size of this "extra" block
  634. Original
  635. Size 8 bytes Original uncompresseed file size
  636. Compressed
  637. Size 8 bytes Size of compressed data
  638. Relative Header
  639. Offset 8 bytes Offset of local header record
  640. Disk Start
  641. Number 4 bytes Number of the disk on which
  642. this file starts
  643. This entry in the Local header must include BOTH original
  644. and compressed file sizes.
  645. -Extended Timestamp Extra Field:
  646. ==============================
  647. The following is the layout of the extended-timestamp extra block.
  648. (Last Revision 19970118)
  649. Local-header version:
  650. Value Size Description
  651. ----- ---- -----------
  652. (time) 0x5455 Short tag for this extra block type ("UT")
  653. TSize Short total data size for this block
  654. Flags Byte info bits
  655. (ModTime) Long time of last modification (UTC/GMT)
  656. (AcTime) Long time of last access (UTC/GMT)
  657. (CrTime) Long time of original creation (UTC/GMT)
  658. Central-header version:
  659. Value Size Description
  660. ----- ---- -----------
  661. (time) 0x5455 Short tag for this extra block type ("UT")
  662. TSize Short total data size for this block
  663. Flags Byte info bits (refers to local header!)
  664. (ModTime) Long time of last modification (UTC/GMT)
  665. The central-header extra field contains the modification time only,
  666. or no timestamp at all. TSize is used to flag its presence or
  667. absence. But note:
  668. If "Flags" indicates that Modtime is present in the local header
  669. field, it MUST be present in the central header field, too!
  670. This correspondence is required because the modification time
  671. value may be used to support trans-timezone freshening and
  672. updating operations with zip archives.
  673. The time values are in standard Unix signed-long format, indicating
  674. the number of seconds since 1 January 1970 00:00:00. The times
  675. are relative to Coordinated Universal Time (UTC), also sometimes
  676. referred to as Greenwich Mean Time (GMT). To convert to local time,
  677. the software must know the local timezone offset from UTC/GMT.
  678. The lower three bits of Flags in both headers indicate which time-
  679. stamps are present in the LOCAL extra field:
  680. bit 0 if set, modification time is present
  681. bit 1 if set, access time is present
  682. bit 2 if set, creation time is present
  683. bits 3-7 reserved for additional timestamps; not set
  684. Those times that are present will appear in the order indicated, but
  685. any combination of times may be omitted. (Creation time may be
  686. present without access time, for example.) TSize should equal
  687. (1 + 4*(number of set bits in Flags)), as the block is currently
  688. defined. Other timestamps may be added in the future.
  689. -Info-ZIP Unix Extra Field (type 1):
  690. ==================================
  691. The following is the layout of the old Info-ZIP extra block for
  692. Unix. It has been replaced by the extended-timestamp extra block
  693. (0x5455) and the Unix type 2 extra block (0x7855).
  694. (Last Revision 19970118)
  695. Local-header version:
  696. Value Size Description
  697. ----- ---- -----------
  698. (Unix1) 0x5855 Short tag for this extra block type ("UX")
  699. TSize Short total data size for this block
  700. AcTime Long time of last access (UTC/GMT)
  701. ModTime Long time of last modification (UTC/GMT)
  702. UID Short Unix user ID (optional)
  703. GID Short Unix group ID (optional)
  704. Central-header version:
  705. Value Size Description
  706. ----- ---- -----------
  707. (Unix1) 0x5855 Short tag for this extra block type ("UX")
  708. TSize Short total data size for this block
  709. AcTime Long time of last access (GMT/UTC)
  710. ModTime Long time of last modification (GMT/UTC)
  711. The file access and modification times are in standard Unix signed-
  712. long format, indicating the number of seconds since 1 January 1970
  713. 00:00:00. The times are relative to Coordinated Universal Time
  714. (UTC), also sometimes referred to as Greenwich Mean Time (GMT). To
  715. convert to local time, the software must know the local timezone
  716. offset from UTC/GMT. The modification time may be used by non-Unix
  717. systems to support inter-timezone freshening and updating of zip
  718. archives.
  719. The local-header extra block may optionally contain UID and GID
  720. info for the file. The local-header TSize value is the only
  721. indication of this. Note that Unix UIDs and GIDs are usually
  722. specific to a particular machine, and they generally require root
  723. access to restore.
  724. This extra field type is obsolete, but it has been in use since
  725. mid-1994. Therefore future archiving software should continue to
  726. support it. Some guidelines:
  727. An archive member should either contain the old "Unix1"
  728. extra field block or the new extra field types "time" and/or
  729. "Unix2".
  730. If both the old "Unix1" block type and one or both of the new
  731. block types "time" and "Unix2" are found, the "Unix1" block
  732. should be considered invalid and ignored.
  733. Unarchiving software should recognize both old and new extra
  734. field block types, but the info from new types overrides the
  735. old "Unix1" field.
  736. Archiving software should recognize "Unix1" extra fields for
  737. timestamp comparison but never create it for updated, freshened
  738. or new archive members. When copying existing members to a new
  739. archive, any "Unix1" extra field blocks should be converted to
  740. the new "time" and/or "Unix2" types.
  741. -Info-ZIP Unix Extra Field (type 2):
  742. ==================================
  743. The following is the layout of the new Info-ZIP extra block for
  744. Unix. (Last Revision 19960922)
  745. Local-header version:
  746. Value Size Description
  747. ----- ---- -----------
  748. (Unix2) 0x7855 Short tag for this extra block type ("Ux")
  749. TSize Short total data size for this block (4)
  750. UID Short Unix user ID
  751. GID Short Unix group ID
  752. Central-header version:
  753. Value Size Description
  754. ----- ---- -----------
  755. (Unix2) 0x7855 Short tag for this extra block type ("Ux")
  756. TSize Short total data size for this block (0)
  757. The data size of the central-header version is zero; it is used
  758. solely as a flag that UID/GID info is present in the local-header
  759. extra field. If additional fields are ever added to the local
  760. version, the central version may be extended to indicate this.
  761. Note that Unix UIDs and GIDs are usually specific to a particular
  762. machine, and they generally require root access to restore.
  763. -ASi Unix Extra Field:
  764. ====================
  765. The following is the layout of the ASi extra block for Unix. The
  766. local-header and central-header versions are identical.
  767. (Last Revision 19960916)
  768. Value Size Description
  769. ----- ---- -----------
  770. (Unix3) 0x756e Short tag for this extra block type ("nu")
  771. TSize Short total data size for this block
  772. CRC Long CRC-32 of the remaining data
  773. Mode Short file permissions
  774. SizDev Long symlink'd size OR major/minor dev num
  775. UID Short user ID
  776. GID Short group ID
  777. (var.) variable symbolic link filename
  778. Mode is the standard Unix st_mode field from struct stat, containing
  779. user/group/other permissions, setuid/setgid and symlink info, etc.
  780. If Mode indicates that this file is a symbolic link, SizDev is the
  781. size of the file to which the link points. Otherwise, if the file
  782. is a device, SizDev contains the standard Unix st_rdev field from
  783. struct stat (includes the major and minor numbers of the device).
  784. SizDev is undefined in other cases.
  785. If Mode indicates that the file is a symbolic link, the final field
  786. will be the name of the file to which the link points. The file-
  787. name length can be inferred from TSize.
  788. [Note that TSize may incorrectly refer to the data size not counting
  789. the CRC; i.e., it may be four bytes too small.]
  790. -BeOS Extra Field:
  791. ================
  792. The following is the layout of the file-attributes extra block for
  793. BeOS. (Last Revision 19970531)
  794. Local-header version:
  795. Value Size Description
  796. ----- ---- -----------
  797. (BeOS) 0x6542 Short tag for this extra block type ("Be")
  798. TSize Short total data size for this block
  799. BSize Long uncompressed file attribute data size
  800. Flags Byte info bits
  801. (CType) Short compression type
  802. (CRC) Long CRC value for uncompressed file attribs
  803. Attribs variable file attribute data
  804. Central-header version:
  805. Value Size Description
  806. ----- ---- -----------
  807. (BeOS) 0x6542 Short tag for this extra block type ("Be")
  808. TSize Short total data size for this block (5)
  809. BSize Long size of uncompr. local EF block data
  810. Flags Byte info bits
  811. The least significant bit of Flags in both headers indicates whether
  812. the LOCAL extra field is uncompressed (and therefore whether CType
  813. and CRC are omitted):
  814. bit 0 if set, Attribs is uncompressed (no CType, CRC)
  815. bits 1-7 reserved; if set, assume error or unknown data
  816. Currently the only supported compression types are deflated (type 8)
  817. and stored (type 0); the latter is not used by Info-ZIP's Zip but is
  818. supported by UnZip.
  819. Attribs is a BeOS-specific block of data in big-endian format with
  820. the following structure (if compressed, uncompress it first):
  821. Value Size Description
  822. ----- ---- -----------
  823. Name variable attribute name (null-terminated string)
  824. Type Long attribute type (32-bit unsigned integer)
  825. Size Long Long data size for this sub-block (64 bits)
  826. Data variable attribute data
  827. The attribute structure is repeated for every attribute. The Data
  828. field may contain anything--text, flags, bitmaps, etc.
  829. -SMS/QDOS Extra Field:
  830. ====================
  831. The following is the layout of the file-attributes extra block for
  832. SMS/QDOS. The local-header and central-header versions are identical.
  833. (Last Revision 19960929)
  834. Value Size Description
  835. ----- ---- -----------
  836. (QDOS) 0xfb4a Short tag for this extra block type
  837. TSize Short total data size for this block
  838. LongID Long extra-field signature
  839. (ExtraID) Long additional signature/flag bytes
  840. QDirect 64 bytes qdirect structure
  841. LongID may be "QZHD" or "QDOS". In the latter case, ExtraID will
  842. be present. Its first three bytes are "02\0"; the last byte is
  843. currently undefined.
  844. QDirect contains the file's uncompressed directory info (qdirect
  845. struct). Its elements are in native (big-endian) format:
  846. d_length beLong file length
  847. d_access byte file access type
  848. d_type byte file type
  849. d_datalen beLong data length
  850. d_reserved beLong unused
  851. d_szname beShort size of filename
  852. d_name 36 bytes filename
  853. d_update beLong time of last update
  854. d_refdate beLong file version number
  855. d_backup beLong time of last backup (archive date)
  856. -AOS/VS Extra Field:
  857. ==================
  858. The following is the layout of the extra block for Data General
  859. AOS/VS. The local-header and central-header versions are identical.
  860. (Last Revision 19961125)
  861. Value Size Description
  862. ----- ---- -----------
  863. (AOSVS) 0x5356 Short tag for this extra block type ("VS")
  864. TSize Short total data size for this block
  865. "FCI\0" Long extra-field signature
  866. Version Byte version of AOS/VS extra block (10 = 1.0)
  867. Fstat variable fstat packet
  868. AclBuf variable raw ACL data ($MXACL bytes)
  869. Fstat contains the file's uncompressed fstat packet, which is one of
  870. the following:
  871. normal fstat packet (P_FSTAT struct)
  872. DIR/CPD fstat packet (P_FSTAT_DIR struct)
  873. unit (device) fstat packet (P_FSTAT_UNIT struct)
  874. IPC file fstat packet (P_FSTAT_IPC struct)
  875. AclBuf contains the raw ACL data; its length is $MXACL.
  876. -Tandem NSK Extra Field:
  877. ======================
  878. The following is the layout of the file-attributes extra block for
  879. Tandem NSK. The local-header and central-header versions are
  880. identical. (Last Revision 19981221)
  881. Value Size Description
  882. ----- ---- -----------
  883. (TA) 0x4154 Short tag for this extra block type ("TA")
  884. TSize Short total data size for this block (20)
  885. NSKattrs 20 Bytes NSK attributes
  886. -THEOS Extra Field:
  887. =================
  888. The following is the layout of the file-attributes extra block for
  889. Theos. The local-header and central-header versions are identical.
  890. (Last Revision 19990206)
  891. Value Size Description
  892. ----- ---- -----------
  893. (Theos) 0x6854 Short 'Th' signature
  894. size Short size of extra block
  895. flags Byte reserved for future use
  896. filesize Long file size
  897. fileorg Byte type of file (see below)
  898. keylen Short key length for indexed and keyed files,
  899. data segment size for 16 bits programs
  900. reclen Short record length for indexed,keyed and direct,
  901. text segment size for 16 bits programs
  902. filegrow Byte growing factor for indexed,keyed and direct
  903. protect Byte protections (see below)
  904. reserved Short reserved for future use
  905. File types
  906. ==========
  907. 0x80 library (keyed access list of files)
  908. 0x40 directory
  909. 0x10 stream file
  910. 0x08 direct file
  911. 0x04 keyed file
  912. 0x02 indexed file
  913. 0x0e reserved
  914. 0x01 16 bits real mode program (obsolete)
  915. 0x21 16 bits protected mode program
  916. 0x41 32 bits protected mode program
  917. Protection codes
  918. ================
  919. User protection
  920. ---------------
  921. 0x01 non readable
  922. 0x02 non writable
  923. 0x04 non executable
  924. 0x08 non erasable
  925. Other protection
  926. ----------------
  927. 0x10 non readable
  928. 0x20 non writable
  929. 0x40 non executable Theos before 4.0
  930. 0x40 modified Theos 4.x
  931. 0x80 not hidden
  932. -THEOS old inofficial Extra Field:
  933. ================================
  934. The following is the layout of an inoffical former version of a
  935. Theos file-attributes extra blocks. This layout was never published
  936. and is no longer created. However, UnZip can optionally support it
  937. when compiling with the option flag OLD_THEOS_EXTRA defined.
  938. Both the local-header and central-header versions are identical.
  939. (Last Revision 19990206)
  940. Value Size Description
  941. ----- ---- -----------
  942. (THS0) 0x4854 Short 'TH' signature
  943. size Short size of extra block
  944. flags Short reserved for future use
  945. filesize Long file size
  946. reclen Short record length for indexed,keyed and direct,
  947. text segment size for 16 bits programs
  948. keylen Short key length for indexed and keyed files,
  949. data segment size for 16 bits programs
  950. filegrow Byte growing factor for indexed,keyed and direct
  951. reserved 3 Bytes reserved for future use
  952. -FWKCS MD5 Extra Field:
  953. =====================
  954. The FWKCS Contents_Signature System, used in automatically
  955. identifying files independent of filename, optionally adds
  956. and uses an extra field to support the rapid creation of
  957. an enhanced contents_signature.
  958. There is no local-header version; the following applies
  959. only to the central header. (Last Revision 19961207)
  960. Central-header version:
  961. Value Size Description
  962. ----- ---- -----------
  963. (MD5) 0x4b46 Short tag for this extra block type ("FK")
  964. TSize Short total data size for this block (19)
  965. "MD5" 3 bytes extra-field signature
  966. MD5hash 16 bytes 128-bit MD5 hash of uncompressed data
  967. (low byte first)
  968. When FWKCS revises a .ZIP file central directory to add
  969. this extra field for a file, it also replaces the
  970. central directory entry for that file's uncompressed
  971. file length with a measured value.
  972. FWKCS provides an option to strip this extra field, if
  973. present, from a .ZIP file central directory. In adding
  974. this extra field, FWKCS preserves .ZIP file Authenticity
  975. Verification; if stripping this extra field, FWKCS
  976. preserves all versions of AV through PKZIP version 2.04g.
  977. FWKCS, and FWKCS Contents_Signature System, are
  978. trademarks of Frederick W. Kantor.
  979. (1) R. Rivest, RFC1321.TXT, MIT Laboratory for Computer
  980. Science and RSA Data Security, Inc., April 1992.
  981. ll.76-77: "The MD5 algorithm is being placed in the
  982. public domain for review and possible adoption as a
  983. standard."
  984. -Info-ZIP Unicode Path Extra Field:
  985. =================================
  986. Stores the UTF-8 version of the entry path as stored in the
  987. local header and central directory header.
  988. (Last Revision 20070912)
  989. Value Size Description
  990. ----- ---- -----------
  991. (UPath) 0x7075 Short tag for this extra block type ("up")
  992. TSize Short total data size for this block
  993. Version 1 byte version of this extra field, currently 1
  994. NameCRC32 4 bytes File Name Field CRC32 Checksum
  995. UnicodeName Variable UTF-8 version of the entry File Name
  996. Currently Version is set to the number 1. If there is a need
  997. to change this field, the version will be incremented. Changes
  998. may not be backward compatible so this extra field should not be
  999. used if the version is not recognized.
  1000. The NameCRC32 is the standard zip CRC32 checksum of the File Name
  1001. field in the header. This is used to verify that the header
  1002. File Name field has not changed since the Unicode Path extra field
  1003. was created. This can happen if a utility renames the entry but
  1004. does not update the UTF-8 path extra field. If the CRC check fails,
  1005. this UTF-8 Path Extra Field should be ignored and the File Name field
  1006. in the header used instead.
  1007. The UnicodeName is the UTF-8 version of the contents of the File Name
  1008. field in the header. As UnicodeName is defined to be UTF-8, no UTF-8
  1009. byte order mark (BOM) is used. The length of this field is determined
  1010. by subtracting the size of the previous fields from TSize. If both
  1011. the File Name and Comment fields are UTF-8, the new General Purpose
  1012. Bit Flag, bit 11 (Language encoding flag (EFS)), can be used to
  1013. indicate that both the header File Name and Comment fields are UTF-8
  1014. and, in this case, the Unicode Path and Unicode Comment extra fields
  1015. are not needed and should not be created. Note that, for backward
  1016. compatibility, bit 11 should only be used if the native character set
  1017. of the paths and comments being zipped up are already in UTF-8. The
  1018. same method, either bit 11 or extra fields, should be used in both
  1019. the local and central directory headers.
  1020. -Info-ZIP Unicode Comment Extra Field:
  1021. ====================================
  1022. Stores the UTF-8 version of the entry comment as stored in the
  1023. central directory header.
  1024. (Last Revision 20070912)
  1025. Value Size Description
  1026. ----- ---- -----------
  1027. (UCom) 0x6375 Short tag for this extra block type ("uc")
  1028. TSize Short total data size for this block
  1029. Version 1 byte version of this extra field, currently 1
  1030. ComCRC32 4 bytes Comment Field CRC32 Checksum
  1031. UnicodeCom Variable UTF-8 version of the entry comment
  1032. Currently Version is set to the number 1. If there is a need
  1033. to change this field, the version will be incremented. Changes
  1034. may not be backward compatible so this extra field should not be
  1035. used if the version is not recognized.
  1036. The ComCRC32 is the standard zip CRC32 checksum of the Comment
  1037. field in the central directory header. This is used to verify that
  1038. the comment field has not changed since the Unicode Comment extra field
  1039. was created. This can happen if a utility changes the Comment field
  1040. but does not update the UTF-8 Comment extra field. If the CRC check
  1041. fails, this Unicode Comment extra field should be ignored and the
  1042. Comment field in the header used.
  1043. The UnicodeCom field is the UTF-8 version of the entry comment field
  1044. in the header. As UnicodeCom is defined to be UTF-8, no UTF-8 byte
  1045. order mark (BOM) is used. The length of this field is determined by
  1046. subtracting the size of the previous fields from TSize. If both the
  1047. File Name and Comment fields are UTF-8, the new General Purpose Bit
  1048. Flag, bit 11 (Language encoding flag (EFS)), can be used to indicate
  1049. both the header File Name and Comment fields are UTF-8 and, in this
  1050. case, the Unicode Path and Unicode Comment extra fields are not
  1051. needed and should not be created. Note that, for backward
  1052. compatibility, bit 11 should only be used if the native character set
  1053. of the paths and comments being zipped up are already in UTF-8. The
  1054. same method, either bit 11 or extra fields, should be used in both
  1055. the local and central directory headers.
  1056. -Info-ZIP New Unix Extra Field:
  1057. ====================================
  1058. Currently stores Unix UIDs/GIDs up to 32 bits.
  1059. (Last Revision 20080509)
  1060. Value Size Description
  1061. ----- ---- -----------
  1062. (UnixN) 0x7875 Short tag for this extra block type ("ux")
  1063. TSize Short total data size for this block
  1064. Version 1 byte version of this extra field, currently 1
  1065. UIDSize 1 byte Size of UID field
  1066. UID Variable UID for this entry
  1067. GIDSize 1 byte Size of GID field
  1068. GID Variable GID for this entry
  1069. Currently Version is set to the number 1. If there is a need
  1070. to change this field, the version will be incremented. Changes
  1071. may not be backward compatible so this extra field should not be
  1072. used if the version is not recognized.
  1073. UIDSize is the size of the UID field in bytes. This size should
  1074. match the size of the UID field on the target OS.
  1075. UID is the UID for this entry in standard little endian format.
  1076. GIDSize is the size of the GID field in bytes. This size should
  1077. match the size of the GID field on the target OS.
  1078. GID is the GID for this entry in standard little endian format.
  1079. If both the old 16-bit Unix extra field (tag 0x7855, Info-ZIP Unix)
  1080. and this extra field are present, the values in this extra field
  1081. supercede the values in that extra field.