archive 78 KB

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