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