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