os2 6.3 KB

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