archive 102 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812
  1. #------------------------------------------------------------------------------
  2. # $File: archive,v 1.207 2024/11/27 15:37:46 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
  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. # display information of TTComp archive
  721. 0 name ttcomp
  722. # (version 5.25) labeled the entry as "TTComp archive data"
  723. >0 ubyte x TTComp archive data
  724. !:mime application/x-compress-ttcomp
  725. # PBACKSCR.PI1
  726. !:ext $xe/$ts/pi1/__d
  727. # compression type: 0~binary compression 1~ASCII compression
  728. >0 ubyte 0 \b, binary
  729. >0 ubyte 1 \b, ASCII
  730. # size of the dictionary: 4~1024 bytes 5~2048 bytes 6~4096 bytes
  731. >1 ubyte 4 \b, 1K
  732. >1 ubyte 5 \b, 2K
  733. >1 ubyte 6 \b, 4K
  734. >1 ubyte x dictionary
  735. # https://mark0.net/forum/index.php?topic=848
  736. # last 3 bytes probably have only 8 possible bit sequences
  737. # xxxxxxxx 0000000x 11111111 ____FFh
  738. # xxxxxxxx 10000000 01111111 __807Fh
  739. # 0xxxxxxx 11000000 00111111 __C03Fh
  740. # 00xxxxxx 11100000 00011111 __E01Fh
  741. # 000xxxxx 11110000 00001111 __F00Fh
  742. # 0000xxxx 11111000 00000111 __F807h
  743. # 00000xxx 11111100 00000011 __FC03h
  744. # 000000xx 11111110 00000001 __FE01h
  745. # but for quickgif.__d 0A7DD4h
  746. #>-3 ubyte x \b, last 3 bytes 0x%2.2x
  747. #>-2 ubeshort x \b%4.4x
  748. # From: Joerg Jenderek
  749. # URL: https://en.wikipedia.org/wiki/Disk_Copy
  750. # reference: http://nulib.com/library/FTN.e00005.htm
  751. 0x52 ubeshort 0x0100
  752. # test for disk image size equal or above 400k
  753. >0x40 ubelong >409599
  754. # test also for disk image size equal or below 1440k to skip
  755. # windows7en.mbr UNICODE.DAT
  756. #>>0x40 ubelong <1474561
  757. # test now for "low" disk image size equal or below 64 MiB to skip
  758. # windows7en.mbr (B441BBAAh) UNICODE.DAT (0400AF05h)
  759. >>0x40 ubelong <0x04000001
  760. # To skip Flags$StringJoiner.class with size 00106A61h test also for valid disk image sizes
  761. # 00064000 for 400k GCR disks dc42-400k-gcr.trid.xml
  762. # 000c8000 for 800k GCR disks dc42-800k-gcr.trid.xml
  763. # 000b4000 for 720k MFM disks dc42-720k-mfm.trid.xml
  764. # 00168000 for 1440k MFM disks dc42-1440k-mfm.trid.xml
  765. # https://lisaem.sunder.net/LisaProjectDocs.txt
  766. # 00500000 05M available
  767. # 00A00000 10M available
  768. # 01800000 24M possible
  769. # 02000000 32M uncertain
  770. # 04000000 64M uncertain
  771. >>>0x40 ubelong&0xf8003fFF 0
  772. # skip samples with invalid disk name length like:
  773. # 181 (biosmd80.rom) 202 (Flags$StringJoiner.class) 90 (UNICODE.DAT)
  774. >>>>0x0 ubyte <64
  775. >>>>>0 use dc42-floppy
  776. # display information of Apple DiskCopy 4.2 floppy image
  777. 0 name dc42-floppy
  778. # disk name length; maximal 63
  779. #>0 ubyte x DISK NAME LENGTH %u
  780. # ASCII image pascal (maximal 63 bytes) name padded with NULs like:
  781. # "Microsoft Mail" "Disquette 2" "IIe Installer Disk"
  782. # "-lisaem.sunder.net hd-" (dc42-lisaem.trid.xml) "-not a Macintosh disk" (dc42-nonmac.trid.xml)
  783. >00 pstring/B x Apple DiskCopy 4.2 image %s
  784. #!:mime application/octet-stream
  785. !:mime application/x-dc42-floppy-image
  786. !:apple dCpydImg
  787. # probably also img like: "Utilitaires 2.img" "Installation 7.img"
  788. !:ext image/dc42/img
  789. # data size in bytes like: 409600 737280 819200 1474560
  790. >0x40 ubelong x \b, %u bytes
  791. # for debugging purpose size in hexadecimal
  792. #>0x40 ubelong x (%#8.8x)
  793. # tag size in bytes like: 0 (often) 2580h (PUID fmt/625) 4B00h (Microsoft Mail.image)
  794. >0x44 ubelong >0 \b, %#x tag size
  795. # data checksum
  796. #>0x48 ubelong x \b, %#x checksum
  797. # tag checksum
  798. #>0x4c ubelong x \b, %#x tag checksum
  799. # disk encoding like: 0 1 2 3 (PUID: fmt/625)
  800. >0x50 ubyte 0 \b, GCR CLV ssdd (400k)
  801. >0x50 ubyte 1 \b, GCR CLV dsdd (800k)
  802. >0x50 ubyte 2 \b, MFM CAV dsdd (720k)
  803. >0x50 ubyte 3 \b, MFM CAV dshd (1440k)
  804. >0x50 ubyte >3 \b, %#x encoding
  805. # format byte like: 12h (Lisa 400K) 24h (400K Macintosh) 96h (800K Apple II disk)
  806. # 2 (Mac 400k "Disquette Installation 13.image")
  807. # 22h (double-sided MFM or Mac 800k "Disco 12.image" "IIe Installer Disk.image")
  808. >0x51 ubyte x \b, %#x format
  809. #>0x54 ubequad x \b, data %#16.16llx
  810. # ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
  811. 0 string ESP ESP archive data
  812. # ZPack
  813. 0 string \1ZPK\1 ZPack archive data
  814. # Sky
  815. 0 string \xbc\x40 Sky archive data
  816. # UFA
  817. 0 string UFA UFA archive data
  818. # Dry
  819. 0 string =-H2O DRY archive data
  820. # FoxSQZ
  821. 0 string FOXSQZ FoxSQZ archive data
  822. # AR7
  823. 0 string ,AR7 AR7 archive data
  824. # PPMZ
  825. 0 string PPMZ PPMZ archive data
  826. # MS Compress
  827. # Update: Joerg Jenderek
  828. # URL: http://fileformats.archiveteam.org/wiki/MS-DOS_installation_compression
  829. # Reference: https://hwiegman.home.xs4all.nl/fileformats/compress/szdd_kwaj_format.html
  830. # Note: use correct version of extracting tool like EXPAND, UNPACK, DECOMP or 7Z
  831. 4 string \x88\xf0\x27
  832. # KWAJ variant
  833. >0 string KWAJ MS Compress archive data, KWAJ variant
  834. !:mime application/x-ms-compress-kwaj
  835. # extension not working in version 5.32
  836. # magic/Magdir/archive, 284: Warning: EXTENSION type ` ??_' has bad char '?'
  837. # file: line 284: Bad magic entry ' ??_'
  838. !:ext ??_
  839. # compression method (0-4)
  840. >>8 uleshort x \b, %u method
  841. # offset of compressed data
  842. >>10 uleshort x \b, %#x offset
  843. #>>(10.s) uleshort x
  844. #>>>&-6 string x \b, TEST extension %-.3s
  845. # header flags to mark header extensions
  846. >>12 uleshort >0 \b, %#x flags
  847. # 4 bytes: decompressed length of file
  848. >>12 uleshort &0x01
  849. >>>14 ulelong x \b, original size: %u bytes
  850. # 2 bytes: unknown purpose
  851. # 2 bytes: length of unknown data + mentioned bytes
  852. # 1-9 bytes: null-terminated file name
  853. # 1-4 bytes: null-terminated file extension
  854. >>12 uleshort &0x08
  855. >>>12 uleshort ^0x01
  856. >>>>12 uleshort ^0x02
  857. >>>>>12 uleshort ^0x04
  858. >>>>>>12 uleshort ^0x10
  859. >>>>>>>14 string x \b, %-.8s
  860. >>>>>>12 uleshort &0x10
  861. >>>>>>>14 string x \b, %-.8s
  862. >>>>>>>>&1 string x \b.%-.3s
  863. >>>>>12 uleshort &0x04
  864. >>>>>>12 uleshort ^0x10
  865. >>>>>>>(14.s) uleshort x
  866. >>>>>>>>&14 string x \b, %-.8s
  867. >>>>>>12 uleshort &0x10
  868. >>>>>>>(14.s) uleshort x
  869. >>>>>>>>&14 string x \b, %-.8s
  870. >>>>>>>>>&1 string x \b.%-.3s
  871. >>>>12 uleshort &0x02
  872. >>>>>12 uleshort ^0x04
  873. >>>>>>12 uleshort ^0x10
  874. >>>>>>>16 string x \b, %-.8s
  875. >>>>>>12 uleshort &0x10
  876. >>>>>>>16 string x \b, %-.8s
  877. >>>>>>>>&1 string x \b.%-.3s
  878. >>>>>12 uleshort &0x04
  879. >>>>>>12 uleshort ^0x10
  880. >>>>>>>(16.s) uleshort x
  881. >>>>>>>>&16 string x \b, %-.8s
  882. >>>>>>12 uleshort &0x10
  883. #>>>>>>>(16.s) uleshort x
  884. >>>>>>>&16 string x %-.8s
  885. >>>>>>>>&1 string x \b.%-.3s
  886. >>>12 uleshort &0x01
  887. >>>>12 uleshort ^0x02
  888. >>>>>12 uleshort ^0x04
  889. >>>>>>12 uleshort ^0x10
  890. >>>>>>>18 string x \b, %-.8s
  891. >>>>>>12 uleshort &0x10
  892. >>>>>>>18 string x \b, %-.8s
  893. >>>>>>>>&1 string x \b.%-.3s
  894. >>>>>12 uleshort &0x04
  895. >>>>>>12 uleshort ^0x10
  896. >>>>>>>(18.s) uleshort x
  897. >>>>>>>>&18 string x \b, %-.8s
  898. >>>>>>12 uleshort &0x10
  899. >>>>>>>(18.s) uleshort x
  900. >>>>>>>>&18 string x \b, %-.8s
  901. >>>>>>>>>&1 string x \b.%-.3s
  902. >>>>12 uleshort &0x02
  903. >>>>>12 uleshort ^0x04
  904. >>>>>>12 uleshort ^0x10
  905. >>>>>>>20 string x \b, %-.8s
  906. >>>>>>12 uleshort &0x10
  907. >>>>>>>20 string x \b, %-.8s
  908. >>>>>>>>&1 string x \b.%-.3s
  909. >>>>>12 uleshort &0x04
  910. >>>>>>12 uleshort ^0x10
  911. >>>>>>>(20.s) uleshort x
  912. >>>>>>>>&20 string x \b, %-.8s
  913. >>>>>>12 uleshort &0x10
  914. >>>>>>>(20.s) uleshort x
  915. >>>>>>>>&20 string x \b, %-.8s
  916. >>>>>>>>>&1 string x \b.%-.3s
  917. # 2 bytes: length of data + mentioned bytes
  918. #
  919. # SZDD variant Haruhiko Okumura's LZSS or 7z type MsLZ
  920. # URL: http://fileformats.archiveteam.org/wiki/MS-DOS_installation_compression
  921. # Reference: http://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html
  922. # http://mark0.net/download/triddefs_xml.7z/defs/s/szdd.trid.xml
  923. # Note: called "Microsoft SZDD compressed (Haruhiko Okumura's LZSS)" by TrID
  924. # verfied by 7-Zip `7z l -tMsLZ -slt *.??_` as MsLZ
  925. # `deark -l -m lzss_oku -d2 setup-1-41.bin` as "LZSS.C by Haruhiko Okumura"
  926. >0 string SZDD MS Compress archive data, SZDD variant
  927. # 2nd part of signature
  928. #>>4 ubelong 0x88F02733 \b, SIGNATURE OK
  929. !:mime application/x-ms-compress-szdd
  930. !:ext ??_
  931. # The character missing from the end of the filename (0=unknown)
  932. >>9 string >\0 \b, %-.1s is last character of original name
  933. # https://www.betaarchive.com/forum/viewtopic.php?t=26161
  934. # Compression mode: "A" (0x41) found but sometimes "B" in Windows 3.1 builds 026 and 034e
  935. >>8 string !A \b, %-.1s method
  936. >>10 ulelong >0 \b, original size: %u bytes
  937. # Summary: InstallShield archive with SZDD compressed
  938. # URL: https://community.flexera.com/t5/InstallShield-Knowledge-Base/InstallShield-Redistributable-Files/ta-p/5647
  939. # From: Joerg Jenderek
  940. 1 search/48/bs SZDD\x88\xF0\x27\x33 InstallShield archive
  941. #!:mime application/octet-stream
  942. !:mime application/x-installshield-compress-szdd
  943. !:ext ibt
  944. # name of compressed archive member like: setup.dl_ _setup7int.dl_ _setup2k.dl_ _igdi.dl_ cabinet.dl_
  945. >0 string x %s
  946. # name of uncompressed archive member like: setup.dll _Setup.dll IGdi.dll CABINET.DLL
  947. >>&1 string x (%s)
  948. # probably version like: 9.0.0.333 9.1.0.429 11.50.0.42618
  949. >>>&1 string x \b, version %s
  950. # SZDD member length like: 168048 169333 181842
  951. >>>>&1 string x \b, %s bytes
  952. # MS Compress archive data
  953. #>&0 string SZDD \b, SIGNATURE FOUND
  954. >&0 indirect x
  955. # QBasic SZDD variant
  956. 3 string \x88\xf0\x27
  957. >0 string SZ\x20 MS Compress archive data, QBasic variant
  958. !:mime application/x-ms-compress-sz
  959. !:ext ??$
  960. >>8 ulelong >0 \b, original size: %u bytes
  961. # Summary: lzss compressed/EDI Pack
  962. # From: Joerg Jenderek
  963. # URL: http://fileformats.archiveteam.org/wiki/EDI_Install_packed_file
  964. # Note: called "EDI Install LZS compressed data" by TrID and verified by
  965. # command like `deark -l -m edi_pack -d2 BOOK01A.IC$` as "EDI Pack LZSS1"
  966. 0 string EDILZSS
  967. >7 string 1
  968. # look for point character before orginal file name extension
  969. >>8 search/9/b .
  970. # check suffix of possible orginal file anme
  971. #>>>&0 ubelong x SUFFIX=%8.8x
  972. # samples without valid character after point in original file name field like: FENNEL.LZS PLANTAIN.LZS
  973. >>>&0 ubyte <0x20
  974. >>>>0 use edi-lzs
  975. # samples with valid character after point in original file name field
  976. >>>&0 ubyte >0x1F
  977. # check 2nd charcter of suffix
  978. #>>>>&0 ubyte x 2ND_SUFFIX=%x
  979. # sample with one valid character after point followed by \0 in original file name field like: SPELMATE.H$
  980. >>>>&0 ubyte =0
  981. >>>>>0 use edi-pack
  982. >>>>&0 ubyte >0x1F
  983. # check 3rd charcter of suffix
  984. #>>>>>&0 ubyte x 3RD_SUFFIX=%x
  985. # no sample with 2 valid characters after point followed by \0 in original file name field
  986. >>>>>&0 ubyte =0
  987. >>>>>>0 use edi-pack
  988. # samples with valid 3rd character after point in original file name field
  989. >>>>>&0 ubyte >0x1F
  990. # sample with 3 valid character after point followed by \0 in original file name field like: BOOK01A.IC$ CTL3D.DL$
  991. >>>>>>&0 ubyte =0
  992. >>>>>>>0 use edi-pack
  993. # sample with 3 valid character after point followed by no \0 in original file name field like: HERBTEXT.LZS
  994. >>>>>>&0 ubyte !0
  995. >>>>>>>0 use edi-lzs
  996. # no sample with invalid 3rd character after point in original file name field
  997. >>>>>&0 default x
  998. >>>>>>0 use edi-lzs
  999. # sample with invalid 2nd character after point in original file name field like: LACERATE.LZS SPLINTER.LZS
  1000. >>>>&0 default x
  1001. >>>>>0 use edi-lzs
  1002. # sample without point character in original file name field like GUNSHOT.LZS
  1003. >>8 default x
  1004. >>>0 use edi-lzs
  1005. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/e/edi-lzss2.trid.xml
  1006. # Note: called "EDI Install Pro LZSS2 compressed data" by TrID and verified by
  1007. # command like `deark -l -m edi_pack -d2 4WAY.WA$` as "EDI Pack LZSS2"
  1008. >7 string 2 EDI LZSS2 packed
  1009. #!:mime application/octet-stream
  1010. !:mime application/x-edi-pack-lzss
  1011. # the name of a compressed file often ends in character '$' or '_'
  1012. !:ext ??$/??_
  1013. # original filename, NUL-terminated, padded to 13 bytes like: mci.vbx 4way.wav skymap.exe cmdialog.vbx
  1014. >>8 string x "%-0.13s"
  1015. # original file size, as a 4-byte integer.
  1016. >>21 ulelong x \b, %u bytes
  1017. # compressed data like: ff5249464606ec00 ff4d5aa601010000
  1018. >>>25 ubequad x \b, data %#16.16llx...
  1019. 0 name edi-pack
  1020. # Note: verified by command like `deark -l -d2 SPELMATE.H$` as "EDI Pack LZSS1"
  1021. # original filename, NUL-terminated, padded to 13 bytes like: ctl3d.dll spelmate.h filemenu.rc owl.def index-it.exe
  1022. # but not like \377Aloe.lzs\273 (HERBTEXT.LZS)
  1023. >8 string x EDI LZSS packed "%-.13s"
  1024. #!:mime application/octet-stream
  1025. !:mime application/x-edi-pack-lzss
  1026. # the name of a compressed file often ends in character '$' or '_'
  1027. !:ext ??$/?$
  1028. # compressed data like: f7000001eff02020 ff4d5aa900020000 ff2f2a207370656c
  1029. >21 ubequad x \b, data %#16.16llx...
  1030. # URL: http://fileformats.archiveteam.org/wiki/EDI_LZSSLib
  1031. # Note: verified partly by command like `deark -l -m edi_pack -d2 GUNSHOT.LZS` as "EDI LZSSLib"
  1032. 0 name edi-lzs
  1033. # Note: verified by command like `deark -l -d2 GUNSHOT.LZS` as "EDI LZSSLib"
  1034. # no original filename looks like: \277BM\226.\0 \277BM.n\001 \277BM\226.\0 \277BM.g\001 \377Aloe.lzs\273
  1035. >8 string x EDI LZSSLib packed
  1036. #!:mime application/octet-stream
  1037. !:mime application/x-edi-pack-lzss
  1038. # The name of a compressed file ends with LZS suffix
  1039. !:ext lzs
  1040. # compressed data like: bf424df6e10100f3 ff416c6f652e6c7a ff416c6f652e6c7a
  1041. >8 ubequad x \b, data %#16.16llx...
  1042. # Summary: CAZIP compressed file
  1043. # From: Joerg Jenderek
  1044. # URL: http://fileformats.archiveteam.org/wiki/CAZIP
  1045. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/c/caz.trid.xml
  1046. # Note: Format is distinct from CAZIPXP compressed
  1047. 0 string \x0D\x0A\x1ACAZIP CAZIP compressed file
  1048. #!:mime application/octet-stream
  1049. !:mime application/x-compress-cazip
  1050. # like: BLINKER.WR_ CLIPDEFS._ CAOSETUP.EX_ CLIPPER.EX_ FILEIO.C_
  1051. !:ext ??_/?_/_
  1052. # Summary: FTCOMP compressed archive
  1053. # From: Joerg Jenderek
  1054. # URL: http://fileformats.archiveteam.org/wiki/FTCOMP
  1055. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/a/ark-ftcomp.trid.xml
  1056. # Note: called by TrID "FTCOMP compressed archive"
  1057. # extracted by `unpack seahelp.hl_`
  1058. 24 string/b FTCOMP FTCOMP compressed archive
  1059. #!:mime application/octet-stream
  1060. !:mime application/x-compress-ftcomp
  1061. !:ext ??_/??@/dll/drv/pk2/
  1062. # probably A596FDFF magic at the beginning
  1063. >0 ubelong !0xA596FDFF \b, at beginning %#x
  1064. # probably original file name with directory like: \OS2\unpack.exe \SYSTEM\8514.DRV MAHJONGG.EXE
  1065. >41 string x "%s"
  1066. # MP3 (archiver, not lossy audio compression)
  1067. 0 string MP3\x1a MP3-Archiver archive data
  1068. # ZET
  1069. 0 string OZ\xc3\x9d ZET archive data
  1070. # TSComp
  1071. # Update: Joerg Jenderek 2023 Nov
  1072. # URL: http://fileformats.archiveteam.org/wiki/TSComp
  1073. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/t/tscomp.trid.xml
  1074. # https://entropymine.com/deark/releases/deark-1.6.5.tar.gz
  1075. # deark-1.6.5/modules/installshld.c
  1076. # Note: called "TSComp compressed data" by TrID
  1077. # verified by command like `deark -m tscomp -l -d2 MAKERRES.DL$`
  1078. # The "13" might be a version number. The "8c" is a mystery
  1079. 0 string \x65\x5d\x13\x8c\x08\x01\x03\x00 TSComp archive
  1080. #!:mime application/octet-stream
  1081. !:mime application/x-tscomp-compressed
  1082. # filename style: 0~old version 1~without wildcard 2~with wildcard
  1083. #>0x08 ubyte x \b, filename style %u
  1084. >0x08 ubyte 0 data, filename style 0
  1085. # no example found
  1086. !:ext ??$
  1087. #>0x08 ubyte 1 data, without wildcard
  1088. >0x08 ubyte 1 data
  1089. # for single-file archives, often the last letter of the filename extension is changed to "$"; but also name like: BUILD3.BM!
  1090. !:ext ??$/??!
  1091. >0x08 ubyte 2 data, with wildcard
  1092. # for multi-file archives common extensions seem to be .lib and .cmp, but also names like: SAMPMIF$ OTDATA.$$$ TWOFILES.TSC WIN.PAK
  1093. !:ext /lib/cmp/$$$/tsc/pak
  1094. # fnlen; pascal string length; original 1st file name like: CHFORMAT.MML
  1095. >0x1c pstring x \b, %s
  1096. # md->fi->timestamp
  1097. >0x16 lemsdosdate x \b, modified %s
  1098. >0x18 lemsdostime x %s
  1099. # 1st compressed size: like 180 (SAMPMML$$)
  1100. >0x0E ulelong x \b, compressed size %u
  1101. # de_dbg_indent(c, 1): like: 12h
  1102. #>0x0d ubyte x b, at 0xD %#x
  1103. # like: 0
  1104. #>0x1A ubeshort x \b, at 0x1A %#x
  1105. # 2nd member offset
  1106. #>0x12 ulelong x \b, next offset %#x
  1107. >0x12 ulelong >0
  1108. # original 2nd archive member name like: FORMATS.MML
  1109. >>(0x12.l+15) pstring x \b, %s ...
  1110. # ARQ
  1111. 0 string gW\4\1 ARQ archive data
  1112. # Squash
  1113. 3 string OctSqu Squash archive data
  1114. # Terse
  1115. 0 string \5\1\1\0 Terse archive data
  1116. # UHarc
  1117. 0 string UHA UHarc archive data
  1118. # ABComp
  1119. 0 string \2AB ABComp archive data
  1120. 0 string \3AB2 ABComp archive data
  1121. # CMP
  1122. 0 string CO\0 CMP archive data
  1123. # Splint
  1124. 0 string \x93\xb9\x06 Splint archive data
  1125. # InstallShield
  1126. 0 string \x13\x5d\x65\x8c InstallShield Z archive Data
  1127. # Gather
  1128. 1 string GTH Gather archive data
  1129. # BOA
  1130. 0 string BOA BOA archive data
  1131. # RAX
  1132. 0 string ULEB\xa RAX archive data
  1133. # Xtreme
  1134. 0 string ULEB\0 Xtreme archive data
  1135. # Pack Magic
  1136. 0 string @\xc3\xa2\1\0 Pack Magic archive data
  1137. # BTS
  1138. 0 belong&0xfeffffff 0x1a034465 BTS archive data
  1139. # ELI 5750
  1140. 0 string Ora\ ELI 5750 archive data
  1141. # QFC
  1142. 0 string \x1aFC\x1a QFC archive data
  1143. 0 string \x1aQF\x1a QFC archive data
  1144. # PRO-PACK https://www.segaretro.org/Rob_Northen_compression
  1145. 0 string RNC
  1146. >3 byte 1 PRO-PACK archive data (compression 1)
  1147. >3 byte 2 PRO-PACK archive data (compression 2)
  1148. # 777
  1149. 0 string 777 777 archive data
  1150. # LZS221
  1151. 0 string sTaC LZS221 archive data
  1152. # HPA
  1153. 0 string HPA HPA archive data
  1154. # Arhangel
  1155. 0 string LG Arhangel archive data
  1156. # EXP1, uses bzip2
  1157. 0 string 0123456789012345BZh EXP1 archive data
  1158. # IMP
  1159. 0 string IMP\xa IMP archive data
  1160. # NRV
  1161. 0 string \x00\x9E\x6E\x72\x76\xFF NRV archive data
  1162. # Squish
  1163. 0 string \x73\xb2\x90\xf4 Squish archive data
  1164. # Par
  1165. 0 string PHILIPP Par archive data
  1166. 0 string PAR Par archive data
  1167. # HIT
  1168. 0 string UB HIT archive data
  1169. # SBX
  1170. 0 belong&0xfffff000 0x53423000 SBX archive data
  1171. # NaShrink
  1172. 0 string NSK NaShrink archive data
  1173. # SAPCAR
  1174. 0 string #\ CAR\ archive\ header SAPCAR archive data
  1175. 0 string CAR\ 2.00 SAPCAR archive data
  1176. 0 string CAR\ 2.01 SAPCAR archive data
  1177. #!:mime application/octet-stream
  1178. !:mime application/vnd.sar
  1179. !:ext sar
  1180. # Disintegrator
  1181. 0 string DST Disintegrator archive data
  1182. # ASD
  1183. 0 string ASD ASD archive data
  1184. # InstallShield CAB
  1185. # Update: Joerg Jenderek at Nov 2021
  1186. # URL: https://en.wikipedia.org/wiki/InstallShield
  1187. # Reference: https://github.com/twogood/unshield/blob/master/lib/cabfile.h
  1188. # Note: Not compatible with Microsoft CAB files
  1189. # http://mark0.net/download/triddefs_xml.7z/defs/a/ark-cab-ishield.trid.xml
  1190. # CAB_SIGNATURE 0x28635349
  1191. 0 string ISc( InstallShield
  1192. #!:mime application/octet-stream
  1193. !:mime application/x-installshield
  1194. # http://mark0.net/download/triddefs_xml.7z/defs/a/ark-cab-ishield-hdr.trid.xml
  1195. >16 ulelong !0 setup header
  1196. # like: _SYS1.HDR _USER1.HDR data1.hdr
  1197. !:ext hdr
  1198. >16 ulelong =0 CAB
  1199. # like: _SYS1.CAB _USER1.CAB DATA1.CAB data2.cab
  1200. !:ext cab
  1201. # https://github.com/twogood/unshield/blob/master/lib/helper.c
  1202. # version like: 0x1005201 0x100600c 0x1007000 0x1009500
  1203. # 0x2000578 0x20005dc 0x2000640 0x40007d0 0x4000834
  1204. >4 ulelong x \b, version %#x
  1205. # volume_info like: 0
  1206. >8 ulelong !0 \b, volume_info %#x
  1207. # cab_descriptor_offset like: 0x200
  1208. >12 ulelong !0x200 \b, offset %#x
  1209. #>0x200 ubequad x \b, at 0x200 %#16.16llx
  1210. # cab_descriptor_size like: 0 (*.cab) BD5 C8B DA5 E2A E36 116C 251D 4DA9 56F0 5CC2 6E4B 777D 779E 1F7C2
  1211. >16 ulelong !0 \b, descriptor size %#x
  1212. # TOP4
  1213. 0 string T4\x1a TOP4 archive data
  1214. # BatComp left out: sig looks like COM executable
  1215. # so TODO: get real 4dos batcomp file and find sig
  1216. # BlakHole
  1217. 0 string BH\5\7 BlakHole archive data
  1218. # BIX
  1219. 0 string BIX0 BIX archive data
  1220. # ChiefLZA
  1221. 0 string ChfLZ ChiefLZA archive data
  1222. # Blink
  1223. 0 string Blink Blink archive data
  1224. # Logitech Compress
  1225. 0 string \xda\xfa Logitech Compress archive data
  1226. # ARS-Sfx (FIXME: really a SFX? then goto COM/EXE)
  1227. 1 string (C)\ STEPANYUK ARS-Sfx archive data
  1228. # AKT/AKT32
  1229. 0 string AKT32 AKT32 archive data
  1230. 0 string AKT AKT archive data
  1231. # NPack
  1232. 0 string MSTSM NPack archive data
  1233. # PFT
  1234. 0 string \0\x50\0\x14 PFT archive data
  1235. # SemOne
  1236. 0 string SEM SemOne archive data
  1237. # PPMD
  1238. 0 string \x8f\xaf\xac\x84 PPMD archive data
  1239. # FIZ
  1240. 0 string FIZ FIZ archive data
  1241. # MSXiE
  1242. 0 belong&0xfffff0f0 0x4d530000 MSXiE archive data
  1243. # DeepFreezer
  1244. 0 belong&0xfffffff0 0x797a3030 DeepFreezer archive data
  1245. # DC
  1246. 0 string =<DC- DC archive data
  1247. # TPac
  1248. 0 string \4TPAC\3 TPac archive data
  1249. # Ai
  1250. # Update: Joerg Jenderek
  1251. # URL: http://fileformats.archiveteam.org/wiki/Ai_Archiver
  1252. 0 string Ai\1\1\0 Ai archive data
  1253. #!:mime application/octet-stream
  1254. !:mime application/x-compress-ai
  1255. !:ext ai
  1256. 0 string Ai\1\0\0 Ai archive data
  1257. #!:mime application/octet-stream
  1258. !:mime application/x-compress-ai
  1259. !:ext ai
  1260. # Ai32
  1261. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/a/ark-ai.trid.xml
  1262. # Note: called "Ai Archivator compressed archive" by TrID
  1263. 0 string Ai\2\0 Ai32 archive data
  1264. #!:mime application/octet-stream
  1265. !:mime application/x-compress-ai
  1266. !:ext ai
  1267. # original file name
  1268. >8 pstring/h x "%s"
  1269. # according to TrID the next 3 bytes are nil
  1270. >5 ubyte !0 \b, at 5 %#x
  1271. >6 ubyte !0 \b, at 6 %#x
  1272. >7 ubyte !0 \b, at 7 %#x
  1273. # the fourth byte with value 0 is probably a flag for "non solid" mode
  1274. #>3 ubyte =0x00 \b, unsolid mode
  1275. 0 string Ai\2\1 Ai32 archive data
  1276. #!:mime application/octet-stream
  1277. !:mime application/x-compress-ai
  1278. !:ext ai
  1279. # original file name
  1280. >8 pstring/h x "%s"
  1281. # the fourth byte with value 0x01 is probably a flag for "solid" mode; this is not the default
  1282. >3 ubyte =0x01 \b, solid mode
  1283. # SBC
  1284. 0 string SBC SBC archive data
  1285. # Ybs
  1286. 0 string YBS Ybs archive data
  1287. # DitPack
  1288. 0 string \x9e\0\0 DitPack archive data
  1289. # DMS
  1290. 0 string DMS! DMS archive data
  1291. # EPC
  1292. 0 string \x8f\xaf\xac\x8c EPC archive data
  1293. # VSARC
  1294. 0 string VS\x1a VSARC archive data
  1295. # PDZ
  1296. 0 string PDZ PDZ archive data
  1297. # ReDuq
  1298. 0 string rdqx ReDuq archive data
  1299. # GCA
  1300. 0 string GCAX GCA archive data
  1301. # PPMN
  1302. 0 string pN PPMN archive data
  1303. # WinImage
  1304. 3 string WINIMAGE WinImage archive data
  1305. # Compressia
  1306. 0 string CMP0CMP Compressia archive data
  1307. # UHBC
  1308. 0 string UHB UHBC archive data
  1309. # WinHKI
  1310. 0 string \x61\x5C\x04\x05 WinHKI archive data
  1311. # WWPack data file
  1312. 0 string WWP WWPack archive data
  1313. # BSN (BSA, PTS-DOS)
  1314. 0 string \xffBSG BSN archive data
  1315. 1 string \xffBSG BSN archive data
  1316. 3 string \xffBSG BSN archive data
  1317. 1 string \0\xae\2 BSN archive data
  1318. 1 string \0\xae\3 BSN archive data
  1319. 1 string \0\xae\7 BSN archive data
  1320. # AIN
  1321. 0 string \x33\x18 AIN archive data
  1322. 0 string \x33\x17 AIN archive data
  1323. # XPA32 test moved and merged with XPA by Joerg Jenderek at Sep 2015
  1324. # SZip (TODO: doesn't catch all versions)
  1325. 0 string SZ\x0a\4 SZip archive data
  1326. # XPack DiskImage
  1327. # *.XDI updated by Joerg Jenderek Sep 2015
  1328. # ftp://ftp.sac.sk/pub/sac/pack/0index.txt
  1329. # GRR: this test is still too general as it catches also text files starting with jm
  1330. 0 string jm
  1331. # only found examples with this additional characteristic 2 bytes
  1332. >2 string \x2\x4 Xpack DiskImage archive data
  1333. #!:ext xdi
  1334. # XPack Data
  1335. # *.xpa updated by Joerg Jenderek Sep 2015
  1336. # ftp://ftp.elf.stuba.sk/pub/pc/pack/
  1337. 0 string xpa XPA
  1338. !:ext xpa
  1339. # XPA32
  1340. # ftp://ftp.elf.stuba.sk/pub/pc/pack/xpa32.zip
  1341. # created by XPA32.EXE version 1.0.2 for Windows
  1342. >0 string xpa\0\1 \b32 archive data
  1343. # created by XPACK.COM version 1.67m or 1.67r with short 0x1800
  1344. >3 ubeshort !0x0001 \bck archive data
  1345. # XPack Single Data
  1346. # changed by Joerg Jenderek Sep 2015 back to like in version 5.12
  1347. # letter 'I'+ acute accent is equivalent to \xcd
  1348. 0 string \xcd\ jm Xpack single archive data
  1349. #!:mime application/x-xpa-compressed
  1350. !:ext xpa
  1351. # TODO: missing due to unknown magic/magic at end of file:
  1352. #DWC
  1353. #ARG
  1354. #ZAR
  1355. #PC/3270
  1356. #InstallIt
  1357. #RKive
  1358. #RK
  1359. #XPack Diskimage
  1360. # These were inspired by idarc, but actually verified
  1361. # Dzip archiver (.dz)
  1362. # Update: Joerg Jenderek
  1363. # URL: http://speeddemosarchive.com/dzip/
  1364. # reference: http://speeddemosarchive.com/dzip/dz29src.zip/main.c
  1365. # GRR: line below is too general as it matches also ASCII texts like Doszip commander help dz.txt
  1366. 0 string DZ
  1367. # latest version is 2.9 dated 7 may 2003
  1368. >2 byte <4 Dzip archive data
  1369. !:mime application/x-dzip
  1370. !:ext dz
  1371. >>2 byte x \b, version %i
  1372. >>3 byte x \b.%i
  1373. >>4 ulelong x \b, offset %#x
  1374. >>8 ulelong x \b, %u files
  1375. # ZZip archiver (.zz)
  1376. 0 string ZZ\ \0\0 ZZip archive data
  1377. 0 string ZZ0 ZZip archive data
  1378. # PAQ archiver (.paq)
  1379. 0 string \xaa\x40\x5f\x77\x1f\xe5\x82\x0d PAQ archive data
  1380. 0 string PAQ PAQ archive data
  1381. >3 byte&0xf0 0x30
  1382. >>3 byte x (v%c)
  1383. # JAR archiver (.j), this is the successor to ARJ, not Java's JAR (which is essentially ZIP)
  1384. # Update: Joerg Jenderek
  1385. # URL: http://fileformats.archiveteam.org/wiki/JAR_(ARJ_Software)
  1386. # reference: http://mark0.net/download/triddefs_xml.7z/defs/a/ark-jar.trid.xml
  1387. # https://www.sac.sk/download/pack/jar102x.exe/TECHNOTE.DOC
  1388. # Note: called "JAR compressed archive" by TrID
  1389. 0xe string \x1aJar\x1b JAR (ARJ Software, Inc.) archive data
  1390. #!:mime application/octet-stream
  1391. !:mime application/x-compress-j
  1392. >0 ulelong x \b, CRC32 %#x
  1393. # standard suffix is ".j"; for multi volumes following order j01 j02 ... j99 100 ... 990
  1394. !:ext j/j01/j02
  1395. # URL: http://fileformats.archiveteam.org/wiki/JARCS
  1396. # reference: http://mark0.net/download/triddefs_xml.7z/defs/a/ark-jarcs.trid.xml
  1397. # Note: called "JARCS compressed archive" by TrID
  1398. 0 string JARCS JAR (ARJ Software, Inc.) archive data
  1399. #!:mime application/octet-stream
  1400. !:mime application/x-compress-jar
  1401. !:ext jar
  1402. # ARJ archiver (jason@jarthur.Claremont.EDU)
  1403. # URL: http://fileformats.archiveteam.org/wiki/ARJ
  1404. # reference: http://mark0.net/download/triddefs_xml.7z/defs/a/ark-arj.trid.xml
  1405. # https://github.com/FarGroup/FarManager/
  1406. # blob/master/plugins/multiarc/arc.doc/arj.txt
  1407. # Note: called "ARJ compressed archive" by TrID and
  1408. # "ARJ File Format" by DROID via PUID fmt/610
  1409. # verified by `7z l -tarj PHRACK1.ARJ` and
  1410. # `arj.exe l TEST-hk9.ARJ`
  1411. 0 leshort 0xea60
  1412. # skip DROID fmt-610-signature-id-946.arj by check for valid file type of main header
  1413. >0xA ubyte 2
  1414. >>0 use arj-archive
  1415. 0 name arj-archive
  1416. >0 leshort x ARJ archive
  1417. !:mime application/x-arj
  1418. # look for terminating 0-character of filename
  1419. >0x26 search/1024 \0
  1420. # file name extension is normally .arj but not for parts of multi volume
  1421. #>>&-5 string x extension %.4s
  1422. >>&-5 string/c .arj data
  1423. !:ext arj
  1424. >>&-5 default x
  1425. # for multi volume first name is archive.arj then following parts archive.a01 archive.a02 ...
  1426. >>>8 byte &0x04 data
  1427. !:ext a01/a02
  1428. # for SFX first name is archive.exe then following parts archive.e01 archive.e02 ...
  1429. >>>8 byte ^0x04 data, SFX multi-volume
  1430. !:ext e01/e02
  1431. # basic header size like: 0x002b 0x002c 0x04e0 0x04e3 0x04e7
  1432. #>2 uleshort x basic header size %#4.4x
  1433. # next fragment content like: 0x0a200a003a8fc713 0x524a000010bb3471 0x524a0000c73c70f9
  1434. #>(2.s) ubequad x NEXT FRAGMENT CONTENT %#16.16llx
  1435. # first_hdr_size; seems to be same as basic header size
  1436. #>2 uleshort x 1st header size %#x
  1437. # archiver version number like: 3 4 6 11 102
  1438. >5 byte x \b, v%d
  1439. # minimum archiver version to extract like: 1
  1440. >6 ubyte !1 \b, minimum %u to extract
  1441. # FOR DEBUGGING
  1442. #>8 byte x \b, FLAGS %#x
  1443. # GARBLED_FLAG1; garble with password; g switch
  1444. >8 byte &0x01 \b, password-protected
  1445. # encryption version: 0~old 1~old 2~new 3~reserved 4~40 bit key GOST
  1446. >>0x20 ubyte x (v%u)
  1447. #>8 byte &0x02 \b, secured
  1448. # ANSIPAGE_FLAG; indicates ANSI codepage used by ARJ32; hy switch
  1449. >8 byte &0x02 \b, ANSI codepage
  1450. # VOLUME_FLAG indicates presence of succeeding volume; but apparently not for SFX
  1451. >8 byte &0x04 \b, multi-volume
  1452. #>8 byte &0x08 \b, file-offset
  1453. # ARJPROT_FLAG; build with data protection record; hk switch
  1454. >8 byte &0x08 \b, recoverable
  1455. # arj protection factor; maximal 10; switch hky -> factor=y+1
  1456. >>0x22 byte x (factor %u)
  1457. >8 byte &0x10 \b, slash-switched
  1458. # BACKUP_FLAG; obsolete
  1459. >8 byte &0x20 \b, backup
  1460. # SECURED_FLAG;
  1461. >8 byte &0x40 \b, secured,
  1462. # ALTNAME_FLAG; indicates dual-name archive
  1463. >8 byte &0x80 \b, dual-name
  1464. # security version; 0~old 2~current
  1465. >9 ubyte !0
  1466. >>9 ubyte !2 \b, security version %u
  1467. # file type; 2 in main header; 0~binary 1~7-bitText 2~comment 3~directory 4~VolumeLabel 5=ChapterLabel
  1468. >0xA ubyte !2 \b, file type %u
  1469. # date+time when original archive was created in MS-DOS format via ./msdos
  1470. >0xC ulelong x \b, created
  1471. >0xC use dos-date
  1472. # or date and time by new internal function
  1473. #>0xE lemsdosdate x %s
  1474. #>0xC lemsdostime x %s
  1475. # FOR DEBUGGING
  1476. #>0x12 uleshort x RAW DATE %#4.4x
  1477. #>0x10 uleshort x RAW TIME %#4.4x
  1478. # date+time when archive was last modified; sometimes nil or
  1479. # maybe wrong like in HP4DRVR.ARJ
  1480. #>0x10 ulelong >0 \b, modified
  1481. #>>0x10 use dos-date
  1482. # or date and time by new internal function
  1483. #>>0x12 lemsdosdate x %s
  1484. #>>0x10 lemsdostime x %s
  1485. # archive size (currently used only for secured archives); MAYBE?
  1486. #>0x14 ulelong !0 \b, file size %u
  1487. # security envelope file position; MAYBE?
  1488. #>0x18 ulelong !0 \b, at %#x security envelope
  1489. # filespec position in filename; WHAT IS THAT?
  1490. #>0x1C uleshort >0 \b, filespec position %#x
  1491. # length in bytes of security envelope data like: 2CAh 301h 364h 471h
  1492. >0x1E uleshort !0 \b, security envelope length %#x
  1493. # last chapter like: 0 1
  1494. >0x21 ubyte !0 \b, last chapter %u
  1495. # filename (null-terminated string); sometimes at 0x26 when 4 bytes for extra data
  1496. >34 byte x \b, original name:
  1497. # with extras data
  1498. >34 byte <0x0B
  1499. >>38 string x %s
  1500. # without extras data
  1501. >34 byte >0x0A
  1502. >>34 string x %s
  1503. # host OS: 0~MSDOS ... 11~WIN32
  1504. >7 byte 0 \b, os: MS-DOS
  1505. >7 byte 1 \b, os: PRIMOS
  1506. >7 byte 2 \b, os: Unix
  1507. >7 byte 3 \b, os: Amiga
  1508. >7 byte 4 \b, os: Macintosh
  1509. >7 byte 5 \b, os: OS/2
  1510. >7 byte 6 \b, os: Apple ][ GS
  1511. >7 byte 7 \b, os: Atari ST
  1512. >7 byte 8 \b, os: NeXT
  1513. >7 byte 9 \b, os: VAX/VMS
  1514. >7 byte 10 \b, os: WIN95
  1515. >7 byte 11 \b, os: WIN32
  1516. # [JW] idarc says this is also possible
  1517. 2 leshort 0xea60 ARJ archive data
  1518. #2 leshort 0xea60
  1519. #>2 use arj-archive
  1520. # HA archiver (Greg Roelofs, newt@uchicago.edu)
  1521. # This is a really bad format. A file containing HAWAII will match this...
  1522. #0 string HA HA archive data,
  1523. #>2 leshort =1 1 file,
  1524. #>2 leshort >1 %u files,
  1525. #>4 byte&0x0f =0 first is type CPY
  1526. #>4 byte&0x0f =1 first is type ASC
  1527. #>4 byte&0x0f =2 first is type HSC
  1528. #>4 byte&0x0f =0x0e first is type DIR
  1529. #>4 byte&0x0f =0x0f first is type SPECIAL
  1530. # suggestion: at least identify small archives (<1024 files)
  1531. 0 belong&0xffff00fc 0x48410000 HA archive data
  1532. >2 leshort =1 1 file,
  1533. >2 leshort >1 %u files,
  1534. >4 byte&0x0f =0 first is type CPY
  1535. >4 byte&0x0f =1 first is type ASC
  1536. >4 byte&0x0f =2 first is type HSC
  1537. >4 byte&0x0f =0x0e first is type DIR
  1538. >4 byte&0x0f =0x0f first is type SPECIAL
  1539. # HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
  1540. 0 string HPAK HPACK archive data
  1541. # JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
  1542. 0 string \351,\001JAM\ JAM archive,
  1543. >7 string >\0 version %.4s
  1544. >0x26 byte =0x27 -
  1545. >>0x2b string >\0 label %.11s,
  1546. >>0x27 lelong x serial %08x,
  1547. >>0x36 string >\0 fstype %.8s
  1548. # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
  1549. # Update: Joerg Jenderek
  1550. # URL: https://en.wikipedia.org/wiki/LHA_(file_format)
  1551. # Reference: https://web.archive.org/web/20021005080911/http://www.osirusoft.com/joejared/lzhformat.html
  1552. #
  1553. # check and display information of lharc (LHa,PMarc) file
  1554. 0 name lharc-file
  1555. # check 1st character of method id like -lz4- -lh5- or -pm2-
  1556. >2 string -
  1557. # check 5th character of method id
  1558. >>6 string -
  1559. # check header level 0 1 2 3
  1560. >>>20 ubyte <4
  1561. # check 2nd, 3th and 4th character of method id
  1562. >>>>3 regex \^(lh[0-9a-ex]|lz[s2-8]|pm[012]|pc1) \b
  1563. !:mime application/x-lzh-compressed
  1564. # creator type "LHA "
  1565. !:apple ????LHA
  1566. # display archive type name like "LHa/LZS archive data" or "LArc archive"
  1567. >>>>>2 string -lz \b
  1568. !:ext lzs
  1569. # already known -lzs- -lz4- -lz5- with old names
  1570. >>>>>>2 string -lzs LHa/LZS archive data
  1571. >>>>>>3 regex \^lz[45] LHarc 1.x archive data
  1572. # missing -lz?- with wikipedia names
  1573. >>>>>>3 regex \^lz[2378] LArc archive
  1574. # display archive type name like "LHa (2.x) archive data"
  1575. >>>>>2 string -lh \b
  1576. # already known -lh0- -lh1- -lh2- -lh3- -lh4- -lh5- -lh6- -lh7- -lhd- variants with old names
  1577. >>>>>>3 regex \^lh[01] LHarc 1.x/ARX archive data
  1578. # LHice archiver use ".ICE" as name extension instead usual one ".lzh"
  1579. # FOOBAR archiver use ".foo" as name extension instead usual one
  1580. # "Florian Orjanov's and Olga Bachetska's ARchiver" not found at the moment
  1581. >>>>>>>2 string -lh1 \b
  1582. !:ext lha/lzh/ice
  1583. >>>>>>3 regex \^lh[23d] LHa 2.x? archive data
  1584. >>>>>>3 regex \^lh[7] LHa (2.x)/LHark archive data
  1585. >>>>>>3 regex \^lh[456] LHa (2.x) archive data
  1586. >>>>>>>2 string -lh5 \b
  1587. # https://en.wikipedia.org/wiki/BIOS
  1588. # Some mainboard BIOS like Award use LHa compression. So archives with unusual extension are found like
  1589. # bios.rom , kd7_v14.bin, 1010.004, ...
  1590. !:ext lha/lzh/rom/bin
  1591. # missing -lh?- variants (Joe Jared)
  1592. >>>>>>3 regex \^lh[89a-ce] LHa (Joe Jared) archive
  1593. # UNLHA32 2.67a
  1594. >>>>>>2 string -lhx LHa (UNLHA32) archive
  1595. # lha archives with standard file name extensions ".lha" ".lzh"
  1596. >>>>>>3 regex !\^(lh1|lh5) \b
  1597. !:ext lha/lzh
  1598. # this should not happen if all -lh variants are described
  1599. >>>>>>2 default x LHa (unknown) archive
  1600. #!:ext lha
  1601. # PMarc
  1602. >>>>>3 regex \^pm[012] PMarc archive data
  1603. !:ext pma
  1604. # append method id without leading and trailing minus character
  1605. >>>>>3 string x [%3.3s]
  1606. >>>>>>0 use lharc-header
  1607. #
  1608. # check and display information of lharc header
  1609. 0 name lharc-header
  1610. # header size 0x4 , 0x1b-0x61
  1611. #>0 ubyte x
  1612. # compressed data size != compressed file size
  1613. #>7 ulelong x \b, data size %d
  1614. # attribute: 0x2~?? 0x10~symlink|target 0x20~normal
  1615. #>19 ubyte x \b, 19_%#x
  1616. # level identifier 0 1 2 3
  1617. #>20 ubyte x \b, level %d
  1618. # time stamp
  1619. #>15 ubelong x DATE %#8.8x
  1620. # OS ID for level 1
  1621. >20 ubyte 1
  1622. # 0x20 types find for *.rom files
  1623. >>(21.b+24) ubyte <0x21 \b, %#x OS
  1624. # ascii type like M for MSDOS
  1625. >>(21.b+24) ubyte >0x20 \b, '%c' OS
  1626. # OS ID for level 2
  1627. >20 ubyte 2
  1628. #>>23 ubyte x \b, OS ID %#x
  1629. >>23 ubyte <0x21 \b, %#x OS
  1630. >>23 ubyte >0x20 \b, '%c' OS
  1631. # filename only for level 0 and 1
  1632. >20 ubyte <2
  1633. # length of filename
  1634. >>21 ubyte >0 \b, with
  1635. # filename
  1636. >>>21 pstring x "%s"
  1637. #
  1638. #2 string -lh0- LHarc 1.x/ARX archive data [lh0]
  1639. #!:mime application/x-lharc
  1640. 2 string -lh0-
  1641. >0 use lharc-file
  1642. #2 string -lh1- LHarc 1.x/ARX archive data [lh1]
  1643. #!:mime application/x-lharc
  1644. 2 string -lh1-
  1645. >0 use lharc-file
  1646. # NEW -lz2- ... -lz8-
  1647. 2 string -lz2-
  1648. >0 use lharc-file
  1649. 2 string -lz3-
  1650. >0 use lharc-file
  1651. 2 string -lz4-
  1652. >0 use lharc-file
  1653. 2 string -lz5-
  1654. >0 use lharc-file
  1655. 2 string -lz7-
  1656. >0 use lharc-file
  1657. 2 string -lz8-
  1658. >0 use lharc-file
  1659. # [never seen any but the last; -lh4- reported in comp.compression:]
  1660. #2 string -lzs- LHa/LZS archive data [lzs]
  1661. 2 string -lzs-
  1662. >0 use lharc-file
  1663. # According to wikipedia and others such a version does not exist
  1664. #2 string -lh\40- LHa 2.x? archive data [lh ]
  1665. #2 string -lhd- LHa 2.x? archive data [lhd]
  1666. 2 string -lhd-
  1667. >0 use lharc-file
  1668. #2 string -lh2- LHa 2.x? archive data [lh2]
  1669. 2 string -lh2-
  1670. >0 use lharc-file
  1671. #2 string -lh3- LHa 2.x? archive data [lh3]
  1672. 2 string -lh3-
  1673. >0 use lharc-file
  1674. #2 string -lh4- LHa (2.x) archive data [lh4]
  1675. 2 string -lh4-
  1676. >0 use lharc-file
  1677. #2 string -lh5- LHa (2.x) archive data [lh5]
  1678. 2 string -lh5-
  1679. >0 use lharc-file
  1680. #2 string -lh6- LHa (2.x) archive data [lh6]
  1681. 2 string -lh6-
  1682. >0 use lharc-file
  1683. #2 string -lh7- LHa (2.x)/LHark archive data [lh7]
  1684. 2 string -lh7-
  1685. # !:mime application/x-lha
  1686. # >20 byte x - header level %d
  1687. >0 use lharc-file
  1688. # NEW -lh8- ... -lhe- , -lhx-
  1689. 2 string -lh8-
  1690. >0 use lharc-file
  1691. 2 string -lh9-
  1692. >0 use lharc-file
  1693. 2 string -lha-
  1694. >0 use lharc-file
  1695. 2 string -lhb-
  1696. >0 use lharc-file
  1697. 2 string -lhc-
  1698. >0 use lharc-file
  1699. 2 string -lhe-
  1700. >0 use lharc-file
  1701. 2 string -lhx-
  1702. >0 use lharc-file
  1703. # taken from idarc [JW]
  1704. 2 string -lZ PUT archive data
  1705. # already done by LHarc magics
  1706. # this should never happen if all sub types of LZS archive are identified
  1707. #2 string -lz LZS archive data
  1708. 2 string -sw1- Swag archive data
  1709. 0 name rar-file-header
  1710. >24 byte 15 \b, v1.5
  1711. >24 byte 20 \b, v2.0
  1712. >24 byte 29 \b, v4
  1713. >15 byte 0 \b, os: MS-DOS
  1714. >15 byte 1 \b, os: OS/2
  1715. >15 byte 2 \b, os: Win32
  1716. >15 byte 3 \b, os: Unix
  1717. >15 byte 4 \b, os: Mac OS
  1718. >15 byte 5 \b, os: BeOS
  1719. 0 name rar-archive-header
  1720. >3 leshort&0x1ff >0 \b, flags:
  1721. >>3 leshort &0x01 ArchiveVolume
  1722. >>3 leshort &0x02 Commented
  1723. >>3 leshort &0x04 Locked
  1724. >>3 leshort &0x10 NewVolumeNaming
  1725. >>3 leshort &0x08 Solid
  1726. >>3 leshort &0x20 Authenticated
  1727. >>3 leshort &0x40 RecoveryRecordPresent
  1728. >>3 leshort &0x80 EncryptedBlockHeader
  1729. >>3 leshort &0x100 FirstVolume
  1730. # RAR (Roshal Archive) archive
  1731. 0 string Rar!\x1a\7\0 RAR archive data
  1732. !:mime application/vnd.rar
  1733. !:ext rar/cbr
  1734. # file header
  1735. >(0xc.l+9) byte 0x74
  1736. >>(0xc.l+7) use rar-file-header
  1737. # subblock seems to share information with file header
  1738. >(0xc.l+9) byte 0x7a
  1739. >>(0xc.l+7) use rar-file-header
  1740. >9 byte 0x73
  1741. >>7 use rar-archive-header
  1742. 0 string Rar!\x1a\7\1\0 RAR archive data, v5
  1743. !:mime application/vnd.rar
  1744. !:ext rar
  1745. # Very old RAR archive
  1746. # https://jasonblanks.com/wp-includes/images/papers/KnowyourarchiveRAR.pdf
  1747. 0 string RE\x7e\x5e RAR archive data (<v1.5)
  1748. !:mime application/vnd.rar
  1749. !:ext rar/cbr
  1750. # SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
  1751. 0 string SQSH squished archive data (Acorn RISCOS)
  1752. # UC2 archiver (Greg Roelofs, newt@uchicago.edu)
  1753. # [JW] see exe section for self-extracting version
  1754. 0 string UC2\x1a UC2 archive data
  1755. # PKZIP multi-volume archive
  1756. 0 string PK\x07\x08PK\x03\x04 Zip multi-volume archive data, at least PKZIP v2.50 to extract
  1757. !:mime application/zip
  1758. !:ext zip/cbz
  1759. 0 string PK\003\004
  1760. !:strength +1
  1761. # IOS/IPadOS IPA file (Zip archive)
  1762. # Starts with Payload (file name length = 19)
  1763. >26 uleshort 8
  1764. >>30 string Payload IOS/iPadOS IPA file
  1765. >>>&26 search/6000 PK\003\004
  1766. >>>>&34 string x containing %s
  1767. !:mime application/x-ios-app
  1768. !:ext ipa
  1769. # Android APK file (Zip archive)
  1770. # Starts with AndroidManifest.xml (file name length = 19)
  1771. >26 uleshort 19
  1772. >>30 string AndroidManifest.xml Android package (APK), with AndroidManifest.xml
  1773. !:mime application/vnd.android.package-archive
  1774. !:ext apk
  1775. >>>-22 string PK\005\006
  1776. >>>>(-6.l-16) string APK\x20Sig\x20Block\x2042 \b, with APK Signing Block
  1777. # Starts with META-INF/com/android/build/gradle/app-metadata.properties
  1778. >26 uleshort 57
  1779. >>30 string META-INF/com/android/build/gradle/
  1780. >>>&0 string app-metadata.properties Android package (APK), with gradle app-metadata.properties
  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. # Starts with classes.dex (file name length = 11)
  1786. >26 uleshort 11
  1787. >>30 string classes.dex Android package (APK), with classes.dex
  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. # Starts with META-INF/MANIFEST.MF (file name length = 20)
  1793. # NB: checks for resources.arsc, classes.dex, etc. as well to avoid matching JAR files
  1794. >26 uleshort 20
  1795. >>30 string META-INF/MANIFEST.MF
  1796. # Contains resources.arsc (near the end, in the central directory)
  1797. >>>-512 search resources.arsc Android package (APK), with MANIFEST.MF and resources.arsc
  1798. !:mime application/vnd.android.package-archive
  1799. !:ext apk
  1800. >>>>-22 string PK\005\006
  1801. >>>>>(-6.l-16) string APK\x20Sig\x20Block\x2042 \b, with APK Signing Block
  1802. >>>-512 default x
  1803. # Contains classes.dex (near the end, in the central directory)
  1804. >>>>-512 search classes.dex Android package (APK), with MANIFEST.MF and classes.dex
  1805. !:mime application/vnd.android.package-archive
  1806. !:ext apk
  1807. >>>>>-22 string PK\005\006
  1808. >>>>>>(-6.l-16) string APK\x20Sig\x20Block\x2042 \b, with APK Signing Block
  1809. >>>>-512 default x
  1810. # Contains lib/armeabi (near the end, in the central directory)
  1811. >>>>>-512 search lib/armeabi Android package (APK), with MANIFEST.MF and armeabi lib
  1812. !:mime application/vnd.android.package-archive
  1813. !:ext apk
  1814. >>>>>>-22 string PK\005\006
  1815. >>>>>>>(-6.l-16) string APK\x20Sig\x20Block\x2042 \b, with APK Signing Block
  1816. >>>>>-512 default x
  1817. # Contains drawables (near the end, in the central directory)
  1818. >>>>>>-512 search res/drawable Android package (APK), with MANIFEST.MF and drawables
  1819. !:mime application/vnd.android.package-archive
  1820. !:ext apk
  1821. >>>>>>>-22 string PK\005\006
  1822. >>>>>>>>(-6.l-16) string APK\x20Sig\x20Block\x2042 \b, with APK Signing Block
  1823. # It may or may not be an APK file, but it's definitely a Java JAR file
  1824. >>>>>>-512 default x Java archive data (JAR)
  1825. !:mime application/java-archive
  1826. !:ext jar
  1827. # Starts with zipflinger virtual entry (28 + 104 = 132 bytes)
  1828. # See https://github.com/obfusk/apksigcopier/blob/666f5b7/apksigcopier/__init__.py#L230
  1829. >4 string \x00\x00\x00\x00\x00\x00
  1830. >>&0 string \x21\x08\x21\x02
  1831. >>>&0 string \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
  1832. >>>>&0 string \x00\x00 Android package (APK), with zipflinger virtual entry
  1833. !:mime application/vnd.android.package-archive
  1834. !:ext apk
  1835. >>>>>-22 string PK\005\006
  1836. >>>>>>(-6.l-16) string APK\x20Sig\x20Block\x2042 \b, with APK Signing Block
  1837. # Specialised zip formats which start with a member named 'mimetype'
  1838. # (stored uncompressed, with no 'extra field') containing the file's MIME type.
  1839. # Check for have 8-byte name, 0-byte extra field, name "mimetype", and
  1840. # contents starting with "application/":
  1841. >26 string \x8\0\0\0mimetypeapplication/
  1842. # KOffice / OpenOffice & StarOffice / OpenDocument formats
  1843. # From: Abel Cheung <abel@oaka.org>
  1844. # KOffice (1.2 or above) formats
  1845. # (mimetype contains "application/vnd.kde.<SUBTYPE>")
  1846. >>50 string vnd.kde. KOffice (>=1.2)
  1847. >>>58 string karbon Karbon document
  1848. >>>58 string kchart KChart document
  1849. >>>58 string kformula KFormula document
  1850. >>>58 string kivio Kivio document
  1851. >>>58 string kontour Kontour document
  1852. >>>58 string kpresenter KPresenter document
  1853. >>>58 string kspread KSpread document
  1854. >>>58 string kword KWord document
  1855. # OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7)
  1856. # (mimetype contains "application/vnd.sun.xml.<SUBTYPE>")
  1857. # URL: https://en.wikipedia.org/wiki/OpenOffice.org_XML
  1858. # reference: http://fileformats.archiveteam.org/wiki/OpenOffice.org_XML
  1859. >>50 string vnd.sun.xml. OpenOffice.org 1.x
  1860. >>>62 string writer Writer
  1861. >>>>68 byte !0x2e document
  1862. !:mime application/vnd.sun.xml.writer
  1863. !:ext sxw
  1864. >>>>68 string .template template
  1865. !:mime application/vnd.sun.xml.writer.template
  1866. !:ext stw
  1867. >>>>68 string .web Web template
  1868. !:mime application/vnd.sun.xml.writer.web
  1869. !:ext stw
  1870. >>>>68 string .global global document
  1871. !:mime application/vnd.sun.xml.writer.global
  1872. !:ext sxg
  1873. >>>62 string calc Calc
  1874. >>>>66 byte !0x2e spreadsheet
  1875. !:mime application/vnd.sun.xml.calc
  1876. !:ext sxc
  1877. >>>>66 string .template template
  1878. !:mime application/vnd.sun.xml.calc.template
  1879. !:ext stc
  1880. >>>62 string draw Draw
  1881. >>>>66 byte !0x2e document
  1882. !:mime application/vnd.sun.xml.draw
  1883. !:ext sxd
  1884. >>>>66 string .template template
  1885. !:mime application/vnd.sun.xml.draw.template
  1886. !:ext std
  1887. >>>62 string impress Impress
  1888. >>>>69 byte !0x2e presentation
  1889. !:mime application/vnd.sun.xml.impress
  1890. !:ext sxi
  1891. >>>>69 string .template template
  1892. !:mime application/vnd.sun.xml.impress.template
  1893. !:ext sti
  1894. >>>62 string math Math document
  1895. !:mime application/vnd.sun.xml.math
  1896. !:ext sxm
  1897. >>>62 string base Database file
  1898. !:mime application/vnd.sun.xml.base
  1899. !:ext sdb
  1900. # URL: https://wiki.openoffice.org/wiki/Documentation/DevGuide/Extensions/File_Format
  1901. # From: Joerg Jenderek
  1902. # Note: only few OXT samples are detected here by mimetype member
  1903. # is used by OpenOffice and LibreOffice and probably also NeoOffice
  1904. # verified by `unzip -Zv *.oxt` or `7z l -slt *.oxt`
  1905. >>50 string vnd.openofficeorg. OpenOffice
  1906. >>>68 string extension \b/LibreOffice Extension
  1907. # http://extension.nirsoft.net/oxt
  1908. !:mime application/vnd.openofficeorg.extension
  1909. # like: Gallery-Puzzle.2.1.0.1.oxt
  1910. !:ext oxt
  1911. # OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
  1912. # URL: http://fileformats.archiveteam.org/wiki/OpenDocument
  1913. # https://lists.oasis-open.org/archives/office/200505/msg00006.html
  1914. # (mimetype contains "application/vnd.oasis.opendocument.<SUBTYPE>")
  1915. >>50 string vnd.oasis.opendocument. OpenDocument
  1916. >>>73 string text
  1917. >>>>77 byte !0x2d Text
  1918. !:mime application/vnd.oasis.opendocument.text
  1919. !:ext odt
  1920. >>>>77 string -template Text Template
  1921. !:mime application/vnd.oasis.opendocument.text-template
  1922. !:ext ott
  1923. >>>>77 string -web HTML Document Template
  1924. !:mime application/vnd.oasis.opendocument.text-web
  1925. !:ext oth
  1926. >>>>77 string -master
  1927. >>>>>84 byte !0x2d Master Document
  1928. !:mime application/vnd.oasis.opendocument.text-master
  1929. !:ext odm
  1930. >>>>>84 string -template Master Template
  1931. !:mime application/vnd.oasis.opendocument.text-master-template
  1932. !:ext otm
  1933. >>>73 string graphics
  1934. >>>>81 byte !0x2d Drawing
  1935. !:mime application/vnd.oasis.opendocument.graphics
  1936. !:ext odg
  1937. >>>>81 string -template Drawing Template
  1938. !:mime application/vnd.oasis.opendocument.graphics-template
  1939. !:ext otg
  1940. >>>73 string presentation
  1941. >>>>85 byte !0x2d Presentation
  1942. !:mime application/vnd.oasis.opendocument.presentation
  1943. !:ext odp
  1944. >>>>85 string -template Presentation Template
  1945. !:mime application/vnd.oasis.opendocument.presentation-template
  1946. !:ext otp
  1947. >>>73 string spreadsheet
  1948. >>>>84 byte !0x2d Spreadsheet
  1949. !:mime application/vnd.oasis.opendocument.spreadsheet
  1950. !:ext ods
  1951. >>>>84 string -template Spreadsheet Template
  1952. !:mime application/vnd.oasis.opendocument.spreadsheet-template
  1953. !:ext ots
  1954. >>>73 string chart
  1955. >>>>78 byte !0x2d Chart
  1956. !:mime application/vnd.oasis.opendocument.chart
  1957. !:ext odc
  1958. >>>>78 string -template Chart Template
  1959. !:mime application/vnd.oasis.opendocument.chart-template
  1960. !:ext otc
  1961. >>>73 string formula
  1962. >>>>80 byte !0x2d Formula
  1963. !:mime application/vnd.oasis.opendocument.formula
  1964. !:ext odf
  1965. >>>>80 string -template Formula Template
  1966. !:mime application/vnd.oasis.opendocument.formula-template
  1967. !:ext otf
  1968. # https://www.loc.gov/preservation/digital/formats/fdd/fdd000441.shtml
  1969. >>>73 string database Database
  1970. !:mime application/vnd.oasis.opendocument.database
  1971. !:ext odb
  1972. # Valid for LibreOffice Base 6.0.1.1 at least
  1973. >>>73 string base Database
  1974. # https://bugs.documentfoundation.org/show_bug.cgi?id=45854
  1975. !:mime application/vnd.oasis.opendocument.base
  1976. !:ext odb
  1977. >>>73 string image
  1978. >>>>78 byte !0x2d Image
  1979. !:mime application/vnd.oasis.opendocument.image
  1980. !:ext odi
  1981. >>>>78 string -template Image Template
  1982. !:mime application/vnd.oasis.opendocument.image-template
  1983. !:ext oti
  1984. # EPUB (OEBPS) books using OCF (OEBPS Container Format)
  1985. # https://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4.
  1986. # From: Ralf Brown <ralf.brown@gmail.com>
  1987. >>50 string epub+zip EPUB document
  1988. !:mime application/epub+zip
  1989. # From: Hajin Jang <jb6804@naver.com>
  1990. # hwpx (OWPML) document format follows OCF specification.
  1991. # Hangul Word Processor 2010+ supports HWPX format.
  1992. # URL: https://www.hancom.com/etc/hwpDownload.do
  1993. # https://standard.go.kr/KSCI/standardIntro/getStandardSearchView.do?menuId=503&topMenuId=502&ksNo=KSX6101
  1994. # https://e-ks.kr/streamdocs/view/sd;streamdocsId=72059197557727331
  1995. >>50 string hwp+zip Hancom HWP (Hangul Word Processor) file, HWPX
  1996. !:mime application/x-hwp+zip
  1997. !:ext hwpx
  1998. # From: Joerg Jenderek
  1999. # URL: http://en.wikipedia.org/wiki/CorelDRAW
  2000. # NOTE: version; til 2 WL-based; from 3 til 13 by ./riff; from 14 zip based
  2001. >>50 string x-vnd.corel. Corel
  2002. >>>62 string draw.document+zip Draw drawing, version 14-16
  2003. !:mime application/x-vnd.corel.draw.document+zip
  2004. !:ext cdr
  2005. >>>62 string draw.template+zip Draw template, version 14-16
  2006. !:mime application/x-vnd.corel.draw.template+zip
  2007. !:ext cdrt
  2008. >>>62 string zcf.draw.document+zip Draw drawing, version 17-22
  2009. !:mime application/x-vnd.corel.zcf.draw.document+zip
  2010. !:ext cdr
  2011. >>>62 string zcf.draw.template+zip Draw template, version 17-22
  2012. !:mime application/x-vnd.corel.zcf.draw.template+zip
  2013. !:ext cdt/cdrt
  2014. # URL: http://product.corel.com/help/CorelDRAW/540240626/Main/EN/Doc/CorelDRAW-Other-file-formats.html
  2015. >>>62 string zcf.pattern+zip Draw pattern, version 22
  2016. !:mime application/x-vnd.corel.zcf.pattern+zip
  2017. !:ext pat
  2018. # URL: https://en.wikipedia.org/wiki/Corel_Designer
  2019. # Reference: http://fileformats.archiveteam.org/wiki/Corel_Designer
  2020. # Note: called by TrID "Corel DESIGN graphics"
  2021. >>>62 string designer.document+zip DESIGNER graphics, version 14-16
  2022. !:mime application/x-vnd.corel.designer.document+zip
  2023. !:ext des
  2024. >>>62 string zcf.designer.document+zip DESIGNER graphics, version 17-21
  2025. !:mime application/x-vnd.corel.zcf.designer.document+zip
  2026. !:ext des
  2027. # URL: http://product.corel.com/help/CorelDRAW/540223850/Main/EN/Documentation/
  2028. # CorelDRAW-Corel-Symbol-Library-CSL.html
  2029. >>>62 string symbol.library+zip Symbol Library, version 6-16.3
  2030. !:mime application/x-vnd.corel.symbol.library+zip
  2031. !:ext csl
  2032. >>>62 string zcf.symbol.library+zip Symbol Library, version 17-22
  2033. !:mime application/x-vnd.corel.zcf.symbol.library+zip
  2034. !:ext csl
  2035. # Catch other ZIP-with-mimetype formats
  2036. # In a ZIP file, the bytes immediately after a member's contents are
  2037. # always "PK". The 2 regex rules here print the "mimetype" member's
  2038. # contents up to the first 'P'. Luckily, most MIME types don't contain
  2039. # any capital 'P's. This is a kludge.
  2040. # (mimetype contains "application/<OTHER>")
  2041. >>50 default x Zip data
  2042. >>>38 regex [!-OQ-~]+ (MIME type "%s"?)
  2043. !:mime application/zip
  2044. # (mimetype contents other than "application/*")
  2045. >26 string \x8\0\0\0mimetype
  2046. >>38 string !application/
  2047. >>>38 regex [!-OQ-~]+ Zip data (MIME type "%s"?)
  2048. !:mime application/zip
  2049. # Java Jar files (see also APK files above)
  2050. >(26.s+30) leshort 0xcafe Java archive data (JAR)
  2051. !:mime application/java-archive
  2052. !:ext jar
  2053. # iOS App
  2054. >(26.s+30) leshort !0xcafe
  2055. >>26 string !\x8\0\0\0mimetype
  2056. >>>30 string Payload/
  2057. >>>>38 search/64 .app/ iOS App
  2058. !:mime application/x-ios-app
  2059. # Dup, see above.
  2060. #>30 search/100/b application/epub+zip EPUB document
  2061. #!:mime application/epub+zip
  2062. # APK Signing Block
  2063. >(26.s+30) leshort !0xcafe
  2064. >>30 search/100/b !application/epub+zip
  2065. >>>26 string !\x8\0\0\0mimetype
  2066. >>>>-22 string PK\005\006
  2067. >>>>>(-6.l-16) string APK\x20Sig\x20Block\x2042 Android package (APK), with APK Signing Block
  2068. !:mime application/vnd.android.package-archive
  2069. !:ext apk
  2070. # Keyman Compiled Package File (keyman.com)
  2071. # https://help.keyman.com/developer/current-version/reference/file-types/kmp
  2072. # Find start of central directory
  2073. >>>>>(-6.l) string PK\001\002
  2074. # Scan central directory for string 'kmp.json', will suffice for a
  2075. # package containing about 150 files
  2076. >>>>>>(-6.l) search/9000 kmp.json Keyman Compiled Package File
  2077. !:mime application/vnd.keyman.kmp+zip
  2078. !:ext kmp
  2079. # Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
  2080. # Next line excludes specialized formats:
  2081. >>>>+4 default x
  2082. >>>>>4 beshort x Zip archive data, at least
  2083. !:mime application/zip
  2084. >>>>>4 use zipversion
  2085. >>>>>4 beshort x to extract
  2086. >>>>>8 beshort x \b, compression method=
  2087. >>>>>8 use zipcompression
  2088. >>>>>0x161 string WINZIP \b, WinZIP self-extracting
  2089. # Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
  2090. 0 string PK\005\006 Zip archive data (empty)
  2091. !:mime application/zip
  2092. !:ext zip/cbz
  2093. !:strength +1
  2094. # StarView Metafile
  2095. # From Pierre Ducroquet <pinaraf@pinaraf.info>
  2096. 0 string VCLMTF StarView MetaFile
  2097. >6 beshort x \b, version %d
  2098. >8 belong x \b, size %d
  2099. # Zoo archiver
  2100. # Update: Joerg Jenderek
  2101. # URL: https://en.wikipedia.org/wiki/Zoo_(file_format)
  2102. # http://fileformats.archiveteam.org/wiki/Zoo
  2103. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/a/ark-zoo-strict.trid.xml
  2104. # http://distcache.freebsd.org/ports-distfiles/zoo-2.10pl1.tar.gz/zoo.h
  2105. # Note: called "ZOO compressed archive (strict)" by TrID and "ZOO Compressed Archive" by DROID via PUID x-fmt/269
  2106. # verified by command like `deark -m zoo -l -d2 WHRCGA.ZOO`
  2107. 20 lelong 0xfdc4a7dc
  2108. # skip DROID x-fmt-269-signature-id-621.zoo by looking for valid major version to manipulate archive
  2109. >32 byte >0 Zoo archive data
  2110. !:mime application/x-zoo
  2111. # bak is extension of backup-ed zoo
  2112. !:ext zoo/bak
  2113. # version in text form like: 1.50 2.00 2.10
  2114. >>4 byte >48 \b, v%c.
  2115. >>>6 byte >47 \b%c
  2116. >>>>7 byte >47 \b%c
  2117. # ZOO files typically start with "ZOO ?.?? Archive.", followed by the bytes 0x1a 0x0 0x0; not used by Zoo and they may be anything
  2118. >>8 string !\040Archive.\032 \b, at 8
  2119. >>>8 string x text "%0.10s"
  2120. # major_ver.minor_ver; minimum version needed to manipulate archive like: 1.0 2.0
  2121. >>32 byte >0 \b, modify: v%d
  2122. >>>33 byte x \b.%d+
  2123. # major_ver.minor_ver; minimum version needed to extract after modify like in old versions
  2124. >>(24.l+28) ubyte x \b, extract: v%u
  2125. >>(24.l+29) ubyte x \b.%u+
  2126. # with zoo 2.00 additional fields have been added in the archive header
  2127. >>32 byte >1
  2128. # type; type of archive header like: 1 2
  2129. >>>34 ubyte !1 \b, header type %u
  2130. # acmt_pos; position of archive comment like: 6258 30599 61369 149501
  2131. >>>35 lelong >0 \b, at %d
  2132. # acmt_len; length of archive comment like: 258
  2133. >>>>39 uleshort x %u bytes comment
  2134. #>>>>(35.l) ubequad x COMMENT=%16.16llx
  2135. # 1st character of comment maybe is CarriageReturn (0x0d)
  2136. >>>>(35.l) ubyte <040
  2137. # 2nd character of comment maybe is LineFeed (0x0a)
  2138. >>>>>(35.l+1) ubyte <040
  2139. # comment string after CRLF like "Anonymous ftp site garbo.uwasa.fi 128.214.87.1 moderated by"
  2140. >>>>>>(35.l+2) string x %s
  2141. # next character of remaining comment maybe is CarriageReturn (0x0d)
  2142. >>>>>>>&0 ubyte <040
  2143. >>>>>>>>&0 ubyte <040
  2144. # 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
  2145. >>>>>>>>>&0 string >037 %s
  2146. # vdata; archive-level versioning byte like: 1 3
  2147. >>>41 ubyte !1 \b, vdata %#x
  2148. # zoo_start; pointer to 1st entry header
  2149. >>24 lelong x \b; at %u
  2150. # zoo_minus; zoo_start -1 for consistency checking
  2151. #>>28 lelong x \b, zoo_minus %#x
  2152. # zoo_tag; tag for check
  2153. #>>(24.l+0) ulelong !0xfdc4a7dc \b, zoo_tag=%8.8x
  2154. # type; type of directory entry like: 1 2
  2155. >>(24.l+4) ubyte !2 type=%u
  2156. # packing_method; 0~no packing 1~normal LZW 2~lzh
  2157. >>(24.l+5) ubyte x method=
  2158. >>>(24.l+5) ubyte 0 \bnot-compressed
  2159. >>>(24.l+5) ubyte 1 \blzd
  2160. >>>(24.l+5) ubyte 2 \blzh
  2161. # next; position of next directory entry
  2162. >>(24.l+6) ulelong x \b, next entry at %u
  2163. # offset; position of file data for this entry
  2164. #>>(24.l+10) ulelong x \b, data at %u
  2165. # file_crc; CRC-16 of file data
  2166. >>(24.l+18) uleshort x \b, CRC %#4.4x
  2167. # comment; zero if none or points to entry comment like ADD9h (WHRCGA.ZOO)
  2168. >>(24.l+32) lelong >0 \b, at %#x
  2169. # cmt_size; if not 0 for none then length of entry comment like: 46
  2170. >>>(24.l+36) uleshort >0 %u bytes comment
  2171. # entry comment itself like: "CGA .GL file showing menu input from keyboard"
  2172. >>>>(&-6.l) string x "%s"
  2173. # org_size; original size of file
  2174. >>(24.l+20) ulelong x \b, size %u
  2175. # size_now; compressed size of file
  2176. >>(24.l+24) ulelong x (%u compressed)
  2177. # major_ver.minor_ver; minimum version needed to extract already done
  2178. # deleted; will be 1 if deleted, 0 if not
  2179. >>(24.l+30) ubyte =1 \b, deleted
  2180. # struc; file structure if any; WHAT IS THAT?
  2181. >>(24.l+31) ubyte !0 \b, structured
  2182. # fname[13]; short/DOS file name like 12345678.012
  2183. >>(24.l+38) string x \b, %0.13s
  2184. # for directory entry type 2 with variable part
  2185. >>(24.l+4) ubyte =2
  2186. # var_dir_len; length of variable part of dir entry
  2187. >>>(24.l+51) uleshort >0
  2188. #>>>(24.l+51) uleshort >0 \b, variable part length %u
  2189. # namlen; length of long filename
  2190. #>>>>(24.l+56) ubyte x \b, namlen %u
  2191. # dirlen; length of directory name
  2192. #>>>>(24.l+57) ubyte x \b, dirlen %u
  2193. # if file length positive then show long file name
  2194. >>>>(24.l+56) ubyte >0
  2195. # lfname[256]; long file name \0-terminated
  2196. >>>>>(24.l+58) string x "%s"
  2197. # 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
  2198. >>>>(24.l+57) ubyte >0
  2199. >>>>>(24.l+55) ubyte x
  2200. # dirname[256]; directory name \0-terminated
  2201. >>>>>>&(&0.b+2) string x in "%s"
  2202. # dir_crc; CRC of directory entry
  2203. #>>>(24.l+54) uleshort x \b, entry CRC %#4.4x
  2204. # tz; timezone where file was archived; 7Fh~unknown 4~1.00hoursWestOfUTC 12 16 20~5.00hoursWestOfUTC -107~26.75hoursEastOfUTC -4~1.00hoursEastOfUTC
  2205. >>>(24.l+53) byte !0x7f \b, time zone %d/4
  2206. # date; last mod file date in DOS format
  2207. >>>(24.l+14) lemsdosdate x \b, modified %s
  2208. # time; last mod file time in DOS format
  2209. >>>(24.l+16) lemsdostime x %s
  2210. # Shell archives
  2211. 10 string #\ This\ is\ a\ shell\ archive shell archive text
  2212. !:mime application/octet-stream
  2213. #
  2214. # LBR. NB: May conflict with the questionable
  2215. # "binary Computer Graphics Metafile" format.
  2216. #
  2217. 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data
  2218. #
  2219. # PMA (CP/M derivative of LHA)
  2220. # Update: Joerg Jenderek
  2221. # URL: https://en.wikipedia.org/wiki/LHA_(file_format)
  2222. #
  2223. #2 string -pm0- PMarc archive data [pm0]
  2224. 2 string -pm0-
  2225. >0 use lharc-file
  2226. #2 string -pm1- PMarc archive data [pm1]
  2227. 2 string -pm1-
  2228. >0 use lharc-file
  2229. #2 string -pm2- PMarc archive data [pm2]
  2230. 2 string -pm2-
  2231. >0 use lharc-file
  2232. 2 string -pms- PMarc SFX archive (CP/M, DOS)
  2233. #!:mime application/x-foobar-exec
  2234. !:ext com
  2235. 5 string -pc1- PopCom compressed executable (CP/M)
  2236. #!:mime application/x-
  2237. #!:ext com
  2238. # From Rafael Laboissiere <rafael@laboissiere.net>
  2239. # The Project Revision Control System (see
  2240. # http://prcs.sourceforge.net) generates a packaged project
  2241. # file which is recognized by the following entry:
  2242. 0 leshort 0xeb81 PRCS packaged project
  2243. # Microsoft cabinets
  2244. # by David Necas (Yeti) <yeti@physics.muni.cz>
  2245. #0 string MSCF\0\0\0\0 Microsoft cabinet file data,
  2246. #>25 byte x v%d
  2247. #>24 byte x \b.%d
  2248. # MPi: All CABs have version 1.3, so this is pointless.
  2249. # Better magic in debian-additions.
  2250. # GTKtalog catalogs
  2251. # by David Necas (Yeti) <yeti@physics.muni.cz>
  2252. 4 string gtktalog\ GTKtalog catalog data,
  2253. >13 string 3 version 3
  2254. >>14 beshort 0x677a (gzipped)
  2255. >>14 beshort !0x677a (not gzipped)
  2256. >13 string >3 version %s
  2257. ############################################################################
  2258. # Parity archive reconstruction file, the 'par' file format now used on Usenet.
  2259. 0 string PAR\0 PARity archive data
  2260. >48 leshort =0 - Index file
  2261. >48 leshort >0 - file number %d
  2262. # Felix von Leitner <felix-file@fefe.de>
  2263. 0 string d8:announce BitTorrent file
  2264. !:mime application/x-bittorrent
  2265. !:ext torrent
  2266. # Durval Menezes, <jmgthbfile at durval dot com>
  2267. 0 string d13:announce-list BitTorrent file
  2268. !:mime application/x-bittorrent
  2269. !:ext torrent
  2270. 0 string d7:comment BitTorrent file
  2271. !:mime application/x-bittorrent
  2272. !:ext torrent
  2273. 0 string d4:info BitTorrent file
  2274. !:mime application/x-bittorrent
  2275. !:ext torrent
  2276. # Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
  2277. # URL: http://fileformats.archiveteam.org/wiki/MSA_(Magic_Shadow_Archiver)
  2278. # Reference: http://info-coach.fr/atari/documents/_mydoc/FD_Image_File_Format.pdf
  2279. # http://mark0.net/download/triddefs_xml.7z/defs/m/msa.trid.xml
  2280. # Update: Joerg Jenderek
  2281. # Note: called by TrID "Atari MSA Disk Image" and verified by
  2282. # command like `deark -l -m msa -d2 PDATS578.msa` as " Atari ST floppy disk image"
  2283. # GRR: line below is too general as it matches setup.skin
  2284. 0 beshort 0x0e0f
  2285. # skip foo setup.skin with unrealistic high number 52255 of sides by check for valid "low" value
  2286. >4 ubeshort <2 Atari MSA archive data
  2287. #!:mime application/octet-stream
  2288. !:mime application/x-atari-msa
  2289. !:ext msa
  2290. # sectors per track like: 9 10
  2291. >>2 beshort x \b, %d sectors per track
  2292. # sides (0 or 1; add 1 to this to get correct number of sides)
  2293. >>4 beshort 0 \b, 1 sided
  2294. >>4 beshort 1 \b, 2 sided
  2295. # starting track like: 0
  2296. >>6 beshort x \b, starting track: %d
  2297. # ending track like: 39 79 80 81
  2298. >>8 beshort x \b, ending track: %d
  2299. # tracks content
  2300. #>>10 ubequad x \b, track content %#16.16llx
  2301. # Alternate ZIP string (amc@arwen.cs.berkeley.edu)
  2302. 0 string PK00PK\003\004 Zip archive data
  2303. !:mime application/zip
  2304. !:ext zip/cbz
  2305. # Recognize ZIP archives with prepended data by end-of-central-directory record
  2306. # https://en.wikipedia.org/wiki/ZIP_(file_format)#End_of_central_directory_record_(EOCD)
  2307. # by Michal Gorny <mgorny@gentoo.org>
  2308. -2 uleshort 0
  2309. >&-22 string PK\005\006
  2310. # without #!
  2311. >>0 string !#! Zip archive, with extra data prepended
  2312. !:mime application/zip
  2313. !:ext zip/cbz
  2314. # with #!
  2315. >>0 string/w #!\ a
  2316. >>>&-1 string/T x %s script executable (Zip archive)
  2317. # ACE archive (from http://www.wotsit.org/download.asp?f=ace)
  2318. # by Stefan `Sec` Zehl <sec@42.org>
  2319. 7 string **ACE** ACE archive data
  2320. !:mime application/x-ace-compressed
  2321. !:ext ace
  2322. >15 byte >0 version %d
  2323. >16 byte =0x00 \b, from MS-DOS
  2324. >16 byte =0x01 \b, from OS/2
  2325. >16 byte =0x02 \b, from Win/32
  2326. >16 byte =0x03 \b, from Unix
  2327. >16 byte =0x04 \b, from MacOS
  2328. >16 byte =0x05 \b, from WinNT
  2329. >16 byte =0x06 \b, from Primos
  2330. >16 byte =0x07 \b, from AppleGS
  2331. >16 byte =0x08 \b, from Atari
  2332. >16 byte =0x09 \b, from Vax/VMS
  2333. >16 byte =0x0A \b, from Amiga
  2334. >16 byte =0x0B \b, from Next
  2335. >14 byte x \b, version %d to extract
  2336. >5 leshort &0x0080 \b, multiple volumes,
  2337. >>17 byte x \b (part %d),
  2338. >5 leshort &0x0002 \b, contains comment
  2339. >5 leshort &0x0200 \b, sfx
  2340. >5 leshort &0x0400 \b, small dictionary
  2341. >5 leshort &0x0800 \b, multi-volume
  2342. >5 leshort &0x1000 \b, contains AV-String
  2343. >>30 string \x16*UNREGISTERED\x20VERSION* (unregistered)
  2344. >5 leshort &0x2000 \b, with recovery record
  2345. >5 leshort &0x4000 \b, locked
  2346. >5 leshort &0x8000 \b, solid
  2347. # Date in MS-DOS format (whatever that is)
  2348. #>18 lelong x Created on
  2349. # sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
  2350. # <doj@cubic.org>
  2351. 0x1A string sfArk sfArk compressed Soundfont
  2352. >0x15 string 2
  2353. >>0x1 string >\0 Version %s
  2354. >>0x2A string >\0 : %s
  2355. # DR-DOS 7.03 Packed File *.??_
  2356. # Reference: http://www.antonis.de/dos/dos-tuts/mpdostip/html/nwdostip.htm
  2357. # Note: unpacked by PNUNPACK.EXE
  2358. 0 string Packed\ File\
  2359. # by looking for Control-Z skip ASCII text starting with Packed File
  2360. >0x18 ubyte 0x1a Personal NetWare Packed File
  2361. !:mime application/x-novell-compress
  2362. !:ext ??_
  2363. >>12 string x \b, was "%.12s"
  2364. # 1 or 2
  2365. #>>0x19 ubyte x \b, at 0x19 %u
  2366. >>0x1b ulelong x with %u bytes
  2367. # EET archive
  2368. # From: Tilman Sauerbeck <tilman@code-monkey.de>
  2369. 0 belong 0x1ee7ff00 EET archive
  2370. !:mime application/x-eet
  2371. # From: Joerg Jenderek
  2372. # URL: https://help.foxitsoftware.com/kb/install-fzip-file.php
  2373. # reference: http://mark0.net/download/triddefs_xml.7z/
  2374. # defs/f/fzip.trid.xml
  2375. # Note: unknown compression; No "PK" zip magic; normally in directory like
  2376. # "%APPDATA%\Foxit Software\Addon\Foxit Reader\Install"
  2377. 0 ubequad 0x2506781901010000 Foxit add-on/update
  2378. !:mime application/x-fzip
  2379. !:ext fzip
  2380. # From: "Robert Dale" <robdale@gmail.com>
  2381. 0 belong 123 dar archive,
  2382. >4 belong x label "%.8x
  2383. >>8 belong x %.8x
  2384. >>>12 beshort x %.4x"
  2385. >14 byte 0x54 end slice
  2386. >14 beshort 0x4e4e multi-part
  2387. >14 beshort 0x4e53 multi-part, with -S
  2388. # Symbian installation files
  2389. # https://www.thouky.co.uk/software/psifs/sis.html
  2390. # http://developer.symbian.com/main/downloads/papers/SymbianOSv91/softwareinstallsis.pdf
  2391. 8 lelong 0x10000419 Symbian installation file
  2392. !:mime application/vnd.symbian.install
  2393. >4 lelong 0x1000006D (EPOC release 3/4/5)
  2394. >4 lelong 0x10003A12 (EPOC release 6)
  2395. 0 lelong 0x10201A7A Symbian installation file (Symbian OS 9.x)
  2396. !:mime x-epoc/x-sisx-app
  2397. # From "Nelson A. de Oliveira" <naoliv@gmail.com>
  2398. 0 string MPQ\032 MoPaQ (MPQ) archive
  2399. # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
  2400. # .kgb
  2401. 0 string KGB_arch KGB Archiver file
  2402. >10 string x with compression level %.1s
  2403. # xar (eXtensible ARchiver) archive
  2404. # URL: https://en.wikipedia.org/wiki/Xar_(archiver)
  2405. # xar archive format: https://code.google.com/p/xar/
  2406. # From: "David Remahl" <dremahl@apple.com>
  2407. # Update: Joerg Jenderek
  2408. # TODO: lzma compression; X509Data for pkg and xip
  2409. # Note: verified by `xar --dump-header -f FullBundleUpdate.xar` or
  2410. # 7z t -txar Xcode_10.2_beta_4.xip`
  2411. 0 string xar! xar archive
  2412. !:mime application/x-xar
  2413. # pkg for Mac OSX installer package like FullBundleUpdate.pkg
  2414. # xip for signed Apple software like Xcode_10.2_beta_4.xip
  2415. !:ext xar/pkg/xip
  2416. # always 28 in older archives
  2417. >4 ubeshort >28 \b, header size %u
  2418. # currently there exit only version 1 since about 2014
  2419. >6 ubeshort >1 version %u,
  2420. >8 ubequad x compressed TOC: %llu,
  2421. #>16 ubequad x uncompressed TOC: %llu,
  2422. # cksum_alg 0-2 in older and also 3-4 in newer
  2423. >24 belong 0 no checksum
  2424. >24 belong 1 SHA-1 checksum
  2425. >24 belong 2 MD5 checksum
  2426. >24 belong 3 SHA-256 checksum
  2427. >24 belong 4 SHA-512 checksum
  2428. >24 belong >4 unknown %#x checksum
  2429. #>24 belong >4 checksum
  2430. # For no compression jump 0 bytes
  2431. >24 belong 0
  2432. >>0 ubyte x
  2433. # jump more bytes forward by header size
  2434. >>>&(4.S) ubyte x
  2435. # jump more bytes forward by compressed table of contents size
  2436. #>>>>&(8.Q) ubequad x \b, heap data %#llx
  2437. >>>>&(8.Q) ubyte x
  2438. # look for data by ./compress after message with 1 space at end
  2439. >>>>>&-3 indirect x \b, contains
  2440. # For SHA-1 jump 20 minus 2 bytes
  2441. >24 belong 1
  2442. >>18 ubyte x
  2443. # jump more bytes forward by header size
  2444. >>>&(4.S) ubyte x
  2445. # jump more bytes forward by compressed table of contents size
  2446. >>>>&(8.Q) ubyte x
  2447. # data compressed by gzip, bzip, lzma or none
  2448. >>>>>&-1 indirect x \b, contains
  2449. # For SHA-256 jump 32 minus 2 bytes
  2450. >24 belong 3
  2451. >>30 ubyte x
  2452. # jump more bytes forward by header size
  2453. >>>&(4.S) ubyte x
  2454. # jump more bytes forward by compressed table of contents size
  2455. >>>>&(8.Q) ubyte x
  2456. >>>>>&-1 indirect x \b, contains
  2457. # For SHA-512 jump 64 minus 2 bytes
  2458. >24 belong 4
  2459. >>62 ubyte x
  2460. # jump more bytes forward by header size
  2461. >>>&(4.S) ubyte x
  2462. # jump more bytes forward by compressed table of contents size
  2463. >>>>&(8.Q) ubyte x
  2464. >>>>>&-1 indirect x \b, contains
  2465. # Type: Parity Archive
  2466. # From: Daniel van Eeden <daniel_e@dds.nl>
  2467. 0 string PAR2 Parity Archive Volume Set
  2468. # Bacula volume format. (Volumes always start with a block header.)
  2469. # URL: https://bacula.org/3.0.x-manuals/en/developers/developers/Block_Header.html
  2470. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  2471. 12 string BB02 Bacula volume
  2472. >20 bedate x \b, started %s
  2473. # ePub is XHTML + XML inside a ZIP archive. The first member of the
  2474. # archive must be an uncompressed file called 'mimetype' with contents
  2475. # 'application/epub+zip'
  2476. # From: "Michael Gorny" <mgorny@gentoo.org>
  2477. # ZPAQ: http://mattmahoney.net/dc/zpaq.html
  2478. 0 string zPQ ZPAQ stream
  2479. >3 byte x \b, level %d
  2480. # From: Barry Carter <carter.barry@gmail.com>
  2481. # https://encode.ru/threads/456-zpaq-updates/page32
  2482. 0 string 7kSt ZPAQ file
  2483. # BBeB ebook, unencrypted (LRF format)
  2484. # URL: https://www.sven.de/librie/Librie/LrfFormat
  2485. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  2486. 0 string L\0R\0F\0\0\0 BBeB ebook data, unencrypted
  2487. >8 beshort x \b, version %d
  2488. >36 byte 1 \b, front-to-back
  2489. >36 byte 16 \b, back-to-front
  2490. >42 beshort x \b, (%dx,
  2491. >44 beshort x %d)
  2492. # Symantec GHOST image by Joerg Jenderek at May 2014
  2493. # https://us.norton.com/ghost/
  2494. # https://www.garykessler.net/library/file_sigs.html
  2495. 0 ubelong&0xFFFFf7f0 0xFEEF0100 Norton GHost image
  2496. # *.GHO
  2497. >2 ubyte&0x08 0x00 \b, first file
  2498. # *.GHS or *.[0-9] with cns program option
  2499. >2 ubyte&0x08 0x08 \b, split file
  2500. # part of split index interesting for *.ghs
  2501. >>4 ubyte x id=%#x
  2502. # compression tag minus one equals numeric compression command line switch z[1-9]
  2503. >3 ubyte 0 \b, no compression
  2504. >3 ubyte 2 \b, fast compression (Z1)
  2505. >3 ubyte 3 \b, medium compression (Z2)
  2506. >3 ubyte >3
  2507. >>3 ubyte <11 \b, compression (Z%d-1)
  2508. >2 ubyte&0x08 0x00
  2509. # ~ 30 byte password field only for *.gho
  2510. >>12 ubequad !0 \b, password protected
  2511. >>44 ubyte !1
  2512. # 1~Image All, sector-by-sector only for *.gho
  2513. >>>10 ubyte 1 \b, sector copy
  2514. # 1~Image Boot track only for *.gho
  2515. >>>43 ubyte 1 \b, boot track
  2516. # 1~Image Disc only for *.gho implies Image Boot track and sector copy
  2517. >>44 ubyte 1 \b, disc sector copy
  2518. # optional image description only *.gho
  2519. >>0xff string >\0 "%-.254s"
  2520. # look for DOS sector end sequence
  2521. >0xE08 search/7776 \x55\xAA
  2522. >>&-512 indirect x \b; contains
  2523. # Google Chrome extensions
  2524. # https://developer.chrome.com/extensions/crx
  2525. # https://developer.chrome.com/extensions/hosting
  2526. 0 string Cr24 Google Chrome extension
  2527. !:mime application/x-chrome-extension
  2528. >4 ulong x \b, version %u
  2529. # SeqBox - Sequenced container
  2530. # ext: sbx, seqbox
  2531. # Marco Pontello marcopon@gmail.com
  2532. # reference: https://github.com/MarcoPon/SeqBox
  2533. 0 string SBx SeqBox,
  2534. >3 byte x version %d
  2535. # LyNX archive
  2536. # Update: Joerg Jenderek
  2537. # URL: http://fileformats.archiveteam.org/wiki/Lynx_archive
  2538. # Reference: http://ist.uwaterloo.ca/~schepers/formats/LNX.TXT
  2539. # http://mark0.net/download/triddefs_xml.7z/defs/a/ark-lnx.trid.xml
  2540. # Note: called "Lynx archive" by TrID and "Commodore C64 BASIC program" with "POKE 53280" by ./c64
  2541. # TODO: merge and unify with Commodore C64 BASIC program
  2542. 56 string USE\040LYNX\040TO\040DISSOLVE\040THIS\040FILE LyNX archive
  2543. # display "Lynx archive" (strength=330) before Commodore C64 BASIC program (strength=50) handled by ./c64
  2544. #!:strength +0
  2545. #!:mime application/octet-stream
  2546. !:mime application/x-commodore-lnx
  2547. !:ext lnx
  2548. # afterwards look for BASIC tokenized GOTO (89h) 10, line terminator \0, end of programm tag \0\0 and CarriageReturn
  2549. >86 search/10 \x8910\0\0\0\r \b,
  2550. # for DEBUGGING
  2551. #>>&0 string x STRING="%s"
  2552. # number in ASCII of directory blocks with spaces on both sides like: 1 2 3 5
  2553. >>&0 regex [0-9]{1,5} %s directory blocks
  2554. # signature like: "*LYNX XII BY WILL CORLEY" " LYNX IX BY WILL CORLEY" "*LYNX BY CBMCONVERT 2.0*"
  2555. >>>&2 regex [^\r]{1,24} \b, signature "%s"
  2556. # number of files in ASCII surrounded by spaces and delimited by CR like: 2 3 6 13 69 144 (maximum?)
  2557. >>>>&1 regex [0-9]{1,3} \b, %s files
  2558. # From: Joerg Jenderek
  2559. # URL: https://www.acronis.com/
  2560. # Reference: https://en.wikipedia.org/wiki/TIB_(file_format)
  2561. # Note: only tested with True Image 2013 Build 5962 and 2019 Build 14110
  2562. 0 ubequad 0xce24b9a220000000 Acronis True Image backup
  2563. !:mime application/x-acronis-tib
  2564. !:ext tib
  2565. # 01000000
  2566. #>20 ubelong x \b, at 20 %#x
  2567. # 20000000
  2568. #>28 ubelong x \b, at 28 %#x
  2569. # strings like "Generic- SD/MMC 1.00" "Unknown Disk" "Msft Virtual Disk 1.0"
  2570. # ???
  2571. # strings like "\Device\0000011e" "\Device\0000015a"
  2572. #>0 search/0x6852300/cs \\Device\\
  2573. #>>&-1 pstring x \b, %s
  2574. # "\Device\HarddiskVolume30" "\Device\HarddiskVolume39"
  2575. #>>>&1 search/180/cs \\Device\\
  2576. #>>>>&-1 pstring x \b, %s
  2577. #>>>>>&0 search/29/cs \0\0\xc8\0
  2578. # disk label
  2579. #>>>>>>&10 lestring16 x \b, disk label %11.11s
  2580. #>>>>>>&9 plestring16 x \b, disk label "%11.11s"
  2581. #>>>>>>&10 ubequad x %16.16llx
  2582. # Gentoo XPAK binary package
  2583. # by Michal Gorny <mgorny@gentoo.org>
  2584. # https://gitweb.gentoo.org/proj/portage.git/tree/man/xpak.5
  2585. -4 string STOP
  2586. >-16 string XPAKSTOP Gentoo binary package (XPAK)
  2587. !:mime application/vnd.gentoo.xpak
  2588. # From: Joerg Jenderek
  2589. # URL: https://kodi.wiki/view/TexturePacker
  2590. # Reference: https://mirrors.kodi.tv/releases/source/17.3-Krypton.tar.gz
  2591. # /xbmc-Krypton/xbmc/guilib/XBTF.h
  2592. # /xbmc-Krypton/xbmc/guilib/XBTF.cpp
  2593. 0 string XBTF
  2594. # skip ASCII text by looking for terminating \0 of path
  2595. >264 ubyte 0 XBMC texture package
  2596. !:mime application/x-xbmc-xbt
  2597. !:ext xbt
  2598. # XBTF_VERSION 2
  2599. >>4 string !2 \b, version %-.1s
  2600. # nofFiles /xbmc-Krypton/xbmc/guilib/XBTFReader.cpp
  2601. >>5 ulelong x \b, %u file
  2602. # plural s
  2603. >>5 ulelong >1 \bs
  2604. # path[CXBTFFile[MaximumPathLength=256]
  2605. >>9 string x \b, 1st %s
  2606. # ALZIP archive
  2607. # by Hyungjun Park <hyungjun.park@worksmobile.com>, Hajin Jang <hajin_jang@worksmobile.com>
  2608. # http://kippler.com/win/unalz/
  2609. # https://salsa.debian.org/l10n-korean-team/unalz
  2610. 0 string ALZ\001 ALZ archive data
  2611. !:ext alz
  2612. # https://cf-aldn.altools.co.kr/setup/EGG_Specification.zip
  2613. 0 string EGGA EGG archive data,
  2614. !:ext egg
  2615. >5 byte x version %u
  2616. >4 byte x \b.%u
  2617. >>0x0E ulelong =0x08E28222
  2618. >>0x0E ulelong =0x24F5A262 \b, split
  2619. >>0x0E ulelong =0x24E5A060 \b, solid
  2620. >>0x0E default x \b, unknown
  2621. # PAQ9A archive
  2622. # URL: http://mattmahoney.net/dc/#paq9a
  2623. # Note: Line 1186 of paq9a.cpp gives the magic bytes
  2624. 0 string pQ9\001 PAQ9A archive
  2625. # From wof (wof@stachelkaktus.net)
  2626. 0 string Unison\ archive\ format Unison archive format
  2627. # https://ankiweb.net
  2628. 30 string collection.anki2 Anki APKG file
  2629. #!:ext .apkg
  2630. # Synology archive (DiskStation Manager 7.0+)
  2631. # From: Alexandre Iooss <erdnaxe@crans.org>
  2632. # Note: These archives are signed and encrypted.
  2633. 0 ulelong&0xFFFFFF00 0xEFBEAD00
  2634. # MessagePack header (fixarray of 5 elements starting with a bin of 32 bytes)
  2635. >8 ulelong&0x00FFFFFF 0x20C495 Synology archive
  2636. !:ext spk
  2637. # Extract some properties from MessagePack third item
  2638. >>43 search/0x10000 package=
  2639. >>>&0 string x \b, package %s
  2640. >>43 search/0x10000 arch=
  2641. >>>&0 string x %s
  2642. >>43 search/0x10000 version=
  2643. >>>&0 string x %s
  2644. >>43 search/0x10000 create_time=
  2645. >>>&0 string x \b, created on %s
  2646. # MonoGame/XNA processed assets archive
  2647. # From: Alexandre Iooss <erdnaxe@crans.org>
  2648. # URL: https://github.com/MonoGame/MonoGame/blob/v3.8.1/MonoGame.Framework/Content/ContentManager.cs
  2649. 0 string XNB
  2650. # XNB must be version 4 or 5
  2651. >4 byte <6
  2652. >>4 byte >3
  2653. # Size must be positive
  2654. >>>6 lelong >0 MonoGame/XNA processed assets
  2655. !:ext xnb
  2656. >>>>3 string =w \b, for Windows
  2657. >>>>3 string =x \b, for Xbox360
  2658. >>>>3 string =i \b, for iOS
  2659. >>>>3 string =a \b, for Android
  2660. >>>>3 string =d \b, for DesktopGL
  2661. >>>>3 string =X \b, for MacOSX
  2662. >>>>3 string =W \b, for WindowsStoreApp
  2663. >>>>3 string =n \b, for NativeClient
  2664. >>>>3 string =M \b, for WindowsPhone8
  2665. >>>>3 string =r \b, for RaspberryPi
  2666. >>>>3 string =P \b, for PlayStation4
  2667. >>>>3 string =5 \b, for PlayStation5
  2668. >>>>3 string =O \b, for XboxOne
  2669. >>>>3 string =S \b, for Nintendo Switch
  2670. >>>>3 string =G \b, for Google Stadia
  2671. >>>>3 string =b \b, for WebAssembly and Bridge.NET
  2672. >>>>3 string =m \b, for WindowsPhone7.0 (XNA)
  2673. >>>>3 string =p \b, for PlayStationMobile
  2674. >>>>3 string =v \b, for PSVita
  2675. >>>>3 string =g \b, for Windows (OpenGL)
  2676. >>>>3 string =l \b, for Linux
  2677. >>>>4 byte x \b, version %d
  2678. >>>>5 byte &0x80 \b, LZX compressed
  2679. >>>>>10 lelong x \b, decompressed size: %d bytes
  2680. >>>>5 byte &0x40 \b, LZ4 compressed
  2681. >>>>>10 lelong x \b, decompressed size: %d bytes
  2682. # Electron ASAR archive
  2683. # From: Alexandre Iooss <erdnaxe@crans.org>
  2684. # URL: https://github.com/electron/asar
  2685. 0 ulelong 4
  2686. # Match JSON header start and end
  2687. >16 string {"files":{"
  2688. >>(12.l+12) string }}}} Electron ASAR archive
  2689. !:ext asar
  2690. >>>12 ulelong x \b, header length: %d bytes
  2691. # Wasay ImageIt DataPack
  2692. # From: Alexandre Iooss <erdnaxe@crans.org>
  2693. # URL: https://www.neowin.net/forum/topic/615151-anyone-know-what-program-opens-dsi-and-wsi-files/
  2694. # Note: Used in Acer eRecovery and Lenovo OneKey Recovery (OKR)
  2695. 4 string WSVD
  2696. # bytes 3-4 are the checksum or the first 32 bytes of the file
  2697. >0 uleshort 0x40 Wasay ImageIt DataPack
  2698. >>8 uleshort x v%u
  2699. >>10 uleshort x \b.%u
  2700. >>16 lestring16/8 x \b, "%s"
  2701. >>12 uleshort x (%u)
  2702. >>32 byte x \b, created on %02d
  2703. >>33 byte x \b%02d
  2704. >>34 byte x \b/%02d
  2705. >>35 byte x \b/%02d
  2706. >>36 byte x %02d
  2707. >>37 byte x \b:%02d
  2708. >>38 byte x \b:%02d
  2709. >>56 ulelong x \b, size: %u bytes