archive 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. #------------------------------------------------------------------------------
  2. # archive: file(1) magic for archive formats (see also "msdos" for self-
  3. # extracting compressed archives)
  4. #
  5. # cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
  6. # pre-POSIX "tar" archives are handled in the C code.
  7. # POSIX tar archives
  8. 257 string ustar\0 POSIX tar archive
  9. 257 string ustar\040\040\0 GNU tar archive
  10. # cpio archives
  11. #
  12. # Yes, the top two "cpio archive" formats *are* supposed to just be "short".
  13. # The idea is to indicate archives produced on machines with the same
  14. # byte order as the machine running "file" with "cpio archive", and
  15. # to indicate archives produced on machines with the opposite byte order
  16. # from the machine running "file" with "byte-swapped cpio archive".
  17. #
  18. # The SVR4 "cpio(4)" hints that there are additional formats, but they
  19. # are defined as "short"s; I think all the new formats are
  20. # character-header formats and thus are strings, not numbers.
  21. 0 short 070707 cpio archive
  22. 0 short 0143561 byte-swapped cpio archive
  23. 0 string 070707 ASCII cpio archive (pre-SVR4 or odc)
  24. 0 string 070701 ASCII cpio archive (SVR4 with no CRC)
  25. 0 string 070702 ASCII cpio archive (SVR4 with CRC)
  26. # Debian package (needs to go before regular portable archives)
  27. #
  28. 0 string !<arch>\ndebian
  29. >8 string debian-split part of multipart Debian package
  30. >8 string debian-binary Debian binary package
  31. >68 string >\0 (format %s)
  32. >81 string bz2 \b, uses bzip2 compression
  33. >84 string gz \b, uses gzip compression
  34. #>136 ledate x created: %s
  35. # other archives
  36. 0 long 0177555 very old archive
  37. 0 short 0177555 very old PDP-11 archive
  38. 0 long 0177545 old archive
  39. 0 short 0177545 old PDP-11 archive
  40. 0 long 0100554 apl workspace
  41. 0 string =<ar> archive
  42. # MIPS archive (needs to go before regular portable archives)
  43. #
  44. 0 string !<arch>\n__________E MIPS archive
  45. >20 string U with MIPS Ucode members
  46. >21 string L with MIPSEL members
  47. >21 string B with MIPSEB members
  48. >19 string L and an EL hash table
  49. >19 string B and an EB hash table
  50. >22 string X -- out of date
  51. 0 string -h- Software Tools format archive text
  52. #
  53. # XXX - why are there multiple <ar> thingies? Note that 0x213c6172 is
  54. # "!<ar", so, for new-style (4.xBSD/SVR2andup) archives, we have:
  55. #
  56. # 0 string !<arch> current ar archive
  57. # 0 long 0x213c6172 archive file
  58. #
  59. # and for SVR1 archives, we have:
  60. #
  61. # 0 string \<ar> System V Release 1 ar archive
  62. # 0 string =<ar> archive
  63. #
  64. # XXX - did Aegis really store shared libraries, breakpointed modules,
  65. # and absolute code program modules in the same format as new-style
  66. # "ar" archives?
  67. #
  68. 0 string !<arch> current ar archive
  69. >8 string __.SYMDEF random library
  70. >0 belong =65538 - pre SR9.5
  71. >0 belong =65539 - post SR9.5
  72. >0 beshort 2 - object archive
  73. >0 beshort 3 - shared library module
  74. >0 beshort 4 - debug break-pointed module
  75. >0 beshort 5 - absolute code program module
  76. 0 string \<ar> System V Release 1 ar archive
  77. 0 string =<ar> archive
  78. #
  79. # XXX - from "vax", which appears to collect a bunch of byte-swapped
  80. # thingies, to help you recognize VAX files on big-endian machines;
  81. # with "leshort", "lelong", and "string", that's no longer necessary....
  82. #
  83. 0 belong 0x65ff0000 VAX 3.0 archive
  84. 0 belong 0x3c61723e VAX 5.0 archive
  85. #
  86. 0 long 0x213c6172 archive file
  87. 0 lelong 0177555 very old VAX archive
  88. 0 leshort 0177555 very old PDP-11 archive
  89. #
  90. # XXX - "pdp" claims that 0177545 can have an __.SYMDEF member and thus
  91. # be a random library (it said 0xff65 rather than 0177545).
  92. #
  93. 0 lelong 0177545 old VAX archive
  94. >8 string __.SYMDEF random library
  95. 0 leshort 0177545 old PDP-11 archive
  96. >8 string __.SYMDEF random library
  97. #
  98. # From "pdp" (but why a 4-byte quantity?)
  99. #
  100. 0 lelong 0x39bed PDP-11 old archive
  101. 0 lelong 0x39bee PDP-11 4.0 archive
  102. # ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
  103. #
  104. # The first byte is the magic (0x1a), byte 2 is the compression type for
  105. # the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
  106. # filename of the first file (null terminated). Since some types collide
  107. # we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
  108. # 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%). 0x01 collides with terminfo.
  109. 0 lelong&0x8080ffff 0x0000081a ARC archive data, dynamic LZW
  110. 0 lelong&0x8080ffff 0x0000091a ARC archive data, squashed
  111. 0 lelong&0x8080ffff 0x0000021a ARC archive data, uncompressed
  112. 0 lelong&0x8080ffff 0x0000031a ARC archive data, packed
  113. 0 lelong&0x8080ffff 0x0000041a ARC archive data, squeezed
  114. 0 lelong&0x8080ffff 0x0000061a ARC archive data, crunched
  115. # Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
  116. # I can't create either SPARK or ArcFS archives so I have not tested this stuff
  117. # [GRR: the original entries collide with ARC, above; replaced with combined
  118. # version (not tested)]
  119. #0 byte 0x1a RISC OS archive
  120. #>1 string archive (ArcFS format)
  121. #0 string \032archive RISC OS archive (ArcFS format)
  122. 0 string \032 RISC OS archive (spark format)
  123. 0 string Archive\000 RISC OS archive (ArcFS format)
  124. # ARJ archiver (jason@jarthur.Claremont.EDU)
  125. 0 leshort 0xea60 ARJ archive data
  126. >5 byte x \b, v%d,
  127. >8 byte &0x04 multi-volume,
  128. >8 byte &0x10 slash-switched,
  129. >8 byte &0x20 backup,
  130. >34 string x original name: %s,
  131. >7 byte 0 os: MS-DOS
  132. >7 byte 1 os: PRIMOS
  133. >7 byte 2 os: Unix
  134. >7 byte 3 os: Amiga
  135. >7 byte 4 os: Macintosh
  136. >7 byte 5 os: OS/2
  137. >7 byte 6 os: Apple ][ GS
  138. >7 byte 7 os: Atari ST
  139. >7 byte 8 os: NeXT
  140. >7 byte 9 os: VAX/VMS
  141. >3 byte >0 %d]
  142. # HA archiver (Greg Roelofs, newt@uchicago.edu)
  143. # This is a really bad format. A file containing HAWAII will match this...
  144. #0 string HA HA archive data,
  145. #>2 leshort =1 1 file,
  146. #>2 leshort >1 %u files,
  147. #>4 byte&0x0f =0 first is type CPY
  148. #>4 byte&0x0f =1 first is type ASC
  149. #>4 byte&0x0f =2 first is type HSC
  150. #>4 byte&0x0f =0x0e first is type DIR
  151. #>4 byte&0x0f =0x0f first is type SPECIAL
  152. # HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
  153. 0 string HPAK HPACK archive data
  154. # JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
  155. 0 string \351,\001JAM\ JAM archive,
  156. >7 string >\0 version %.4s
  157. >0x26 byte =0x27 -
  158. >>0x2b string >\0 label %.11s,
  159. >>0x27 lelong x serial %08x,
  160. >>0x36 string >\0 fstype %.8s
  161. # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
  162. 2 string -lh0- LHarc 1.x archive data [lh0]
  163. 2 string -lh1- LHarc 1.x archive data [lh1]
  164. 2 string -lz4- LHarc 1.x archive data [lz4]
  165. 2 string -lz5- LHarc 1.x archive data [lz5]
  166. # [never seen any but the last; -lh4- reported in comp.compression:]
  167. 2 string -lzs- LHa 2.x? archive data [lzs]
  168. 2 string -lh\40- LHa 2.x? archive data [lh ]
  169. 2 string -lhd- LHa 2.x? archive data [lhd]
  170. 2 string -lh2- LHa 2.x? archive data [lh2]
  171. 2 string -lh3- LHa 2.x? archive data [lh3]
  172. 2 string -lh4- LHa (2.x) archive data [lh4]
  173. 2 string -lh5- LHa (2.x) archive data [lh5]
  174. 2 string -lh6- LHa (2.x) archive data [lh6]
  175. 2 string -lh7- LHa (2.x) archive data [lh7]
  176. >20 byte x - header level %d
  177. # RAR archiver (Greg Roelofs, newt@uchicago.edu)
  178. 0 string Rar! RAR archive data,
  179. >44 byte x v%0x,
  180. >35 byte 0 os: MS-DOS
  181. >35 byte 1 os: OS/2
  182. >35 byte 2 os: Win32
  183. >35 byte 3 os: Unix
  184. # SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
  185. 0 string SQSH squished archive data (Acorn RISCOS)
  186. # UC2 archiver (Greg Roelofs, newt@uchicago.edu)
  187. # I can't figure out the self-extracting form of these buggers...
  188. 0 string UC2\x1a UC2 archive data
  189. # ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
  190. 0 string PK\003\004 Zip archive data
  191. >4 byte 0x09 \b, at least v0.9 to extract
  192. >4 byte 0x0a \b, at least v1.0 to extract
  193. >4 byte 0x0b \b, at least v1.1 to extract
  194. >4 byte 0x14 \b, at least v2.0 to extract
  195. # Zoo archiver
  196. 20 lelong 0xfdc4a7dc Zoo archive data
  197. >4 byte >48 \b, v%c.
  198. >>6 byte >47 \b%c
  199. >>>7 byte >47 \b%c
  200. >32 byte >0 \b, modify: v%d
  201. >>33 byte x \b.%d+
  202. >42 lelong 0xfdc4a7dc \b,
  203. >>70 byte >0 extract: v%d
  204. >>>71 byte x \b.%d+
  205. # Shell archives
  206. 10 string #\ This\ is\ a\ shell\ archive shell archive text
  207. #
  208. # LBR. NB: May conflict with the questionable
  209. # "binary Computer Graphics Metafile" format.
  210. #
  211. 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data
  212. #
  213. # PMA (CP/M derivative of LHA)
  214. #
  215. 2 string -pm0- PMarc archive data [pm0]
  216. 2 string -pm1- PMarc archive data [pm1]
  217. 2 string -pm2- PMarc archive data [pm2]
  218. 2 string -pms- PMarc SFX archive (CP/M, DOS)
  219. 5 string -pc1- PopCom compressed executable (CP/M)
  220. # From Rafael Laboissiere <rafael@laboissiere.net>
  221. # The Project Revision Control System (see
  222. # http://prcs.sourceforge.net) generates a packaged project
  223. # file which is recognized by the following entry:
  224. 0 leshort 0xeb81 PRCS packaged project
  225. # Microsoft cabinets
  226. # by David Necas (Yeti) <yeti@physics.muni.cz>
  227. #0 string MSCF\0\0\0\0 Microsoft cabinet file data,
  228. #>25 byte x v%d
  229. #>24 byte x \b.%d
  230. # MPi: All CABs have version 1.3, so this is pointless.
  231. # Better magic in debian-additions.
  232. # GTKtalog catalogs
  233. # by David Necas (Yeti) <yeti@physics.muni.cz>
  234. 4 string gtktalog\ GTKtalog catalog data,
  235. >13 string 3 version 3
  236. >>14 beshort 0x677a (gzipped)
  237. >>14 beshort !0x677a (not gzipped)
  238. >13 string >3 version %s
  239. ############################################################################
  240. # Parity archive reconstruction file, the 'par' file format now used on Usenet.
  241. 0 string PAR\0 PARity archive data
  242. >48 leshort =0 - Index file
  243. >48 leshort >0 - file number %d
  244. # Felix von Leitner <felix-file@fefe.de>
  245. 0 string d8:announce BitTorrent file
  246. # Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
  247. 0 beshort 0x0e0f Atari MSA archive data
  248. >2 beshort x \b, %d sectors per track
  249. >4 beshort 0 \b, 1 sided
  250. >4 beshort 1 \b, 2 sided
  251. >6 beshort x \b, starting track: %d
  252. >8 beshort x \b, ending track: %d
  253. # Alternate ZIP string (amc@arwen.cs.berkeley.edu)
  254. 0 string PK00PK\003\004 Zip archive data
  255. # ACE archive (from http://www.wotsit.org/download.asp?f=ace)
  256. # by Stefan `Sec` Zehl <sec@42.org>
  257. 7 string **ACE** ACE compressed archive
  258. >15 byte >0 version %d
  259. >16 byte =0x00 \b, from MS-DOS
  260. >16 byte =0x01 \b, from OS/2
  261. >16 byte =0x02 \b, from Win/32
  262. >16 byte =0x03 \b, from Unix
  263. >16 byte =0x04 \b, from MacOS
  264. >16 byte =0x05 \b, from WinNT
  265. >16 byte =0x06 \b, from Primos
  266. >16 byte =0x07 \b, from AppleGS
  267. >16 byte =0x08 \b, from Atari
  268. >16 byte =0x09 \b, from Vax/VMS
  269. >16 byte =0x0A \b, from Amiga
  270. >16 byte =0x0B \b, from Next
  271. >14 byte x \b, version %d to extract
  272. >5 leshort &0x0080 \b, multiple volumes,
  273. >>17 byte x \b (part %d),
  274. >5 leshort &0x0002 \b, contains comment
  275. >5 leshort &0x0200 \b, sfx
  276. >5 leshort &0x0400 \b, small dictionary
  277. >5 leshort &0x0800 \b, multi-volume
  278. >5 leshort &0x1000 \b, contains AV-String
  279. >>30 string\x16*UNREGISTERED\x20VERSION* (unregistered)
  280. >5 leshort &0x2000 \b, with recovery record
  281. >5 leshort &0x4000 \b, locked
  282. >5 leshort &0x8000 \b, solid
  283. # Date in MS-DOS format (whatever that is)
  284. #>18 lelong x Created on
  285. # sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
  286. # <doj@cubic.org>
  287. 0x1A string sfArk sfArk compressed Soundfont
  288. >0x15 string 2
  289. >>0x1 string >\0 Version %s
  290. >>0x2A string >\0 : %s