archive 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852
  1. #------------------------------------------------------------------------------
  2. # $File: archive,v 1.151 2021/08/16 10:19:56 christos 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 also handled in the C code ../../src/is_tar.c.
  8. # POSIX tar archives
  9. # URL: https://en.wikipedia.org/wiki/Tar_(computing)
  10. # Reference: https://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5&manpath=FreeBSD+8-current
  11. # header mainly padded with nul bytes
  12. 500 quad 0
  13. !:strength /2
  14. # filename or extended attribute printable strings in range space null til umlaut ue
  15. >0 ubeshort >0x1F00
  16. >>0 ubeshort <0xFCFD
  17. # last 4 header bytes often null but tar\0 in gtarfail2.tar gtarfail.tar-bad
  18. # at https://sourceforge.net/projects/s-tar/files/testscripts/
  19. >>>508 ubelong&0x8B9E8DFF 0
  20. # nul, space or ascii digit 0-7 at start of mode
  21. >>>>100 ubyte&0xC8 =0
  22. >>>>>101 ubyte&0xC8 =0
  23. # nul, space at end of check sum
  24. >>>>>>155 ubyte&0xDF =0
  25. # space or ascii digit 0 at start of check sum
  26. >>>>>>>148 ubyte&0xEF =0x20
  27. >>>>>>>>0 use tar-file
  28. # minimal check and then display tar archive information which can also be
  29. # embedded inside others like Android Backup, Clam AntiVirus database
  30. 0 name tar-file
  31. >257 string !ustar
  32. # header padded with nuls
  33. >>257 ulong =0
  34. # GNU tar version 1.29 with non pax format option without refusing
  35. # creates misleading V7 header for Long path, Multi-volume, Volume type
  36. >>>156 ubyte 0x4c GNU tar archive
  37. !:mime application/x-gtar
  38. !:ext tar/gtar
  39. >>>156 ubyte 0x4d GNU tar archive
  40. !:mime application/x-gtar
  41. !:ext tar/gtar
  42. >>>156 ubyte 0x56 GNU tar archive
  43. !:mime application/x-gtar
  44. !:ext tar/gtar
  45. >>>156 default x tar archive (V7)
  46. !:mime application/x-tar
  47. !:ext tar
  48. # other stuff in padding
  49. # some implementations add new fields to the blank area at the end of the header record
  50. # created for example by DOS TAR 3.20g 1994 Tim V.Shapore with -j option
  51. >>257 ulong !0 tar archive (old)
  52. !:mime application/x-tar
  53. !:ext tar
  54. # magic in newer, GNU, posix variants
  55. >257 string =ustar
  56. # 2 last char of magic and UStar version because string expression does not work
  57. # 2 space characters followed by a null for GNU variant
  58. >>261 ubelong =0x72202000 POSIX tar archive (GNU)
  59. !:mime application/x-gtar
  60. !:ext tar/gtar
  61. # UStar version with ASCII "00"
  62. >>261 ubelong 0x72003030 POSIX
  63. # gLOBAL and ExTENSION type only found in POSIX.1-2001 format
  64. >>>156 ubyte 0x67 \b.1-2001
  65. >>>156 ubyte 0x78 \b.1-2001
  66. >>>156 ubyte x tar archive
  67. !:mime application/x-ustar
  68. !:ext tar/ustar
  69. # version with 2 binary nuls embedded in Android Backup like com.android.settings.ab
  70. >>261 ubelong 0x72000000 tar archive (ustar)
  71. !:mime application/x-ustar
  72. !:ext tar/ustar
  73. # not seen ustar variant with garbish version
  74. >>261 default x tar archive (unknown ustar)
  75. !:mime application/x-ustar
  76. !:ext tar/ustar
  77. # type flag of 1st tar archive member
  78. #>156 ubyte x \b, %c-type
  79. >156 ubyte x
  80. >>156 ubyte 0 \b, file
  81. >>156 ubyte 0x30 \b, file
  82. >>156 ubyte 0x31 \b, hard link
  83. >>156 ubyte 0x32 \b, symlink
  84. >>156 ubyte 0x33 \b, char device
  85. >>156 ubyte 0x34 \b, block device
  86. >>156 ubyte 0x35 \b, directory
  87. >>156 ubyte 0x36 \b, fifo
  88. >>156 ubyte 0x37 \b, reserved
  89. >>156 ubyte 0x4c \b, long path
  90. >>156 ubyte 0x4d \b, multi volume
  91. >>156 ubyte 0x56 \b, volume
  92. >>156 ubyte 0x67 \b, global
  93. >>156 ubyte 0x78 \b, extension
  94. >>156 default x \b, type
  95. >>>156 ubyte x '%c'
  96. # name[100]
  97. >0 string >\0 %-.60s
  98. # mode mainly stored as an octal number in ASCII null or space terminated
  99. >100 string >\0 \b, mode %-.7s
  100. # user id mainly as octal numbers in ASCII null or space terminated
  101. >108 string >\0 \b, uid %-.7s
  102. # group id mainly as octal numbers in ASCII null or space terminated
  103. >116 string >\0 \b, gid %-.7s
  104. # size mainly as octal number in ASCII
  105. >124 ubyte <0x38
  106. >>124 string >\0 \b, size %-.12s
  107. # coding indicated by setting the high-order bit of the leftmost byte
  108. >124 ubyte >0xEF \b, size 0x
  109. >>124 ubyte !0xff \b%2.2x
  110. >>125 ubyte !0xff \b%2.2x
  111. >>126 ubyte !0xff \b%2.2x
  112. >>127 ubyte !0xff \b%2.2x
  113. >>128 ubyte !0xff \b%2.2x
  114. >>129 ubyte !0xff \b%2.2x
  115. >>130 ubyte !0xff \b%2.2x
  116. >>131 ubyte !0xff \b%2.2x
  117. >>132 ubyte !0xff \b%2.2x
  118. >>133 ubyte !0xff \b%2.2x
  119. >>134 ubyte !0xff \b%2.2x
  120. >>135 ubyte !0xff \b%2.2x
  121. # seconds since 0:0:0 1 jan 1970 UTC as octal number mainly in ASCII null or space terminated
  122. >136 string >\0 \b, seconds %-.11s
  123. # header checksum stored as an octal number in ASCII null or space terminated
  124. #>148 string x \b, cksum %.7s
  125. # linkname[100]
  126. >157 string >\0 \b, linkname %-.40s
  127. # additional fields for ustar
  128. >257 string =ustar
  129. # owner user name null terminated
  130. >>265 string >\0 \b, user %-.32s
  131. # group name null terminated
  132. >>297 string >\0 \b, group %-.32s
  133. # device major minor if not zero
  134. >>329 ubequad&0xCFCFCFCFcFcFcFdf !0
  135. >>>329 string x \b, devmaj %-.7s
  136. >>337 ubequad&0xCFCFCFCFcFcFcFdf !0
  137. >>>337 string x \b, devmin %-.7s
  138. # prefix[155]
  139. >>345 string >\0 \b, prefix %-.155s
  140. # old non ustar/POSIX tar
  141. >257 string !ustar
  142. >>508 string =tar\0
  143. # padding[255] in old star
  144. >>>257 string >\0 \b, padding: %-.40s
  145. >>508 default x
  146. # padding[255] in old tar sometimes comment field
  147. >>>257 string >\0 \b, comment: %-.40s
  148. # Incremental snapshot gnu-tar format from:
  149. # https://www.gnu.org/software/tar/manual/html_node/Snapshot-Files.html
  150. 0 string GNU\ tar- GNU tar incremental snapshot data
  151. >&0 regex [0-9]\.[0-9]+-[0-9]+ version %s
  152. # cpio archives
  153. #
  154. # Yes, the top two "cpio archive" formats *are* supposed to just be "short".
  155. # The idea is to indicate archives produced on machines with the same
  156. # byte order as the machine running "file" with "cpio archive", and
  157. # to indicate archives produced on machines with the opposite byte order
  158. # from the machine running "file" with "byte-swapped cpio archive".
  159. #
  160. # The SVR4 "cpio(4)" hints that there are additional formats, but they
  161. # are defined as "short"s; I think all the new formats are
  162. # character-header formats and thus are strings, not numbers.
  163. 0 short 070707 cpio archive
  164. !:mime application/x-cpio
  165. 0 short 0143561 byte-swapped cpio archive
  166. !:mime application/x-cpio # encoding: swapped
  167. 0 string 070707 ASCII cpio archive (pre-SVR4 or odc)
  168. !:mime application/x-cpio
  169. 0 string 070701 ASCII cpio archive (SVR4 with no CRC)
  170. !:mime application/x-cpio
  171. 0 string 070702 ASCII cpio archive (SVR4 with CRC)
  172. !:mime application/x-cpio
  173. #
  174. # Various archive formats used by various versions of the "ar"
  175. # command.
  176. #
  177. #
  178. # Original UNIX archive formats.
  179. # They were written with binary values in host byte order, and
  180. # the magic number was a host "int", which might have been 16 bits
  181. # or 32 bits. We don't say "PDP-11" or "VAX", as there might have
  182. # been ports to little-endian 16-bit-int or 32-bit-int platforms
  183. # (x86?) using some of those formats; if none existed, feel free
  184. # to use "PDP-11" for little-endian 16-bit and "VAX" for little-endian
  185. # 32-bit. There might have been big-endian ports of that sort as
  186. # well.
  187. #
  188. 0 leshort 0177555 very old 16-bit-int little-endian archive
  189. 0 beshort 0177555 very old 16-bit-int big-endian archive
  190. 0 lelong 0177555 very old 32-bit-int little-endian archive
  191. 0 belong 0177555 very old 32-bit-int big-endian archive
  192. 0 leshort 0177545 old 16-bit-int little-endian archive
  193. >2 string __.SYMDEF random library
  194. 0 beshort 0177545 old 16-bit-int big-endian archive
  195. >2 string __.SYMDEF random library
  196. 0 lelong 0177545 old 32-bit-int little-endian archive
  197. >4 string __.SYMDEF random library
  198. 0 belong 0177545 old 32-bit-int big-endian archive
  199. >4 string __.SYMDEF random library
  200. #
  201. # From "pdp" (but why a 4-byte quantity?)
  202. #
  203. 0 lelong 0x39bed PDP-11 old archive
  204. 0 lelong 0x39bee PDP-11 4.0 archive
  205. #
  206. # XXX - what flavor of APL used this, and was it a variant of
  207. # some ar archive format? It's similar to, but not the same
  208. # as, the APL workspace magic numbers in pdp.
  209. #
  210. 0 long 0100554 apl workspace
  211. #
  212. # System V Release 1 portable(?) archive format.
  213. #
  214. 0 string =<ar> System V Release 1 ar archive
  215. !:mime application/x-archive
  216. #
  217. # Debian package; it's in the portable archive format, and needs to go
  218. # before the entry for regular portable archives, as it's recognized as
  219. # a portable archive whose first member has a name beginning with
  220. # "debian".
  221. #
  222. # Update: Joerg Jenderek
  223. # URL: https://en.wikipedia.org/wiki/Deb_(file_format)
  224. 0 string =!<arch>\ndebian
  225. # https://manpages.debian.org/testing/dpkg/dpkg-split.1.en.html
  226. >14 string -split part of multipart Debian package
  227. !:mime application/vnd.debian.binary-package
  228. # udeb is used for stripped down deb file
  229. !:ext deb/udeb
  230. >14 string -binary Debian binary package
  231. !:mime application/vnd.debian.binary-package
  232. # For ipk packager see also https://en.wikipedia.org/wiki/Opkg
  233. !:ext deb/udeb/ipk
  234. # This should not happen
  235. >14 default x Unknown Debian package
  236. # NL terminated version; for most Debian cases this is 2.0 or 2.1 for split
  237. >68 string >\0 (format %s)
  238. #>68 string !2.0\n
  239. #>>68 string x (format %.3s)
  240. >68 string =2.0\n
  241. # 2nd archive name=control archive name like control.tar.gz or control.tar.xz
  242. >>72 string >\0 \b, with %.14s
  243. # look for 3rd archive name=data archive name like data.tar.{gz,xz,bz2,lzma}
  244. >>0 search/0x93e4f data.tar. \b, data compression
  245. # the above line only works if FILE_BYTES_MAX in ../../src/file.h is raised
  246. # for example like libreoffice-dev-doc_1%3a5.2.7-1+rpi1+deb9u3_all.deb
  247. >>>&0 string x %.2s
  248. # skip space (0x20 BSD) and slash (0x2f System V) character marking end of name
  249. >>>&2 ubyte !0x20
  250. >>>>&-1 ubyte !0x2f
  251. # display 3rd character of file name extension like 2 of bz2 or m of lzma
  252. >>>>>&-1 ubyte x \b%c
  253. >>>>>>&0 ubyte !0x20
  254. >>>>>>>&-1 ubyte !0x2f
  255. # display 4th character of file name extension like a of lzma
  256. >>>>>>>>&-1 ubyte x \b%c
  257. # split debian package case
  258. >68 string =2.1\n
  259. # dpkg-1.18.25/dpkg-split/info.c
  260. # NL terminated ASCII package name like ckermit
  261. >>&0 string x \b, %s
  262. # NL terminated package version like 302-5.3
  263. >>>&1 string x %s
  264. # NL terminated MD5 checksum
  265. >>>>&1 string x \b, MD5 %s
  266. # NL terminated original package length
  267. >>>>>&1 string x \b, unsplitted size %s
  268. # NL terminated part length
  269. >>>>>>&1 string x \b, part length %s
  270. # NL terminated package part like n/m
  271. >>>>>>>&1 string x \b, part %s
  272. # NL terminated package architecture like armhf since dpkg 1.16.1 or later
  273. >>>>>>>>&1 string x \b, %s
  274. #
  275. # MIPS archive; they're in the portable archive format, and need to go
  276. # before the entry for regular portable archives, as it's recognized as
  277. # a portable archive whose first member has a name beginning with
  278. # "__________E".
  279. #
  280. 0 string =!<arch>\n__________E MIPS archive
  281. !:mime application/x-archive
  282. >20 string U with MIPS Ucode members
  283. >21 string L with MIPSEL members
  284. >21 string B with MIPSEB members
  285. >19 string L and an EL hash table
  286. >19 string B and an EB hash table
  287. >22 string X -- out of date
  288. #
  289. # BSD/SVR2-and-later portable archive formats.
  290. #
  291. # Update: Joerg Jenderek
  292. # URL: http://fileformats.archiveteam.org/wiki/AR
  293. # Reference: https://www.unix.com/man-page/opensolaris/3HEAD/ar.h/
  294. # Note: Mach-O universal binary in ./cafebabe is dependent
  295. # TODO: unify current ar archive, MIPS archive, Debian package
  296. # distinguish BSD, SVR; 32, 64 bit; HP from other 32-bit SVR;
  297. # *.ar packages from *.a libraries. handle empty archive
  298. 0 string =!<arch>\n current ar archive
  299. # print first and possibly second ar_name[16] for debugging purpose
  300. #>8 string x \b, 1st "%.16s"
  301. #>68 string x \b, 2nd "%.16s"
  302. !:mime application/x-archive
  303. # a in most case for libraries; lib for Microsoft libraries; ar else cases
  304. !:ext a/lib/ar
  305. >8 string __.SYMDEF random library
  306. # first member with long marked name __.SYMDEF SORTED implies BSD library
  307. >68 string __.SYMDEF\ SORTED random library
  308. # Reference: https://parisc.wiki.kernel.org/images-parisc/b/b2/Rad_11_0_32.pdf
  309. # "archive file" entry moved from ./hp
  310. # LST header system_id 0210h~PA-RISC 1.1,... identifies the target architecture
  311. # LST header a_magic 0619h~relocatable library
  312. >68 belong 0x020b0619 - PA-RISC1.0 relocatable library
  313. >68 belong 0x02100619 - PA-RISC1.1 relocatable library
  314. >68 belong 0x02110619 - PA-RISC1.2 relocatable library
  315. >68 belong 0x02140619 - PA-RISC2.0 relocatable library
  316. #EOF for common ar archives
  317. #
  318. # "Thin" archive, as can be produced by GNU ar.
  319. #
  320. 0 string =!<thin>\n thin archive with
  321. >68 belong 0 no symbol entries
  322. >68 belong 1 %d symbol entry
  323. >68 belong >1 %d symbol entries
  324. 0 search/1 -h- Software Tools format archive text
  325. # ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
  326. #
  327. # The first byte is the magic (0x1a), byte 2 is the compression type for
  328. # the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
  329. # filename of the first file (null terminated). Since some types collide
  330. # we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
  331. # 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%). 0x01 collides with terminfo.
  332. 0 lelong&0x8080ffff 0x0000081a ARC archive data, dynamic LZW
  333. !:mime application/x-arc
  334. 0 lelong&0x8080ffff 0x0000091a ARC archive data, squashed
  335. !:mime application/x-arc
  336. 0 lelong&0x8080ffff 0x0000021a ARC archive data, uncompressed
  337. !:mime application/x-arc
  338. 0 lelong&0x8080ffff 0x0000031a ARC archive data, packed
  339. !:mime application/x-arc
  340. 0 lelong&0x8080ffff 0x0000041a ARC archive data, squeezed
  341. !:mime application/x-arc
  342. 0 lelong&0x8080ffff 0x0000061a ARC archive data, crunched
  343. !:mime application/x-arc
  344. # [JW] stuff taken from idarc, obviously ARC successors:
  345. 0 lelong&0x8080ffff 0x00000a1a PAK archive data
  346. !:mime application/x-arc
  347. 0 lelong&0x8080ffff 0x0000141a ARC+ archive data
  348. !:mime application/x-arc
  349. 0 lelong&0x8080ffff 0x0000481a HYP archive data
  350. !:mime application/x-arc
  351. # Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
  352. # I can't create either SPARK or ArcFS archives so I have not tested this stuff
  353. # [GRR: the original entries collide with ARC, above; replaced with combined
  354. # version (not tested)]
  355. #0 byte 0x1a RISC OS archive (spark format)
  356. 0 string \032archive RISC OS archive (ArcFS format)
  357. 0 string Archive\000 RISC OS archive (ArcFS format)
  358. # All these were taken from idarc, many could not be verified. Unfortunately,
  359. # there were many low-quality sigs, i.e. easy to trigger false positives.
  360. # Please notify me of any real-world fishy/ambiguous signatures and I'll try
  361. # to get my hands on the actual archiver and see if I find something better. [JW]
  362. # probably many can be enhanced by finding some 0-byte or control char near the start
  363. # idarc calls this Crush/Uncompressed... *shrug*
  364. 0 string CRUSH Crush archive data
  365. # Squeeze It (.sqz)
  366. 0 string HLSQZ Squeeze It archive data
  367. # SQWEZ
  368. 0 string SQWEZ SQWEZ archive data
  369. # HPack (.hpk)
  370. 0 string HPAK HPack archive data
  371. # HAP
  372. 0 string \x91\x33HF HAP archive data
  373. # MD/MDCD
  374. 0 string MDmd MDCD archive data
  375. # LIM
  376. 0 string LIM\x1a LIM archive data
  377. # SAR
  378. 3 string LH5 SAR archive data
  379. # BSArc/BS2
  380. 0 string \212\3SB\020\0 BSArc/BS2 archive data
  381. # Bethesda Softworks Archive (Oblivion)
  382. 0 string BSA\0 BSArc archive data
  383. >4 lelong x version %d
  384. # MAR
  385. 2 string =-ah MAR archive data
  386. # ACB
  387. #0 belong&0x00f800ff 0x00800000 ACB archive data
  388. # CPZ
  389. # TODO, this is what idarc says: 0 string \0\0\0 CPZ archive data
  390. # JRC
  391. 0 string JRchive JRC archive data
  392. # Quantum
  393. 0 string DS\0 Quantum archive data
  394. # ReSOF
  395. 0 string PK\3\6 ReSOF archive data
  396. # QuArk
  397. 0 string 7\4 QuArk archive data
  398. # YAC
  399. 14 string YC YAC archive data
  400. # X1
  401. 0 string X1 X1 archive data
  402. 0 string XhDr X1 archive data
  403. # CDC Codec (.dqt)
  404. 0 belong&0xffffe000 0x76ff2000 CDC Codec archive data
  405. # AMGC
  406. 0 string \xad6" AMGC archive data
  407. # NuLIB
  408. 0 string N\xc3\xb5F\xc3\xa9lx\xc3\xa5 NuLIB archive data
  409. # PakLeo
  410. 0 string LEOLZW PAKLeo archive data
  411. # ChArc
  412. 0 string SChF ChArc archive data
  413. # PSA
  414. 0 string PSA PSA archive data
  415. # CrossePAC
  416. 0 string DSIGDCC CrossePAC archive data
  417. # Freeze
  418. 0 string \x1f\x9f\x4a\x10\x0a Freeze archive data
  419. # KBoom
  420. 0 string \xc2\xa8MP\xc2\xa8 KBoom archive data
  421. # NSQ, must go after CDC Codec
  422. 0 string \x76\xff NSQ archive data
  423. # DPA
  424. 0 string Dirk\ Paehl DPA archive data
  425. # BA
  426. # TODO: idarc says "bytes 0-2 == bytes 3-5"
  427. # TTComp
  428. # URL: http://fileformats.archiveteam.org/wiki/TTComp_archive
  429. # Update: Joerg Jenderek
  430. # GRR: line below is too general as it matches also Panorama database "TCDB 2003-10 demo.pan", others
  431. 0 string \0\6
  432. # look for first keyword of Panorama database *.pan
  433. >12 search/261 DESIGN
  434. # skip keyword with low entropy
  435. >12 default x
  436. # skip DOS 2.0 backup id file, sequence 6 with many nils like BACKUPID_xx6.@@@ handled by ./msdos
  437. >>8 quad !0
  438. >>>0 use ttcomp
  439. # variant ASCII, 4K dictionary (strength=48=50-2). With strength=49 wrong order! WHY?
  440. 0 string \1\6
  441. # TODO:
  442. # skip VAX-order 68k Blit mpx/mux executable (strength=50) handled by ./blit
  443. !:strength -2
  444. >0 use ttcomp
  445. 0 string \0\5
  446. # skip some DOS 2.0 backup id file, sequence 5 with many nils like BACKUPID_075.@@@ handled by ./msdos
  447. >8 quad !0
  448. >>0 use ttcomp
  449. 0 string \1\5
  450. # TODO:
  451. # variant ASCII, 2K dictionary (strength=48=50-2). With strength=49 wrong order! WHY?
  452. # skip ctab data (strength=50) handled by ./ibm6000
  453. # skip locale data table (strength=50) handled by ./digital
  454. !:strength -2
  455. >0 use ttcomp
  456. 0 string \0\4
  457. # skip many Maple help database *.hdb with version tag handled by ./maple
  458. >1028 string !version
  459. # skip veclib maple.hdb by looking for Mable keyword
  460. >>4 search/1091 Maple\040
  461. #>4 search/34090 Maple\040
  462. >>4 default x
  463. # skip DOS 2.0-3.2 backed up sequence 4 with many nils like LOTUS5.RAR handled by ./msdos
  464. # skip xBASE Compound Index file *.CDX with many nils
  465. >>>0x54 quad !0
  466. >>>>0 use ttcomp
  467. 0 string \1\4
  468. # TODO:
  469. # skip Commodore PET BASIC 4.0 program *.prg
  470. # variant ASCII, 1K dictionary (strength=48=50-2). With strength=49 wrong order! WHY?
  471. # skip shared library (strength=50) handled by ./ibm6000
  472. !:strength -2
  473. >0 use ttcomp
  474. # display information of TTComp archive
  475. 0 name ttcomp
  476. # (version 5.25) labeled the entry as "TTComp archive data"
  477. >0 ubyte x TTComp archive data
  478. !:mime application/x-compress-ttcomp
  479. # PBACKSCR.PI1
  480. !:ext $xe/$ts/pi1/__d
  481. # compression type: 0~binary compression 1~ASCII compression
  482. >0 ubyte 0 \b, binary
  483. >0 ubyte 1 \b, ASCII
  484. # size of the dictionary: 4~1024 bytes 5~2048 bytes 6~4096 bytes
  485. >1 ubyte 4 \b, 1K
  486. >1 ubyte 5 \b, 2K
  487. >1 ubyte 6 \b, 4K
  488. >1 ubyte x dictionary
  489. # https://mark0.net/forum/index.php?topic=848
  490. # last 3 bytes probably have only 8 possible bit sequences
  491. # xxxxxxxx 0000000x 11111111 ____FFh
  492. # xxxxxxxx 10000000 01111111 __807Fh
  493. # 0xxxxxxx 11000000 00111111 __C03Fh
  494. # 00xxxxxx 11100000 00011111 __E01Fh
  495. # 000xxxxx 11110000 00001111 __F00Fh
  496. # 0000xxxx 11111000 00000111 __F807h
  497. # 00000xxx 11111100 00000011 __FC03h
  498. # 000000xx 11111110 00000001 __FE01h
  499. # but for quickgif.__d 0A7DD4h
  500. #>-3 ubyte x \b, last 3 bytes 0x%2.2x
  501. #>-2 ubeshort x \b%4.4x
  502. # From: Joerg Jenderek
  503. # URL: https://wiki.68kmla.org/DiskCopy_4.2_format_specification
  504. # reference: http://nulib.com/library/FTN.e00005.htm
  505. 0x52 ubeshort 0x0100
  506. # test for disk image size equal or above 400k
  507. >0x40 ubelong >409599
  508. # test also for disk image size equal or below 1440k to skip
  509. # windows7en.mbr UNICODE.DAT
  510. >>0x40 ubelong <1474561
  511. # To skip Flags$StringJoiner.class with size 00106A61h test also for only 4 disk image sizes
  512. # 00064000 for 400k GCR disks
  513. # 000c8000 for 800k GCR disks
  514. # 000b4000 for 720k MFM disks
  515. # 00168000 for 1440k MFM disks
  516. >>>0x40 ubelong&0xffE03fFF 0
  517. >>>>0 use dc42-floppy
  518. # display information of Apple DiskCopy 4.2 floppy image
  519. 0 name dc42-floppy
  520. # image pascal name padded with NULs like Microsoft Mail
  521. >00 pstring/B x Apple DiskCopy 4.2 image %s
  522. #!:mime application/octet-stream
  523. !:mime application/x-dc42-floppy-image
  524. !:apple dCpydImg
  525. !:ext image/dc42
  526. # data size in bytes like 409600
  527. >0x40 ubelong x \b, %u bytes
  528. # for debugging purpose size in hexadecimal
  529. #>0x40 ubelong x (%#8.8x)
  530. # tag size in bytes
  531. >0x44 ubelong >0 \b, %#x tag size
  532. # data checksum
  533. #>0x48 ubelong x \b, %#x checksum
  534. # tag checksum
  535. #>0x4c ubelong x \b, %#x tag checksum
  536. # disk encoding
  537. >0x50 ubyte 0 \b, GCR CLV ssdd (400k)
  538. >0x50 ubyte 1 \b, GCR CLV dsdd (800k)
  539. >0x50 ubyte 2 \b, MFM CAV dsdd (720k)
  540. >0x50 ubyte 3 \b, MFM CAV dshd (1440k)
  541. >0x50 ubyte >3 \b, %#x encoding
  542. # format byte
  543. >0x51 ubyte x \b, %#x format
  544. #>0x54 ubequad x \b, data %#16.16llx
  545. # ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
  546. 0 string ESP ESP archive data
  547. # ZPack
  548. 0 string \1ZPK\1 ZPack archive data
  549. # Sky
  550. 0 string \xbc\x40 Sky archive data
  551. # UFA
  552. 0 string UFA UFA archive data
  553. # Dry
  554. 0 string =-H2O DRY archive data
  555. # FoxSQZ
  556. 0 string FOXSQZ FoxSQZ archive data
  557. # AR7
  558. 0 string ,AR7 AR7 archive data
  559. # PPMZ
  560. 0 string PPMZ PPMZ archive data
  561. # MS Compress
  562. # Update: Joerg Jenderek
  563. # URL: http://fileformats.archiveteam.org/wiki/MS-DOS_installation_compression
  564. # Reference: https://hwiegman.home.xs4all.nl/fileformats/compress/szdd_kwaj_format.html
  565. # Note: use correct version of extracting tool like EXPAND, UNPACK, DECOMP or 7Z
  566. 4 string \x88\xf0\x27
  567. # KWAJ variant
  568. >0 string KWAJ MS Compress archive data, KWAJ variant
  569. !:mime application/x-ms-compress-kwaj
  570. # extension not working in version 5.32
  571. # magic/Magdir/archive, 284: Warning: EXTENSION type ` ??_' has bad char '?'
  572. # file: line 284: Bad magic entry ' ??_'
  573. !:ext ??_
  574. # compression method (0-4)
  575. >>8 uleshort x \b, %u method
  576. # offset of compressed data
  577. >>10 uleshort x \b, %#x offset
  578. #>>(10.s) uleshort x
  579. #>>>&-6 string x \b, TEST extension %-.3s
  580. # header flags to mark header extensions
  581. >>12 uleshort >0 \b, %#x flags
  582. # 4 bytes: decompressed length of file
  583. >>12 uleshort &0x01
  584. >>>14 ulelong x \b, original size: %u bytes
  585. # 2 bytes: unknown purpose
  586. # 2 bytes: length of unknown data + mentioned bytes
  587. # 1-9 bytes: null-terminated file name
  588. # 1-4 bytes: null-terminated file extension
  589. >>12 uleshort &0x08
  590. >>>12 uleshort ^0x01
  591. >>>>12 uleshort ^0x02
  592. >>>>>12 uleshort ^0x04
  593. >>>>>>12 uleshort ^0x10
  594. >>>>>>>14 string x \b, %-.8s
  595. >>>>>>12 uleshort &0x10
  596. >>>>>>>14 string x \b, %-.8s
  597. >>>>>>>>&1 string x \b.%-.3s
  598. >>>>>12 uleshort &0x04
  599. >>>>>>12 uleshort ^0x10
  600. >>>>>>>(14.s) uleshort x
  601. >>>>>>>>&14 string x \b, %-.8s
  602. >>>>>>12 uleshort &0x10
  603. >>>>>>>(14.s) uleshort x
  604. >>>>>>>>&14 string x \b, %-.8s
  605. >>>>>>>>>&1 string x \b.%-.3s
  606. >>>>12 uleshort &0x02
  607. >>>>>12 uleshort ^0x04
  608. >>>>>>12 uleshort ^0x10
  609. >>>>>>>16 string x \b, %-.8s
  610. >>>>>>12 uleshort &0x10
  611. >>>>>>>16 string x \b, %-.8s
  612. >>>>>>>>&1 string x \b.%-.3s
  613. >>>>>12 uleshort &0x04
  614. >>>>>>12 uleshort ^0x10
  615. >>>>>>>(16.s) uleshort x
  616. >>>>>>>>&16 string x \b, %-.8s
  617. >>>>>>12 uleshort &0x10
  618. >>>>>>>(16.s) uleshort x
  619. >>>>>>>&16 string x %-.8s
  620. >>>>>>>>&1 string x \b.%-.3s
  621. >>>12 uleshort &0x01
  622. >>>>12 uleshort ^0x02
  623. >>>>>12 uleshort ^0x04
  624. >>>>>>12 uleshort ^0x10
  625. >>>>>>>18 string x \b, %-.8s
  626. >>>>>>12 uleshort &0x10
  627. >>>>>>>18 string x \b, %-.8s
  628. >>>>>>>>&1 string x \b.%-.3s
  629. >>>>>12 uleshort &0x04
  630. >>>>>>12 uleshort ^0x10
  631. >>>>>>>(18.s) uleshort x
  632. >>>>>>>>&18 string x \b, %-.8s
  633. >>>>>>12 uleshort &0x10
  634. >>>>>>>(18.s) uleshort x
  635. >>>>>>>>&18 string x \b, %-.8s
  636. >>>>>>>>>&1 string x \b.%-.3s
  637. >>>>12 uleshort &0x02
  638. >>>>>12 uleshort ^0x04
  639. >>>>>>12 uleshort ^0x10
  640. >>>>>>>20 string x \b, %-.8s
  641. >>>>>>12 uleshort &0x10
  642. >>>>>>>20 string x \b, %-.8s
  643. >>>>>>>>&1 string x \b.%-.3s
  644. >>>>>12 uleshort &0x04
  645. >>>>>>12 uleshort ^0x10
  646. >>>>>>>(20.s) uleshort x
  647. >>>>>>>>&20 string x \b, %-.8s
  648. >>>>>>12 uleshort &0x10
  649. >>>>>>>(20.s) uleshort x
  650. >>>>>>>>&20 string x \b, %-.8s
  651. >>>>>>>>>&1 string x \b.%-.3s
  652. # 2 bytes: length of data + mentioned bytes
  653. #
  654. # SZDD variant Haruhiko Okumura's LZSS or 7z type MsLZ
  655. >0 string SZDD MS Compress archive data, SZDD variant
  656. !:mime application/x-ms-compress-szdd
  657. !:ext ??_
  658. # The character missing from the end of the filename (0=unknown)
  659. >>9 string >\0 \b, %-.1s is last character of original name
  660. # https://www.betaarchive.com/forum/viewtopic.php?t=26161
  661. # Compression mode: "A" (0x41) found but sometimes "B" in Windows 3.1 builds 026 and 034e
  662. >>8 string !A \b, %-.1s method
  663. >>10 ulelong >0 \b, original size: %u bytes
  664. # QBasic SZDD variant
  665. 3 string \x88\xf0\x27
  666. >0 string SZ\x20 MS Compress archive data, QBasic variant
  667. !:mime application/x-ms-compress-sz
  668. !:ext ??$
  669. >>8 ulelong >0 \b, original size: %u bytes
  670. # Summary: FTCOMP compressed archive
  671. # From: Joerg Jenderek
  672. # URL: http://fileformats.archiveteam.org/wiki/FTCOMP
  673. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/a/ark-ftcomp.trid.xml
  674. # Note: called by TrID "FTCOMP compressed archive"
  675. # extracted by `unpack seahelp.hl_`
  676. 24 string/b FTCOMP FTCOMP compressed archive
  677. #!:mime application/octet-stream
  678. !:mime application/x-compress-ftcomp
  679. !:ext ??_/??@/dll/drv/pk2/
  680. # probably A596FDFF magic at the beginning
  681. >0 ubelong !0xA596FDFF \b, at beginning %#x
  682. # probably original file name with directory like: \OS2\unpack.exe \SYSTEM\8514.DRV MAHJONGG.EXE
  683. >41 string x "%s"
  684. # MP3 (archiver, not lossy audio compression)
  685. 0 string MP3\x1a MP3-Archiver archive data
  686. # ZET
  687. 0 string OZ\xc3\x9d ZET archive data
  688. # TSComp
  689. 0 string \x65\x5d\x13\x8c\x08\x01\x03\x00 TSComp archive data
  690. # ARQ
  691. 0 string gW\4\1 ARQ archive data
  692. # Squash
  693. 3 string OctSqu Squash archive data
  694. # Terse
  695. 0 string \5\1\1\0 Terse archive data
  696. # PUCrunch
  697. 0 string \x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31 PUCrunch archive data
  698. # UHarc
  699. 0 string UHA UHarc archive data
  700. # ABComp
  701. 0 string \2AB ABComp archive data
  702. 0 string \3AB2 ABComp archive data
  703. # CMP
  704. 0 string CO\0 CMP archive data
  705. # Splint
  706. 0 string \x93\xb9\x06 Splint archive data
  707. # InstallShield
  708. 0 string \x13\x5d\x65\x8c InstallShield Z archive Data
  709. # Gather
  710. 1 string GTH Gather archive data
  711. # BOA
  712. 0 string BOA BOA archive data
  713. # RAX
  714. 0 string ULEB\xa RAX archive data
  715. # Xtreme
  716. 0 string ULEB\0 Xtreme archive data
  717. # Pack Magic
  718. 0 string @\xc3\xa2\1\0 Pack Magic archive data
  719. # BTS
  720. 0 belong&0xfeffffff 0x1a034465 BTS archive data
  721. # ELI 5750
  722. 0 string Ora\ ELI 5750 archive data
  723. # QFC
  724. 0 string \x1aFC\x1a QFC archive data
  725. 0 string \x1aQF\x1a QFC archive data
  726. # PRO-PACK
  727. 0 string RNC PRO-PACK archive data
  728. # 777
  729. 0 string 777 777 archive data
  730. # LZS221
  731. 0 string sTaC LZS221 archive data
  732. # HPA
  733. 0 string HPA HPA archive data
  734. # Arhangel
  735. 0 string LG Arhangel archive data
  736. # EXP1, uses bzip2
  737. 0 string 0123456789012345BZh EXP1 archive data
  738. # IMP
  739. 0 string IMP\xa IMP archive data
  740. # NRV
  741. 0 string \x00\x9E\x6E\x72\x76\xFF NRV archive data
  742. # Squish
  743. 0 string \x73\xb2\x90\xf4 Squish archive data
  744. # Par
  745. 0 string PHILIPP Par archive data
  746. 0 string PAR Par archive data
  747. # HIT
  748. 0 string UB HIT archive data
  749. # SBX
  750. 0 belong&0xfffff000 0x53423000 SBX archive data
  751. # NaShrink
  752. 0 string NSK NaShrink archive data
  753. # SAPCAR
  754. 0 string #\ CAR\ archive\ header SAPCAR archive data
  755. 0 string CAR\ 2.00RG SAPCAR archive data
  756. # Disintegrator
  757. 0 string DST Disintegrator archive data
  758. # ASD
  759. 0 string ASD ASD archive data
  760. # InstallShield CAB
  761. 0 string ISc( InstallShield CAB
  762. # TOP4
  763. 0 string T4\x1a TOP4 archive data
  764. # BatComp left out: sig looks like COM executable
  765. # so TODO: get real 4dos batcomp file and find sig
  766. # BlakHole
  767. 0 string BH\5\7 BlakHole archive data
  768. # BIX
  769. 0 string BIX0 BIX archive data
  770. # ChiefLZA
  771. 0 string ChfLZ ChiefLZA archive data
  772. # Blink
  773. 0 string Blink Blink archive data
  774. # Logitech Compress
  775. 0 string \xda\xfa Logitech Compress archive data
  776. # ARS-Sfx (FIXME: really a SFX? then goto COM/EXE)
  777. 1 string (C)\ STEPANYUK ARS-Sfx archive data
  778. # AKT/AKT32
  779. 0 string AKT32 AKT32 archive data
  780. 0 string AKT AKT archive data
  781. # NPack
  782. 0 string MSTSM NPack archive data
  783. # PFT
  784. 0 string \0\x50\0\x14 PFT archive data
  785. # SemOne
  786. 0 string SEM SemOne archive data
  787. # PPMD
  788. 0 string \x8f\xaf\xac\x84 PPMD archive data
  789. # FIZ
  790. 0 string FIZ FIZ archive data
  791. # MSXiE
  792. 0 belong&0xfffff0f0 0x4d530000 MSXiE archive data
  793. # DeepFreezer
  794. 0 belong&0xfffffff0 0x797a3030 DeepFreezer archive data
  795. # DC
  796. 0 string =<DC- DC archive data
  797. # TPac
  798. 0 string \4TPAC\3 TPac archive data
  799. # Ai
  800. 0 string Ai\1\1\0 Ai archive data
  801. 0 string Ai\1\0\0 Ai archive data
  802. # Ai32
  803. 0 string Ai\2\0 Ai32 archive data
  804. 0 string Ai\2\1 Ai32 archive data
  805. # SBC
  806. 0 string SBC SBC archive data
  807. # Ybs
  808. 0 string YBS Ybs archive data
  809. # DitPack
  810. 0 string \x9e\0\0 DitPack archive data
  811. # DMS
  812. 0 string DMS! DMS archive data
  813. # EPC
  814. 0 string \x8f\xaf\xac\x8c EPC archive data
  815. # VSARC
  816. 0 string VS\x1a VSARC archive data
  817. # PDZ
  818. 0 string PDZ PDZ archive data
  819. # ReDuq
  820. 0 string rdqx ReDuq archive data
  821. # GCA
  822. 0 string GCAX GCA archive data
  823. # PPMN
  824. 0 string pN PPMN archive data
  825. # WinImage
  826. 3 string WINIMAGE WinImage archive data
  827. # Compressia
  828. 0 string CMP0CMP Compressia archive data
  829. # UHBC
  830. 0 string UHB UHBC archive data
  831. # WinHKI
  832. 0 string \x61\x5C\x04\x05 WinHKI archive data
  833. # WWPack data file
  834. 0 string WWP WWPack archive data
  835. # BSN (BSA, PTS-DOS)
  836. 0 string \xffBSG BSN archive data
  837. 1 string \xffBSG BSN archive data
  838. 3 string \xffBSG BSN archive data
  839. 1 string \0\xae\2 BSN archive data
  840. 1 string \0\xae\3 BSN archive data
  841. 1 string \0\xae\7 BSN archive data
  842. # AIN
  843. 0 string \x33\x18 AIN archive data
  844. 0 string \x33\x17 AIN archive data
  845. # XPA32 test moved and merged with XPA by Joerg Jenderek at Sep 2015
  846. # SZip (TODO: doesn't catch all versions)
  847. 0 string SZ\x0a\4 SZip archive data
  848. # XPack DiskImage
  849. # *.XDI updated by Joerg Jenderek Sep 2015
  850. # ftp://ftp.sac.sk/pub/sac/pack/0index.txt
  851. # GRR: this test is still too general as it catches also text files starting with jm
  852. 0 string jm
  853. # only found examples with this additional characteristic 2 bytes
  854. >2 string \x2\x4 Xpack DiskImage archive data
  855. #!:ext xdi
  856. # XPack Data
  857. # *.xpa updated by Joerg Jenderek Sep 2015
  858. # ftp://ftp.elf.stuba.sk/pub/pc/pack/
  859. 0 string xpa XPA
  860. !:ext xpa
  861. # XPA32
  862. # ftp://ftp.elf.stuba.sk/pub/pc/pack/xpa32.zip
  863. # created by XPA32.EXE version 1.0.2 for Windows
  864. >0 string xpa\0\1 \b32 archive data
  865. # created by XPACK.COM version 1.67m or 1.67r with short 0x1800
  866. >3 ubeshort !0x0001 \bck archive data
  867. # XPack Single Data
  868. # changed by Joerg Jenderek Sep 2015 back to like in version 5.12
  869. # letter 'I'+ acute accent is equivalent to \xcd
  870. 0 string \xcd\ jm Xpack single archive data
  871. #!:mime application/x-xpa-compressed
  872. !:ext xpa
  873. # TODO: missing due to unknown magic/magic at end of file:
  874. #DWC
  875. #ARG
  876. #ZAR
  877. #PC/3270
  878. #InstallIt
  879. #RKive
  880. #RK
  881. #XPack Diskimage
  882. # These were inspired by idarc, but actually verified
  883. # Dzip archiver (.dz)
  884. # Update: Joerg Jenderek
  885. # URL: http://speeddemosarchive.com/dzip/
  886. # reference: http://speeddemosarchive.com/dzip/dz29src.zip/main.c
  887. # GRR: line below is too general as it matches also ASCII texts like Doszip commander help dz.txt
  888. 0 string DZ
  889. # latest version is 2.9 dated 7 may 2003
  890. >2 byte <4 Dzip archive data
  891. !:mime application/x-dzip
  892. !:ext dz
  893. >>2 byte x \b, version %i
  894. >>3 byte x \b.%i
  895. >>4 ulelong x \b, offset %#x
  896. >>8 ulelong x \b, %u files
  897. # ZZip archiver (.zz)
  898. 0 string ZZ\ \0\0 ZZip archive data
  899. 0 string ZZ0 ZZip archive data
  900. # PAQ archiver (.paq)
  901. 0 string \xaa\x40\x5f\x77\x1f\xe5\x82\x0d PAQ archive data
  902. 0 string PAQ PAQ archive data
  903. >3 byte&0xf0 0x30
  904. >>3 byte x (v%c)
  905. # JAR archiver (.j), this is the successor to ARJ, not Java's JAR (which is essentially ZIP)
  906. 0xe string \x1aJar\x1b JAR (ARJ Software, Inc.) archive data
  907. 0 string JARCS JAR (ARJ Software, Inc.) archive data
  908. # ARJ archiver (jason@jarthur.Claremont.EDU)
  909. 0 leshort 0xea60 ARJ archive data
  910. !:mime application/x-arj
  911. >5 byte x \b, v%d,
  912. >8 byte &0x04 multi-volume,
  913. >8 byte &0x10 slash-switched,
  914. >8 byte &0x20 backup,
  915. >34 string x original name: %s,
  916. >7 byte 0 os: MS-DOS
  917. >7 byte 1 os: PRIMOS
  918. >7 byte 2 os: Unix
  919. >7 byte 3 os: Amiga
  920. >7 byte 4 os: Macintosh
  921. >7 byte 5 os: OS/2
  922. >7 byte 6 os: Apple ][ GS
  923. >7 byte 7 os: Atari ST
  924. >7 byte 8 os: NeXT
  925. >7 byte 9 os: VAX/VMS
  926. >3 byte >0 %d]
  927. # [JW] idarc says this is also possible
  928. 2 leshort 0xea60 ARJ archive data
  929. # HA archiver (Greg Roelofs, newt@uchicago.edu)
  930. # This is a really bad format. A file containing HAWAII will match this...
  931. #0 string HA HA archive data,
  932. #>2 leshort =1 1 file,
  933. #>2 leshort >1 %hu files,
  934. #>4 byte&0x0f =0 first is type CPY
  935. #>4 byte&0x0f =1 first is type ASC
  936. #>4 byte&0x0f =2 first is type HSC
  937. #>4 byte&0x0f =0x0e first is type DIR
  938. #>4 byte&0x0f =0x0f first is type SPECIAL
  939. # suggestion: at least identify small archives (<1024 files)
  940. 0 belong&0xffff00fc 0x48410000 HA archive data
  941. >2 leshort =1 1 file,
  942. >2 leshort >1 %u files,
  943. >4 byte&0x0f =0 first is type CPY
  944. >4 byte&0x0f =1 first is type ASC
  945. >4 byte&0x0f =2 first is type HSC
  946. >4 byte&0x0f =0x0e first is type DIR
  947. >4 byte&0x0f =0x0f first is type SPECIAL
  948. # HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
  949. 0 string HPAK HPACK archive data
  950. # JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
  951. 0 string \351,\001JAM\ JAM archive,
  952. >7 string >\0 version %.4s
  953. >0x26 byte =0x27 -
  954. >>0x2b string >\0 label %.11s,
  955. >>0x27 lelong x serial %08x,
  956. >>0x36 string >\0 fstype %.8s
  957. # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
  958. # Update: Joerg Jenderek
  959. # URL: https://en.wikipedia.org/wiki/LHA_(file_format)
  960. # Reference: https://web.archive.org/web/20021005080911/http://www.osirusoft.com/joejared/lzhformat.html
  961. #
  962. # check and display information of lharc (LHa,PMarc) file
  963. 0 name lharc-file
  964. # check 1st character of method id like -lz4- -lh5- or -pm2-
  965. >2 string -
  966. # check 5th character of method id
  967. >>6 string -
  968. # check header level 0 1 2 3
  969. >>>20 ubyte <4
  970. # check 2nd, 3th and 4th character of method id
  971. >>>>3 regex \^(lh[0-9a-ex]|lz[s2-8]|pm[012]|pc1) \b
  972. !:mime application/x-lzh-compressed
  973. # creator type "LHA "
  974. !:apple ????LHA
  975. # display archive type name like "LHa/LZS archive data" or "LArc archive"
  976. >>>>>2 string -lz \b
  977. !:ext lzs
  978. # already known -lzs- -lz4- -lz5- with old names
  979. >>>>>>2 string -lzs LHa/LZS archive data
  980. >>>>>>3 regex \^lz[45] LHarc 1.x archive data
  981. # missing -lz?- with wikipedia names
  982. >>>>>>3 regex \^lz[2378] LArc archive
  983. # display archive type name like "LHa (2.x) archive data"
  984. >>>>>2 string -lh \b
  985. # already known -lh0- -lh1- -lh2- -lh3- -lh4- -lh5- -lh6- -lh7- -lhd- variants with old names
  986. >>>>>>3 regex \^lh[01] LHarc 1.x/ARX archive data
  987. # LHice archiver use ".ICE" as name extension instead usual one ".lzh"
  988. # FOOBAR archiver use ".foo" as name extension instead usual one
  989. # "Florain Orjanov's and Olga Bachetska's ARchiver" not found at the moment
  990. >>>>>>>2 string -lh1 \b
  991. !:ext lha/lzh/ice
  992. >>>>>>3 regex \^lh[23d] LHa 2.x? archive data
  993. >>>>>>3 regex \^lh[7] LHa (2.x)/LHark archive data
  994. >>>>>>3 regex \^lh[456] LHa (2.x) archive data
  995. >>>>>>>2 string -lh5 \b
  996. # https://en.wikipedia.org/wiki/BIOS
  997. # Some mainboard BIOS like Award use LHa compression. So archives with unusual extension are found like
  998. # bios.rom , kd7_v14.bin, 1010.004, ...
  999. !:ext lha/lzh/rom/bin
  1000. # missing -lh?- variants (Joe Jared)
  1001. >>>>>>3 regex \^lh[89a-ce] LHa (Joe Jared) archive
  1002. # UNLHA32 2.67a
  1003. >>>>>>2 string -lhx LHa (UNLHA32) archive
  1004. # lha archives with standard file name extensions ".lha" ".lzh"
  1005. >>>>>>3 regex !\^(lh1|lh5) \b
  1006. !:ext lha/lzh
  1007. # this should not happen if all -lh variants are described
  1008. >>>>>>2 default x LHa (unknown) archive
  1009. #!:ext lha
  1010. # PMarc
  1011. >>>>>3 regex \^pm[012] PMarc archive data
  1012. !:ext pma
  1013. # append method id without leading and trailing minus character
  1014. >>>>>3 string x [%3.3s]
  1015. >>>>>>0 use lharc-header
  1016. #
  1017. # check and display information of lharc header
  1018. 0 name lharc-header
  1019. # header size 0x4 , 0x1b-0x61
  1020. >0 ubyte x
  1021. # compressed data size != compressed file size
  1022. #>7 ulelong x \b, data size %d
  1023. # attribute: 0x2~?? 0x10~symlink|target 0x20~normal
  1024. #>19 ubyte x \b, 19_%#x
  1025. # level identifier 0 1 2 3
  1026. #>20 ubyte x \b, level %d
  1027. # time stamp
  1028. #>15 ubelong x DATE %#8.8x
  1029. # OS ID for level 1
  1030. >20 ubyte 1
  1031. # 0x20 types find for *.rom files
  1032. >>(21.b+24) ubyte <0x21 \b, %#x OS
  1033. # ascii type like M for MSDOS
  1034. >>(21.b+24) ubyte >0x20 \b, '%c' OS
  1035. # OS ID for level 2
  1036. >20 ubyte 2
  1037. #>>23 ubyte x \b, OS ID %#x
  1038. >>23 ubyte <0x21 \b, %#x OS
  1039. >>23 ubyte >0x20 \b, '%c' OS
  1040. # filename only for level 0 and 1
  1041. >20 ubyte <2
  1042. # length of filename
  1043. >>21 ubyte >0 \b, with
  1044. # filename
  1045. >>>21 pstring x "%s"
  1046. #
  1047. #2 string -lh0- LHarc 1.x/ARX archive data [lh0]
  1048. #!:mime application/x-lharc
  1049. 2 string -lh0-
  1050. >0 use lharc-file
  1051. #2 string -lh1- LHarc 1.x/ARX archive data [lh1]
  1052. #!:mime application/x-lharc
  1053. 2 string -lh1-
  1054. >0 use lharc-file
  1055. # NEW -lz2- ... -lz8-
  1056. 2 string -lz2-
  1057. >0 use lharc-file
  1058. 2 string -lz3-
  1059. >0 use lharc-file
  1060. 2 string -lz4-
  1061. >0 use lharc-file
  1062. 2 string -lz5-
  1063. >0 use lharc-file
  1064. 2 string -lz7-
  1065. >0 use lharc-file
  1066. 2 string -lz8-
  1067. >0 use lharc-file
  1068. # [never seen any but the last; -lh4- reported in comp.compression:]
  1069. #2 string -lzs- LHa/LZS archive data [lzs]
  1070. 2 string -lzs-
  1071. >0 use lharc-file
  1072. # According to wikipedia and others such a version does not exist
  1073. #2 string -lh\40- LHa 2.x? archive data [lh ]
  1074. #2 string -lhd- LHa 2.x? archive data [lhd]
  1075. 2 string -lhd-
  1076. >0 use lharc-file
  1077. #2 string -lh2- LHa 2.x? archive data [lh2]
  1078. 2 string -lh2-
  1079. >0 use lharc-file
  1080. #2 string -lh3- LHa 2.x? archive data [lh3]
  1081. 2 string -lh3-
  1082. >0 use lharc-file
  1083. #2 string -lh4- LHa (2.x) archive data [lh4]
  1084. 2 string -lh4-
  1085. >0 use lharc-file
  1086. #2 string -lh5- LHa (2.x) archive data [lh5]
  1087. 2 string -lh5-
  1088. >0 use lharc-file
  1089. #2 string -lh6- LHa (2.x) archive data [lh6]
  1090. 2 string -lh6-
  1091. >0 use lharc-file
  1092. #2 string -lh7- LHa (2.x)/LHark archive data [lh7]
  1093. 2 string -lh7-
  1094. # !:mime application/x-lha
  1095. # >20 byte x - header level %d
  1096. >0 use lharc-file
  1097. # NEW -lh8- ... -lhe- , -lhx-
  1098. 2 string -lh8-
  1099. >0 use lharc-file
  1100. 2 string -lh9-
  1101. >0 use lharc-file
  1102. 2 string -lha-
  1103. >0 use lharc-file
  1104. 2 string -lhb-
  1105. >0 use lharc-file
  1106. 2 string -lhc-
  1107. >0 use lharc-file
  1108. 2 string -lhe-
  1109. >0 use lharc-file
  1110. 2 string -lhx-
  1111. >0 use lharc-file
  1112. # taken from idarc [JW]
  1113. 2 string -lZ PUT archive data
  1114. # already done by LHarc magics
  1115. # this should never happen if all sub types of LZS archive are identified
  1116. #2 string -lz LZS archive data
  1117. 2 string -sw1- Swag archive data
  1118. 0 name rar-file-header
  1119. >24 byte 15 \b, v1.5
  1120. >24 byte 20 \b, v2.0
  1121. >24 byte 29 \b, v4
  1122. >15 byte 0 \b, os: MS-DOS
  1123. >15 byte 1 \b, os: OS/2
  1124. >15 byte 2 \b, os: Win32
  1125. >15 byte 3 \b, os: Unix
  1126. >15 byte 4 \b, os: Mac OS
  1127. >15 byte 5 \b, os: BeOS
  1128. 0 name rar-archive-header
  1129. >3 leshort&0x1ff >0 \b, flags:
  1130. >>3 leshort &0x01 ArchiveVolume
  1131. >>3 leshort &0x02 Commented
  1132. >>3 leshort &0x04 Locked
  1133. >>3 leshort &0x10 NewVolumeNaming
  1134. >>3 leshort &0x08 Solid
  1135. >>3 leshort &0x20 Authenticated
  1136. >>3 leshort &0x40 RecoveryRecordPresent
  1137. >>3 leshort &0x80 EncryptedBlockHeader
  1138. >>3 leshort &0x100 FirstVolume
  1139. # RAR (Roshal Archive) archive
  1140. 0 string Rar!\x1a\7\0 RAR archive data
  1141. !:mime application/x-rar
  1142. !:ext rar/cbr
  1143. # file header
  1144. >(0xc.l+9) byte 0x74
  1145. >>(0xc.l+7) use rar-file-header
  1146. # subblock seems to share information with file header
  1147. >(0xc.l+9) byte 0x7a
  1148. >>(0xc.l+7) use rar-file-header
  1149. >9 byte 0x73
  1150. >>7 use rar-archive-header
  1151. 0 string Rar!\x1a\7\1\0 RAR archive data, v5
  1152. !:mime application/x-rar
  1153. !:ext rar
  1154. # Very old RAR archive
  1155. # https://jasonblanks.com/wp-includes/images/papers/KnowyourarchiveRAR.pdf
  1156. 0 string RE\x7e\x5e RAR archive data (<v1.5)
  1157. !:mime application/x-rar
  1158. !:ext rar/cbr
  1159. # SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
  1160. 0 string SQSH squished archive data (Acorn RISCOS)
  1161. # UC2 archiver (Greg Roelofs, newt@uchicago.edu)
  1162. # [JW] see exe section for self-extracting version
  1163. 0 string UC2\x1a UC2 archive data
  1164. # PKZIP multi-volume archive
  1165. 0 string PK\x07\x08PK\x03\x04 Zip multi-volume archive data, at least PKZIP v2.50 to extract
  1166. !:mime application/zip
  1167. !:ext zip/cbz
  1168. # Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
  1169. 0 string PK\005\006 Zip archive data (empty)
  1170. !:mime application/zip
  1171. !:ext zip/cbz
  1172. !:strength +1
  1173. 0 string PK\003\004
  1174. !:strength +1
  1175. # Specialised zip formats which start with a member named 'mimetype'
  1176. # (stored uncompressed, with no 'extra field') containing the file's MIME type.
  1177. # Check for have 8-byte name, 0-byte extra field, name "mimetype", and
  1178. # contents starting with "application/":
  1179. >26 string \x8\0\0\0mimetypeapplication/
  1180. # KOffice / OpenOffice & StarOffice / OpenDocument formats
  1181. # From: Abel Cheung <abel@oaka.org>
  1182. # KOffice (1.2 or above) formats
  1183. # (mimetype contains "application/vnd.kde.<SUBTYPE>")
  1184. >>50 string vnd.kde. KOffice (>=1.2)
  1185. >>>58 string karbon Karbon document
  1186. >>>58 string kchart KChart document
  1187. >>>58 string kformula KFormula document
  1188. >>>58 string kivio Kivio document
  1189. >>>58 string kontour Kontour document
  1190. >>>58 string kpresenter KPresenter document
  1191. >>>58 string kspread KSpread document
  1192. >>>58 string kword KWord document
  1193. # OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7)
  1194. # (mimetype contains "application/vnd.sun.xml.<SUBTYPE>")
  1195. # URL: https://en.wikipedia.org/wiki/OpenOffice.org_XML
  1196. # reference: http://fileformats.archiveteam.org/wiki/OpenOffice.org_XML
  1197. >>50 string vnd.sun.xml. OpenOffice.org 1.x
  1198. >>>62 string writer Writer
  1199. >>>>68 byte !0x2e document
  1200. !:mime application/vnd.sun.xml.writer
  1201. !:ext sxw
  1202. >>>>68 string .template template
  1203. !:mime application/vnd.sun.xml.writer.template
  1204. !:ext stw
  1205. >>>>68 string .web Web template
  1206. !:mime application/vnd.sun.xml.writer.web
  1207. !:ext stw
  1208. >>>>68 string .global global document
  1209. !:mime application/vnd.sun.xml.writer.global
  1210. !:ext sxg
  1211. >>>62 string calc Calc
  1212. >>>>66 byte !0x2e spreadsheet
  1213. !:mime application/vnd.sun.xml.calc
  1214. !:ext sxc
  1215. >>>>66 string .template template
  1216. !:mime application/vnd.sun.xml.calc.template
  1217. !:ext stc
  1218. >>>62 string draw Draw
  1219. >>>>66 byte !0x2e document
  1220. !:mime application/vnd.sun.xml.draw
  1221. !:ext sxd
  1222. >>>>66 string .template template
  1223. !:mime application/vnd.sun.xml.draw.template
  1224. !:ext std
  1225. >>>62 string impress Impress
  1226. >>>>69 byte !0x2e presentation
  1227. !:mime application/vnd.sun.xml.impress
  1228. !:ext sxi
  1229. >>>>69 string .template template
  1230. !:mime application/vnd.sun.xml.impress.template
  1231. !:ext sti
  1232. >>>62 string math Math document
  1233. !:mime application/vnd.sun.xml.math
  1234. !:ext sxm
  1235. >>>62 string base Database file
  1236. !:mime application/vnd.sun.xml.base
  1237. !:ext sdb
  1238. # OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
  1239. # URL: http://fileformats.archiveteam.org/wiki/OpenDocument
  1240. # https://lists.oasis-open.org/archives/office/200505/msg00006.html
  1241. # (mimetype contains "application/vnd.oasis.opendocument.<SUBTYPE>")
  1242. >>50 string vnd.oasis.opendocument. OpenDocument
  1243. >>>73 string text
  1244. >>>>77 byte !0x2d Text
  1245. !:mime application/vnd.oasis.opendocument.text
  1246. !:ext odt
  1247. >>>>77 string -template Text Template
  1248. !:mime application/vnd.oasis.opendocument.text-template
  1249. !:ext ott
  1250. >>>>77 string -web HTML Document Template
  1251. !:mime application/vnd.oasis.opendocument.text-web
  1252. !:ext oth
  1253. >>>>77 string -master Master Document
  1254. !:mime application/vnd.oasis.opendocument.text-master
  1255. !:ext odm
  1256. >>>73 string graphics
  1257. >>>>81 byte !0x2d Drawing
  1258. !:mime application/vnd.oasis.opendocument.graphics
  1259. !:ext odg
  1260. >>>>81 string -template Drawing Template
  1261. !:mime application/vnd.oasis.opendocument.graphics-template
  1262. !:ext otg
  1263. >>>73 string presentation
  1264. >>>>85 byte !0x2d Presentation
  1265. !:mime application/vnd.oasis.opendocument.presentation
  1266. !:ext odp
  1267. >>>>85 string -template Presentation Template
  1268. !:mime application/vnd.oasis.opendocument.presentation-template
  1269. !:ext otp
  1270. >>>73 string spreadsheet
  1271. >>>>84 byte !0x2d Spreadsheet
  1272. !:mime application/vnd.oasis.opendocument.spreadsheet
  1273. !:ext ods
  1274. >>>>84 string -template Spreadsheet Template
  1275. !:mime application/vnd.oasis.opendocument.spreadsheet-template
  1276. !:ext ots
  1277. >>>73 string chart
  1278. >>>>78 byte !0x2d Chart
  1279. !:mime application/vnd.oasis.opendocument.chart
  1280. !:ext odc
  1281. >>>>78 string -template Chart Template
  1282. !:mime application/vnd.oasis.opendocument.chart-template
  1283. !:ext otc
  1284. >>>73 string formula
  1285. >>>>80 byte !0x2d Formula
  1286. !:mime application/vnd.oasis.opendocument.formula
  1287. !:ext odf
  1288. >>>>80 string -template Formula Template
  1289. !:mime application/vnd.oasis.opendocument.formula-template
  1290. !:ext otf
  1291. # https://www.loc.gov/preservation/digital/formats/fdd/fdd000441.shtml
  1292. >>>73 string database Database
  1293. !:mime application/vnd.oasis.opendocument.database
  1294. !:ext odb
  1295. # Valid for LibreOffice Base 6.0.1.1 at least
  1296. >>>73 string base Database
  1297. # https://bugs.documentfoundation.org/show_bug.cgi?id=45854
  1298. !:mime application/vnd.oasis.opendocument.database
  1299. #!:mime application/vnd.oasis.opendocument.base
  1300. !:ext odb
  1301. >>>73 string image
  1302. >>>>78 byte !0x2d Image
  1303. !:mime application/vnd.oasis.opendocument.image
  1304. !:ext odi
  1305. >>>>78 string -template Image Template
  1306. !:mime application/vnd.oasis.opendocument.image-template
  1307. !:ext oti
  1308. # EPUB (OEBPS) books using OCF (OEBPS Container Format)
  1309. # https://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4.
  1310. # From: Ralf Brown <ralf.brown@gmail.com>
  1311. >>50 string epub+zip EPUB document
  1312. !:mime application/epub+zip
  1313. # From: Joerg Jenderek
  1314. # URL: http://en.wikipedia.org/wiki/CorelDRAW
  1315. # NOTE: version; til 2 WL-based; from 3 til 13 by ./riff; from 14 zip based
  1316. >>50 string x-vnd.corel. Corel
  1317. >>>62 string draw.document+zip Draw drawing, version 14-16
  1318. !:mime application/x-vnd.corel.draw.document+zip
  1319. !:ext cdr
  1320. >>>62 string draw.template+zip Draw template, version 14-16
  1321. !:mime application/x-vnd.corel.draw.template+zip
  1322. !:ext cdrt
  1323. >>>62 string zcf.draw.document+zip Draw drawing, version 17-22
  1324. !:mime application/x-vnd.corel.zcf.draw.document+zip
  1325. !:ext cdr
  1326. >>>62 string zcf.draw.template+zip Draw template, version 17-22
  1327. !:mime application/x-vnd.corel.zcf.draw.template+zip
  1328. !:ext cdt/cdrt
  1329. # URL: http://product.corel.com/help/CorelDRAW/540240626/Main/EN/Doc/CorelDRAW-Other-file-formats.html
  1330. >>>62 string zcf.pattern+zip Draw pattern, version 22
  1331. !:mime application/x-vnd.corel.zcf.pattern+zip
  1332. !:ext pat
  1333. # URL: https://en.wikipedia.org/wiki/Corel_Designer
  1334. # Reference: http://fileformats.archiveteam.org/wiki/Corel_Designer
  1335. # Note: called by TrID "Corel DESIGN graphics"
  1336. >>>62 string designer.document+zip DESIGNER graphics, version 14-16
  1337. !:mime application/x-vnd.corel.designer.document+zip
  1338. !:ext des
  1339. >>>62 string zcf.designer.document+zip DESIGNER graphics, version 17-21
  1340. !:mime application/x-vnd.corel.zcf.designer.document+zip
  1341. !:ext des
  1342. # URL: http://product.corel.com/help/CorelDRAW/540223850/Main/EN/Documentation/
  1343. # CorelDRAW-Corel-Symbol-Library-CSL.html
  1344. >>>62 string symbol.library+zip Symbol Library, version 6-16.3
  1345. !:mime application/x-vnd.corel.symbol.library+zip
  1346. !:ext csl
  1347. >>>62 string zcf.symbol.library+zip Symbol Library, version 17-22
  1348. !:mime application/x-vnd.corel.zcf.symbol.library+zip
  1349. !:ext csl
  1350. # Catch other ZIP-with-mimetype formats
  1351. # In a ZIP file, the bytes immediately after a member's contents are
  1352. # always "PK". The 2 regex rules here print the "mimetype" member's
  1353. # contents up to the first 'P'. Luckily, most MIME types don't contain
  1354. # any capital 'P's. This is a kludge.
  1355. # (mimetype contains "application/<OTHER>")
  1356. >>50 default x Zip data
  1357. >>>38 regex [!-OQ-~]+ (MIME type "%s"?)
  1358. !:mime application/zip
  1359. # (mimetype contents other than "application/*")
  1360. >26 string \x8\0\0\0mimetype
  1361. >>38 string !application/
  1362. >>>38 regex [!-OQ-~]+ Zip data (MIME type "%s"?)
  1363. !:mime application/zip
  1364. # Java Jar files
  1365. >(26.s+30) leshort 0xcafe Java archive data (JAR)
  1366. !:mime application/java-archive
  1367. # iOS App
  1368. >(26.s+30) leshort !0xcafe
  1369. >>26 string !\x8\0\0\0mimetype
  1370. >>>30 string Payload/
  1371. >>>>38 search/64 .app/ iOS App
  1372. !:mime application/x-ios-app
  1373. # Dup, see above.
  1374. #>30 search/100/b application/epub+zip EPUB document
  1375. #!:mime application/epub+zip
  1376. # Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
  1377. # Next line excludes specialized formats:
  1378. >(26.s+30) leshort !0xcafe
  1379. >>30 search/100/b !application/epub+zip
  1380. >>>26 string !\x8\0\0\0mimetype Zip archive data
  1381. !:mime application/zip
  1382. >>>>4 beshort x \b, at least
  1383. >>>>4 use zipversion
  1384. >>>>4 beshort x to extract
  1385. >>>>8 beshort x \b, compression method=
  1386. >>>>8 use zipcompression
  1387. >>>>0x161 string WINZIP \b, WinZIP self-extracting
  1388. # StarView Metafile
  1389. # From Pierre Ducroquet <pinaraf@pinaraf.info>
  1390. 0 string VCLMTF StarView MetaFile
  1391. >6 beshort x \b, version %d
  1392. >8 belong x \b, size %d
  1393. # Zoo archiver
  1394. 20 lelong 0xfdc4a7dc Zoo archive data
  1395. !:mime application/x-zoo
  1396. >4 byte >48 \b, v%c.
  1397. >>6 byte >47 \b%c
  1398. >>>7 byte >47 \b%c
  1399. >32 byte >0 \b, modify: v%d
  1400. >>33 byte x \b.%d+
  1401. >42 lelong 0xfdc4a7dc \b,
  1402. >>70 byte >0 extract: v%d
  1403. >>>71 byte x \b.%d+
  1404. # Shell archives
  1405. 10 string #\ This\ is\ a\ shell\ archive shell archive text
  1406. !:mime application/octet-stream
  1407. #
  1408. # LBR. NB: May conflict with the questionable
  1409. # "binary Computer Graphics Metafile" format.
  1410. #
  1411. 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data
  1412. #
  1413. # PMA (CP/M derivative of LHA)
  1414. # Update: Joerg Jenderek
  1415. # URL: https://en.wikipedia.org/wiki/LHA_(file_format)
  1416. #
  1417. #2 string -pm0- PMarc archive data [pm0]
  1418. 2 string -pm0-
  1419. >0 use lharc-file
  1420. #2 string -pm1- PMarc archive data [pm1]
  1421. 2 string -pm1-
  1422. >0 use lharc-file
  1423. #2 string -pm2- PMarc archive data [pm2]
  1424. 2 string -pm2-
  1425. >0 use lharc-file
  1426. 2 string -pms- PMarc SFX archive (CP/M, DOS)
  1427. #!:mime application/x-foobar-exec
  1428. !:ext com
  1429. 5 string -pc1- PopCom compressed executable (CP/M)
  1430. #!:mime application/x-
  1431. #!:ext com
  1432. # From Rafael Laboissiere <rafael@laboissiere.net>
  1433. # The Project Revision Control System (see
  1434. # http://prcs.sourceforge.net) generates a packaged project
  1435. # file which is recognized by the following entry:
  1436. 0 leshort 0xeb81 PRCS packaged project
  1437. # Microsoft cabinets
  1438. # by David Necas (Yeti) <yeti@physics.muni.cz>
  1439. #0 string MSCF\0\0\0\0 Microsoft cabinet file data,
  1440. #>25 byte x v%d
  1441. #>24 byte x \b.%d
  1442. # MPi: All CABs have version 1.3, so this is pointless.
  1443. # Better magic in debian-additions.
  1444. # GTKtalog catalogs
  1445. # by David Necas (Yeti) <yeti@physics.muni.cz>
  1446. 4 string gtktalog\ GTKtalog catalog data,
  1447. >13 string 3 version 3
  1448. >>14 beshort 0x677a (gzipped)
  1449. >>14 beshort !0x677a (not gzipped)
  1450. >13 string >3 version %s
  1451. ############################################################################
  1452. # Parity archive reconstruction file, the 'par' file format now used on Usenet.
  1453. 0 string PAR\0 PARity archive data
  1454. >48 leshort =0 - Index file
  1455. >48 leshort >0 - file number %d
  1456. # Felix von Leitner <felix-file@fefe.de>
  1457. 0 string d8:announce BitTorrent file
  1458. !:mime application/x-bittorrent
  1459. # Durval Menezes, <jmgthbfile at durval dot com>
  1460. 0 string d13:announce-list BitTorrent file
  1461. !:mime application/x-bittorrent
  1462. 0 string d7:comment BitTorrent file
  1463. !:mime application/x-bittorrent
  1464. 0 string d4:info BitTorrent file
  1465. !:mime application/x-bittorrent
  1466. # Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
  1467. 0 beshort 0x0e0f Atari MSA archive data
  1468. >2 beshort x \b, %d sectors per track
  1469. >4 beshort 0 \b, 1 sided
  1470. >4 beshort 1 \b, 2 sided
  1471. >6 beshort x \b, starting track: %d
  1472. >8 beshort x \b, ending track: %d
  1473. # Alternate ZIP string (amc@arwen.cs.berkeley.edu)
  1474. 0 string PK00PK\003\004 Zip archive data
  1475. !:mime application/zip
  1476. !:ext zip/cbz
  1477. # ACE archive (from http://www.wotsit.org/download.asp?f=ace)
  1478. # by Stefan `Sec` Zehl <sec@42.org>
  1479. 7 string **ACE** ACE archive data
  1480. >15 byte >0 version %d
  1481. >16 byte =0x00 \b, from MS-DOS
  1482. >16 byte =0x01 \b, from OS/2
  1483. >16 byte =0x02 \b, from Win/32
  1484. >16 byte =0x03 \b, from Unix
  1485. >16 byte =0x04 \b, from MacOS
  1486. >16 byte =0x05 \b, from WinNT
  1487. >16 byte =0x06 \b, from Primos
  1488. >16 byte =0x07 \b, from AppleGS
  1489. >16 byte =0x08 \b, from Atari
  1490. >16 byte =0x09 \b, from Vax/VMS
  1491. >16 byte =0x0A \b, from Amiga
  1492. >16 byte =0x0B \b, from Next
  1493. >14 byte x \b, version %d to extract
  1494. >5 leshort &0x0080 \b, multiple volumes,
  1495. >>17 byte x \b (part %d),
  1496. >5 leshort &0x0002 \b, contains comment
  1497. >5 leshort &0x0200 \b, sfx
  1498. >5 leshort &0x0400 \b, small dictionary
  1499. >5 leshort &0x0800 \b, multi-volume
  1500. >5 leshort &0x1000 \b, contains AV-String
  1501. >>30 string \x16*UNREGISTERED\x20VERSION* (unregistered)
  1502. >5 leshort &0x2000 \b, with recovery record
  1503. >5 leshort &0x4000 \b, locked
  1504. >5 leshort &0x8000 \b, solid
  1505. # Date in MS-DOS format (whatever that is)
  1506. #>18 lelong x Created on
  1507. # sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
  1508. # <doj@cubic.org>
  1509. 0x1A string sfArk sfArk compressed Soundfont
  1510. >0x15 string 2
  1511. >>0x1 string >\0 Version %s
  1512. >>0x2A string >\0 : %s
  1513. # DR-DOS 7.03 Packed File *.??_
  1514. # Reference: http://www.antonis.de/dos/dos-tuts/mpdostip/html/nwdostip.htm
  1515. # Note: unpacked by PNUNPACK.EXE
  1516. 0 string Packed\ File\
  1517. # by looking for Control-Z skip ASCII text starting with Packed File
  1518. >0x18 ubyte 0x1a Personal NetWare Packed File
  1519. !:mime application/x-novell-compress
  1520. !:ext ??_
  1521. >>12 string x \b, was "%.12s"
  1522. # 1 or 2
  1523. #>>0x19 ubyte x \b, at 0x19 %u
  1524. >>0x1b ulelong x with %u bytes
  1525. # EET archive
  1526. # From: Tilman Sauerbeck <tilman@code-monkey.de>
  1527. 0 belong 0x1ee7ff00 EET archive
  1528. !:mime application/x-eet
  1529. # rzip archives
  1530. 0 string RZIP rzip compressed data
  1531. >4 byte x - version %d
  1532. >5 byte x \b.%d
  1533. >6 belong x (%d bytes)
  1534. # From: Joerg Jenderek
  1535. # URL: https://help.foxitsoftware.com/kb/install-fzip-file.php
  1536. # reference: http://mark0.net/download/triddefs_xml.7z/
  1537. # defs/f/fzip.trid.xml
  1538. # Note: unknown compression; No "PK" zip magic; normally in directory like
  1539. # "%APPDATA%\Foxit Software\Addon\Foxit Reader\Install"
  1540. 0 ubequad 0x2506781901010000 Foxit add-on/update
  1541. !:mime application/x-fzip
  1542. !:ext fzip
  1543. # From: "Robert Dale" <robdale@gmail.com>
  1544. 0 belong 123 dar archive,
  1545. >4 belong x label "%.8x
  1546. >>8 belong x %.8x
  1547. >>>12 beshort x %.4x"
  1548. >14 byte 0x54 end slice
  1549. >14 beshort 0x4e4e multi-part
  1550. >14 beshort 0x4e53 multi-part, with -S
  1551. # Symbian installation files
  1552. # https://www.thouky.co.uk/software/psifs/sis.html
  1553. # http://developer.symbian.com/main/downloads/papers/SymbianOSv91/softwareinstallsis.pdf
  1554. 8 lelong 0x10000419 Symbian installation file
  1555. !:mime application/vnd.symbian.install
  1556. >4 lelong 0x1000006D (EPOC release 3/4/5)
  1557. >4 lelong 0x10003A12 (EPOC release 6)
  1558. 0 lelong 0x10201A7A Symbian installation file (Symbian OS 9.x)
  1559. !:mime x-epoc/x-sisx-app
  1560. # From "Nelson A. de Oliveira" <naoliv@gmail.com>
  1561. 0 string MPQ\032 MoPaQ (MPQ) archive
  1562. # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
  1563. # .kgb
  1564. 0 string KGB_arch KGB Archiver file
  1565. >10 string x with compression level %.1s
  1566. # xar (eXtensible ARchiver) archive
  1567. # URL: https://en.wikipedia.org/wiki/Xar_(archiver)
  1568. # xar archive format: https://code.google.com/p/xar/
  1569. # From: "David Remahl" <dremahl@apple.com>
  1570. # Update: Joerg Jenderek
  1571. # TODO: lzma compression; X509Data for pkg and xip
  1572. # Note: verified by `xar --dump-header -f FullBundleUpdate.xar` or
  1573. # 7z t -txar Xcode_10.2_beta_4.xip`
  1574. 0 string xar! xar archive
  1575. !:mime application/x-xar
  1576. # pkg for Mac OSX installer package like FullBundleUpdate.pkg
  1577. # xip for signed Apple software like Xcode_10.2_beta_4.xip
  1578. !:ext xar/pkg/xip
  1579. # always 28 in older archives
  1580. >4 ubeshort >28 \b, header size %u
  1581. # currently there exit only version 1 since about 2014
  1582. >6 ubeshort >1 version %u,
  1583. >8 ubequad x compressed TOC: %llu,
  1584. #>16 ubequad x uncompressed TOC: %llu,
  1585. # cksum_alg 0-2 in older and also 3-4 in newer
  1586. >24 belong 0 no checksum
  1587. >24 belong 1 SHA-1 checksum
  1588. >24 belong 2 MD5 checksum
  1589. >24 belong 3 SHA-256 checksum
  1590. >24 belong 4 SHA-512 checksum
  1591. >24 belong >4 unknown %#x checksum
  1592. #>24 belong >4 checksum
  1593. # For no compression jump 0 bytes
  1594. >24 belong 0
  1595. >>0 ubyte x
  1596. # jump more bytes forward by header size
  1597. >>>&(4.S) ubyte x
  1598. # jump more bytes forward by compressed table of contents size
  1599. #>>>>&(8.Q) ubequad x \b, heap data %#llx
  1600. >>>>&(8.Q) ubyte x
  1601. # look for data by ./compress after message with 1 space at end
  1602. >>>>>&-3 indirect x \b, contains
  1603. # For SHA-1 jump 20 minus 2 bytes
  1604. >24 belong 1
  1605. >>18 ubyte x
  1606. # jump more bytes forward by header size
  1607. >>>&(4.S) ubyte x
  1608. # jump more bytes forward by compressed table of contents size
  1609. >>>>&(8.Q) ubyte x
  1610. # data compressed by gzip, bzip, lzma or none
  1611. >>>>>&-1 indirect x \b, contains
  1612. # For SHA-256 jump 32 minus 2 bytes
  1613. >24 belong 3
  1614. >>30 ubyte x
  1615. # jump more bytes forward by header size
  1616. >>>&(4.S) ubyte x
  1617. # jump more bytes forward by compressed table of contents size
  1618. >>>>&(8.Q) ubyte x
  1619. >>>>>&-1 indirect x \b, contains
  1620. # For SHA-512 jump 64 minus 2 bytes
  1621. >24 belong 4
  1622. >>62 ubyte x
  1623. # jump more bytes forward by header size
  1624. >>>&(4.S) ubyte x
  1625. # jump more bytes forward by compressed table of contents size
  1626. >>>>&(8.Q) ubyte x
  1627. >>>>>&-1 indirect x \b, contains
  1628. # Type: Parity Archive
  1629. # From: Daniel van Eeden <daniel_e@dds.nl>
  1630. 0 string PAR2 Parity Archive Volume Set
  1631. # Bacula volume format. (Volumes always start with a block header.)
  1632. # URL: https://bacula.org/3.0.x-manuals/en/developers/developers/Block_Header.html
  1633. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1634. 12 string BB02 Bacula volume
  1635. >20 bedate x \b, started %s
  1636. # ePub is XHTML + XML inside a ZIP archive. The first member of the
  1637. # archive must be an uncompressed file called 'mimetype' with contents
  1638. # 'application/epub+zip'
  1639. # From: "Michael Gorny" <mgorny@gentoo.org>
  1640. # ZPAQ: http://mattmahoney.net/dc/zpaq.html
  1641. 0 string zPQ ZPAQ stream
  1642. >3 byte x \b, level %d
  1643. # From: Barry Carter <carter.barry@gmail.com>
  1644. # https://encode.ru/threads/456-zpaq-updates/page32
  1645. 0 string 7kSt ZPAQ file
  1646. # BBeB ebook, unencrypted (LRF format)
  1647. # URL: https://www.sven.de/librie/Librie/LrfFormat
  1648. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1649. 0 string L\0R\0F\0\0\0 BBeB ebook data, unencrypted
  1650. >8 beshort x \b, version %d
  1651. >36 byte 1 \b, front-to-back
  1652. >36 byte 16 \b, back-to-front
  1653. >42 beshort x \b, (%dx,
  1654. >44 beshort x %d)
  1655. # Symantec GHOST image by Joerg Jenderek at May 2014
  1656. # https://us.norton.com/ghost/
  1657. # https://www.garykessler.net/library/file_sigs.html
  1658. 0 ubelong&0xFFFFf7f0 0xFEEF0100 Norton GHost image
  1659. # *.GHO
  1660. >2 ubyte&0x08 0x00 \b, first file
  1661. # *.GHS or *.[0-9] with cns program option
  1662. >2 ubyte&0x08 0x08 \b, split file
  1663. # part of split index interesting for *.ghs
  1664. >>4 ubyte x id=%#x
  1665. # compression tag minus one equals numeric compression command line switch z[1-9]
  1666. >3 ubyte 0 \b, no compression
  1667. >3 ubyte 2 \b, fast compression (Z1)
  1668. >3 ubyte 3 \b, medium compression (Z2)
  1669. >3 ubyte >3
  1670. >>3 ubyte <11 \b, compression (Z%d-1)
  1671. >2 ubyte&0x08 0x00
  1672. # ~ 30 byte password field only for *.gho
  1673. >>12 ubequad !0 \b, password protected
  1674. >>44 ubyte !1
  1675. # 1~Image All, sector-by-sector only for *.gho
  1676. >>>10 ubyte 1 \b, sector copy
  1677. # 1~Image Boot track only for *.gho
  1678. >>>43 ubyte 1 \b, boot track
  1679. # 1~Image Disc only for *.gho implies Image Boot track and sector copy
  1680. >>44 ubyte 1 \b, disc sector copy
  1681. # optional image description only *.gho
  1682. >>0xff string >\0 "%-.254s"
  1683. # look for DOS sector end sequence
  1684. >0xE08 search/7776 \x55\xAA
  1685. >>&-512 indirect x \b; contains
  1686. # Google Chrome extensions
  1687. # https://developer.chrome.com/extensions/crx
  1688. # https://developer.chrome.com/extensions/hosting
  1689. 0 string Cr24 Google Chrome extension
  1690. !:mime application/x-chrome-extension
  1691. >4 ulong x \b, version %u
  1692. # SeqBox - Sequenced container
  1693. # ext: sbx, seqbox
  1694. # Marco Pontello marcopon@gmail.com
  1695. # reference: https://github.com/MarcoPon/SeqBox
  1696. 0 string SBx SeqBox,
  1697. >3 byte x version %d
  1698. # LyNX archive
  1699. 56 string USE\040LYNX\040TO\040DISSOLVE\040THIS\040FILE LyNX archive
  1700. # From: Joerg Jenderek
  1701. # URL: https://www.acronis.com/
  1702. # Reference: https://en.wikipedia.org/wiki/TIB_(file_format)
  1703. # Note: only tested with True Image 2013 Build 5962 and 2019 Build 14110
  1704. 0 ubequad 0xce24b9a220000000 Acronis True Image backup
  1705. !:mime application/x-acronis-tib
  1706. !:ext tib
  1707. # 01000000
  1708. #>20 ubelong x \b, at 20 %#x
  1709. # 20000000
  1710. #>28 ubelong x \b, at 28 %#x
  1711. # strings like "Generic- SD/MMC 1.00" "Unknown Disk" "Msft Virtual Disk 1.0"
  1712. # ???
  1713. # strings like "\Device\0000011e" "\Device\0000015a"
  1714. #>0 search/0x6852300/cs \\Device\\
  1715. #>>&-1 pstring x \b, %s
  1716. # "\Device\HarddiskVolume30" "\Device\HarddiskVolume39"
  1717. #>>>&1 search/180/cs \\Device\\
  1718. #>>>>&-1 pstring x \b, %s
  1719. #>>>>>&0 search/29/cs \0\0\xc8\0
  1720. # disk label
  1721. #>>>>>>&10 lestring16 x \b, disk label %11.11s
  1722. #>>>>>>&9 plestring16 x \b, disk label "%11.11s"
  1723. #>>>>>>&10 ubequad x %16.16llx
  1724. # Gentoo XPAK binary package
  1725. # by Michal Gorny <mgorny@gentoo.org>
  1726. # https://gitweb.gentoo.org/proj/portage.git/tree/man/xpak.5
  1727. -4 string STOP
  1728. >-16 string XPAKSTOP Gentoo binary package (XPAK)
  1729. # From: Joerg Jenderek
  1730. # URL: https://kodi.wiki/view/TexturePacker
  1731. # Reference: https://mirrors.kodi.tv/releases/source/17.3-Krypton.tar.gz
  1732. # /xbmc-Krypton/xbmc/guilib/XBTF.h
  1733. # /xbmc-Krypton/xbmc/guilib/XBTF.cpp
  1734. 0 string XBTF
  1735. # skip ASCII text by looking for terminating \0 of path
  1736. >264 ubyte 0 XBMC texture package
  1737. !:mime application/x-xbmc-xbt
  1738. !:ext xbt
  1739. # XBTF_VERSION 2
  1740. >>4 string !2 \b, version %-.1s
  1741. # nofFiles /xbmc-Krypton/xbmc/guilib/XBTFReader.cpp
  1742. >>5 ulelong x \b, %u file
  1743. # plural s
  1744. >>5 ulelong >1 \bs
  1745. # path[CXBTFFile[MaximumPathLength=256]
  1746. >>9 string x \b, 1st %s
  1747. # ALZIP archive
  1748. # by Hyungjun Park <hyungjun.park@worksmobile.com>, Hajin Jang <hajin_jang@worksmobile.com>
  1749. # http://kippler.com/win/unalz/
  1750. # https://salsa.debian.org/l10n-korean-team/unalz
  1751. 0 string ALZ\001 ALZ archive data
  1752. !:ext alz
  1753. # https://cf-aldn.altools.co.kr/setup/EGG_Specification.zip
  1754. 0 string EGGA EGG archive data,
  1755. !:ext egg
  1756. >5 byte x version %u
  1757. >4 byte x \b.%u
  1758. >>0x0E ulelong =0x08E28222
  1759. >>0x0E ulelong =0x24F5A262 \b, split
  1760. >>0x0E ulelong =0x24E5A060 \b, solid
  1761. >>0x0E default x \b, unknown
  1762. # PAQ9A archive
  1763. # URL: http://mattmahoney.net/dc/#paq9a
  1764. # Note: Line 1186 of paq9a.cpp gives the magic bytes
  1765. 0 string pQ9\001 PAQ9A archive