archive 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892
  1. #------------------------------------------------------------------------------
  2. # $File: archive,v 1.67 2011/07/12 11:31:09 rrt Exp $
  3. # archive: file(1) magic for archive formats (see also "msdos" for self-
  4. # extracting compressed archives)
  5. #
  6. # cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
  7. # pre-POSIX "tar" archives are handled in the C code.
  8. # POSIX tar archives
  9. 257 string ustar\0 POSIX tar archive
  10. !:mime application/x-tar # encoding: posix
  11. 257 string ustar\040\040\0 GNU tar archive
  12. !:mime application/x-tar # encoding: gnu
  13. # cpio archives
  14. #
  15. # Yes, the top two "cpio archive" formats *are* supposed to just be "short".
  16. # The idea is to indicate archives produced on machines with the same
  17. # byte order as the machine running "file" with "cpio archive", and
  18. # to indicate archives produced on machines with the opposite byte order
  19. # from the machine running "file" with "byte-swapped cpio archive".
  20. #
  21. # The SVR4 "cpio(4)" hints that there are additional formats, but they
  22. # are defined as "short"s; I think all the new formats are
  23. # character-header formats and thus are strings, not numbers.
  24. 0 short 070707 cpio archive
  25. !:mime application/x-cpio
  26. 0 short 0143561 byte-swapped cpio archive
  27. !:mime application/x-cpio # encoding: swapped
  28. 0 string 070707 ASCII cpio archive (pre-SVR4 or odc)
  29. 0 string 070701 ASCII cpio archive (SVR4 with no CRC)
  30. 0 string 070702 ASCII cpio archive (SVR4 with CRC)
  31. # Debian package (needs to go before regular portable archives)
  32. #
  33. 0 string =!<arch>\ndebian
  34. !:mime application/x-debian-package
  35. >8 string debian-split part of multipart Debian package
  36. >8 string debian-binary Debian binary package
  37. >8 string !debian
  38. >68 string >\0 (format %s)
  39. # These next two lines do not work, because a bzip2 Debian archive
  40. # still uses gzip for the control.tar (first in the archive). Only
  41. # data.tar varies, and the location of its filename varies too.
  42. # file/libmagic does not current have support for ascii-string based
  43. # (offsets) as of 2005-09-15.
  44. #>81 string bz2 \b, uses bzip2 compression
  45. #>84 string gz \b, uses gzip compression
  46. #>136 ledate x created: %s
  47. # other archives
  48. 0 long 0177555 very old archive
  49. 0 short 0177555 very old PDP-11 archive
  50. 0 long 0177545 old archive
  51. 0 short 0177545 old PDP-11 archive
  52. 0 long 0100554 apl workspace
  53. 0 string =<ar> archive
  54. !:mime application/x-archive
  55. # MIPS archive (needs to go before regular portable archives)
  56. #
  57. 0 string =!<arch>\n__________E MIPS archive
  58. >20 string U with MIPS Ucode members
  59. >21 string L with MIPSEL members
  60. >21 string B with MIPSEB members
  61. >19 string L and an EL hash table
  62. >19 string B and an EB hash table
  63. >22 string X -- out of date
  64. 0 search/1 -h- Software Tools format archive text
  65. #
  66. # XXX - why are there multiple <ar> thingies? Note that 0x213c6172 is
  67. # "!<ar", so, for new-style (4.xBSD/SVR2andup) archives, we have:
  68. #
  69. # 0 string =!<arch> current ar archive
  70. # 0 long 0x213c6172 archive file
  71. #
  72. # and for SVR1 archives, we have:
  73. #
  74. # 0 string \<ar> System V Release 1 ar archive
  75. # 0 string =<ar> archive
  76. #
  77. # XXX - did Aegis really store shared libraries, breakpointed modules,
  78. # and absolute code program modules in the same format as new-style
  79. # "ar" archives?
  80. #
  81. 0 string =!<arch> current ar archive
  82. !:mime application/x-archive
  83. >8 string __.SYMDEF random library
  84. >0 belong =65538 - pre SR9.5
  85. >0 belong =65539 - post SR9.5
  86. >0 beshort 2 - object archive
  87. >0 beshort 3 - shared library module
  88. >0 beshort 4 - debug break-pointed module
  89. >0 beshort 5 - absolute code program module
  90. 0 string \<ar> System V Release 1 ar archive
  91. 0 string =<ar> archive
  92. #
  93. # XXX - from "vax", which appears to collect a bunch of byte-swapped
  94. # thingies, to help you recognize VAX files on big-endian machines;
  95. # with "leshort", "lelong", and "string", that's no longer necessary....
  96. #
  97. 0 belong 0x65ff0000 VAX 3.0 archive
  98. 0 belong 0x3c61723e VAX 5.0 archive
  99. #
  100. 0 long 0x213c6172 archive file
  101. 0 lelong 0177555 very old VAX archive
  102. 0 leshort 0177555 very old PDP-11 archive
  103. #
  104. # XXX - "pdp" claims that 0177545 can have an __.SYMDEF member and thus
  105. # be a random library (it said 0xff65 rather than 0177545).
  106. #
  107. 0 lelong 0177545 old VAX archive
  108. >8 string __.SYMDEF random library
  109. 0 leshort 0177545 old PDP-11 archive
  110. >8 string __.SYMDEF random library
  111. #
  112. # From "pdp" (but why a 4-byte quantity?)
  113. #
  114. 0 lelong 0x39bed PDP-11 old archive
  115. 0 lelong 0x39bee PDP-11 4.0 archive
  116. # ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
  117. #
  118. # The first byte is the magic (0x1a), byte 2 is the compression type for
  119. # the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
  120. # filename of the first file (null terminated). Since some types collide
  121. # we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
  122. # 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%). 0x01 collides with terminfo.
  123. 0 lelong&0x8080ffff 0x0000081a ARC archive data, dynamic LZW
  124. !:mime application/x-arc
  125. 0 lelong&0x8080ffff 0x0000091a ARC archive data, squashed
  126. !:mime application/x-arc
  127. 0 lelong&0x8080ffff 0x0000021a ARC archive data, uncompressed
  128. !:mime application/x-arc
  129. 0 lelong&0x8080ffff 0x0000031a ARC archive data, packed
  130. !:mime application/x-arc
  131. 0 lelong&0x8080ffff 0x0000041a ARC archive data, squeezed
  132. !:mime application/x-arc
  133. 0 lelong&0x8080ffff 0x0000061a ARC archive data, crunched
  134. !:mime application/x-arc
  135. # [JW] stuff taken from idarc, obviously ARC successors:
  136. 0 lelong&0x8080ffff 0x00000a1a PAK archive data
  137. !:mime application/x-arc
  138. 0 lelong&0x8080ffff 0x0000141a ARC+ archive data
  139. !:mime application/x-arc
  140. 0 lelong&0x8080ffff 0x0000481a HYP archive data
  141. !:mime application/x-arc
  142. # Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
  143. # I can't create either SPARK or ArcFS archives so I have not tested this stuff
  144. # [GRR: the original entries collide with ARC, above; replaced with combined
  145. # version (not tested)]
  146. #0 byte 0x1a RISC OS archive (spark format)
  147. 0 string \032archive RISC OS archive (ArcFS format)
  148. 0 string Archive\000 RISC OS archive (ArcFS format)
  149. # All these were taken from idarc, many could not be verified. Unfortunately,
  150. # there were many low-quality sigs, i.e. easy to trigger false positives.
  151. # Please notify me of any real-world fishy/ambiguous signatures and I'll try
  152. # to get my hands on the actual archiver and see if I find something better. [JW]
  153. # probably many can be enhanced by finding some 0-byte or control char near the start
  154. # idarc calls this Crush/Uncompressed... *shrug*
  155. 0 string CRUSH Crush archive data
  156. # Squeeze It (.sqz)
  157. 0 string HLSQZ Squeeze It archive data
  158. # SQWEZ
  159. 0 string SQWEZ SQWEZ archive data
  160. # HPack (.hpk)
  161. 0 string HPAK HPack archive data
  162. # HAP
  163. 0 string \x91\x33HF HAP archive data
  164. # MD/MDCD
  165. 0 string MDmd MDCD archive data
  166. # LIM
  167. 0 string LIM\x1a LIM archive data
  168. # SAR
  169. 3 string LH5 SAR archive data
  170. # BSArc/BS2
  171. 0 string \212\3SB \0 BSArc/BS2 archive data
  172. # MAR
  173. 2 string =-ah MAR archive data
  174. # ACB
  175. 0 belong&0x00f800ff 0x00800000 ACB archive data
  176. # CPZ
  177. # TODO, this is what idarc says: 0 string \0\0\0 CPZ archive data
  178. # JRC
  179. 0 string JRchive JRC archive data
  180. # Quantum
  181. 0 string DS\0 Quantum archive data
  182. # ReSOF
  183. 0 string PK\3\6 ReSOF archive data
  184. # QuArk
  185. 0 string 7\4 QuArk archive data
  186. # YAC
  187. 14 string YC YAC archive data
  188. # X1
  189. 0 string X1 X1 archive data
  190. 0 string XhDr X1 archive data
  191. # CDC Codec (.dqt)
  192. 0 belong&0xffffe000 0x76ff2000 CDC Codec archive data
  193. # AMGC
  194. 0 string \xad6" AMGC archive data
  195. # NuLIB
  196. 0 string NõFélå NuLIB archive data
  197. # PakLeo
  198. 0 string LEOLZW PAKLeo archive data
  199. # ChArc
  200. 0 string SChF ChArc archive data
  201. # PSA
  202. 0 string PSA PSA archive data
  203. # CrossePAC
  204. 0 string DSIGDCC CrossePAC archive data
  205. # Freeze
  206. 0 string \x1f\x9f\x4a\x10\x0a Freeze archive data
  207. # KBoom
  208. 0 string ¨MP¨ KBoom archive data
  209. # NSQ, must go after CDC Codec
  210. 0 string \x76\xff NSQ archive data
  211. # DPA
  212. 0 string Dirk\ Paehl DPA archive data
  213. # BA
  214. # TODO: idarc says "bytes 0-2 == bytes 3-5"
  215. # TTComp
  216. 0 string \0\6 TTComp archive data
  217. # ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
  218. 0 string ESP ESP archive data
  219. # ZPack
  220. 0 string \1ZPK\1 ZPack archive data
  221. # Sky
  222. 0 string \xbc\x40 Sky archive data
  223. # UFA
  224. 0 string UFA UFA archive data
  225. # Dry
  226. 0 string =-H2O DRY archive data
  227. # FoxSQZ
  228. 0 string FOXSQZ FoxSQZ archive data
  229. # AR7
  230. 0 string ,AR7 AR7 archive data
  231. # PPMZ
  232. 0 string PPMZ PPMZ archive data
  233. # MS Compress
  234. 4 string \x88\xf0\x27 MS Compress archive data
  235. # updated by Joerg Jenderek
  236. >9 string \0
  237. >>0 string KWAJ
  238. >>>7 string \321\003 MS Compress archive data
  239. >>>>14 ulong >0 \b, original size: %ld bytes
  240. >>>>18 ubyte >0x65
  241. >>>>>18 string x \b, was %.8s
  242. >>>>>(10.b-4) string x \b.%.3s
  243. # MP3 (archiver, not lossy audio compression)
  244. 0 string MP3\x1a MP3-Archiver archive data
  245. # ZET
  246. 0 string OZÝ ZET archive data
  247. # TSComp
  248. 0 string \x65\x5d\x13\x8c\x08\x01\x03\x00 TSComp archive data
  249. # ARQ
  250. 0 string gW\4\1 ARQ archive data
  251. # Squash
  252. 3 string OctSqu Squash archive data
  253. # Terse
  254. 0 string \5\1\1\0 Terse archive data
  255. # PUCrunch
  256. 0 string \x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31 PUCrunch archive data
  257. # UHarc
  258. 0 string UHA UHarc archive data
  259. # ABComp
  260. 0 string \2AB ABComp archive data
  261. 0 string \3AB2 ABComp archive data
  262. # CMP
  263. 0 string CO\0 CMP archive data
  264. # Splint
  265. 0 string \x93\xb9\x06 Splint archive data
  266. # InstallShield
  267. 0 string \x13\x5d\x65\x8c InstallShield Z archive Data
  268. # Gather
  269. 1 string GTH Gather archive data
  270. # BOA
  271. 0 string BOA BOA archive data
  272. # RAX
  273. 0 string ULEB\xa RAX archive data
  274. # Xtreme
  275. 0 string ULEB\0 Xtreme archive data
  276. # Pack Magic
  277. 0 string @â\1\0 Pack Magic archive data
  278. # BTS
  279. 0 belong&0xfeffffff 0x1a034465 BTS archive data
  280. # ELI 5750
  281. 0 string Ora\ ELI 5750 archive data
  282. # QFC
  283. 0 string \x1aFC\x1a QFC archive data
  284. 0 string \x1aQF\x1a QFC archive data
  285. # PRO-PACK
  286. 0 string RNC PRO-PACK archive data
  287. # 777
  288. 0 string 777 777 archive data
  289. # LZS221
  290. 0 string sTaC LZS221 archive data
  291. # HPA
  292. 0 string HPA HPA archive data
  293. # Arhangel
  294. 0 string LG Arhangel archive data
  295. # EXP1, uses bzip2
  296. 0 string 0123456789012345BZh EXP1 archive data
  297. # IMP
  298. 0 string IMP\xa IMP archive data
  299. # NRV
  300. 0 string \x00\x9E\x6E\x72\x76\xFF NRV archive data
  301. # Squish
  302. 0 string \x73\xb2\x90\xf4 Squish archive data
  303. # Par
  304. 0 string PHILIPP Par archive data
  305. 0 string PAR Par archive data
  306. # HIT
  307. 0 string UB HIT archive data
  308. # SBX
  309. 0 belong&0xfffff000 0x53423000 SBX archive data
  310. # NaShrink
  311. 0 string NSK NaShrink archive data
  312. # SAPCAR
  313. 0 string #\ CAR\ archive\ header SAPCAR archive data
  314. 0 string CAR\ 2.00RG SAPCAR archive data
  315. # Disintegrator
  316. 0 string DST Disintegrator archive data
  317. # ASD
  318. 0 string ASD ASD archive data
  319. # InstallShield CAB
  320. 0 string ISc( InstallShield CAB
  321. # TOP4
  322. 0 string T4\x1a TOP4 archive data
  323. # BatComp left out: sig looks like COM executable
  324. # so TODO: get real 4dos batcomp file and find sig
  325. # BlakHole
  326. 0 string BH\5\7 BlakHole archive data
  327. # BIX
  328. 0 string BIX0 BIX archive data
  329. # ChiefLZA
  330. 0 string ChfLZ ChiefLZA archive data
  331. # Blink
  332. 0 string Blink Blink archive data
  333. # Logitech Compress
  334. 0 string \xda\xfa Logitech Compress archive data
  335. # ARS-Sfx (FIXME: really a SFX? then goto COM/EXE)
  336. 1 string (C)\ STEPANYUK ARS-Sfx archive data
  337. # AKT/AKT32
  338. 0 string AKT32 AKT32 archive data
  339. 0 string AKT AKT archive data
  340. # NPack
  341. 0 string MSTSM NPack archive data
  342. # PFT
  343. 0 string \0\x50\0\x14 PFT archive data
  344. # SemOne
  345. 0 string SEM SemOne archive data
  346. # PPMD
  347. 0 string \x8f\xaf\xac\x84 PPMD archive data
  348. # FIZ
  349. 0 string FIZ FIZ archive data
  350. # MSXiE
  351. 0 belong&0xfffff0f0 0x4d530000 MSXiE archive data
  352. # DeepFreezer
  353. 0 belong&0xfffffff0 0x797a3030 DeepFreezer archive data
  354. # DC
  355. 0 string =<DC- DC archive data
  356. # TPac
  357. 0 string \4TPAC\3 TPac archive data
  358. # Ai
  359. 0 string Ai\1\1\0 Ai archive data
  360. 0 string Ai\1\0\0 Ai archive data
  361. # Ai32
  362. 0 string Ai\2\0 Ai32 archive data
  363. 0 string Ai\2\1 Ai32 archive data
  364. # SBC
  365. 0 string SBC SBC archive data
  366. # Ybs
  367. 0 string YBS Ybs archive data
  368. # DitPack
  369. 0 string \x9e\0\0 DitPack archive data
  370. # DMS
  371. 0 string DMS! DMS archive data
  372. # EPC
  373. 0 string \x8f\xaf\xac\x8c EPC archive data
  374. # VSARC
  375. 0 string VS\x1a VSARC archive data
  376. # PDZ
  377. 0 string PDZ PDZ archive data
  378. # ReDuq
  379. 0 string rdqx ReDuq archive data
  380. # GCA
  381. 0 string GCAX GCA archive data
  382. # PPMN
  383. 0 string pN PPMN archive data
  384. # WinImage
  385. 3 string WINIMAGE WinImage archive data
  386. # Compressia
  387. 0 string CMP0CMP Compressia archive data
  388. # UHBC
  389. 0 string UHB UHBC archive data
  390. # WinHKI
  391. 0 string \x61\x5C\x04\x05 WinHKI archive data
  392. # WWPack data file
  393. 0 string WWP WWPack archive data
  394. # BSN (BSA, PTS-DOS)
  395. 0 string \xffBSG BSN archive data
  396. 1 string \xffBSG BSN archive data
  397. 3 string \xffBSG BSN archive data
  398. 1 string \0\xae\2 BSN archive data
  399. 1 string \0\xae\3 BSN archive data
  400. 1 string \0\xae\7 BSN archive data
  401. # AIN
  402. 0 string \x33\x18 AIN archive data
  403. 0 string \x33\x17 AIN archive data
  404. # XPA32
  405. 0 string xpa\0\1 XPA32 archive data
  406. # SZip (TODO: doesn't catch all versions)
  407. 0 string SZ\x0a\4 SZip archive data
  408. # XPack DiskImage
  409. 0 string jm XPack DiskImage archive data
  410. # XPack Data
  411. 0 string xpa XPack archive data
  412. # XPack Single Data
  413. 0 string Í\ jm XPack single archive data
  414. # TODO: missing due to unknown magic/magic at end of file:
  415. #DWC
  416. #ARG
  417. #ZAR
  418. #PC/3270
  419. #InstallIt
  420. #RKive
  421. #RK
  422. #XPack Diskimage
  423. # These were inspired by idarc, but actually verified
  424. # Dzip archiver (.dz)
  425. 0 string DZ Dzip archive data
  426. >2 byte x \b, version %i
  427. >3 byte x \b.%i
  428. # ZZip archiver (.zz)
  429. 0 string ZZ\ \0\0 ZZip archive data
  430. 0 string ZZ0 ZZip archive data
  431. # PAQ archiver (.paq)
  432. 0 string \xaa\x40\x5f\x77\x1f\xe5\x82\x0d PAQ archive data
  433. 0 string PAQ PAQ archive data
  434. >3 byte&0xf0 0x30
  435. >>3 byte x (v%c)
  436. # JAR archiver (.j), this is the successor to ARJ, not Java's JAR (which is essentially ZIP)
  437. 0xe string \x1aJar\x1b JAR (ARJ Software, Inc.) archive data
  438. 0 string JARCS JAR (ARJ Software, Inc.) archive data
  439. # ARJ archiver (jason@jarthur.Claremont.EDU)
  440. 0 leshort 0xea60 ARJ archive data
  441. !:mime application/x-arj
  442. >5 byte x \b, v%d,
  443. >8 byte &0x04 multi-volume,
  444. >8 byte &0x10 slash-switched,
  445. >8 byte &0x20 backup,
  446. >34 string x original name: %s,
  447. >7 byte 0 os: MS-DOS
  448. >7 byte 1 os: PRIMOS
  449. >7 byte 2 os: Unix
  450. >7 byte 3 os: Amiga
  451. >7 byte 4 os: Macintosh
  452. >7 byte 5 os: OS/2
  453. >7 byte 6 os: Apple ][ GS
  454. >7 byte 7 os: Atari ST
  455. >7 byte 8 os: NeXT
  456. >7 byte 9 os: VAX/VMS
  457. >3 byte >0 %d]
  458. # [JW] idarc says this is also possible
  459. 2 leshort 0xea60 ARJ archive data
  460. # HA archiver (Greg Roelofs, newt@uchicago.edu)
  461. # This is a really bad format. A file containing HAWAII will match this...
  462. #0 string HA HA archive data,
  463. #>2 leshort =1 1 file,
  464. #>2 leshort >1 %u files,
  465. #>4 byte&0x0f =0 first is type CPY
  466. #>4 byte&0x0f =1 first is type ASC
  467. #>4 byte&0x0f =2 first is type HSC
  468. #>4 byte&0x0f =0x0e first is type DIR
  469. #>4 byte&0x0f =0x0f first is type SPECIAL
  470. # suggestion: at least identify small archives (<1024 files)
  471. 0 belong&0xffff00fc 0x48410000 HA archive data
  472. >2 leshort =1 1 file,
  473. >2 leshort >1 %u files,
  474. >4 byte&0x0f =0 first is type CPY
  475. >4 byte&0x0f =1 first is type ASC
  476. >4 byte&0x0f =2 first is type HSC
  477. >4 byte&0x0f =0x0e first is type DIR
  478. >4 byte&0x0f =0x0f first is type SPECIAL
  479. # HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
  480. 0 string HPAK HPACK archive data
  481. # JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
  482. 0 string \351,\001JAM\ JAM archive,
  483. >7 string >\0 version %.4s
  484. >0x26 byte =0x27 -
  485. >>0x2b string >\0 label %.11s,
  486. >>0x27 lelong x serial %08x,
  487. >>0x36 string >\0 fstype %.8s
  488. # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
  489. 2 string -lh0- LHarc 1.x/ARX archive data [lh0]
  490. !:mime application/x-lharc
  491. 2 string -lh1- LHarc 1.x/ARX archive data [lh1]
  492. !:mime application/x-lharc
  493. 2 string -lz4- LHarc 1.x archive data [lz4]
  494. !:mime application/x-lharc
  495. 2 string -lz5- LHarc 1.x archive data [lz5]
  496. !:mime application/x-lharc
  497. # [never seen any but the last; -lh4- reported in comp.compression:]
  498. 2 string -lzs- LHa/LZS archive data [lzs]
  499. !:mime application/x-lha
  500. 2 string -lh\40- LHa 2.x? archive data [lh ]
  501. !:mime application/x-lha
  502. 2 string -lhd- LHa 2.x? archive data [lhd]
  503. !:mime application/x-lha
  504. 2 string -lh2- LHa 2.x? archive data [lh2]
  505. !:mime application/x-lha
  506. 2 string -lh3- LHa 2.x? archive data [lh3]
  507. !:mime application/x-lha
  508. 2 string -lh4- LHa (2.x) archive data [lh4]
  509. !:mime application/x-lha
  510. 2 string -lh5- LHa (2.x) archive data [lh5]
  511. !:mime application/x-lha
  512. 2 string -lh6- LHa (2.x) archive data [lh6]
  513. !:mime application/x-lha
  514. 2 string -lh7- LHa (2.x)/LHark archive data [lh7]
  515. !:mime application/x-lha
  516. >20 byte x - header level %d
  517. # taken from idarc [JW]
  518. 2 string -lZ PUT archive data
  519. 2 string -lz LZS archive data
  520. 2 string -sw1- Swag archive data
  521. # RAR archiver (Greg Roelofs, newt@uchicago.edu)
  522. 0 string Rar! RAR archive data,
  523. !:mime application/x-rar
  524. >44 byte x v%0x,
  525. >10 byte >0 flags:
  526. >>10 byte &0x01 Archive volume,
  527. >>10 byte &0x02 Commented,
  528. >>10 byte &0x04 Locked,
  529. >>10 byte &0x08 Solid,
  530. >>10 byte &0x20 Authenticated,
  531. >35 byte 0 os: MS-DOS
  532. >35 byte 1 os: OS/2
  533. >35 byte 2 os: Win32
  534. >35 byte 3 os: Unix
  535. # some old version? idarc says:
  536. 0 string RE\x7e\x5e RAR archive data
  537. # SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
  538. 0 string SQSH squished archive data (Acorn RISCOS)
  539. # UC2 archiver (Greg Roelofs, newt@uchicago.edu)
  540. # [JW] see exe section for self-extracting version
  541. 0 string UC2\x1a UC2 archive data
  542. # PKZIP multi-volume archive
  543. 0 string PK\x07\x08PK\x03\x04 Zip multi-volume archive data, at least PKZIP v2.50 to extract
  544. !:mime application/zip
  545. # Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
  546. 0 string PK\003\004
  547. # Specialised zip formats which start with a member named 'mimetype'
  548. # (stored uncompressed, with no 'extra field') containing the file's MIME type.
  549. # Check for have 8-byte name, 0-byte extra field, name "mimetype", and
  550. # contents starting with "application/":
  551. >26 string \x8\0\0\0mimetypeapplication/
  552. # KOffice / OpenOffice & StarOffice / OpenDocument formats
  553. # From: Abel Cheung <abel@oaka.org>
  554. # KOffice (1.2 or above) formats
  555. # (mimetype contains "application/vnd.kde.<SUBTYPE>")
  556. >>50 string vnd.kde. KOffice (>=1.2)
  557. >>>58 string karbon Karbon document
  558. >>>58 string kchart KChart document
  559. >>>58 string kformula KFormula document
  560. >>>58 string kivio Kivio document
  561. >>>58 string kontour Kontour document
  562. >>>58 string kpresenter KPresenter document
  563. >>>58 string kspread KSpread document
  564. >>>58 string kword KWord document
  565. # OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7)
  566. # (mimetype contains "application/vnd.sun.xml.<SUBTYPE>")
  567. >>50 string vnd.sun.xml. OpenOffice.org 1.x
  568. >>>62 string writer Writer
  569. >>>>68 byte !0x2e document
  570. >>>>68 string .template template
  571. >>>>68 string .global global document
  572. >>>62 string calc Calc
  573. >>>>66 byte !0x2e spreadsheet
  574. >>>>66 string .template template
  575. >>>62 string draw Draw
  576. >>>>66 byte !0x2e document
  577. >>>>66 string .template template
  578. >>>62 string impress Impress
  579. >>>>69 byte !0x2e presentation
  580. >>>>69 string .template template
  581. >>>62 string math Math document
  582. >>>62 string base Database file
  583. # OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
  584. # http://lists.oasis-open.org/archives/office/200505/msg00006.html
  585. # (mimetype contains "application/vnd.oasis.opendocument.<SUBTYPE>")
  586. >>50 string vnd.oasis.opendocument. OpenDocument
  587. >>>73 string text
  588. >>>>77 byte !0x2d Text
  589. !:mime application/vnd.oasis.opendocument.text
  590. >>>>77 string -template Text Template
  591. !:mime application/vnd.oasis.opendocument.text-template
  592. >>>>77 string -web HTML Document Template
  593. !:mime application/vnd.oasis.opendocument.text-web
  594. >>>>77 string -master Master Document
  595. !:mime application/vnd.oasis.opendocument.text-master
  596. >>>73 string graphics
  597. >>>>81 byte !0x2d Drawing
  598. !:mime application/vnd.oasis.opendocument.graphics
  599. >>>>81 string -template Template
  600. !:mime application/vnd.oasis.opendocument.graphics-template
  601. >>>73 string presentation
  602. >>>>85 byte !0x2d Presentation
  603. !:mime application/vnd.oasis.opendocument.presentation
  604. >>>>85 string -template Template
  605. !:mime application/vnd.oasis.opendocument.presentation-template
  606. >>>73 string spreadsheet
  607. >>>>84 byte !0x2d Spreadsheet
  608. !:mime application/vnd.oasis.opendocument.spreadsheet
  609. >>>>84 string -template Template
  610. !:mime application/vnd.oasis.opendocument.spreadsheet-template
  611. >>>73 string chart
  612. >>>>78 byte !0x2d Chart
  613. !:mime application/vnd.oasis.opendocument.chart
  614. >>>>78 string -template Template
  615. !:mime application/vnd.oasis.opendocument.chart-template
  616. >>>73 string formula
  617. >>>>80 byte !0x2d Formula
  618. !:mime application/vnd.oasis.opendocument.formula
  619. >>>>80 string -template Template
  620. !:mime application/vnd.oasis.opendocument.formula-template
  621. >>>73 string database Database
  622. !:mime application/vnd.oasis.opendocument.database
  623. >>>73 string image
  624. >>>>78 byte !0x2d Image
  625. !:mime application/vnd.oasis.opendocument.image
  626. >>>>78 string -template Template
  627. !:mime application/vnd.oasis.opendocument.image-template
  628. # EPUB (OEBPS) books using OCF (OEBPS Container Format)
  629. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  630. # http://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4.
  631. # (mimetype contains "application/epub+zip")
  632. >>50 string epub+zip EPUB ebook data
  633. !:mime application/epub+zip
  634. # Catch other ZIP-with-mimetype formats
  635. # In a ZIP file, the bytes immediately after a member's contents are
  636. # always "PK". The 2 regex rules here print the "mimetype" member's
  637. # contents up to the first 'P'. Luckily, most MIME types don't contain
  638. # any capital 'P's. This is a kludge.
  639. # (mimetype contains "application/<OTHER>")
  640. >>50 string !epub+zip
  641. >>>50 string !vnd.oasis.opendocument.
  642. >>>>50 string !vnd.sun.xml.
  643. >>>>>50 string !vnd.kde.
  644. >>>>>>38 regex [!-OQ-~]+ Zip data (MIME type "%s"?)
  645. !:mime application/zip
  646. # (mimetype contents other than "application/*")
  647. >26 string \x8\0\0\0mimetype
  648. >>38 string !application/
  649. >>>38 regex [!-OQ-~]+ Zip data (MIME type "%s"?)
  650. !:mime application/zip
  651. # Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
  652. # Next line excludes specialized formats:
  653. >26 string !\x8\0\0\0mimetype Zip archive data
  654. !:mime application/zip
  655. >>4 byte 0x09 \b, at least v0.9 to extract
  656. >>4 byte 0x0a \b, at least v1.0 to extract
  657. >>4 byte 0x0b \b, at least v1.1 to extract
  658. >>4 byte 0x14 \b, at least v2.0 to extract
  659. >>4 byte 0x2d \b, at least v3.0 to extract
  660. >>0x161 string WINZIP \b, WinZIP self-extracting
  661. # StarView Metafile
  662. # From Pierre Ducroquet <pinaraf@pinaraf.info>
  663. 0 string VCLMTF StarView MetaFile
  664. >6 beshort x \b, version %d
  665. >8 belong x \b, size %d
  666. # Zoo archiver
  667. 20 lelong 0xfdc4a7dc Zoo archive data
  668. !:mime application/x-zoo
  669. >4 byte >48 \b, v%c.
  670. >>6 byte >47 \b%c
  671. >>>7 byte >47 \b%c
  672. >32 byte >0 \b, modify: v%d
  673. >>33 byte x \b.%d+
  674. >42 lelong 0xfdc4a7dc \b,
  675. >>70 byte >0 extract: v%d
  676. >>>71 byte x \b.%d+
  677. # Shell archives
  678. 10 string #\ This\ is\ a\ shell\ archive shell archive text
  679. !:mime application/octet-stream
  680. #
  681. # LBR. NB: May conflict with the questionable
  682. # "binary Computer Graphics Metafile" format.
  683. #
  684. 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data
  685. #
  686. # PMA (CP/M derivative of LHA)
  687. #
  688. 2 string -pm0- PMarc archive data [pm0]
  689. 2 string -pm1- PMarc archive data [pm1]
  690. 2 string -pm2- PMarc archive data [pm2]
  691. 2 string -pms- PMarc SFX archive (CP/M, DOS)
  692. 5 string -pc1- PopCom compressed executable (CP/M)
  693. # From Rafael Laboissiere <rafael@laboissiere.net>
  694. # The Project Revision Control System (see
  695. # http://prcs.sourceforge.net) generates a packaged project
  696. # file which is recognized by the following entry:
  697. 0 leshort 0xeb81 PRCS packaged project
  698. # Microsoft cabinets
  699. # by David Necas (Yeti) <yeti@physics.muni.cz>
  700. #0 string MSCF\0\0\0\0 Microsoft cabinet file data,
  701. #>25 byte x v%d
  702. #>24 byte x \b.%d
  703. # MPi: All CABs have version 1.3, so this is pointless.
  704. # Better magic in debian-additions.
  705. # GTKtalog catalogs
  706. # by David Necas (Yeti) <yeti@physics.muni.cz>
  707. 4 string gtktalog\ GTKtalog catalog data,
  708. >13 string 3 version 3
  709. >>14 beshort 0x677a (gzipped)
  710. >>14 beshort !0x677a (not gzipped)
  711. >13 string >3 version %s
  712. ############################################################################
  713. # Parity archive reconstruction file, the 'par' file format now used on Usenet.
  714. 0 string PAR\0 PARity archive data
  715. >48 leshort =0 - Index file
  716. >48 leshort >0 - file number %d
  717. # Felix von Leitner <felix-file@fefe.de>
  718. 0 string d8:announce BitTorrent file
  719. !:mime application/x-bittorrent
  720. # Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
  721. 0 beshort 0x0e0f Atari MSA archive data
  722. >2 beshort x \b, %d sectors per track
  723. >4 beshort 0 \b, 1 sided
  724. >4 beshort 1 \b, 2 sided
  725. >6 beshort x \b, starting track: %d
  726. >8 beshort x \b, ending track: %d
  727. # Alternate ZIP string (amc@arwen.cs.berkeley.edu)
  728. 0 string PK00PK\003\004 Zip archive data
  729. # ACE archive (from http://www.wotsit.org/download.asp?f=ace)
  730. # by Stefan `Sec` Zehl <sec@42.org>
  731. 7 string **ACE** ACE archive data
  732. >15 byte >0 version %d
  733. >16 byte =0x00 \b, from MS-DOS
  734. >16 byte =0x01 \b, from OS/2
  735. >16 byte =0x02 \b, from Win/32
  736. >16 byte =0x03 \b, from Unix
  737. >16 byte =0x04 \b, from MacOS
  738. >16 byte =0x05 \b, from WinNT
  739. >16 byte =0x06 \b, from Primos
  740. >16 byte =0x07 \b, from AppleGS
  741. >16 byte =0x08 \b, from Atari
  742. >16 byte =0x09 \b, from Vax/VMS
  743. >16 byte =0x0A \b, from Amiga
  744. >16 byte =0x0B \b, from Next
  745. >14 byte x \b, version %d to extract
  746. >5 leshort &0x0080 \b, multiple volumes,
  747. >>17 byte x \b (part %d),
  748. >5 leshort &0x0002 \b, contains comment
  749. >5 leshort &0x0200 \b, sfx
  750. >5 leshort &0x0400 \b, small dictionary
  751. >5 leshort &0x0800 \b, multi-volume
  752. >5 leshort &0x1000 \b, contains AV-String
  753. >>30 string \x16*UNREGISTERED\x20VERSION* (unregistered)
  754. >5 leshort &0x2000 \b, with recovery record
  755. >5 leshort &0x4000 \b, locked
  756. >5 leshort &0x8000 \b, solid
  757. # Date in MS-DOS format (whatever that is)
  758. #>18 lelong x Created on
  759. # sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
  760. # <doj@cubic.org>
  761. 0x1A string sfArk sfArk compressed Soundfont
  762. >0x15 string 2
  763. >>0x1 string >\0 Version %s
  764. >>0x2A string >\0 : %s
  765. # DR-DOS 7.03 Packed File *.??_
  766. 0 string Packed\ File\ Personal NetWare Packed File
  767. >12 string x \b, was "%.12s"
  768. # EET archive
  769. # From: Tilman Sauerbeck <tilman@code-monkey.de>
  770. 0 belong 0x1ee7ff00 EET archive
  771. !:mime application/x-eet
  772. # rzip archives
  773. 0 string RZIP rzip compressed data
  774. >4 byte x - version %d
  775. >5 byte x \b.%d
  776. >6 belong x (%d bytes)
  777. # From: "Robert Dale" <robdale@gmail.com>
  778. 0 belong 123 dar archive,
  779. >4 belong x label "%.8x
  780. >>8 belong x %.8x
  781. >>>12 beshort x %.4x"
  782. >14 byte 0x54 end slice
  783. >14 beshort 0x4e4e multi-part
  784. >14 beshort 0x4e53 multi-part, with -S
  785. # Symbian installation files
  786. # http://www.thouky.co.uk/software/psifs/sis.html
  787. # http://developer.symbian.com/main/downloads/papers/SymbianOSv91/softwareinstallsis.pdf
  788. 8 lelong 0x10000419 Symbian installation file
  789. !:mime application/vnd.symbian.install
  790. >4 lelong 0x1000006D (EPOC release 3/4/5)
  791. >4 lelong 0x10003A12 (EPOC release 6)
  792. 0 lelong 0x10201A7A Symbian installation file (Symbian OS 9.x)
  793. !:mime x-epoc/x-sisx-app
  794. # From "Nelson A. de Oliveira" <naoliv@gmail.com>
  795. 0 string MPQ\032 MoPaQ (MPQ) archive
  796. # From: Dirk Jagdmann <doj@cubic.org>
  797. # xar archive format: http://code.google.com/p/xar/
  798. 0 string xar! xar archive
  799. >6 beshort x - version %ld
  800. # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
  801. # .kgb
  802. 0 string KGB_arch KGB Archiver file
  803. >10 string x with compression level %.1s
  804. # xar (eXtensible ARchiver) archive
  805. # From: "David Remahl" <dremahl@apple.com>
  806. 0 string xar! xar archive
  807. #>4 beshort x header size %d
  808. >6 beshort x version %d,
  809. #>8 quad x compressed TOC: %d,
  810. #>16 quad x uncompressed TOC: %d,
  811. >24 belong 0 no checksum
  812. >24 belong 1 SHA-1 checksum
  813. >24 belong 2 MD5 checksum
  814. # Type: Parity Archive
  815. # From: Daniel van Eeden <daniel_e@dds.nl>
  816. 0 string PAR2 Parity Archive Volume Set
  817. # Bacula volume format. (Volumes always start with a block header.)
  818. # URL: http://bacula.org/3.0.x-manuals/en/developers/developers/Block_Header.html
  819. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  820. 12 string BB02 Bacula volume
  821. >20 bedate x \b, started %s
  822. # ePub is XHTML + XML inside a ZIP archive. The first member of the
  823. # archive must be an uncompressed file called 'mimetype' with contents
  824. # 'application/epub+zip'
  825. # start by checking that this is a ZIP archive, then check for the
  826. # proper mimetype file
  827. # From: Ralf Brown <ralf.brown@gmail.com>
  828. 0 string PK\003\004
  829. >0x1E string mimetypeapplication/epub+zip EPUB document
  830. !:mime application/epub+zip
  831. # From: "Michał Górny" <mgorny@gentoo.org>
  832. # ZPAQ: http://mattmahoney.net/dc/zpaq.html
  833. 0 string zPQ ZPAQ stream
  834. >3 byte x \b, level %d