zip 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #------------------------------------------------------------------------------
  2. # $File: zip,v 1.2 2019/04/09 18:34:15 christos Exp $
  3. # zip: file(1) magic for zip files; this is not use
  4. # Note the version of magic in archive is currently stronger, this is
  5. # just an example until negative offsets are supported better
  6. # Zip Central Cirectory record
  7. 0 name zipcd
  8. >0 string PK\001\002 Zip archive data
  9. >>4 leshort x \b, made by
  10. >>4 use zipversion
  11. >>6 leshort x \b, extract using at least
  12. >>6 use zipversion
  13. >>12 ledate x \b, last modified %s
  14. >>24 lelong >0 \b, uncompressed size %d
  15. >>10 leshort x \b, method=
  16. >>10 use zipcompression
  17. # Zip known compressions
  18. 0 name zipcompression
  19. >0 leshort 0 \bstore
  20. >0 leshort 8 \bdeflate
  21. >0 leshort 9 \bdeflate64
  22. >0 leshort 12 \bbzip2
  23. >0 leshort 14 \blzma
  24. >0 leshort 94 \bMP3
  25. >0 leshort 95 \bxz
  26. >0 leshort 96 \bJpeg
  27. >0 leshort 97 \bWavPack
  28. >0 leshort 98 \bPPMd
  29. >0 leshort 99 \bAES Encrypted
  30. >0 default x
  31. >>0 leshort x \b[%#x]
  32. # Zip known versions
  33. 0 name zipversion
  34. >0 leshort 0x09 v0.9
  35. >0 leshort 0x0a v1.0
  36. >0 leshort 0x0b v1.1
  37. >0 leshort 0x14 v2.0
  38. >0 leshort 0x15 v2.1
  39. >0 leshort 0x19 v2.5
  40. >0 leshort 0x1b v2.7
  41. >0 leshort 0x2d v4.5
  42. >0 leshort 0x2e v4.6
  43. >0 leshort 0x32 v5.0
  44. >0 leshort 0x33 v5.1
  45. >0 leshort 0x34 v5.2
  46. >0 leshort 0x3d v6.1
  47. >0 leshort 0x3e v6.2
  48. >0 leshort 0x3f v6.3
  49. >0 default x
  50. >>0 leshort x v?[%#x]
  51. # Zip End Of Central Directory record
  52. -22 string PK\005\006
  53. #>4 leshort >1 \b, %d disks
  54. #>6 leshort >1 \b, central directory disk %d
  55. #>8 leshort >1 \b, %d central directories on this disk
  56. #>10 leshort >1 \b, %d central directories
  57. #>12 lelong x \b, %d central directory bytes
  58. >(16.l) use zipcd
  59. >20 pstring/l >0 \b, %s