]> granicus.if.org Git - file/commitdiff
From Christoph Biedl:
authorChristos Zoulas <christos@zoulas.com>
Fri, 16 Oct 2015 15:11:07 +0000 (15:11 +0000)
committerChristos Zoulas <christos@zoulas.com>
Fri, 16 Oct 2015 15:11:07 +0000 (15:11 +0000)
The bad news first: Detection of WordPerfect/Corel is quite broken due
to forgotten endianess clarification, and has probably been ever since.
On LE archs, nothing but "(Corel/WP)" is printed.

Time for a clarification and cleanup. Basically, there's a product
(Offset 8) and file type (Offset 9) short, and little information about
their meanings. So I took the old logik and placed it in logical
groups, with some questions about PlanPerfect raised. Perhaps there was
an off-by-one when creating the data? Also, the "loadable file" and
"graphic image" fit into the scheme, no need for extra rules.

There were a few hints in the wp2x sources, and the LibreOffice has
a few sample files in the sources. Not all of them are detected, these
have a completely different header (very old format?).

magic/Magdir/wordprocessors

index 10dd1ee89648db79b7c68d76a077650397366748..c8cb8d564bbfb7763d1650e85d2b8d4f59a65a15 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: wordprocessors,v 1.17 2013/02/06 14:18:52 christos Exp $
+# $File: wordprocessors,v 1.18 2013/06/03 19:07:29 christos Exp $
 # wordprocessors:  file(1) magic fo word processors.
 #
 ####### PWP file format used on Smith Corona Personal Word Processors:
 >25    byte    0x54    \b, legal
 >26    byte    0x46    \b, A4
 
-#WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
-0      string  \377WPC\020\000\000\000\022\012\001\001\000\000\000\000 (WP) loadable file
->15    byte    0       Optimized for Intel
->15    byte    1       Optimized for Non-Intel
-1      string  WPC     (Corel/WP)
->8     short   257     WordPerfect macro
->8     short   258     WordPerfect help file
->8     short   259     WordPerfect keyboard file
->8     short   266     WordPerfect document
->8     short   267     WordPerfect dictionary
->8     short   268     WordPerfect thesaurus
->8     short   269     WordPerfect block
->8     short   270     WordPerfect rectangular block
->8     short   271     WordPerfect column block
->8     short   272     WordPerfect printer data
->8     short   275     WordPerfect printer data
->8     short   276     WordPerfect driver resource data
->8     short   279     WordPerfect hyphenation code
->8     short   280     WordPerfect hyphenation data
->8     short   281     WordPerfect macro resource data
->8     short   283     WordPerfect hyphenation lex
->8     short   285     WordPerfect wordlist
->8     short   286     WordPerfect equation resource data
->8     short   289     WordPerfect spell rules
->8     short   290     WordPerfect dictionary rules
->8     short   295     WordPerfect spell rules (Microlytics)
->8     short   299     WordPerfect settings file
->8     short   301     WordPerfect 4.2 document
->8     short   325     WordPerfect dialog file
->8     short   332     WordPerfect button bar
->8     short   513     Shell macro
->8     short   522     Shell definition
->8     short   769     Notebook macro
->8     short   770     Notebook help file
->8     short   771     Notebook keyboard file
->8     short   778     Notebook definition
->8     short   1026    Calculator help file
->8     short   1538    Calendar help file
->8     short   1546    Calendar data file
->8     short   1793    Editor macro
->8     short   1794    Editor help file
->8     short   1795    Editor keyboard file
->8     short   1817    Editor macro resource file
->8     short   2049    Macro editor macro
->8     short   2050    Macro editor help file
->8     short   2051    Macro editor keyboard file
->8     short   2305    PlanPerfect macro
->8     short   2306    PlanPerfect help file
->8     short   2307    PlanPerfect keyboard file
->8     short   2314    PlanPerfect worksheet
->8     short   2319    PlanPerfect printer definition
->8     short   2322    PlanPerfect graphic definition
->8     short   2323    PlanPerfect data
->8     short   2324    PlanPerfect temporary printer
->8     short   2329    PlanPerfect macro resource data
->8     byte    11      Mail
->8     short   2818    help file
->8     short   2821    distribution list
->8     short   2826    out box
->8     short   2827    in box
->8     short   2836    users archived mailbox
->8     short   2837    archived message database
->8     short   2838    archived attachments
->8     short   3083    Printer temporary file
->8     short   3330    Scheduler help file
->8     short   3338    Scheduler in file
->8     short   3339    Scheduler out file
->8     short   3594    GroupWise settings file
->8     short   3601    GroupWise directory services
->8     short   3627    GroupWise settings file
->8     short   4362    Terminal resource data
->8     short   4363    Terminal resource data
->8     short   4395    Terminal resource data
->8     short   4619    GUI loadable text
->8     short   4620    graphics resource data
->8     short   4621    printer settings file
->8     short   4622    port definition file
->8     short   4623    print queue parameters
->8     short   4624    compressed file
->8     short   5130    Network service msg file
->8     short   5131    Network service msg file
->8     short   5132    Async gateway login msg
->8     short   5134    GroupWise message file
->8     short   7956    GroupWise admin domain database
->8     short   7957    GroupWise admin host database
->8     short   7959    GroupWise admin remote host database
->8     short   7960    GroupWise admin ADS deferment data file
->8     short   8458    IntelliTAG (SGML) compiled DTD
->8     long    18219264        WordPerfect graphic image (1.0)
->8     long    18219520        WordPerfect graphic image (2.0)
-#end of WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
+# Corel/WordPerfect
+0      string  \xffWPC
+# WordPerfect
+>8     byte    1
+>>9    byte    1       WordPerfect macro
+>>9    byte    2       WordPerfect help file
+>>9    byte    3       WordPerfect keyboard file
+>>9    byte    10      WordPerfect document
+>>9    byte    11      WordPerfect dictionary
+>>9    byte    12      WordPerfect thesaurus
+>>9    byte    13      WordPerfect block
+>>9    byte    14      WordPerfect rectangular block
+>>9    byte    15      WordPerfect column block
+>>9    byte    16      WordPerfect printer data
+>>9    byte    19      WordPerfect printer data
+>>9    byte    20      WordPerfect driver resource data
+>>9    byte    22      WordPerfect graphic image
+>>9    byte    23      WordPerfect hyphenation code
+>>9    byte    24      WordPerfect hyphenation data
+>>9    byte    25      WordPerfect macro resource data
+>>9    byte    27      WordPerfect hyphenation lex
+>>9    byte    29      WordPerfect wordlist
+>>9    byte    30      WordPerfect equation resource data
+>>9    byte    33      WordPerfect spell rules
+>>9    byte    34      WordPerfect dictionary rules
+>>9    byte    39      WordPerfect spell rules (Microlytics)
+>>9    byte    43      WordPerfect settings file
+>>9    byte    44      WordPerfect 3.5 document
+>>9    byte    45      WordPerfect 4.2 document
+>>9    byte    69      WordPerfect dialog file
+>>9    byte    76      WordPerfect button bar
+>>9    default x
+>>>9   byte    x       Corel WordPerfect: Unknown filetype %d
+# Corel Shell
+>8     byte    2
+>>9    byte    1       Corel shell macro
+>>9    byte    10      Corel shell definition
+>>9    default x
+>>>9   byte    x       Corel Shell: Unknown filetype %d
+# Corel Notebook
+>8     byte    3
+>>9    byte    1       Corel Notebook macro
+>>9    byte    2       Corel Notebook help file
+>>9    byte    3       Corel Notebook keyboard file
+>>9    byte    10      Corel Notebook definition
+>>9    default x
+>>>9   byte    x       Corel Notebook: Unknown filetype %d
+# Corel Calculator
+>8     byte    4
+>>9    byte    2       Corel Calculator help file
+>>9    default x
+>>>9   byte    x       Corel Calculator: Unknown filetype %d
+# Corel File Manager
+>8     byte    5
+>>9    default x
+>>>9   byte    x       Corel File Manager: Unknown filetype %d
+# Corel Calendar
+>8     byte    6
+>>9    byte    2       Corel Calendar help file
+>>9    byte    10      Corel Calendar data file
+>>9    default x
+>>>9   byte    x       Corel Calendar: Unknown filetype %d
+# Corel Program Editor/Ed Editor
+>8     byte    7
+>>9    byte    1       Corel Editor macro
+>>9    byte    2       Corel Editor help file
+>>9    byte    3       Corel Editor keyboard file
+>>9    byte    25      Corel Editor macro resource file
+>>9    default x
+>>>9   byte    x       Corel Program Editor/Ed Editor: Unknown filetype %d
+# Corel Macro Editor
+>8     byte    8
+>>9    byte    1       Corel Macro editor macro
+>>9    byte    2       Corel Macro editor help file
+>>9    byte    3       Corel Macro editor keyboard file
+>>9    default x
+>>>9   byte    x       Corel Macro Editor: Unknown filetype %d
+# Corel Plan Perfect
+>8     byte    9
+>>9    default x
+>>>9   byte    x       Corel Plan Perfect: Unknown filetype %d
+# Corel DataPerfect
+>8     byte    10
+# CHECK: Don't these belong into product 9?
+>>9    byte    1       Corel PlanPerfect macro
+>>9    byte    2       Corel PlanPerfect help file
+>>9    byte    3       Corel PlanPerfect keyboard file
+>>9    byte    10      Corel PlanPerfect worksheet
+>>9    byte    15      Corel PlanPerfect printer definition
+>>9    byte    18      Corel PlanPerfect graphic definition
+>>9    byte    19      Corel PlanPerfect data
+>>9    byte    20      Corel PlanPerfect temporary printer
+>>9    byte    25      Corel PlanPerfect macro resource data
+>>9    default x
+>>>9   byte    x       Corel DataPerfect: Unknown filetype %d
+# Corel Mail
+>8     byte    11
+>>9    byte    2       Corel Mail help file
+>>9    byte    5       Corel Mail distribution list
+>>9    byte    10      Corel Mail out box
+>>9    byte    11      Corel Mail in box
+>>9    byte    20      Corel Mail users archived mailbox
+>>9    byte    21      Corel Mail archived message database
+>>9    byte    22      Corel Mail archived attachments
+>>9    default x
+>>>9   byte    x       Corel Mail: Unknown filetype %d
+# Corel Printer
+>8     byte    12
+>>9    byte    11      Corel Printer temporary file
+>>9    default x
+>>>9   byte    x       Corel Printer: Unknown filetype %d
+# Corel Scheduler
+>8     byte    13
+>>9    byte    2       Corel Scheduler help file
+>>9    byte    10      Corel Scheduler in file
+>>9    byte    11      Corel Scheduler out file
+>>9    default x
+>>>9   byte    x       Corel Scheduler: Unknown filetype %d
+# Corel WordPerfect Office
+>8     byte    14
+>>9    byte    10      Corel GroupWise settings file
+>>9    byte    17      Corel GroupWise directory services
+>>9    byte    43      Corel GroupWise settings file
+>>9    default x
+>>>9   byte    x       Corel WordPerfect Office: Unknown filetype %d
+# Corel DrawPerfect
+>8     byte    15
+>>9    default x
+>>>9   byte    x       Corel DrawPerfect: Unknown filetype %d
+# Corel LetterPerfect
+>8     byte    16
+>>9    default x
+>>>9   byte    x       Corel LetterPerfect: Unknown filetype %d
+# Corel Terminal
+>8     byte    17
+>>9    byte    10      Corel Terminal resource data
+>>9    byte    11      Corel Terminal resource data
+>>9    byte    43      Corel Terminal resource data
+>>9    default x
+>>>9   byte    x       Corel Terminal: Unknown filetype %d
+# Corel loadable file
+>8     byte    18
+>>9    byte    10      Corel loadable file
+>>9    byte    11      Corel GUI loadable text
+>>9    byte    12      Corel graphics resource data
+>>9    byte    13      Corel printer settings file
+>>9    byte    14      Corel port definition file
+>>9    byte    15      Corel print queue parameters
+>>9    byte    16      Corel compressed file
+>>9    default x
+>>>9   byte    x       Corel loadable file: Unknown filetype %d
+>>15   byte    0       \b, optimized for Intel
+>>15   byte    1       \b, optimized for Non-Intel
+# Network service
+>8     byte    20
+>>9    byte    10      Corel Network service msg file
+>>9    byte    11      Corel Network service msg file
+>>9    byte    12      Corel Async gateway login msg
+>>9    byte    14      Corel GroupWise message file
+>>9    default x
+>>>9   byte    x       Corel Network service: Unknown filetype %d
+# GroupWise
+>8     byte    31
+>>9    byte    20      GroupWise admin domain database
+>>9    byte    21      GroupWise admin host database
+>>9    byte    23      GroupWise admin remote host database
+>>9    byte    24      GroupWise admin ADS deferment data file
+>>9    default x
+>>>9   byte    x       GroupWise: Unknown filetype %d
+# IntelliTAG
+>8     byte    33
+>>9    byte    10      IntelliTAG (SGML) compiled DTD
+>>9    default x
+>>>9   byte    x       IntelliTAG: Unknown filetype %d
+# everything else
+>8     default x
+>>8    byte    x       Unknown Corel/Wordperfect product %d,
+>>>9   byte    x       file type %d
+>10    byte    0       \b, v5.
+>10    byte    !0      \b, v%d.
+>11    byte    x       \b%d
 
 # Hangul (Korean) Word Processor File
 0      string  HWP\ Document\ File     Hangul (Korean) Word Processor File 3.0