xref: /freebsd/contrib/file/magic/Magdir/wordprocessors (revision f0d4c2afd65f821b8983152848f4005239ff975a)
1
2#------------------------------------------------------------------------------
3# $File: wordprocessors,v 1.27 2021/12/06 15:05:16 christos Exp $
4# wordprocessors:  file(1) magic fo word processors.
5#
6####### PWP file format used on Smith Corona Personal Word Processors:
72	string	\040\040\040\040\040\040\040\040\040\040\040ML4D\040'92	Smith Corona PWP
8>24	byte	2	\b, single spaced
9>24	byte	3	\b, 1.5 spaced
10>24	byte	4	\b, double spaced
11>25	byte	0x42	\b, letter
12>25	byte	0x54	\b, legal
13>26	byte	0x46	\b, A4
14
15# URL:	http://fileformats.archiveteam.org/wiki/Microsoft_Works_Word_Processor
16# reference:	http://mark0.net/download/triddefs_xml.7z
17#		/defs/w/wps-works-dos.trid.xml
18# From:	Joerg Jenderek
19# Note:	older non OLE 2 Compound based versions
200	ubeshort	=0x01FE
21>112	ubeshort	=0x0100		Microsoft Works 1-3 (DOS) or 2 (Windows) document
22# title like THE GREAT KHAN GAME
23>>0x100	string		x		%s
24!:mime	application/vnd-ms-works
25#!:mime	application/x-msworks
26# https://www.macdisk.com/macsigen.php
27!:apple	????AWWP
28!:ext	wps
29
30# Corel/WordPerfect
310	string	\xffWPC
32# WordPerfect
33>8	byte	1
34>>9	byte	1	WordPerfect macro
35>>9	byte	2	WordPerfect help file
36>>9	byte	3	WordPerfect keyboard file
37>>9	byte	10	WordPerfect document
38>>9	byte	11	WordPerfect dictionary
39>>9	byte	12	WordPerfect thesaurus
40>>9	byte	13	WordPerfect block
41>>9	byte	14	WordPerfect rectangular block
42>>9	byte	15	WordPerfect column block
43>>9	byte	16	WordPerfect printer data
44>>9	byte	19	WordPerfect printer data
45>>9	byte	20	WordPerfect driver resource data
46>>9	byte	22	WordPerfect graphic image
47>>9	byte	23	WordPerfect hyphenation code
48>>9	byte	24	WordPerfect hyphenation data
49>>9	byte	25	WordPerfect macro resource data
50>>9	byte	27	WordPerfect hyphenation lex
51>>9	byte	29	WordPerfect wordlist
52>>9	byte	30	WordPerfect equation resource data
53>>9	byte	33	WordPerfect spell rules
54>>9	byte	34	WordPerfect dictionary rules
55>>9	byte	39	WordPerfect spell rules (Microlytics)
56>>9	byte	43	WordPerfect settings file
57>>9	byte	44	WordPerfect 3.5 document
58>>9	byte	45	WordPerfect 4.2 document
59>>9	byte	69	WordPerfect dialog file
60>>9	byte	76	WordPerfect button bar
61>>9	default x
62>>>9	byte	x	Corel WordPerfect: Unknown filetype %d
63# Corel Shell
64>8	byte	2
65>>9	byte	1	Corel shell macro
66>>9	byte	10	Corel shell definition
67>>9	default x
68>>>9	byte	x	Corel Shell: Unknown filetype %d
69# Corel Notebook
70>8	byte	3
71>>9	byte	1	Corel Notebook macro
72>>9	byte	2	Corel Notebook help file
73>>9	byte	3	Corel Notebook keyboard file
74>>9	byte	10	Corel Notebook definition
75>>9	default	x
76>>>9	byte	x	Corel Notebook: Unknown filetype %d
77# Corel Calculator
78>8	byte	4
79>>9	byte	2	Corel Calculator help file
80>>9	default	x
81>>>9	byte	x	Corel Calculator: Unknown filetype %d
82# Corel File Manager
83>8	byte	5
84>>9	default	x
85>>>9	byte	x	Corel File Manager: Unknown filetype %d
86# Corel Calendar
87>8	byte	6
88>>9	byte 	2	Corel Calendar help file
89>>9	byte 	10	Corel Calendar data file
90>>9	default	x
91>>>9	byte	x	Corel Calendar: Unknown filetype %d
92# Corel Program Editor/Ed Editor
93>8	byte	7
94>>9	byte	1	Corel Editor macro
95>>9	byte	2	Corel Editor help file
96>>9	byte	3	Corel Editor keyboard file
97>>9	byte	25	Corel Editor macro resource file
98>>9	default	x
99>>>9	byte	x	Corel Program Editor/Ed Editor: Unknown filetype %d
100# Corel Macro Editor
101>8	byte	8
102>>9	byte 	1	Corel Macro editor macro
103>>9	byte 	2	Corel Macro editor help file
104>>9	byte	3	Corel Macro editor keyboard file
105>>9	default	x
106>>>9	byte	x	Corel Macro Editor: Unknown filetype %d
107# Corel Plan Perfect
108>8	byte	9
109>>9	default	x
110>>>9	byte	x	Corel Plan Perfect: Unknown filetype %d
111# Corel DataPerfect
112>8	byte	10
113# CHECK: Don't these belong into product 9?
114>>9	byte	1	Corel PlanPerfect macro
115>>9	byte	2	Corel PlanPerfect help file
116>>9	byte	3	Corel PlanPerfect keyboard file
117>>9	byte	10	Corel PlanPerfect worksheet
118>>9	byte	15	Corel PlanPerfect printer definition
119>>9	byte	18	Corel PlanPerfect graphic definition
120>>9	byte	19	Corel PlanPerfect data
121>>9	byte	20	Corel PlanPerfect temporary printer
122>>9	byte	25	Corel PlanPerfect macro resource data
123>>9	default	x
124>>>9	byte	x	Corel DataPerfect: Unknown filetype %d
125# Corel Mail
126>8	byte	11
127>>9	byte	2	Corel Mail help file
128>>9	byte	5	Corel Mail distribution list
129>>9	byte	10	Corel Mail out box
130>>9	byte	11	Corel Mail in box
131>>9	byte	20	Corel Mail users archived mailbox
132>>9	byte	21	Corel Mail archived message database
133>>9	byte	22	Corel Mail archived attachments
134>>9	default	x
135>>>9	byte	x	Corel Mail: Unknown filetype %d
136# Corel Printer
137>8	byte	12
138>>9	byte	11	Corel Printer temporary file
139>>9	default	x
140>>>9	byte	x	Corel Printer: Unknown filetype %d
141# Corel Scheduler
142>8	byte	13
143>>9	byte	2	Corel Scheduler help file
144>>9	byte	10	Corel Scheduler in file
145>>9	byte	11	Corel Scheduler out file
146>>9	default	x
147>>>9	byte	x	Corel Scheduler: Unknown filetype %d
148# Corel WordPerfect Office
149>8	byte	14
150>>9	byte	10	Corel GroupWise settings file
151>>9	byte	17	Corel GroupWise directory services
152>>9	byte	43	Corel GroupWise settings file
153>>9	default	x
154>>>9	byte	x	Corel WordPerfect Office: Unknown filetype %d
155# Corel DrawPerfect
156>8	byte	15
157>>9	default	x
158>>>9	byte	x	Corel DrawPerfect: Unknown filetype %d
159# Corel LetterPerfect
160>8	byte	16
161>>9	default	x
162>>>9	byte	x	Corel LetterPerfect: Unknown filetype %d
163# Corel Terminal
164>8	byte	17
165>>9	byte	10	Corel Terminal resource data
166>>9	byte	11	Corel Terminal resource data
167>>9	byte	43	Corel Terminal resource data
168>>9	default	x
169>>>9	byte	x	Corel Terminal: Unknown filetype %d
170# Corel loadable file
171>8	byte	18
172>>9	byte	10	Corel loadable file
173>>9	byte	11	Corel GUI loadable text
174>>9	byte	12	Corel graphics resource data
175>>9	byte	13	Corel printer settings file
176>>9	byte	14	Corel port definition file
177>>9	byte	15	Corel print queue parameters
178>>9	byte	16	Corel compressed file
179>>9	default	x
180>>>9	byte	x	Corel loadable file: Unknown filetype %d
181>>15	byte	0	\b, optimized for Intel
182>>15	byte	1	\b, optimized for Non-Intel
183# Network service
184>8	byte	20
185>>9	byte	10	Corel Network service msg file
186>>9	byte	11	Corel Network service msg file
187>>9	byte	12	Corel Async gateway login msg
188>>9	byte	14	Corel GroupWise message file
189>>9	default	x
190>>>9	byte	x	Corel Network service: Unknown filetype %d
191# GroupWise
192>8	byte	31
193>>9	byte	20	GroupWise admin domain database
194>>9	byte	21	GroupWise admin host database
195>>9	byte	23	GroupWise admin remote host database
196>>9	byte	24	GroupWise admin ADS deferment data file
197>>9	default	x
198>>>9	byte	x	GroupWise: Unknown filetype %d
199# IntelliTAG
200>8	byte	33
201>>9	byte	10	IntelliTAG (SGML) compiled DTD
202>>9	default	x
203>>>9	byte	x	IntelliTAG: Unknown filetype %d
204# everything else
205>8	default x
206>>8	byte	x	Unknown Corel/Wordperfect product %d,
207>>>9	byte	x	file type %d
208>10	byte	0	\b, v5.
209>10	byte	!0	\b, v%d.
210>11	byte	x	\b%d
211
212# Hangul (Korean) Word Processor File
2130	string	HWP\ Document\ File	Hangul (Korean) Word Processor File 3.0
214
215# CosmicBook, from Benoit Rouits
2160       string  CSBK    Ted Neslson's CosmicBook hypertext file
217
2182       string  EYWR    AmigaWriter file
219
220# chi:  file(1) magic for ChiWriter files
2210       string          \\1cw\          ChiWriter file
222>5      string          >\0             version %s
2230       string          \\1cw           ChiWriter file
224
225# Quark Express from https://www.garykessler.net/library/file_sigs.html
2262	string	IIXPR3			Intel Quark Express Document (English)
2272	string	IIXPRa			Intel Quark Express Document (Korean)
2282	string	MMXPR3			Motorola Quark Express Document (English)
229!:mime	application/x-quark-xpress-3
2302	string	MMXPRa			Motorola Quark Express Document (Korean)
231
232# From:		Joerg Jenderek
233# URL:		http://fileformats.archiveteam.org/wiki/PageMaker
234#		https://en.wikipedia.org/wiki/Adobe_PageMaker
235# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/p
236#		pm4-pagemaker.trid.xml
237#		pm5-pagemaker.trid.xml
238# Note:		since version 6 in 1995 called Adobe PageMaker and
239#		embedded in Compound Document handled by ./ole2compounddocs
240#		mainly tested little endian variant
2414	ubelong		=0x0000FF99
242>0	use		PageMaker
243# big endian variant
2444	ubelong		=0x000099FF
245>0	use		\^PageMaker
246#	display information of Aldus/Adobe PageMaker document/publication
2470	name		PageMaker
248>110	uleshort	<0x0600			Aldus
249>110	uleshort	>0x05FF			Adobe
250>110	uleshort	x			PageMaker
251# "MP" marker for newer version 4 and above according to TrID
252#>108	string		x			\b, MARKER "%.2s"
253# http://www.nationalarchives.gov.uk/pronom/fmt/876
254!:mime		application/vnd.pagemaker
255#!:mime		application/x-pagemaker
256# different file name extensions are used depending on version
257# older version like 3
258>110	uleshort/256	=0			document
259# https://www.macdisk.com/macsigen.php
260!:apple	ALB3ALD3
261# PT3 for template and no example for PageMaker document/publiction with PM3 extension
262!:ext	pm3/pt3
263>110	uleshort/256	=4			document
264!:apple	ALD4ALB4
265# no example for PT4 template
266!:ext	pm4/pt4
267>110	uleshort/256	=5			document
268!:apple	ALD5ALB5
269# no example for PT5 template
270!:ext	pm5/pt5
271>110	uleshort	=0x0600			document
272!:apple	ALD6ALB6
273# PT6 for template
274!:ext	pm6/pt6
275# HOWTO to distinguish version 7 from 6.5 ?
276>110	uleshort	=0x0632			document
277!:apple	AD65AB65
278# no example for T65 template
279!:ext	p65/t65/pmd/pmt
280# version 7 with PMT extension for template
281#!:ext	pmd/pmt
282#!:apple	????PUBF
283# endian marker FF 99 for little endian
284>6	ubyte	=0xFF			\b, little-endian
285>6	ubyte	=0x99			\b, big-endian
286# newer numeric version like: 4 5 6 6.50
287#>110	uleshort	x			\b, VERSION=%#x
288>110	uleshort	>0x03FF
289>>110	uleshort/256	x			\b, version %u
290>>110	uleshort%256	>0			\b.%u
291# older version like 3
292>110	uleshort	<0x0400			\b, maybe version 3
293
294# adobe indesign (document, whatever...) from querkan
2950	belong	0x0606edf5		Adobe InDesign
296>16	string	DOCUMENT		Document
297
298#------------------------------------------------------------------------------
299# ichitaro456: file(1) magic for Just System Word Processor Ichitaro
300#
301# Contributor kenzo-:
302# Reversed-engineered JS Ichitaro magic numbers
303#
304
3050	string		DOC
306>43	byte		0x14	Just System Word Processor Ichitaro v4
307!:mime	application/x-ichitaro4
308>144	string	JDASH		application/x-ichitaro4
309
3100	string		DOC
311>43	byte		0x15	Just System Word Processor Ichitaro v5
312!:mime	application/x-ichitaro5
313
3140	string		DOC
315>43	byte		0x16	Just System Word Processor Ichitaro v6
316!:mime	application/x-ichitaro6
317
318# Type: Freemind mindmap documents
319# From: Jamie Thompson <debian-bugs@jamie-thompson.co.uk>
3200	string/w	\<map\ version	Freemind document
321!:mime	application/x-freemind
322
323# Type: Freeplane mindmap documents
324# From: Felix Natter <fnatter@gmx.net>
3250       string/w        \<map\ version="freeplane  Freeplane document
326!:mime  application/x-freeplane
327
328# Type:        Scribus
329# From:        Werner Fink <werner@suse.de>
3300	string	\<SCRIBUSUTF8\ Version		Scribus Document
3310	string	\<SCRIBUSUTF8NEW\ Version	Scribus Document
332!:mime	application/x-scribus
333
334# help files .hlp compiled from html and used by gfxboot added by Joerg Jenderek
335# markups page=0x04,label=0x12, followed by strings like "opt" or "main" and title=0x14
3360	ulelong&0x8080FFFF	0x00001204	gfxboot compiled html help file
337
338# From:		Joerg Jenderek
339# URL:		https://en.wikipedia.org/wiki/StarOffice
340# Reference:	http://mark0.net/download/triddefs_xml.7z
341#		/defs/t/thm-staroffice.trid.xml
342# Note:		used in Star-, Open- and Libre-Office
343# named as soffice.StarConfigFile.6 or OpenOffice.org configuration by others
3440		ubeshort	0x0400
345# non nil gap
346#>(2.s+8)	ubequad		x		\b, gap %#16.16llx
347# test for null value in gap after theme name maybe unreliable
348#>(2.s+9)	ubyte		0		\b, 0-byte
349# look for keyword GALRESRV near the end
350# "C:\Program Files (x86)\StarOffice6.0\share\gallery\sg27.thm" Navigation, 238 objects
351#>0		search/8415	GALRESRV	\b, GALRESRV found
352# "neues thema6.thm" MorePictures, 315 objects
353#>0		search/19299	GALRESRV	\b, GALRESRV FOUND
354#>2		uleshort	x		\b, name length %u
355# skip file2147.chk by check for positive name length like for sg16.thm "3D"
356>2		uleshort	>0
357# skip dBase printer form T6.PRF with misidentified gallery
358# name :\DBASE\IV\T6.txts by check for 1st object name or RESRV keyword
359# https://www.clicketyclick.dk/databases/xbase/xbase/dbase_ex.zip
360# template/t6/with_data/T6.PRF
361# by first char of object name or RESRV part of keyword GALRESRV
362>>(2.s+13)	ubyte		>0x1F		StarOffice Gallery theme
363!:mime		application/x-stargallery-thm
364# thm is also used for JPEG thumbnail images
365!:ext		thm
366# gallery name often 1 word like: 3D sounds Diagrams Flussdiagramme Fotos
367# or like private://gallery/hidden/imgppt "Cisco - WAN - LAN"
368>>>2		pstring/h	x		%s
369# number of objects
370>>>(2.s+4)	ulelong		x		\b, %u object
371# plural s
372>>>(2.s+4)	ulelong		!1		\bs
373# if available then display first object name
374>>>(2.s+4)	ulelong		>0
375# partial file name, URL or internal name like "dd2*" of 1st object or RESRV
376>>>>(2.s+11)	pstring/h	x		\b, 1st %s
377
378# From:	Joerg Jenderek
379# URL:	http://fileformats.archiveteam.org/wiki/StarOffice_Gallery
380# Note:	used in Star-, Open- and Libre-Office and found in directories like
381#	%APPDATA%\Roaming\LibreOffice\4\user\gallery
382#	$HOME/.config/libreoffice/4/user/gallery
3830	string		SGA3	StarOffice Gallery thumbnails
384# Unknown like 0x04000?0001000142
385#>4	ubequad		x	\b, UNKNOWN %#16.16llx
386#!:mime	application/x-sdg
387!:mime	application/x-stargallery-sdg
388!:ext	sdg
389# display image magic for debugging purpose like 'BM'
390# looking like PC bitmap, Windows 3.x format with unknown compression
391#>11	string		x	\b, image magic '%-.2s'
392# inspect 1st GALLERY thumbnail magic by ./images with 1 space at end
393#>11	indirect	x	\b; contains
394
395