os2 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. #------------------------------------------------------------------------------
  2. # $File: os2,v 1.14 2022/03/21 21:25:50 christos Exp $
  3. # os2: file(1) magic for OS/2 files
  4. #
  5. # Provided 1998/08/22 by
  6. # David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
  7. 1 search/100 InternetShortcut MS Windows 95 Internet shortcut text
  8. !:mime application/x-mswinurl
  9. !:ext url
  10. >17 search/100 URL= (URL=<
  11. >>&0 string x \b%s>)
  12. # OS/2 URL objects
  13. # Provided 1998/08/22 by
  14. # David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
  15. #0 string http: OS/2 URL object text
  16. #>5 string >\ (WWW) <http:%s>
  17. #0 string mailto: OS/2 URL object text
  18. #>7 string >\ (email) <%s>
  19. #0 string news: OS/2 URL object text
  20. #>5 string >\ (Usenet) <%s>
  21. #0 string ftp: OS/2 URL object text
  22. #>4 string >\ (FTP) <ftp:%s>
  23. #0 string file: OS/2 URL object text
  24. #>5 string >\ (Local file) <%s>
  25. # >>>>> OS/2 INF/HLP <<<<< (source: Daniel Dissett ddissett@netcom.com)
  26. # URL: http://fileformats.archiveteam.org/wiki/INF/HLP_(OS/2)
  27. # Reference: http://www.edm2.com/0308/inf.html
  28. # Carl Hauser (chauser.parc@xerox.com) and
  29. # Marcus Groeber (marcusg@ph-cip.uni-koeln.de)
  30. # list the following header format in inf02a.doc:
  31. #
  32. # int16 ID; // ID magic word (5348h = "HS")
  33. # int8 unknown1; // unknown purpose, could be third letter of ID
  34. # int8 flags; // probably a flag word...
  35. # // bit 0: set if INF style file
  36. # // bit 4: set if HLP style file
  37. # // patching this byte allows reading HLP files
  38. # // using the VIEW command, while help files
  39. # // seem to work with INF settings here as well.
  40. # int16 hdrsize; // total size of header
  41. # int16 unknown2; // unknown purpose
  42. #
  43. 0 string HSP\x01\x9b\x00 OS/2 INF
  44. !:mime application/x-os2-inf
  45. !:ext inf
  46. >107 string >0 (%s)
  47. 0 string HSP\x10\x9b\x00 OS/2 HLP
  48. !:mime application/x-os2-hlp
  49. !:ext hlp
  50. >107 string >0 (%s)
  51. # From: Joerg Jenderek
  52. # URL: http://fileformats.archiveteam.org/wiki/MSG_(OS/2)
  53. # Reference: https://github.com/OS2World/UTIL-SYSTEM-MKMSGF/blob/master/mkmsgf.h
  54. # Note: created by MKMSGF.EXE. Text source can be recreated by E_MSGF
  55. # example like OS001H.MSG
  56. 0 string \xffMKMSGF\0 OS/2 help message
  57. !:mime application/x-os2-msg
  58. !:ext msg
  59. # identifier[3] like: DOS NET REX SYS ...
  60. >8 string x '%.3s'
  61. # msgnumber: number of messages
  62. >11 uleshort x \b, %u messages
  63. # firstmsgnumber; number of the first message like: some times 0 often 1 169 1000 3502
  64. >13 uleshort >1 \b, 1st number %u
  65. # offset16bit; 1~Index table has 16-bit offsets (files<64k) 0~Index table has 32-bit offsets
  66. >15 ubyte =0 \b, 32-bit
  67. #>15 ubyte =1 \b, 16-bit
  68. # version; file version: 2~new 0~old
  69. >16 uleshort !2 \b, version %u
  70. # indextaboffset; offset of index table: 1F~after header 0~no index table for version 0?
  71. >18 uleshort >0
  72. >>18 uleshort !0x1f \b, at %#x index
  73. # 32-bit offset
  74. >>15 ubyte =0
  75. # offset with message table
  76. >>>(18.s) ulelong x \b, at %#x
  77. # 1st message
  78. # http://www.os2museum.com/files/docs/os210ptk/os2-1.0-ptk-tools-1988.pdf
  79. # message type: E~Error H~Help I~Information P~Prompt W~Warning ?
  80. >>>>(&-4.l) ubyte x %c-type
  81. >>>>>&0 string x %s
  82. # 16-bit offset
  83. >>15 ubyte =1
  84. # msgnum; message number
  85. >>>(18.s) uleshort x \b, number %u
  86. # msgindex; offset of message from begin of file
  87. >>>(18.s+2) uleshort x at %#x
  88. # message type E H I P W ?
  89. >>>>(&-2.s) ubyte x %c-type
  90. # skip newline carriage return
  91. >>>>>&0 ubeshort =0x0D0a
  92. >>>>>>&0 string x %s
  93. >>>>>&0 ubeshort !0x0D0a
  94. >>>>>>&-2 string x %s
  95. # for version 0 index table apparently at offset 1F
  96. >16 uleshort 0
  97. >>15 ubyte 1
  98. # 1st message 16-bit
  99. >>>0x1F uleshort x \b, at %#x
  100. # message type: E~Error H~Help I~Information P~Prompt W~Warning ?
  101. >>>>(0x1F.s) ubyte x %c-type
  102. >>>>>&0 string x %s
  103. # 2nd message 16-bit
  104. >>>0x21 uleshort x \b, at %#x
  105. >>>>(0x21.s) ubyte x %c-type
  106. >>>>>&0 string x %s
  107. # 3rd message 16-bit
  108. >>>0x23 uleshort x \b, at %#x
  109. >>>>(0x23.s) ubyte x %c-type
  110. >>>>>&0 string x %s
  111. # version 0 32-bit
  112. >>15 ubyte 0
  113. # 1st message 32-bit
  114. >>>0x1f ulelong x \b, at %#x
  115. >>>>(0x1F.l) ubyte x %c-type
  116. >>>>>&0 string x %s
  117. # 2nd message 32-bit
  118. >>>0x23 ulelong x \b, at %#x
  119. >>>>(0x23.l) ubyte x %c-type
  120. >>>>>&0 string x %s
  121. # 3rd message 32-bit
  122. >>>0x27 ulelong x \b, AT %#x
  123. >>>>(0x27.l) ubyte x %c-type
  124. >>>>>&0 string x %s
  125. # countryinfo; offset of country info block: 0 for version 0
  126. >20 uleshort !0 \b, at %#x countryinfo
  127. # nextcoutryinfo
  128. >>22 uleshort >0 \b, at %#x next
  129. # reserved[5]; Must be 0
  130. >>25 ulelong !0 \b, RESERVED %#x
  131. >>(20.s) use os2-msg-info
  132. # display country info block of MKMSGF message file
  133. 0 name os2-msg-info
  134. # bytesperchar; bytes per char: 1~SBCS 2~DBCS
  135. >0 ubyte >1 \b, %u bytes/char
  136. # reserved; Not known
  137. >1 uleshort !0 \b, reserved %#x
  138. # langfamilyID; language family ID like: 0~? 1~Arabic ... 7~German ... 9~English ... 34~Slovene
  139. >3 uleshort >0 \b, language %u
  140. # langversionID; like: 7_1~German 7_2~Swiss German 12_1~French 12_3~Canadian French
  141. >>5 uleshort x \b_%u
  142. # langfamilyID too high. This should not happen
  143. >3 uleshort >34 (invalid language)
  144. # codepagesnumber; number of codepages like: 1 2 ... 16
  145. >7 uleshort x \b, %u code page
  146. # plural s
  147. >7 uleshort >1 \bs
  148. # too many number of codepages. This should not happen
  149. >7 uleshort >16 (Too many)
  150. # codepages[16]; codepages list like 437 850 ...
  151. >7 uleshort <17
  152. # 1st code page
  153. >>9 uleshort >0 %u
  154. # possible 2nd code page number
  155. >>>7 uleshort >1
  156. >>>>11 uleshort x %u
  157. # filename[260]; name of file like: dbaseos2.msg dde4c01e.msg os2ldr.mgr xdfh.msg ...
  158. >41 string x \b, %s
  159. # OS/2 INI (this is a guess)
  160. 0 string \xff\xff\xff\xff\x14\0\0\0 OS/2 INI
  161. !:mime application/x-os2-ini
  162. !:ext ini
  163. # From: Joerg Jenderek
  164. # URL: http://warpin.netlabs.org/
  165. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/a/ark-wpi.trid.xml
  166. # Note: called by TrID "WarpIN Installer"
  167. # probably magic at the beginning
  168. 0 ubelong =0x770402BE WarpIN Installer
  169. #>4 ubelong =0x03000000
  170. #!:mime application/octet-stream
  171. !:mime application/x-os2-wpi
  172. !:ext wpi
  173. # creator program name like: "reserved" or "WIC x.y.z"
  174. >0x106 string x \b, created by %s
  175. # name like: "reserved" or "OS/2 Netlabs"
  176. >0x146 string x \b, '%s'
  177. # name like: "N/A" "http://warpin.netlabs.org"
  178. >0x186 string x \b, URL %s