xref: /freebsd/contrib/file/magic/Magdir/os2 (revision a4d6d3b8910f3805eebcd8703e11e066aad2e2a1)
1b6cee71dSXin LI
2b6cee71dSXin LI#------------------------------------------------------------------------------
3*a4d6d3b8SXin LI# $File: os2,v 1.14 2022/03/21 21:25:50 christos Exp $
4b6cee71dSXin LI# os2:  file(1) magic for OS/2 files
5b6cee71dSXin LI#
6b6cee71dSXin LI
7b6cee71dSXin LI# Provided 1998/08/22 by
8b6cee71dSXin LI# David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
920f8619dSXin LI1	search/100	InternetShortcut	MS Windows 95 Internet shortcut text
10*a4d6d3b8SXin LI!:mime	application/x-mswinurl
11*a4d6d3b8SXin LI!:ext	url
125f0216bdSXin LI>17	search/100	URL= 			(URL=<
135f0216bdSXin LI>>&0	string		x			\b%s>)
14b6cee71dSXin LI
15b6cee71dSXin LI# OS/2 URL objects
16b6cee71dSXin LI# Provided 1998/08/22 by
17b6cee71dSXin LI# David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
18b6cee71dSXin LI#0	string	http:			OS/2 URL object text
19b6cee71dSXin LI#>5	string	>\			(WWW) <http:%s>
20b6cee71dSXin LI#0	string	mailto:			OS/2 URL object text
21b6cee71dSXin LI#>7	string	>\			(email) <%s>
22b6cee71dSXin LI#0	string	news:			OS/2 URL object text
23b6cee71dSXin LI#>5	string	>\			(Usenet) <%s>
24b6cee71dSXin LI#0	string	ftp:			OS/2 URL object text
25b6cee71dSXin LI#>4	string	>\			(FTP) <ftp:%s>
26b6cee71dSXin LI#0	string	file:			OS/2 URL object text
27b6cee71dSXin LI#>5	string	>\			(Local file) <%s>
28b6cee71dSXin LI
29b6cee71dSXin LI# >>>>> OS/2 INF/HLP <<<<<  (source: Daniel Dissett ddissett@netcom.com)
3043a5ec4eSXin LI# URL:		http://fileformats.archiveteam.org/wiki/INF/HLP_(OS/2)
3143a5ec4eSXin LI# Reference:	http://www.edm2.com/0308/inf.html
32b6cee71dSXin LI# Carl Hauser (chauser.parc@xerox.com) and
33b6cee71dSXin LI# Marcus Groeber (marcusg@ph-cip.uni-koeln.de)
34b6cee71dSXin LI# list the following header format in inf02a.doc:
35b6cee71dSXin LI#
36b6cee71dSXin LI#  int16 ID;           // ID magic word (5348h = "HS")
37b6cee71dSXin LI#  int8  unknown1;     // unknown purpose, could be third letter of ID
38b6cee71dSXin LI#  int8  flags;        // probably a flag word...
39b6cee71dSXin LI#                      //  bit 0: set if INF style file
40b6cee71dSXin LI#                      //  bit 4: set if HLP style file
41b6cee71dSXin LI#                      // patching this byte allows reading HLP files
42b6cee71dSXin LI#                      // using the VIEW command, while help files
43b6cee71dSXin LI#                      // seem to work with INF settings here as well.
44b6cee71dSXin LI#  int16 hdrsize;      // total size of header
45b6cee71dSXin LI#  int16 unknown2;     // unknown purpose
46b6cee71dSXin LI#
47b6cee71dSXin LI0   string  HSP\x01\x9b\x00 OS/2 INF
4843a5ec4eSXin LI!:mime	application/x-os2-inf
4943a5ec4eSXin LI!:ext	inf
50b6cee71dSXin LI>107 string >0                      (%s)
51b6cee71dSXin LI0   string  HSP\x10\x9b\x00     OS/2 HLP
5243a5ec4eSXin LI!:mime	application/x-os2-hlp
5343a5ec4eSXin LI!:ext	hlp
54b6cee71dSXin LI>107 string >0                      (%s)
55b6cee71dSXin LI
5643a5ec4eSXin LI# From:		Joerg Jenderek
5743a5ec4eSXin LI# URL:		http://fileformats.archiveteam.org/wiki/MSG_(OS/2)
5843a5ec4eSXin LI# Reference:	https://github.com/OS2World/UTIL-SYSTEM-MKMSGF/blob/master/mkmsgf.h
5943a5ec4eSXin LI# Note:		created by MKMSGF.EXE. Text source can be recreated by E_MSGF
6043a5ec4eSXin LI#		example like OS001H.MSG
6143a5ec4eSXin LI0	string			\xffMKMSGF\0	OS/2 help message
6243a5ec4eSXin LI!:mime	application/x-os2-msg
6343a5ec4eSXin LI!:ext	msg
6443a5ec4eSXin LI# identifier[3] like: DOS NET REX SYS ...
6543a5ec4eSXin LI>8	string				x	'%.3s'
6643a5ec4eSXin LI# msgnumber: number of messages
6743a5ec4eSXin LI>11	uleshort			x	\b, %u messages
6843a5ec4eSXin LI# firstmsgnumber; number of the first message like: some times 0 often 1 169 1000 3502
6943a5ec4eSXin LI>13	uleshort      			>1	\b, 1st number %u
7043a5ec4eSXin LI# offset16bit; 1~Index table has 16-bit offsets (files<64k) 0~Index table has 32-bit offsets
7143a5ec4eSXin LI>15	ubyte				=0	\b, 32-bit
7243a5ec4eSXin LI#>15	ubyte				=1	\b, 16-bit
7343a5ec4eSXin LI# version; file version: 2~new 0~old
7443a5ec4eSXin LI>16	uleshort      			!2	\b, version %u
7543a5ec4eSXin LI# indextaboffset; offset of index table: 1F~after header 0~no index table for version 0?
7643a5ec4eSXin LI>18	uleshort			>0
7743a5ec4eSXin LI>>18		uleshort		!0x1f	\b, at %#x index
7843a5ec4eSXin LI#	32-bit offset
7943a5ec4eSXin LI>>15		ubyte			=0
8043a5ec4eSXin LI# offset with message table
8143a5ec4eSXin LI>>>(18.s)		ulelong		x	\b, at %#x
8243a5ec4eSXin LI# 1st message
8343a5ec4eSXin LI# http://www.os2museum.com/files/docs/os210ptk/os2-1.0-ptk-tools-1988.pdf
8443a5ec4eSXin LI# message type: E~Error H~Help I~Information P~Prompt W~Warning ?
8543a5ec4eSXin LI>>>>(&-4.l)		ubyte		x	%c-type
8643a5ec4eSXin LI>>>>>&0			string		x	%s
8743a5ec4eSXin LI#	16-bit offset
8843a5ec4eSXin LI>>15		ubyte			=1
8943a5ec4eSXin LI# msgnum; message number
9043a5ec4eSXin LI>>>(18.s)		uleshort	x	\b, number %u
9143a5ec4eSXin LI# msgindex; offset of message from begin of file
9243a5ec4eSXin LI>>>(18.s+2)		uleshort	x	at %#x
9343a5ec4eSXin LI# message type E H I P W ?
9443a5ec4eSXin LI>>>>(&-2.s)		ubyte		x	%c-type
9543a5ec4eSXin LI# skip newline carriage return
9643a5ec4eSXin LI>>>>>&0			ubeshort	=0x0D0a
9743a5ec4eSXin LI>>>>>>&0		string		x	%s
9843a5ec4eSXin LI>>>>>&0			ubeshort	!0x0D0a
9943a5ec4eSXin LI>>>>>>&-2		string		x	%s
10043a5ec4eSXin LI#		for version 0 index table apparently at offset 1F
10143a5ec4eSXin LI>16	uleshort      			0
10243a5ec4eSXin LI>>15		ubyte			1
10343a5ec4eSXin LI# 1st message 16-bit
10443a5ec4eSXin LI>>>0x1F			uleshort	x	\b, at %#x
10543a5ec4eSXin LI# message type: E~Error H~Help I~Information P~Prompt W~Warning ?
10643a5ec4eSXin LI>>>>(0x1F.s)		ubyte		x	%c-type
10743a5ec4eSXin LI>>>>>&0			string		x	%s
10843a5ec4eSXin LI# 2nd message 16-bit
10943a5ec4eSXin LI>>>0x21			uleshort	x	\b, at %#x
11043a5ec4eSXin LI>>>>(0x21.s)		ubyte		x	%c-type
11143a5ec4eSXin LI>>>>>&0			string		x	%s
11243a5ec4eSXin LI# 3rd message 16-bit
11343a5ec4eSXin LI>>>0x23			uleshort	x	\b, at %#x
11443a5ec4eSXin LI>>>>(0x23.s)		ubyte		x	%c-type
11543a5ec4eSXin LI>>>>>&0			string		x	%s
11643a5ec4eSXin LI#		version 0 32-bit
11743a5ec4eSXin LI>>15		ubyte			0
11843a5ec4eSXin LI# 1st message 32-bit
11943a5ec4eSXin LI>>>0x1f			ulelong		x	\b, at %#x
12043a5ec4eSXin LI>>>>(0x1F.l)		ubyte		x	%c-type
12143a5ec4eSXin LI>>>>>&0			string		x	%s
12243a5ec4eSXin LI# 2nd message 32-bit
12343a5ec4eSXin LI>>>0x23			ulelong		x	\b, at %#x
12443a5ec4eSXin LI>>>>(0x23.l)		ubyte		x	%c-type
12543a5ec4eSXin LI>>>>>&0			string		x	%s
12643a5ec4eSXin LI# 3rd message 32-bit
12743a5ec4eSXin LI>>>0x27			ulelong		x	\b, AT %#x
12843a5ec4eSXin LI>>>>(0x27.l)		ubyte		x	 %c-type
12943a5ec4eSXin LI>>>>>&0			string		x	%s
13043a5ec4eSXin LI# countryinfo; offset of country info block: 0 for version 0
13143a5ec4eSXin LI>20	uleshort			!0	\b, at %#x countryinfo
13243a5ec4eSXin LI# nextcoutryinfo
13343a5ec4eSXin LI>>22		uleshort		>0	\b, at %#x next
13443a5ec4eSXin LI# reserved[5]; Must be 0
13543a5ec4eSXin LI>>25	ulelong		!0		\b, RESERVED %#x
13643a5ec4eSXin LI>>(20.s) use				os2-msg-info
13743a5ec4eSXin LI#	display country info block of MKMSGF message file
13843a5ec4eSXin LI0	name		os2-msg-info
13943a5ec4eSXin LI# bytesperchar; bytes per char: 1~SBCS 2~DBCS
14043a5ec4eSXin LI>0	ubyte		>1		\b, %u bytes/char
14143a5ec4eSXin LI# reserved; Not known
14243a5ec4eSXin LI>1	uleshort	!0		\b, reserved %#x
14343a5ec4eSXin LI# langfamilyID; language family ID like: 0~? 1~Arabic ... 7~German ... 9~English  ... 34~Slovene
14443a5ec4eSXin LI>3	uleshort	>0		\b, language %u
14543a5ec4eSXin LI# langversionID; like: 7_1~German 7_2~Swiss German 12_1~French 12_3~Canadian French
14643a5ec4eSXin LI>>5	uleshort	x		\b_%u
14743a5ec4eSXin LI# langfamilyID too high. This should not happen
14843a5ec4eSXin LI>3	uleshort	>34		(invalid language)
14943a5ec4eSXin LI# codepagesnumber; number of codepages like: 1 2 ... 16
15043a5ec4eSXin LI>7	uleshort	x		\b, %u code page
15143a5ec4eSXin LI# plural s
15243a5ec4eSXin LI>7	uleshort	>1		\bs
15343a5ec4eSXin LI# too many number of codepages. This should not happen
15443a5ec4eSXin LI>7	uleshort	>16		(Too many)
15543a5ec4eSXin LI# codepages[16]; codepages list like 437 850 ...
15643a5ec4eSXin LI>7	uleshort	<17
15743a5ec4eSXin LI# 1st code page
15843a5ec4eSXin LI>>9	uleshort	>0		%u
15943a5ec4eSXin LI# possible 2nd code page number
16043a5ec4eSXin LI>>>7	uleshort	>1
16143a5ec4eSXin LI>>>>11	uleshort	x		%u
16243a5ec4eSXin LI# filename[260]; name of file like: dbaseos2.msg dde4c01e.msg os2ldr.mgr xdfh.msg ...
16343a5ec4eSXin LI>41	string		x	 	\b, %s
16443a5ec4eSXin LI
165b6cee71dSXin LI# OS/2 INI (this is a guess)
166b6cee71dSXin LI0  string   \xff\xff\xff\xff\x14\0\0\0  OS/2 INI
16743a5ec4eSXin LI!:mime	application/x-os2-ini
16843a5ec4eSXin LI!:ext	ini
16943a5ec4eSXin LI
17043a5ec4eSXin LI# From:		Joerg Jenderek
17143a5ec4eSXin LI# URL:		http://warpin.netlabs.org/
17243a5ec4eSXin LI# Reference:    http://mark0.net/download/triddefs_xml.7z/defs/a/ark-wpi.trid.xml
17343a5ec4eSXin LI# Note:		called by TrID "WarpIN Installer"
17443a5ec4eSXin LI# probably magic at the beginning
17543a5ec4eSXin LI0	ubelong		=0x770402BE	WarpIN Installer
17643a5ec4eSXin LI#>4	ubelong		=0x03000000
17743a5ec4eSXin LI#!:mime	application/octet-stream
17843a5ec4eSXin LI!:mime	application/x-os2-wpi
17943a5ec4eSXin LI!:ext	wpi
18043a5ec4eSXin LI# creator program name like: "reserved" or "WIC x.y.z"
18143a5ec4eSXin LI>0x106	string		x		\b, created by %s
18243a5ec4eSXin LI# name like: "reserved" or "OS/2 Netlabs"
18343a5ec4eSXin LI>0x146	string		x		\b, '%s'
18443a5ec4eSXin LI# name like: "N/A" "http://warpin.netlabs.org"
18543a5ec4eSXin LI>0x186	string		x		\b, URL %s
18643a5ec4eSXin LI
187