archive 56 KB

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