windows 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372
  1. #------------------------------------------------------------------------------
  2. # $File: windows,v 1.46 2022/07/02 17:46:09 christos Exp $
  3. # windows: file(1) magic for Microsoft Windows
  4. #
  5. # This file is mainly reserved for files where programs
  6. # using them are run almost always on MS Windows 3.x or
  7. # above, or files only used exclusively in Windows OS,
  8. # where there is no better category to allocate for.
  9. # For example, even though WinZIP almost run on Windows
  10. # only, it is better to treat them as "archive" instead.
  11. # For format usable in DOS, such as generic executable
  12. # format, please specify under "msdos" file.
  13. #
  14. # Summary: Outlook Express DBX file
  15. # Created by: Christophe Monniez
  16. # Update: Joerg Jenderek
  17. # URL: http://fileformats.archiveteam.org/wiki/Outlook_Express_Database
  18. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/dbx.trid.xml
  19. # https://sourceforge.net/projects/ol2mbox/files/LibDBX/
  20. # v1.0.4/libdbx_1.0.4.tar.gz/FILE-FORMAT
  21. # Note: called "Outlook Express Database" by TrID and DROID via PUID fmt/838 fmt/839
  22. # and partly verified by `undbx --verbosity 4 Posteingang.dbx`
  23. 0 string \xCF\xAD\x12\xFE
  24. # skip DROID fmt-838-signature-id-1193.dbx fmt-839-signature-id-1194.dbx by check for valid file size
  25. >0x7C ulelong >0 MS Outlook Express DBX file
  26. #!:mime application/octet-stream
  27. #!:mime application/vnd.ms-outlook
  28. !:mime application/x-ms-dbx
  29. !:ext dbx
  30. >>4 byte =0xC5 \b, message database
  31. >>4 byte =0xC6 \b, folder database
  32. >>4 byte =0xC7 \b, account information
  33. >>4 byte =0x30 \b, offline database
  34. # version like: 5.2 5.5 (typical)
  35. >>20 ulequad !0x0000000500000005 \b, version
  36. # major version
  37. >>>24 ulelong x %u
  38. # minor version
  39. >>>20 ulelong x \b.%u
  40. # CLSID: 6F74FDC5-E366-11d1-9A4E-00C04FA309D4~Message 6F74FDC6-E366-11D1-9A4E-00C04FA309D4~Folder
  41. # 26FE9D30-1A8F-11D2-AABF-006097D474C4~offline
  42. #>>4 guid x \b, CLSID %s
  43. # file size; total size of file; sometimes real size a little bit higher
  44. >>0x7C ulelong x \b, ~ %u bytes
  45. # highest Email ID; the next email will have a number one higher than this
  46. >>0x5c ulelong x \b, highest ID %#x
  47. # item count; number of items stored in this DBX file
  48. >>0xC4 ulelong x \b, %u item
  49. # plural s
  50. >>0xC4 ulelong !1 \bs
  51. # index pointer; file offset pointing to a page of Data Indexes
  52. >>0xE4 ulelong >0 \b, index pointer %#x
  53. # From: Joerg Jenderek
  54. # URL: http://fileformats.archiveteam.org/wiki/Nickfile
  55. # https://www.nirsoft.net/utils/outlook_nk2_edit.html
  56. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/n/nk2.trid.xml
  57. # https://github.com/libyal/libnk2/blob/main/documentation
  58. # Nickfile%20(NK2)%20format.asciidoc
  59. # Note: called "Outlook Nickfile" by TrID & TestDisk and
  60. # "Outlook Nickname File" by Microsoft Outlook and
  61. # "Outlook AutoComplete File" by Nirsoft NK2Edit
  62. # partly verfied by NK2Edit Raw Text Edit Mode
  63. 0 ubelong 0x0DF0ADBA MS Outlook Nickfile
  64. #!:mime application/octet-stream
  65. #!:mime application/vnd.ms-outlook
  66. !:mime application/x-ms-nickfile
  67. !:ext nk2/dat/bak
  68. # nick is used by "older" Outlook; dat is used by "newer" Outlook (probably 2010 - 2016); bak is used for backup
  69. #!:ext nick/nk2/dat/bak
  70. # Unknown; probably a version indicator like: 0000000Ah 0000000Ch
  71. >4 ulelong x \b, probably version %u
  72. # Unknown2; probably a version indicator like: 1 0
  73. >8 ulelong x \b.%u
  74. # number of rows (nickname or alias items) in file
  75. >12 ulelong x \b, %u items
  76. # number of item entries/columns/properties value like: 17h
  77. >16 ulelong x \b, %u entries
  78. # value type/property tag: 001Fh~4 bytes for data size of UTF-16 LE string
  79. >20 uleshort x \b, value type %#4.4x
  80. # entry type/property identifier: 6001h~PR_DOTSTUFF_STATE/PR_NICK_NAME_W
  81. >22 uleshort x \b, entry type %#4.4x
  82. # Reserved like: 0013FD90h
  83. #>24 ulelong x \b, reserved %#8.8x
  84. # value data array/Irrelevant Union like: 0000000004E31A80h
  85. #>28 ulequad x \b, data %#16.16llx
  86. # UTF-16
  87. >20 uleshort =0x001F
  88. # unicode string bytes like: 2Ch
  89. >>36 ulelong x \b, %u bytes
  90. # unicode string value PT_UNICODE like: janesmith@contoso.org
  91. >>40 lestring16 x "%s"
  92. # Summary: Windows crash dump
  93. # Extension: .dmp
  94. # Created by: Andreas Schuster (https://computer.forensikblog.de/)
  95. # Reference (1): https://computer.forensikblog.de/en/2008/02/64bit_magic.html
  96. # Modified by (1): Abel Cheung (Avoid match with first 4 bytes only)
  97. 0 string PAGE
  98. >4 string DUMP MS Windows 32bit crash dump
  99. >>0x05c byte 0 \b, no PAE
  100. >>0x05c byte 1 \b, PAE
  101. >>0xf88 lelong 1 \b, full dump
  102. >>0xf88 lelong 2 \b, kernel dump
  103. >>0xf88 lelong 3 \b, small dump
  104. >>0x068 lelong x \b, %d pages
  105. >4 string DU64 MS Windows 64bit crash dump
  106. >>0xf98 lelong 1 \b, full dump
  107. >>0xf98 lelong 2 \b, kernel dump
  108. >>0xf98 lelong 3 \b, small dump
  109. >>0x090 lequad x \b, %lld pages
  110. # Summary: Vista Event Log
  111. # Extension: .evtx
  112. # Created by: Andreas Schuster (https://computer.forensikblog.de/)
  113. # Reference (1): https://computer.forensikblog.de/en/2007/05/some_magic.html
  114. 0 string ElfFile\0 MS Windows Vista Event Log
  115. >0x2a leshort x \b, %d chunks
  116. >>0x10 lelong x \b (no. %d in use)
  117. >0x18 lelong >1 \b, next record no. %d
  118. >0x18 lelong =1 \b, empty
  119. >0x78 lelong &1 \b, DIRTY
  120. >0x78 lelong &2 \b, FULL
  121. # Summary: Windows System Deployment Image
  122. # Created by: Joerg Jenderek
  123. # URL: http://en.wikipedia.org/wiki/System_Deployment_Image
  124. # Reference: http://skolk.livejournal.com/1320.html
  125. 0 string $SDI
  126. >4 string 0001 System Deployment Image
  127. !:mime application/x-ms-sdi
  128. #!:mime application/octet-stream
  129. # \Boot\boot.sdi
  130. !:ext sdi
  131. # MDBtype: 0~Unspecified 1~RAM 2~ROM
  132. >>8 ulequad !0 \b, MDBtype %#llx
  133. # BootCodeOffset
  134. >>16 ulequad !0 \b, BootCodeOffset %#llx
  135. # BootCodeSize
  136. >>24 ulequad !0 \b, BootCodeSize %#llx
  137. # VendorID
  138. >>32 ulequad !0 \b, VendorID %#llx
  139. # DeviceID
  140. >>40 ulequad !0 \b, DeviceID %#llx
  141. # DeviceModel
  142. >>48 ulequad !0 \b, DeviceModel %#llx
  143. >>>56 ulequad !0 \b%llx
  144. # DeviceRole
  145. >>64 ulequad !0 \b, DeviceRole %#llx
  146. # Reserved1; reserved fields and gaps between BLOBs are padded with \0
  147. #>>72 ulequad !0 \b, Reserved1 %#llx
  148. # RuntimeGUID
  149. >>80 ulequad !0 \b, RuntimeGUID %#llx
  150. >>>88 ulequad !0 \b%llx
  151. # RuntimeOEMrev
  152. >>96 ulequad !0 \b, RuntimeOEMrev %#llx
  153. # Reserved2
  154. #>>104 ulequad !0 \b, Reserved2 %#llx
  155. # BLOB alignment value in pages, as specified in sdimgr /pack: 1~4K 2~8k
  156. >>112 ulequad !0 \b, PageAlignment %llu
  157. # Reserved3[48]
  158. #>>120 ulequad !0 \b, Reserved3 %#llx
  159. # SDI checksum 39h
  160. >>0x1f8 ulequad x \b, checksum %#llx
  161. # BLOBtype[8] \0-padded: PART, WIM , BOOT, LOAD, DISK
  162. >>0x400 string >\0 \b, type %-3.8s
  163. # 0~non-filesystem 7~NTFS 6~BIGFAT
  164. >>>0x420 ulequad !0 (%#llx)
  165. # ATTRibutes
  166. >>>0x408 ulequad !0 %#llx attributes
  167. # Offset
  168. >>>0x410 ulequad x at %#llx
  169. # print 1 space after size and then handles NTFS boot sector by ./filesystems
  170. >>>0x418 ulequad >0 %llu bytes
  171. >>>>(0x410.l) indirect x
  172. # 2nd BLOB: WIM
  173. >>0x440 string >\0 \b, type %-3.8s
  174. >>>0x428 ulequad !0 (%#llx)
  175. # ATTRibutes
  176. >>>0x448 ulequad !0 %#llx attributes
  177. # Offset
  178. >>>0x450 ulequad x at %#llx
  179. >>>0x458 ulequad >0 %llu bytes
  180. >>>>(0x450.l) indirect x
  181. # 3rd BLOB
  182. >>0x480 string >\0 \b, type %-3.8s
  183. # Summary: Windows boot status log BOOTSTAT.DAT
  184. # From: Joerg Jenderek
  185. # Reference: https://www.geoffchappell.com/notes/windows/boot/bsd.htm
  186. # Note: mainly refers to older Windows Vista, sometimes
  187. # BOOTSTAT.DAT only contains nulls or invalid data
  188. # checking for valid version below 5
  189. 0 ulelong <5
  190. # skip many ISO images by checking for valid 64 KiB file size
  191. >8 ulelong =0x00010000
  192. >>0 use bootstat-dat
  193. # display information of BOOTSTAT.DAT
  194. 0 name bootstat-dat
  195. >0 ulelong x Windows boot log
  196. #!:mime application/octet-stream
  197. !:mime application/x-ms-dat
  198. # BOOTSTAT.DAT in BOOT subdirectory
  199. !:ext dat
  200. # apparently a version number: 2 for older like Vista, 3, 4 Windows 10
  201. >0 ulelong >2 \b, version %u
  202. # apparently the size of the header: often 10h in older Windows, 14h, 18h
  203. >4 ulelong !0x10 \b, header size %#x
  204. #>4 ulelong !0x10 \b, header size %u
  205. # apparently the size of the file: always 0x00010000~64KiB
  206. # the file is acceptable to BOOTMGR only if it is exactly 64 KiB
  207. >8 ulelong !0x00010000 \b, file size %#x
  208. # size of valid data, in bytes: C8h 50h 172h 5D5Ch
  209. >0xc ulelong x \b, %#x valid bytes
  210. # skip header and jump to first bootstat entry and display information
  211. >(0x4.l-1) ubyte x
  212. >>&0 use bootstat-entry
  213. # jump to first entry again because pointer are bad after "use"
  214. >(0x4.l-1) ubyte x
  215. # by 1st entry size jump to 2nd entry and display information
  216. >>&(&0x18.l-1) ubyte x
  217. >>>&0 use bootstat-entry
  218. # jump to possible 3rd boot entry and display information
  219. # >(0x4.l-1) ubyte x
  220. # >>&(&0x18.l-1) ubyte x
  221. # >>>&(&0x18.l-1) ubyte x
  222. # >>>>&0 use bootstat-entry
  223. # display BOOTSTAT.DAT entry
  224. 0 name bootstat-entry
  225. #>0x00 ubequad x \b, ENTRY %16.16llx
  226. # size of entry, in bytes: 40h(init) 78h(launced) 9Ch
  227. #>0x18 ulelong x \b; entry size %u
  228. >0x18 ulelong x \b; entry size %#x
  229. # time stamp, in seconds
  230. >0x00 ulelong x \b, %#x seconds
  231. # always zero, significance unknown
  232. >0x04 ulelong !0 \b, not null %u
  233. # GUID of event source; but empty if event source is BOOTMGR
  234. >0x08 ubequad !0 \b, GUID %#16.16llx
  235. >>0x10 ubequad x \b%16.16llx
  236. # severity code: 1~informational 3~errors
  237. >0x1C ulelong !1 \b, severity %#x
  238. # apparently a version number: 2
  239. >0x20 ulelong !2 \b, version %u
  240. # event identifier 1~log file initialised 11h~boot application launched
  241. #>0x24 ulelong x \b, event %#x
  242. >0x24 ulelong !1
  243. >>0x24 ulelong !0x11 \b, event %#x
  244. # entry data; size depends on event identifier
  245. #>0x28 ubequad x \b, data %#16.16llx
  246. >0x24 ulelong =0x1 \b, Init
  247. # always 0, significance unknown
  248. >>0x34 uleshort !0 \b, not null %u
  249. # always 7, significance unknown
  250. >>0x36 uleshort !7 \b, not seven %u
  251. # year
  252. >>0x28 uleshort x %u
  253. # month
  254. >>0x2A uleshort x \b-%u
  255. # day
  256. >>0x2C uleshort x \b-%u
  257. # hour
  258. >>0x2E uleshort x %u
  259. # minute
  260. >>0x30 uleshort x \b:%u
  261. # second
  262. >>0x32 uleshort x \b:%u
  263. # boot application launched
  264. >0x24 ulelong =0x11 \b, launched
  265. # type of start: 0 normally, 1 or 2 maybe in a recovery sequence
  266. >>0x38 uleshort !0 \b, type %u
  267. # pathname of boot application, as null-terminated Unicode string; typically
  268. # \Windows\system32\winload.exe \Windows\system32\winload.efi
  269. >>0x3C lestring16 x %s
  270. # Summary: Windows Error Report text files
  271. # URL: https://en.wikipedia.org/wiki/Windows_Error_Reporting
  272. # Reference: https://www.nirsoft.net/utils/app_crash_view.html
  273. # Created by: Joerg Jenderek
  274. # Note: in directories %ProgramData%\Microsoft\Windows\WER\{ReportArchive,ReportQueue}
  275. # %LOCALAPPDATA%\Microsoft\Windows\WER\{ReportArchive,ReportQueue}
  276. 0 lestring16 Version=
  277. >22 lestring16 EventType Windows Error Report
  278. !:mime text/plain
  279. # Report.wer
  280. !:ext wer
  281. # Summary: Windows 3.1 group files
  282. # Extension: .grp
  283. # Created by: unknown
  284. 0 string \120\115\103\103 MS Windows 3.1 group files
  285. # Summary: Old format help files
  286. # URL: https://en.wikipedia.org/wiki/WinHelp
  287. # Reference: https://www.oocities.org/mwinterhoff/helpfile.htm
  288. # Update: Joerg Jenderek
  289. # Created by: Dirk Jagdmann <doj@cubic.org>
  290. #
  291. # check and then display version and date inside MS Windows HeLP file fragment
  292. 0 name help-ver-date
  293. # look for Magic of SYSTEMHEADER
  294. >0 leshort 0x036C
  295. # version Major 1 for right file fragment
  296. >>4 leshort 1 Windows
  297. # print non empty string above to avoid error message
  298. # Warning: Current entry does not yet have a description for adding a MIME type
  299. !:mime application/winhelp
  300. !:ext hlp
  301. # version Minor of help file format is hint for windows version
  302. >>>2 leshort 0x0F 3.x
  303. >>>2 leshort 0x15 3.0
  304. >>>2 leshort 0x21 3.1
  305. >>>2 leshort 0x27 x.y
  306. >>>2 leshort 0x33 95
  307. >>>2 default x y.z
  308. >>>>2 leshort x %#x
  309. # to complete message string like "MS Windows 3.x help file"
  310. >>>2 leshort x help
  311. # GenDate often older than file creation date
  312. >>>6 ldate x \b, %s
  313. #
  314. # Magic for HeLP files
  315. 0 lelong 0x00035f3f
  316. # ./windows (version 5.25) labeled the entry as "MS Windows 3.x help file"
  317. # file header magic 0x293B at DirectoryStart+9
  318. >(4.l+9) uleshort 0x293B MS
  319. # look for @VERSION bmf.. like IBMAVW.ANN
  320. >>0xD4 string =\x62\x6D\x66\x01\x00 Windows help annotation
  321. !:mime application/x-winhelp
  322. !:ext ann
  323. >>0xD4 string !\x62\x6D\x66\x01\x00
  324. # "GID Help index" by TrID
  325. >>>(4.l+0x65) string =|Pete Windows help Global Index
  326. !:mime application/x-winhelp
  327. !:ext gid
  328. # HeLP Bookmark or
  329. # "Windows HELP File" by TrID
  330. >>>(4.l+0x65) string !|Pete
  331. # maybe there exist a cleaner way to detect HeLP fragments
  332. # brute search for Magic 0x036C with matching Major maximal 7 iterations
  333. # discapp.hlp
  334. >>>>16 search/0x49AF/s \x6c\x03
  335. >>>>>&0 use help-ver-date
  336. >>>>>&4 leshort !1
  337. # putty.hlp
  338. >>>>>>&0 search/0x69AF/s \x6c\x03
  339. >>>>>>>&0 use help-ver-date
  340. >>>>>>>&4 leshort !1
  341. >>>>>>>>&0 search/0x49AF/s \x6c\x03
  342. >>>>>>>>>&0 use help-ver-date
  343. >>>>>>>>>&4 leshort !1
  344. >>>>>>>>>>&0 search/0x49AF/s \x6c\x03
  345. >>>>>>>>>>>&0 use help-ver-date
  346. >>>>>>>>>>>&4 leshort !1
  347. >>>>>>>>>>>>&0 search/0x49AF/s \x6c\x03
  348. >>>>>>>>>>>>>&0 use help-ver-date
  349. >>>>>>>>>>>>>&4 leshort !1
  350. >>>>>>>>>>>>>>&0 search/0x49AF/s \x6c\x03
  351. >>>>>>>>>>>>>>>&0 use help-ver-date
  352. >>>>>>>>>>>>>>>&4 leshort !1
  353. >>>>>>>>>>>>>>>>&0 search/0x49AF/s \x6c\x03
  354. # GCC.HLP is detected after 7 iterations
  355. >>>>>>>>>>>>>>>>>&0 use help-ver-date
  356. # this only happens if bigger hlp file is detected after used search iterations
  357. >>>>>>>>>>>>>>>>>&4 leshort !1 Windows y.z help
  358. !:mime application/winhelp
  359. !:ext hlp
  360. # repeat search again or following default line does not work
  361. >>>>16 search/0x49AF/s \x6c\x03
  362. # remaining files should be HeLP Bookmark WinHlp32.BMK (XP 32-bit) or WinHlp32 (Windows 8.1 64-bit)
  363. >>>>16 default x Windows help Bookmark
  364. !:mime application/x-winhelp
  365. !:ext bmk
  366. ## FirstFreeBlock normally FFFFFFFFh 10h for *ANN
  367. ##>>8 lelong x \b, FirstFreeBlock %#8.8x
  368. # EntireFileSize
  369. >>12 lelong x \b, %d bytes
  370. ## ReservedSpace normally 042Fh AFh for *.ANN
  371. #>>(4.l) lelong x \b, ReservedSpace %#8.8x
  372. ## UsedSpace normally 0426h A6h for *.ANN
  373. #>>(4.l+4) lelong x \b, UsedSpace %#8.8x
  374. ## FileFlags normally 04...
  375. #>>(4.l+5) lelong x \b, FileFlags %#8.8x
  376. ## file header magic 0x293B
  377. #>>(4.l+9) uleshort x \b, file header magic %#4.4x
  378. ## file header Flags 0x0402
  379. #>>(4.l+11) uleshort x \b, file header Flags %#4.4x
  380. ## file header PageSize 0400h 80h for *.ANN
  381. #>>(4.l+13) uleshort x \b, PageSize %#4.4x
  382. ## Structure[16] z4
  383. #>>(4.l+15) string >\0 \b, Structure_"%-.16s"
  384. ## MustBeZero 0
  385. #>>(4.l+31) uleshort x \b, MustBeZero %#4.4x
  386. ## PageSplits
  387. #>>(4.l+33) uleshort x \b, PageSplits %#4.4x
  388. ## RootPage
  389. #>>(4.l+35) uleshort x \b, RootPage %#4.4x
  390. ## MustBeNegOne 0xffff
  391. #>>(4.l+37) uleshort x \b, MustBeNegOne %#4.4x
  392. ## TotalPages 1
  393. #>>(4.l+39) uleshort x \b, TotalPages %#4.4x
  394. ## NLevels 0x0001
  395. #>>(4.l+41) uleshort x \b, NLevels %#4.4x
  396. ## TotalBtreeEntries
  397. #>>(4.l+43) ulelong x \b, TotalBtreeEntries %#8.8x
  398. ## pages of the B+ tree
  399. #>>(4.l+47) ubequad x \b, PageStart %#16.16llx
  400. # start with colon or semicolon for comment line like Back2Life.cnt
  401. 0 regex \^(:|;)
  402. # look for first keyword Base
  403. >0 search/45 :Base
  404. >>&0 use cnt-name
  405. # only solution to search again from beginning , because relative offsets changes when use is called
  406. >0 search/45 :Base
  407. >0 default x
  408. # look for other keyword Title like in putty.cnt
  409. >>0 search/45 :Title
  410. >>>&0 use cnt-name
  411. #
  412. # display mime type and name of Windows help Content source
  413. 0 name cnt-name
  414. # skip space at beginning
  415. >0 string \040
  416. # name without extension and greater character or name with hlp extension
  417. >>1 regex/c \^([^\xd>]*|.*\\.hlp) MS Windows help file Content, based "%s"
  418. !:mime text/plain
  419. !:apple ????TEXT
  420. !:ext cnt
  421. #
  422. # Windows creates a full text search from hlp file, if the user clicks the "Find" tab and enables keyword indexing
  423. 0 string tfMR MS Windows help Full Text Search index
  424. !:mime application/x-winhelp-fts
  425. !:ext fts
  426. >16 string >\0 for "%s"
  427. # Summary: Hyper terminal
  428. # Extension: .ht
  429. # Created by: unknown
  430. 0 string HyperTerminal\040
  431. >15 string 1.0\ --\ HyperTerminal\ data\ file MS Windows HyperTerminal profile
  432. # https://ithreats.files.wordpress.com/2009/05/\040
  433. # lnk_the_windows_shortcut_file_format.pdf
  434. # Summary: Windows shortcut
  435. # Extension: .lnk
  436. # Created by: unknown
  437. # 'L' + GUUID
  438. 0 string \114\0\0\0\001\024\002\0\0\0\0\0\300\0\0\0\0\0\0\106 MS Windows shortcut
  439. !:mime application/x-ms-shortcut
  440. !:ext lnk
  441. >20 lelong&1 1 \b, Item id list present
  442. >20 lelong&2 2 \b, Points to a file or directory
  443. >20 lelong&4 4 \b, Has Description string
  444. >20 lelong&8 8 \b, Has Relative path
  445. >20 lelong&16 16 \b, Has Working directory
  446. >20 lelong&32 32 \b, Has command line arguments
  447. >20 lelong&64 64 \b, Icon
  448. >>56 lelong x \b number=%d
  449. >24 lelong&1 1 \b, Read-Only
  450. >24 lelong&2 2 \b, Hidden
  451. >24 lelong&4 4 \b, System
  452. >24 lelong&8 8 \b, Volume Label
  453. >24 lelong&16 16 \b, Directory
  454. >24 lelong&32 32 \b, Archive
  455. >24 lelong&64 64 \b, Encrypted
  456. >24 lelong&128 128 \b, Normal
  457. >24 lelong&256 256 \b, Temporary
  458. >24 lelong&512 512 \b, Sparse
  459. >24 lelong&1024 1024 \b, Reparse point
  460. >24 lelong&2048 2048 \b, Compressed
  461. >24 lelong&4096 4096 \b, Offline
  462. >28 leqwdate x \b, ctime=%s
  463. >36 leqwdate x \b, mtime=%s
  464. >44 leqwdate x \b, atime=%s
  465. >52 lelong x \b, length=%u, window=
  466. >60 lelong&1 1 \bhide
  467. >60 lelong&2 2 \bnormal
  468. >60 lelong&4 4 \bshowminimized
  469. >60 lelong&8 8 \bshowmaximized
  470. >60 lelong&16 16 \bshownoactivate
  471. >60 lelong&32 32 \bminimize
  472. >60 lelong&64 64 \bshowminnoactive
  473. >60 lelong&128 128 \bshowna
  474. >60 lelong&256 256 \brestore
  475. >60 lelong&512 512 \bshowdefault
  476. #>20 lelong&1 0
  477. #>>20 lelong&2 2
  478. #>>>(72.l-64) pstring/h x \b [%s]
  479. #>20 lelong&1 1
  480. #>>20 lelong&2 2
  481. #>>>(72.s) leshort x
  482. #>>>&75 pstring/h x \b [%s]
  483. # Summary: Outlook Personal Folders
  484. # Created by: unknown
  485. # Update: Joerg Jenderek
  486. # URL: http://fileformats.archiveteam.org/wiki/Personal_Folder_File
  487. # https://en.wikipedia.org/wiki/Personal_Storage_Table
  488. # Reference: https://interoperability.blob.core.windows.net/files/MS-PST/%5bMS-PST%5d.pdf
  489. # http://mark0.net/download/triddefs_xml.7z/defs/p/pab.trid.xml
  490. # dwMagic !BDN
  491. 0 lelong 0x4E444221
  492. # skip DROID x-fmt-75-signature-id-472.pab x-fmt-248-signature-id-260.pst x-fmt-249-signature-id-261.pst
  493. # by check for existance of bPlatformCreate value
  494. >14 ubyte x Microsoft Outlook
  495. #!:mime application/octet-stream
  496. # NOT official registered !
  497. !:mime application/vnd.ms-outlook
  498. # dwCRCPartial; 32-bit cyclic redundancy check (CRC) value of followin 471 bytes; zero for 64-bit
  499. #>>4 ulelong !0 \b, CRC %#x
  500. # wMagicClient; AB (4142h) is used for PAB files; SM (534Dh) is used for PST files; SO (534Fh) is used for OST files
  501. #>>8 leshort x \b, wMagicClient=%#x
  502. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/pab.trid.xml
  503. # Note: called "Microsoft Personal Address Book" by TrID and
  504. # "Microsoft Outlook Personal Address Book" by DROID via x-fmt/75
  505. >>8 leshort 0x4142 Personal Address Book
  506. #!:mime application/x-ms-pab
  507. !:ext pab
  508. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/pst.trid.xml
  509. # http://mark0.net/download/triddefs_xml.7z/defs/p/pst-unicode.trid.xml
  510. # Note: called "Microsoft OutLook Personal Folder" by TrID and
  511. # by DROID via x-fmt/248 for ANSI and via x-fmt/249 for Unicode
  512. #>>8 leshort 0x4D53 \b, PST~
  513. # called "Microsoft Outlook email folder" in ./windows version 1.37 and older
  514. >>8 leshort 0x4D53 Personal Storage
  515. #!:mime application/x-ms-pst
  516. !:ext pst
  517. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/o/ost.trid.xml
  518. # Note: called "Outlook Exchange Offline Storage" by TrID
  519. >>8 leshort 0x4F53 Offline Storage
  520. #!:mime application/x-ms-ost
  521. !:ext ost
  522. # wVer; file format version. 14 or 15 if the file is ANSI; > 21 or 23(=17h) if Unicode; 37 for written by Outlook with WIP
  523. >>10 uleshort x (
  524. # probably NO intermediate versions exist
  525. >>10 leshort <0x10 \b<=2002, ANSI,
  526. >>10 leshort >0x14 \b>=2003, Unicode,
  527. >>10 uleshort x version %u)
  528. # wVerClient; client file format version like: 19 22
  529. #>>12 uleshort x \b, wVerClient=%u
  530. # bPlatformCreate; This value MUST be set to 1 but also found 2
  531. >>14 ubyte >1 \b, bPlatformCreate=%u
  532. # bPlatformAccess; This value MUST be set to 1 but also found 2
  533. >>15 ubyte >1 \b, bPlatformAccess=%u
  534. # dwReserved1; SHOULD ignore and NOT modify this value; SHOULD initialize to zero
  535. >>16 ulelong !0 \b, dwReserved1=%#x
  536. # dwReserved2; SHOULD ignore and NOT modify this value; SHOULD initialize to zero
  537. >>20 ulelong !0 \b, dwReserved2=%#x
  538. # ANSI 32-bit variant Outlook 1997-2002
  539. >>10 uleshort <16
  540. # bidNextB; next BlockID (ANSI 4 bytes)
  541. #>>>24 ulelong !0 \b, bidNextB=%#x
  542. # bidNextP; Next available back BlockID pointer
  543. #>>>28 ulelong !0 \b, bidNextP=%#x
  544. # dwUnique; value monotonically increased when modifying PST; so CRC is changing
  545. >>>32 ulelong !0 \b, dwUnique=%#x
  546. # rgnid[128]; A fixed array of 32 NodeIDs, each corresponding to one of the 32 possible NID_TYPEs
  547. #>>>36 ubequad x \b, rgnid=%#llx...
  548. # dwReserved; Implementations SHOULD ignore this value and SHOULD NOT modify it; Initialized zero
  549. >>>164 ulelong !0 \b, dwReserved=%#x
  550. # ibFileEof; the size of the PST file, in bytes (ANSI 4 bytes)
  551. >>>168 ulelong x \b, %u bytes
  552. # ibAMapLast; offset to the last AMap page
  553. #>>>172 ulelong x \b, ibAMapLast=%#x
  554. # bSentinel; MUST be set to 0x80
  555. >>>460 ubyte !0x80 \b, bSentinel=%#x
  556. # bCryptMethod: 0~No encryption 1~encryption with permutation 2~encryption with cyclic 16~encryption with Windows Information Protection (WIP)
  557. >>>461 ubyte >0 \b, bCryptMethod=%u
  558. # UNICODE 64-bit variant Outlook 2003-2007
  559. >>10 uleshort >20
  560. # bidUnused; Unused 8 bytes padding (Unicode only); sometimes like: 0x0000000100000004
  561. >>>24 ulequad !0x0000000100000004 \b, bidUnused=%#16.16llx
  562. # dwUnique; value monotonically increased when modifying PST; so CRC is changing
  563. >>>40 ulelong !0 \b, dwUnique=%#x
  564. # rgnid[] (128 bytes): A fixed array of 32 NIDs, each corresponding to one of the 32 possible
  565. #>>>44 ubequad x \b, rgnid=%#llx...
  566. # ibFileEof; the size of the PST file, in bytes (Unicode 8 bytes)
  567. >>>184 ulequad x \b, %llu bytes
  568. # bSentinel; MUST be set to 0x80
  569. >>>512 ubyte !0x80 \b, bSentinel=%#x
  570. # bCryptMethod; Encryption type like: 0 1 2 16
  571. >>>513 ubyte >0 \b, bCryptMethod=%u
  572. # dwCRC; 32-bit CRC of the of the previous 516 bytes
  573. >>>524 ulelong x \b, CRC32 %#x
  574. # Summary: Windows help cache
  575. # Created by: unknown
  576. 0 string \164\146\115\122\012\000\000\000\001\000\000\000 MS Windows help cache
  577. # Summary: IE cache file
  578. # Created by: Christophe Monniez
  579. 0 string Client\ UrlCache\ MMF Internet Explorer cache file
  580. >20 string >\0 version %s
  581. # Summary: Registry files
  582. # Created by: unknown
  583. # Modified by (1): Joerg Jenderek
  584. 0 string regf MS Windows registry file, NT/2000 or above
  585. 0 string CREG MS Windows 95/98/ME registry file
  586. 0 string SHCC3 MS Windows 3.1 registry file
  587. # Summary: Windows Registry text
  588. # URL: https://en.wikipedia.org/wiki/Windows_Registry#.REG_files
  589. # Reference: http://fileformats.archiveteam.org/wiki/Windows_Registry
  590. # Submitted by: Abel Cheung <abelcheung@gmail.com>
  591. # Update: Joerg Jenderek
  592. # Windows 3-9X variant
  593. 0 string REGEDIT
  594. # skip ASCII text like "REGEDITor.txt" but match
  595. # L1WMAP.REG with only 1 CRNL or org.gnome.gnumeric.reg with 2 NL
  596. >7 search/3 \n Windows Registry text
  597. !:mime text/x-ms-regedit
  598. !:ext reg
  599. # Windows 9X variant
  600. >>0 string REGEDIT4 (Win95 or above)
  601. # Windows 2K ANSI variant
  602. 0 string Windows\ Registry\ Editor\
  603. >&0 string Version\ 5.00\r\n\r\n Windows Registry text (Win2K or above)
  604. !:mime text/x-ms-regedit
  605. !:ext reg
  606. # Windows 2K UTF-16 variant
  607. 2 lestring16 Windows\ Registry\ Editor\
  608. >0x32 lestring16 Version\ 5.00\r\n\r\n Windows Registry little-endian text (Win2K or above)
  609. # relative offset not working
  610. #>&0 lestring16 Version\ 5.00\r\n\r\n Windows Registry little-endian text (Win2K or above)
  611. !:mime text/x-ms-regedit
  612. !:ext reg
  613. # WINE variant
  614. # URL: https://en.wikipedia.org/wiki/Wine_(software)
  615. # Reference: https://www.winehq.org/pipermail/wine-cvs/2005-October/018763.html
  616. # Note: WINE use text based registry (system.reg,user.reg,userdef.reg)
  617. # instead binary hiv structure like Windows
  618. 0 string WINE\ REGISTRY\ Version\ WINE registry text
  619. # version 2
  620. >&0 string x \b, version %s
  621. !:mime text/x-wine-extension-reg
  622. !:ext reg
  623. # Windows *.INF *.INI files updated by Joerg Jenderek at Apr 2013, Feb 2018
  624. # empty ,comment , section
  625. # PR/383: remove unicode BOM because it is not portable across regex impls
  626. #0 regex/s \\`(\\r\\n|;|[[])
  627. # empty line CRLF
  628. 0 ubeshort 0x0D0A
  629. >0 use ini-file
  630. # comment line starting with semicolon
  631. 0 string ;
  632. # look for phrase of Windows policy ADMinistrative template (with starting remark)
  633. # like: WINDOW_95_CD/TOOLS/RESKIT/netadmin/poledit/conf.adm
  634. >1 search/3548 END\040CATEGORY
  635. # ADM with remark (by adm-rem.trid.xml) already done by generic ASCII variant
  636. # if no Windows policy ADMinistrative template then Windows INItialization
  637. >1 default x
  638. >>0 use ini-file
  639. # section line starting with left bracket
  640. 0 string [
  641. >0 use ini-file
  642. # check and then display Windows INItialization configuration
  643. 0 name ini-file
  644. # look for left bracket in section line
  645. >0 search/8192 [
  646. # https://en.wikipedia.org/wiki/Autorun.inf
  647. # https://msdn.microsoft.com/en-us/library/windows/desktop/cc144200.aspx
  648. # space after right bracket
  649. # or AutoRun.Amd64 for 64 bit systems
  650. # or only NL separator
  651. >>&0 regex/c \^autorun
  652. # but sometimes total commander directory tree file "treeinfo.wc" with lines like
  653. # [AUTORUN]
  654. # [boot]
  655. >>>&0 string =]\r\n[ Total commander directory treeinfo.wc
  656. !:mime text/plain
  657. !:ext wc
  658. # From: Pal Tamas <folti@balabit.hu>
  659. # Autorun File
  660. >>>&0 string !]\r\n[ Microsoft Windows Autorun file
  661. !:mime application/x-setupscript
  662. !:ext inf
  663. # https://msdn.microsoft.com/en-us/library/windows/hardware/ff549520(v=vs.85).aspx
  664. # version strings ASCII coded case-independent for Windows setup information script file
  665. >>&0 regex/c \^(version|strings)] Windows setup INFormation
  666. !:mime application/x-setupscript
  667. #!:mime application/x-wine-extension-inf
  668. !:ext inf
  669. # NETCRC.INF OEMCPL.INF
  670. >>&0 regex/c \^(WinsockCRCList|OEMCPL)] Windows setup INFormation
  671. !:mime application/x-setupscript
  672. !:ext inf
  673. # http://www.winfaq.de/faq_html/Content/tip2500/onlinefaq.php?h=tip2653.htm
  674. # https://msdn.microsoft.com/en-us/library/windows/desktop/cc144102.aspx
  675. # .ShellClassInfo DeleteOnCopy LocalizedFileNames ASCII coded case-independent
  676. >>&0 regex/1024c \^(\\.ShellClassInfo|DeleteOnCopy|LocalizedFileNames)] Windows desktop.ini
  677. !:mime application/x-wine-extension-ini
  678. #!:mime text/plain
  679. # https://support.microsoft.com/kb/84709/
  680. >>&0 regex/c \^don't\ load] Windows CONTROL.INI
  681. !:mime application/x-wine-extension-ini
  682. !:ext ini
  683. >>&0 regex/c \^(ndishlp\\$|protman\\$|NETBEUI\\$)] Windows PROTOCOL.INI
  684. !:mime application/x-wine-extension-ini
  685. !:ext ini
  686. # https://technet.microsoft.com/en-us/library/cc722567.aspx
  687. # http://www.winfaq.de/faq_html/Content/tip0000/onlinefaq.php?h=tip0137.htm
  688. >>&0 regex/c \^(windows|Compatibility|embedding)] Windows WIN.INI
  689. !:mime application/x-wine-extension-ini
  690. !:ext ini
  691. # https://en.wikipedia.org/wiki/SYSTEM.INI
  692. >>&0 regex/c \^(boot|386enh|drivers)] Windows SYSTEM.INI
  693. !:mime application/x-wine-extension-ini
  694. !:ext ini
  695. # http://www.mdgx.com/newtip6.htm
  696. >>&0 regex/c \^SafeList] Windows IOS.INI
  697. !:mime application/x-wine-extension-ini
  698. !:ext ini
  699. # https://en.wikipedia.org/wiki/NTLDR Windows Boot Loader information
  700. >>&0 regex/c \^boot\x20loader] Windows boot.ini
  701. !:mime application/x-wine-extension-ini
  702. !:ext ini
  703. # https://en.wikipedia.org/wiki/CONFIG.SYS
  704. >>&0 regex/c \^menu] MS-DOS CONFIG.SYS
  705. # @CONFIG.UI configuration file of previous DOS version saved by Caldera OPENDOS INSTALL.EXE
  706. # CONFIG.PSS saved version of file CONFIG.SYS created by %WINDIR%\SYSTEM\MSCONFIG.EXE
  707. # CONFIG.TSH renamed file CONFIG.SYS.BAT by %WINDIR%\SYSTEM\MSCONFIG.EXE
  708. # dos and w40 used in dual booting scene
  709. !:ext sys/dos/w40
  710. # https://support.microsoft.com/kb/118579/
  711. >>&0 regex/c \^Paths]\r\n MS-DOS MSDOS.SYS
  712. !:ext sys/dos
  713. # http://chmspec.nongnu.org/latest/INI.html#HHP
  714. >>&0 regex/c \^options]\r\n Microsoft HTML Help Project
  715. !:mime text/plain
  716. !:ext hhp
  717. # From: Joerg Jenderek
  718. # URL: https://documentation.basis.com/BASISHelp/WebHelp/b3odbc/ODBC_Driver/obdcdriv_character_translation.htm
  719. # Reference: https://www.garykessler.net/library/file_sigs.html
  720. # http://mark0.net/download/triddefs_xml.7z/defs/c/cpx.trid.xml
  721. # Note: stored in directory %WINDIR%\SysWOW64 or %WINDIR%\system
  722. # second word often Latin but sometimes Cyrillic like in 12510866.CPX
  723. >>&0 regex/c \^Windows\ (Latin|Cyrillic) Windows codepage translator
  724. #!:mime text/plain
  725. !:mime text/x-ms-cpx
  726. # like: 12510866.CPX
  727. !:ext cpx
  728. # From: Joerg Jenderek
  729. # URL: https://en.wikipedia.org/wiki/InstallShield
  730. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/l/lid-is.trid.xml
  731. # Note: contain also 3 keywords like: count Default key0
  732. >>&0 regex/c \^Languages] InstallShield Language Identifier
  733. #!:mime text/plain
  734. !:mime text/x-installshield-lid
  735. # like: SETUP.LID
  736. !:ext lid
  737. # From: Joerg Jenderek
  738. # URL: https://www.file-extensions.org/tag-file-extension
  739. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/t/taginfo.trid.xml
  740. # Note: contain also keywords like: Application Category Company Misc Version
  741. >>&0 regex/c \^TagInfo] TagInfo
  742. #!:mime text/plain
  743. #!:mime text/prs.lines.tag
  744. !:mime text/x-ms-tag
  745. # like: DATA.TAG
  746. !:ext tag
  747. # unknown keyword after opening bracket
  748. >>&0 default x
  749. #>>>&0 string/c x UNKNOWN [%s
  750. # look for left bracket of second section
  751. >>>&0 search/8192 [
  752. # version Strings FileIdentification
  753. >>>>&0 string/c version Windows setup INFormation
  754. !:mime application/x-setupscript
  755. !:ext inf
  756. # https://en.wikipedia.org/wiki/Initialization_file Windows Initialization File or other
  757. >>>>&0 default x
  758. >>>>>&0 ubyte x
  759. # characters, digits, underscore and white space followed by right bracket
  760. # terminated by CR implies section line to skip BOOTLOG.TXT DETLOG.TXT
  761. >>>>>>&-1 regex/T \^([A-Za-z0-9_\(\)\ ]+)\]\r Generic INItialization configuration [%-.40s
  762. # NETDEF.INF multiarc.ini
  763. #!:mime application/x-setupscript
  764. !:mime application/x-wine-extension-ini
  765. #!:mime text/plain
  766. !:ext ini/inf
  767. # UTF-16 BOM
  768. 0 ubeshort =0xFFFE
  769. # look for phrase of Windows policy ADMinistrative template (UTF-16 by adm-uni.trid.xml)
  770. # like: wuau.adm
  771. >2 search/0x384A E\0N\0D\0\040\0C\0A\0T\0E\0G\0O\0R\0Y\0
  772. >>0 use windows-adm
  773. # if no Windows policy ADMinistrative template then Windows INFormation
  774. >2 default x
  775. # UTF-16 BOM followed by CR~0D00 , comment~semicolon~3B00 , section~bracket~5B00
  776. >>0 ubelong&0xFFff89FF =0xFFFE0900
  777. # look for left bracket in section line
  778. >>>2 search/8192 [
  779. # keyword without 1st letter which is maybe up-/down-case
  780. >>>>&3 lestring16 ersion] Windows setup INFormation
  781. !:mime application/x-setupscript
  782. # like: hdaudio.inf iscsi.inf spaceport.inf tpm.inf usbhub3.inf UVncVirtualDisplay.inf
  783. !:ext inf
  784. >>>>&3 lestring16 trings] Windows setup INFormation
  785. !:mime application/x-setupscript
  786. # like: arduino_gemma.inf iis.inf MSM8960.inf
  787. !:ext inf
  788. >>>>&3 lestring16 ourceDisksNames] Windows setup INFormation
  789. !:mime application/x-setupscript
  790. # like: atiixpag.inf mdmnokia.inf netefe32.inf rdpbus.inf
  791. !:ext inf
  792. # netnwcli.inf start with ;---[ NetNWCli.INX ]
  793. >>>>&3 default x
  794. # look for NL followed by left bracket
  795. >>>>>&0 search/8192 \x0A\x00\x5b
  796. # like: defltwk.inf netvwifibus.inf WSDPrint.inf
  797. >>>>>>&3 lestring16 ersion] Windows setup INFormation
  798. !:mime application/x-setupscript
  799. !:ext inf
  800. # Summary: Windows Policy ADMinistrative template
  801. # From: Joerg Jenderek
  802. # URL: https://en.wikipedia.org/wiki/Administrative_Template
  803. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/a/adm.trid.xml
  804. # Note: typically stored in directory like: %WINDIR%\system32\GroupPolicy\ADM
  805. # worst case ASCII variant starting with remark line like: inetset.adm
  806. 0 search/0x4E CLASS\040
  807. >&0 string MACHINE
  808. >>0 use windows-adm
  809. >&0 string USER
  810. >>0 use windows-adm
  811. # display information about Windows policy ADMinistrative template
  812. 0 name windows-adm Windows Policy Administrative Template
  813. !:mime text/x-ms-adm
  814. !:ext adm
  815. # UTF-16 BOM implies UTF-16 encoded ADM (by adm-uni.trid.xml)
  816. >0 ubeshort =0xFFFE
  817. >>2 lestring16 x \b, 1st line "%s"
  818. # look for UTF-16 encoded CarriageReturn LineFeed
  819. >>>2 search/0x3A \r\0\n\0
  820. >>>>&0 lestring16 x \b, 2nd line "%s"
  821. # no UTF-16 BOM implies "ASCII" encoded ADM (by adm.trid.xml)
  822. >0 ubeshort !0xFFFE
  823. >>0 string x \b, 1st line "%s"
  824. #>>>&0 ubequad x \b, 2ND %16.16llx
  825. # 2nd line empty
  826. >>>&2 beshort =0x0D0A
  827. >>>>&0 beshort !0x0D0A \b, 3th line
  828. >>>>>&-2 string x "%s"
  829. # 2nd line with content
  830. >>>&2 beshort !0x0D0A \b, 2nd line
  831. >>>>&-2 string x "%s"
  832. # Windows Precompiled INF files *.PNF added by Joerg Jenderek at Mar 2013 of _PNF_HEADER inf.h
  833. # http://read.pudn.com/downloads3/sourcecode/windows/248345/win2k/private/windows/setup/setupapi/inf.h__.htm
  834. # URL: http://fileformats.archiveteam.org/wiki/INF_(Windows)
  835. # Reference: http://en.verysource.com/code/10350344_1/inf.h.html
  836. # Note: stored in %Windir%\Inf %Windir%\System32\DriverStore\FileRepository
  837. # check for valid major and minor versions: 101h - 303h
  838. 0 leshort&0xFcFc =0x0000
  839. # GRR: line above (strength 50) is too general as it catches also "PDP-11 UNIX/RT ldp" ./pdp
  840. >0 leshort&0x0303 !0x0000
  841. # test for valid InfStyles: 1 2
  842. >>2 uleshort >0
  843. >>>2 uleshort <3
  844. # look for colon in WinDirPath after PNF header
  845. #>>>>0x59 search/18 :
  846. >>>>0 use PreCompiledInf
  847. 0 name PreCompiledInf
  848. >0 uleshort x Windows Precompiled iNF
  849. !:mime application/x-pnf
  850. !:ext pnf
  851. # major version 1 for older Windows like XP and 3 since about Windows Vista
  852. # 101h~98-XP; 301h~Windows Vista-7 ; 302h~Windows 10 14393; 303h~Windows 10 18362
  853. >1 ubyte x \b, version %u
  854. >0 ubyte x \b.%u
  855. >0 uleshort =0x0101 (Windows
  856. >>4 ulelong&0x00000001 !0x00000001 98)
  857. >>4 ulelong&0x00000001 =0x00000001 XP)
  858. >0 uleshort =0x0301 (Windows Vista-8.1)
  859. >0 uleshort =0x0302 (Windows 10 older)
  860. >0 uleshort =0x0303 (Windows 10)
  861. # 1 ,2 (windows 98 SE)
  862. >2 uleshort !2 \b, InfStyle %u
  863. # PNF_FLAG_IS_UNICODE 0x00000001
  864. # PNF_FLAG_HAS_STRINGS 0x00000002
  865. # PNF_FLAG_SRCPATH_IS_URL 0x00000004
  866. # PNF_FLAG_HAS_VOLATILE_DIRIDS 0x00000008
  867. # PNF_FLAG_INF_VERIFIED 0x00000010
  868. # PNF_FLAG_INF_DIGITALLY_SIGNED 0x00000020
  869. # UNKNOWN8 0x00000080
  870. # UNKNOWN 0x00000100
  871. # UNKNOWN1 0x01000000
  872. # UNKNOWN2 0x02000000
  873. >4 ulelong&0x03000180 >0 \b, flags
  874. >>4 ulelong x %#x
  875. >4 ulelong&0x00000001 0x00000001 \b, unicoded
  876. >4 ulelong&0x00000002 0x00000002 \b, has strings
  877. >4 ulelong&0x00000004 0x00000004 \b, src URL
  878. >4 ulelong&0x00000008 0x00000008 \b, volatile dir ids
  879. >4 ulelong&0x00000010 0x00000010 \b, verified
  880. >4 ulelong&0x00000020 0x00000020 \b, digitally signed
  881. # >4 ulelong&0x00000080 0x00000080 \b, UNKNOWN8
  882. # >4 ulelong&0x00000100 0x00000100 \b, UNKNOWN
  883. # >4 ulelong&0x01000000 0x01000000 \b, UNKNOWN1
  884. # >4 ulelong&0x02000000 0x02000000 \b, UNKNOWN2
  885. #>8 ulelong x \b, InfSubstValueListOffset %#x
  886. # many 0, 1 lmouusb.PNF, 2 linkfx10.PNF , f webfdr16.PNF
  887. # , 6 bth.PNF, 9 usbport.PNF, d netnwifi.PNF, 10h nettcpip.PNF
  888. #>12 uleshort x \b, InfSubstValueCount %#x
  889. # only < 9 found: 8 hcw85b64.PNF
  890. #>14 uleshort x \b, InfVersionDatumCount %#x
  891. # only found values lower 0x0000ffff ??
  892. #>16 ulelong x \b, InfVersionDataSize %#x
  893. # only found positive values lower 0x00ffFFff for InfVersionDataOffset
  894. >20 ulelong x \b, at %#x
  895. >4 ulelong&0x00000001 =0x00000001
  896. # case independent: CatalogFile Class DriverVer layoutfile LayoutFile SetupClass signature Signature
  897. >>(20.l) lestring16 x "%s"
  898. >4 ulelong&0x00000001 !0x00000001
  899. >>(20.l) string x "%s"
  900. # FILETIME is number of 100-nanosecond intervals since 1 January 1601
  901. #>24 ulequad x \b, InfVersionLastWriteTime %16.16llx
  902. #>24 foodate-0xbar x \b, InfVersionLastWriteTime %s
  903. # for Windows 98, XP
  904. >0 uleshort <0x0102
  905. # only found values lower 0x00ffFFff
  906. # often 70 but also 78h for corelist.PNF
  907. # >>32 ulelong x \b, StringTableBlockOffset %#x
  908. # >>36 ulelong x \b, StringTableBlockSize %#x
  909. # >>40 ulelong x \b, InfSectionCount %#x
  910. # >>44 ulelong x \b, InfSectionBlockOffset %#x
  911. # >>48 ulelong x \b, InfSectionBlockSize %#x
  912. # >>52 ulelong x \b, InfLineBlockOffset %#x
  913. # >>56 ulelong x \b, InfLineBlockSize %#x
  914. # >>60 ulelong x \b, InfValueBlockOffset %#x
  915. # >>64 ulelong x \b, InfValueBlockSize %#x
  916. # WinDirPathOffset
  917. # like 58h, which means direct after PNF header
  918. #>>68 ulelong x \b, at %#x
  919. >>68 ulelong x
  920. >>>4 ulelong&0x00000001 =0x00000001
  921. #>>>>(68.l) ubequad =0x43003a005c005700
  922. # normally unicoded C:\Windows
  923. #>>>>>(68.l) lestring16 x \b, WinDirPath "%s"
  924. >>>>(68.l) ubequad !0x43003a005c005700
  925. >>>>>(68.l) lestring16 x \b, WinDirPath "%s"
  926. >>>4 ulelong&0x00000001 !0x00000001
  927. # normally ASCII C:\WINDOWS
  928. #>>>>(68.l) string =C:\\WINDOWS \b, WinDirPath "%s"
  929. >>>>(68.l) string !C:\\WINDOWS
  930. >>>>>(68.l) string x \b, WinDirPath "%s"
  931. # found OsLoaderPathOffset values often 0 , once 70h corelist.PNF, once 68h ASCII machine.PNF
  932. >>>72 ulelong >0 \b,
  933. >>>>4 ulelong&0x00000001 =0x00000001
  934. >>>>>(72.l) lestring16 x OsLoaderPath "%s"
  935. >>>>4 ulelong&0x00000001 !0x00000001
  936. # seldom C:\ instead empty
  937. >>>>>(72.l) string x OsLoaderPath "%s"
  938. # 1fdh
  939. #>>>76 uleshort x \b, StringTableHashBucketCount %#x
  940. # only 407h found
  941. >>>78 uleshort !0x409 \b, LanguageID %x
  942. #>>>78 uleshort =0x409 \b, LanguageID %x
  943. # InfSourcePathOffset often 0
  944. >>>80 ulelong >0 \b, at %#x
  945. >>>>4 ulelong&0x00000001 =0x00000001
  946. >>>>>(80.l) lestring16 x SourcePath "%s"
  947. >>>>4 ulelong&0x00000001 !0x00000001
  948. >>>>>(80.l) string >\0 SourcePath "%s"
  949. # OriginalInfNameOffset often 0
  950. >>>84 ulelong >0 \b, at %#x
  951. >>>>4 ulelong&0x00000001 =0x00000001
  952. >>>>>(84.l) lestring16 x InfName "%s"
  953. >>>>4 ulelong&0x00000001 !0x00000001
  954. >>>>>(84.l) string >\0 InfName "%s"
  955. # for newer Windows like Vista, 7 , 8.1 , 10
  956. >0 uleshort >0x0101
  957. >>80 ulelong x \b, at %#x WinDirPath
  958. >>>4 ulelong&0x00000001 0x00000001
  959. # normally unicoded C:\Windows
  960. #>>>>(80.l) ubequad =0x43003a005c005700
  961. #>>>>>(80.l) lestring16 x "%s"
  962. >>>>(80.l) ubequad !0x43003a005c005700
  963. >>>>>(80.l) lestring16 x "%s"
  964. # language id: 0 407h~german 409h~English_US
  965. >>90 uleshort !0x409 \b, LanguageID %x
  966. #>>90 uleshort =0x409 \b, LanguageID %x
  967. >>92 ulelong >0 \b, at %#x
  968. >>>4 ulelong&0x00000001 0x00000001
  969. # language string like: de-DE en-US
  970. >>>>(92.l) lestring16 x language %s
  971. # Summary: backup file created with utility like NTBACKUP.EXE shipped with Windows NT/2K/XP/2003
  972. # Extension: .bkf
  973. # Created by: Joerg Jenderek
  974. # URL: https://en.wikipedia.org/wiki/NTBackup
  975. # Reference: http://laytongraphics.com/mtf/MTF_100a.PDF
  976. # Descriptor BloCK name of Microsoft Tape Format
  977. 0 string TAPE
  978. # Format Logical Address is zero
  979. >20 ulequad 0
  980. # Reserved for MBC is zero
  981. >>28 uleshort 0
  982. # Control Block ID is zero
  983. >>>36 ulelong 0
  984. # BIT4-BIT15, BIT18-BIT31 of block attributes are unused
  985. >>>>4 ulelong&0xFFfcFFe0 0 Windows NTbackup archive
  986. #!:mime application/x-ntbackup
  987. !:ext bkf
  988. # OS ID
  989. >>>>>10 ubyte 1 \b NetWare
  990. >>>>>10 ubyte 13 \b NetWare SMS
  991. >>>>>10 ubyte 14 \b NT
  992. >>>>>10 ubyte 24 \b 3
  993. >>>>>10 ubyte 25 \b OS/2
  994. >>>>>10 ubyte 26 \b 95
  995. >>>>>10 ubyte 27 \b Macintosh
  996. >>>>>10 ubyte 28 \b UNIX
  997. # OS Version (2)
  998. #>>>>>11 ubyte x OS V=%x
  999. # MTF_CONTINUATION Media Sequence Number > 1
  1000. #>>>>>4 ulelong&0x00000001 !0 \b, continued
  1001. # MTF_COMPRESSION
  1002. >>>>>4 ulelong&0x00000004 !0 \b, compressed
  1003. # MTF_EOS_AT_EOM End Of Medium was hit during end of set processing
  1004. >>>>>4 ulelong&0x00000008 !0 \b, End Of Medium hit
  1005. >>>>>4 ulelong&0x00020000 0
  1006. # MTF_SET_MAP_EXISTS A Media Based Catalog Set Map may exist on tape
  1007. >>>>>>4 ulelong&0x00010000 !0 \b, with catalog
  1008. # MTF_FDD_ALLOWED However File/Directory Detail can only exist if a Set Map is also present
  1009. >>>>>4 ulelong&0x00020000 !0 \b, with file catalog
  1010. # Offset To First Event 238h,240h,28Ch
  1011. #>>>>>8 uleshort x \b, event offset %4.4x
  1012. # Displayable Size (20e0230h 20e024ch 20e0224h)
  1013. #>>>>>8 ulequad x dis. size %16.16llx
  1014. # Media Family ID (455288C4h 4570BD1Ah 45708F2Fh 4570BBF5h)
  1015. #>>>>>52 ulelong x family ID %8.8x
  1016. # TAPE Attributes (3)
  1017. #>>>>>56 ulelong x TAPE %8.8x
  1018. # Media Sequence Number
  1019. >>>>>60 uleshort >1 \b, sequence %u
  1020. # Password Encryption Algorithm (3)
  1021. >>>>>62 uleshort >0 \b, %#x encrypted
  1022. # Soft Filemark Block Size * 512 (2)
  1023. #>>>>>64 uleshort =2 \b, soft size %u*512
  1024. >>>>>64 uleshort !2 \b, soft size %u*512
  1025. # Media Based Catalog Type (1,2)
  1026. #>>>>>66 uleshort x \b, catalog type %4.4x
  1027. # size of Media Name (66,68,6Eh)
  1028. >>>>>68 uleshort >0
  1029. # offset of Media Name (5Eh)
  1030. >>>>>>70 uleshort >0
  1031. # 0~, 1~ANSI, 2~UNICODE
  1032. >>>>>>>48 ubyte 1
  1033. # size terminated ansi coded string normally followed by "MTF Media Label"
  1034. >>>>>>>>(70.s) string >\0 \b, name: %s
  1035. >>>>>>>48 ubyte 2
  1036. # Not null, but size terminated unicoded string
  1037. >>>>>>>>(70.s) lestring16 x \b, name: %s
  1038. # size of Media Label (104h)
  1039. >>>>>72 uleshort >0
  1040. # offset of Media Label (C4h,C6h,CCh)
  1041. >>>>>74 uleshort >0
  1042. >>>>>>48 ubyte 1
  1043. #Tag|Version|Vendor|Vendor ID|Creation Time Stamp|Cartridge Label|Side|Media ID|Media Domain ID|Vendor Specific fields
  1044. >>>>>>>(74.s) string >\0 \b, label: %s
  1045. >>>>>>48 ubyte 2
  1046. >>>>>>>(74.s) lestring16 x \b, label: %s
  1047. # size of password name (0,1Ch)
  1048. #>>>>>76 uleshort >0 \b, password size %4.4x
  1049. # Software Vendor ID (CBEh)
  1050. >>>>>86 uleshort x \b, software (%#x)
  1051. # size of Software Name (6Eh)
  1052. >>>>>80 uleshort >0
  1053. # offset of Software Name (1C8h,1CAh,1D0h)
  1054. >>>>>>82 uleshort >0
  1055. # 1~ANSI, 2~UNICODE
  1056. >>>>>>>48 ubyte 1
  1057. >>>>>>>>(82.s) string >\0 \b: %s
  1058. >>>>>>>48 ubyte 2
  1059. # size terminated unicoded coded string normally followed by "SPAD"
  1060. >>>>>>>>(82.s) lestring16 x \b: %s
  1061. # Format Logical Block Size (512,1024)
  1062. #>>>>>84 uleshort =1024 \b, block size %u
  1063. >>>>>84 uleshort !1024 \b, block size %u
  1064. # Media Date of MTF_DATE_TIME type with 5 bytes
  1065. #>>>>>>88 ubequad x DATE %16.16llx
  1066. # MTF Major Version (1)
  1067. #>>>>>>93 ubyte x \b, MFT version %x
  1068. #
  1069. # URL: https://en.wikipedia.org/wiki/PaintShop_Pro
  1070. # Reference: https://www.cryer.co.uk/file-types/p/pal.htm
  1071. # Created by: Joerg Jenderek
  1072. # Note: there exist other color palette formats also with .pal extension
  1073. 0 string JASC-PAL\r\n PaintShop Pro color palette
  1074. #!:mime text/plain
  1075. # PspPalette extension is used by newer (probably 8) PaintShopPro versions
  1076. !:ext pal/PspPalette
  1077. # 2nd line contains palette file version. For example "0100"
  1078. >10 string !0100 \b, version %.4s
  1079. # third line contains the number of colours: 16 256 ...
  1080. >16 string x \b, %.3s colors
  1081. # URL: https://en.wikipedia.org/wiki/Innosetup
  1082. # Reference: https://github.com/jrsoftware/issrc/blob/master/Projects/Undo.pas
  1083. # Created by: Joerg Jenderek
  1084. # Note: created by like "InnoSetup self-extracting archive" inside ./msdos
  1085. # TrID labeles the entry as "Inno Setup Uninstall Log"
  1086. # TUninstallLogID
  1087. 0 string Inno\ Setup\ Uninstall\ Log\ (b) InnoSetup Log
  1088. !:mime application/x-innosetup
  1089. # unins000.dat, unins001.dat, ...
  1090. !:ext dat
  1091. # " 64-bit" variant
  1092. >0x1c string >\0 \b%.7s
  1093. # AppName[0x80] like "Minimal SYStem", ClamWin Free Antivirus , ...
  1094. >0xc0 string x %s
  1095. # AppId[0x80] is similar to AppName or
  1096. # GUID like {4BB0DCDC-BC24-49EC-8937-72956C33A470} start with left brace
  1097. >0x40 ubyte 0x7b
  1098. >>0x40 string x %-.38s
  1099. # do not know how this log version correlates to program version
  1100. >0x140 ulelong x \b, version %#x
  1101. # NumRecs
  1102. #>0x144 ulelong x \b, %#4.4x records
  1103. # EndOffset means files size
  1104. >0x148 ulelong x \b, %u bytes
  1105. # Flags 5 25h 35h
  1106. #>0x14c ulelong x \b, flags %8.8x
  1107. # Reserved: array[0..26] of Longint
  1108. # the non Unicode HighestSupportedVersion may never become greater than or equal to 1000
  1109. >0x140 ulelong <1000
  1110. # hostname
  1111. >>0x1d6 pstring x \b, %s
  1112. # user name
  1113. >>>&0 pstring x \b\%s
  1114. # directory like C:\Program Files (x86)\GnuWin32
  1115. >>>>&0 pstring x \b, "%s"
  1116. # version 1000 or higher implies unicode
  1117. >0x140 ulelong >999
  1118. # hostname
  1119. >>0x1db lestring16 x \b, %-.9s
  1120. # utf string variant with prepending fe??ffFFff
  1121. >>0x1db search/43 \xFF\xFF\xFF
  1122. # user name
  1123. >>>&0 lestring16 x \b\%-.9s
  1124. >>>&0 search/43 \xFF\xFF\xFF
  1125. # directory like C:\Program Files\GIMP 2
  1126. >>>>&0 lestring16 x \b, %-.42s
  1127. # URL: https://jrsoftware.org/ishelp/index.php?topic=setup_signeduninstaller
  1128. # Reference:https://github.com/jrsoftware/issrc/blob/main/Projects/Struct.pas
  1129. # From: Joerg Jenderek
  1130. 0 string Inno\ Setup\ Messages\ (
  1131. # null padded til 0x40 boundary
  1132. >0x38 quad 0 InnoSetup messages
  1133. !:mime application/x-innosetup-msg
  1134. # unins000.msg, unins001.msg, ...
  1135. !:ext msg
  1136. # version like 5.1.1 5.1.11 5.5.0 5.5.3 6.0.0
  1137. >>0x15 string x \b, version %.5s
  1138. # look for 6th char of version string or terminating right parentheses
  1139. >>>0x1a ubyte !0x29 \b%c
  1140. # NumMessages
  1141. >>0x40 ulelong x \b, %u messages
  1142. # TotalSize: Cardinal;
  1143. #>>0x44 ulelong x \b, TotalSize %u
  1144. # NotTotalSize: Cardinal;
  1145. #>>0x48 ulelong x \b, NotTotalSize %u
  1146. # CRCMessages: Longint;
  1147. #>>0x4C ulelong x \b, CRC %#x
  1148. >>0x40 ulelong x
  1149. # (u) after version means unicoded messages
  1150. >>>0x1c search/2 (u) (UTF-16),
  1151. >>>>0x50 lestring16 x %s
  1152. # ASCII coded message
  1153. >>>0x1c default x (ASCII),
  1154. >>>>0x50 string x %s
  1155. # Windows Imaging (WIM) Image
  1156. # Update: Joerg Jenderek at Mar 2019, 2021
  1157. # URL: https://en.wikipedia.org/wiki/Windows_Imaging_Format
  1158. # http://fileformats.archiveteam.org/wiki/Windows_Imaging_Format
  1159. # Reference: https://download.microsoft.com/download/f/e/f/
  1160. # fefdc36e-392d-4678-9e4e-771ffa2692ab/Windows%20Imaging%20File%20Format.rtf
  1161. # Note: verified by like `7z t boot.wim` `wiminfo install.esd --header`
  1162. 0 string MSWIM\000\000\000
  1163. >0 use wim-archive
  1164. # https://wimlib.net/man1/wimoptimize.html
  1165. 0 string WLPWM\000\000\000
  1166. >0 use wim-archive
  1167. 0 name wim-archive
  1168. # _WIMHEADER_V1_PACKED ImageTag[8]
  1169. >0 string x Windows imaging
  1170. !:mime application/x-ms-wim
  1171. # TO avoid in file version 5.36 error like
  1172. # Magdir/windows, 760: Warning: Current entry does not yet have a description
  1173. # file: could not find any valid magic files! (No error)
  1174. # split WIM
  1175. >16 ulelong &0x00000008 (SWM
  1176. !:ext swm
  1177. # usPartNumber; 1, unless the file was split into multiple parts
  1178. >>40 uleshort x \b %u
  1179. # usTotalParts; The total number of WIM file parts in a spanned set
  1180. >>42 uleshort x \b of %u) image
  1181. # non split WIM
  1182. >16 ulelong ^0x00000008
  1183. # https://wimlib.net/man1/wimmount.html
  1184. # solid WIMs; version 3584; usually contain LZMS-compressed and the .esd extension
  1185. >>12 ulelong 3584 (ESD) image
  1186. !:ext esd
  1187. >>12 ulelong !3584 (
  1188. # look for archive member RunTime.xml like in Microsoft.Windows.Cosa.Desktop.Client.ppkg
  1189. >>>156 search/68233/s RunTime.xml \bWindows provisioning package)
  1190. !:ext ppkg
  1191. # if is is not a Windows provisioning package, then it is a WIM
  1192. >>>156 default x \bWIM) image
  1193. # second disk image part created by Microsoft's RecoveryDrive.exe has name Reconstruct.WIM2
  1194. !:ext wim/wim2
  1195. >0 string/b WLPWM\000\000\000 \b, wimlib pipable format
  1196. # cbSize size of the WIM header in bytes like 208
  1197. #>8 ulelong x \b, headersize %u
  1198. # dwVersion version of the WIM file 00010d00h~1.13 00000e00h~0.14
  1199. >14 uleshort x v%u
  1200. >13 ubyte x \b.%u
  1201. # dwImageCount; The number of images contained in the WIM file
  1202. >44 ulelong >1 \b, %u images
  1203. # dwBootIndex
  1204. # 1-based index of the bootable image of the WIM, or 0 if no image is bootable
  1205. >0x78 ulelong >0 \b, bootable no. %u
  1206. # dwFlags
  1207. #>16 ulelong x \b, flags %#8.8x
  1208. #define FLAG_HEADER_COMPRESSION 0x00000002
  1209. #define FLAG_HEADER_READONLY 0x00000004
  1210. #define FLAG_HEADER_SPANNED 0x00000008
  1211. #define FLAG_HEADER_RESOURCE_ONLY 0x00000010
  1212. #define FLAG_HEADER_METADATA_ONLY 0x00000020
  1213. #define FLAG_HEADER_WRITE_IN_PROGRESS 0x00000040
  1214. #define FLAG_HEADER_RP_FIX 0x00000080 reparse point fixup
  1215. #define FLAG_HEADER_COMPRESS_RESERVED 0x00010000
  1216. #define FLAG_HEADER_COMPRESS_XPRESS 0x00020000
  1217. #define FLAG_HEADER_COMPRESS_LZX 0x00040000
  1218. #define FLAG_HEADER_COMPRESS_LZMS 0x00080000
  1219. #define FLAG_HEADER_COMPRESS_XPRESS2 0x00100000 wimlib-1.13.0\include\wimlib\header.h
  1220. # XPRESS, with small chunk size
  1221. >16 ulelong &0x00100000 \b, XPRESS2
  1222. >16 ulelong &0x00080000 \b, LZMS
  1223. >16 ulelong &0x00040000 \b, LZX
  1224. >16 ulelong &0x00020000 \b, XPRESS
  1225. >16 ulelong &0x00000002 compressed
  1226. >16 ulelong &0x00000004 \b, read only
  1227. >16 ulelong &0x00000010 \b, resource only
  1228. >16 ulelong &0x00000020 \b, metadata only
  1229. >16 ulelong &0x00000080 \b, reparse point fixup
  1230. #>16 ulelong &0x00010000 \b, RESERVED
  1231. # dwCompressionSize; Uncompressed chunk size for resources or 0 if uncompressed
  1232. #>20 ulelong >0 \b, chunk size %u bytes
  1233. # gWIMGuid
  1234. #>24 ubequad x \b, GUID %#16.16llx
  1235. #>>32 ubequad x \b%16.16llx
  1236. # rhOffsetTable; the location of the resource lookup table
  1237. # wim_reshdr_disk[24]= u8 size_in_wim[7] + u8 flags + le64 offset_in_wim + le64 uncompressed_size
  1238. #>48 ubequad x \b, rhOffsetTable %#16.16llx
  1239. # rhXmlData; the location of the XML data
  1240. #>0x50 ulelong x \b, at %#8.8x
  1241. # NOT WORKING \xff\xfe<\0W\0I\0M\0
  1242. #>(0x50.l) ubequad x \b, xml=%16.16llx
  1243. # rhBootMetadata; the location of the metadata resource
  1244. #>0x60 ubequad x \b, rhBootMetadata %#16.16llx
  1245. # rhIntegrity; the location of integrity table used to verify files
  1246. #>0x7c ubequad x \b, rhIntegrity %#16.16llx
  1247. # Unused[60]
  1248. #>148 ubequad !0 \b,unused %#16.16llx
  1249. #
  1250. # From: Joerg Jenderek
  1251. # URL: https://en.wikipedia.org/wiki/Windows_Easy_Transfer
  1252. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/m/mig.trid.xml
  1253. # Note: called "Windows Easy Transfer migration data" by TrID,
  1254. # "Migration Store" or "EasyTransfer file" by Microsoft
  1255. 0 string 1giM Windows Easy Transfer migration data
  1256. #!:mime application/octet-stream
  1257. !:mime application/x-ms-mig
  1258. !:ext mig
  1259. >0x18 string =MRTS without password
  1260. # data offset with 1 space at end
  1261. >>0x1c ulelong+0x38 x \b, at %#x
  1262. # look for zlib compressed data by ./compress
  1263. >>(0x1c.l+0x38) ubyte x
  1264. >>>&-1 indirect x
  1265. # in password protected examples MRTS comes some bytes further
  1266. >0x18 string !MRTS with password
  1267. # look for first MRTS tag
  1268. >0x18 search/29/b MRTS
  1269. # probably first file name length like 178, ...
  1270. #>>&0 ulelong x \b, 1st length %u
  1271. # URL like File\C:\Users\nutzer\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\desktop.ini
  1272. >>&20 lestring16 x \b, 1st %-s
  1273. # Microsoft SYLK
  1274. # https://en.wikipedia.org/wiki/SYmbolic_LinK_(SYLK)
  1275. # https://outflank.nl/upload/sylksum.txt
  1276. 0 string ID;P Microsoft SYLK program
  1277. >4 string >0 \b, created by %s
  1278. !:ext slk/sylk
  1279. # Summary: Windows Performance Monitor Alert
  1280. # From: Joerg Jenderek
  1281. # URL: https://en.wikipedia.org/wiki/Performance_Monitor
  1282. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/pma.trid.xml
  1283. # Note: called "Windows Performance Monitor Alert" by TrID
  1284. 0 ubelong =0xDC058340
  1285. >4 ubyte =0 Windows Performance Monitor Alert
  1286. #!:mime application/octet-stream
  1287. # https://www.thoughtco.com/mime-types-by-content-type-3469108
  1288. # https://filext.com/file-extension/PAM
  1289. !:mime application/x-perfmon
  1290. #!:mime application/x-ms-pma
  1291. !:ext pma
  1292. # metric type like: "BrowserMetrics" "CrashpadMetrics" "SetupMetrics"
  1293. >>80 string x \b, "%s"
  1294. # From: Joerg Jenderek
  1295. # URL: https://en.wikipedia.org/wiki/InstallShield
  1296. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/i/ins.trid.xml
  1297. # Note: contain also keywords like: BATCH_INSTALL ISVERSION LOGHANDLE SRCDIR SRCDISK WINDIR WINSYSDISK
  1298. 0 ubelong 0xB8C90C00 InstallShield Script
  1299. #!:mime application/octet-stream
  1300. !:mime application/x-installshield-ins
  1301. # like test.ins Setup.ins
  1302. !:ext ins
  1303. # UNKNOWN like: 160034121de07e00 1600341260befe00 16003412e0783700
  1304. # 5000010021083f00 50000100b0335600 50000100cbfdf800 50000100dfbc4700
  1305. #>4 ubequad x \b, at 4 %#16.16llx
  1306. # copyright text like: "Stirling Technologies, Inc. (c) 1990-1994"
  1307. # "InstallSHIELD Software Coporation (c) 1990-1997"
  1308. >13 pstring/h x "%s"
  1309. # look for specific ASCII variable names
  1310. >1 search/0x121/s SRCDIR \b, variable names:
  1311. # 1st like: SRCDIR
  1312. >>&-4 leshort x #%u
  1313. >>&-2 pstring/h x %s
  1314. # 2nd like: SRCDISK
  1315. >>>&0 leshort x #%u
  1316. >>>&2 pstring/h x %s
  1317. # 3rd like: TARGETDISK
  1318. >>>>&0 leshort x #%u
  1319. >>>>&2 pstring/h x %s
  1320. # 4th like: TARGETDIR
  1321. #>>>>>&0 leshort x #%u
  1322. #>>>>>&2 pstring/h x %s
  1323. # 5th like: WINDIR
  1324. #>>>>>>&0 leshort x #%u
  1325. #>>>>>>&2 pstring/h x %s
  1326. # 6th like: WINDISK
  1327. #>>>>>>>&0 leshort x #%u
  1328. #>>>>>>>&2 pstring/h x %s
  1329. # 7th like: WINSYSDIR
  1330. #>>>>>>>>&0 leshort x #%u
  1331. #>>>>>>>>&2 pstring/h x %s
  1332. # ... LOGHANDLE
  1333. >0 ubelong x ...
  1334. #