archive 103 KB

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