[File] [PATCH] Magdir/wordprocessors for WordPerfect Unknown filetype 42 *.IRS+36 *.VRS+21 *.FIL+41 *.INS

Christos Zoulas christos at zoulas.com
Wed Aug 31 08:01:13 UTC 2022


Committed, thanks!

christos

> On Aug 30, 2022, at 6:18 PM, Jörg Jenderek <joerg.jen.der.ek at gmx.net> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 
> some days ago i send patch for Word Perfect CBT samples. These are
> found in sub directory WritingTools inside Word Perfect program
> directory "c:\Program Files (x86)\Corel\WordPerfect Office 2021".
> 
> For control reason i look for other Word Perfect files there and in
> near directories. These often start with 2 letter phrase WP. That
> apparently is the abbreviation for WordPerfect. The last capitals
> often correspond to used language. For Germany DE is used and for
> English En is used.
> 
> When running file command (version 5.42) on such examples i get an
> output like:
> 
> BUTTRFLY.WPG:     WordPerfect graphic image, v1.0
> FOOTEND.WPM:      WordPerfect macro, v1.1
> HP4L593.ALL:      WordPerfect printer data, v3.3
> SHORTCUT.WPK:     WordPerfect keyboard file, v1.1
> STANDARD.IRS:     Corel WordPerfect: Unknown filetype 42, v5.0
> STANDARD.VRS:     Corel WordPerfect: Unknown filetype 36, v5.0
> WORDPFCT.WPD:     WordPerfect document, v2.1
> WORKBOOK.PRS:     WordPerfect printer data, v3.2
> WP.FIL:           Corel WordPerfect: Unknown filetype 21, v3.0
> WP.MRS:           WordPerfect macro resource data, v1.1
> WP3.wpd:          WordPerfect 3.5 document, v2.2
> WP51.INS:         Corel WordPerfect: Unknown filetype 41, v1.0
> WPHELP.FIL:       WordPerfect help file, v5.0
> WPSMALL.DRS:      WordPerfect driver resource data, v3.3
> test-vax-kbd.bin: Corel WordPerfect: Unknown filetype 4, v7.9
> wpen.qrs:         WordPerfect equation resource data, v1.0
> 
> With --extension option only ??? is displayed. Furthermore with -i
> option for my samples only generic application/octet-stream is shown.
> 
> For comparison reason i run the file format identification utility
> TrID ( See https://mark0.net/soft-trid-e.html). This identifies all
> such examples with low rate as "WordPerfect (generic)" by
> wp-generic.trid.xml. Examples like BUTTRFLY.WPG are described with
> higher rate as "WordPerfect Graphics bitmap" by bitmap-wpg.trid.xml.
> Some examples like FOOTEND.WPM are described as "WordPerfect Macro"
> by wpm-macro.trid.xml and some examples like WORDPFCT.WPD are
> described as "WordPerfect Document (generic)" by wpd-doc-gen.trid.xml
> (See appended trid-v-wordperfect.txt.gz ). TrID often list the used
> file name extension and the related URL pointing to some
> information with -v option.
> 
> The description happens inside Magdir/wordprocessors by starting like
> :
> 0	string	\xffWPC
> So we see that the first 4 bytes are the generic magic for all
> WordPerfect samples. By bytes at offset 8 and 9 sub classification is
> done.
> 
> For QRS samples (like WQ.QRS wpDE.qrs wpen.qrs) this is done by lines
> like:
>> 8	byte	1
>>> 9	byte	30	WordPerfect equation resource data
> After i add new lines like:
> !:mime		application/x-wordperfect-qrs
> !:ext		qrs
>>>> (4.l)	ubyte	x
>>>>> &1		string	>A	(...%-.19s...)
>>>> 4		ulelong	x	\b, at %#x document area
> Instead of generic application/octet-stream i show an user defined
> one. At offset 4 a pointer to document area is stored as 4 byte
> little endian integer. So also show this information (like 17C4h).
> So jump here to that area and show stored equation information ( like
> "Fraction:  x OVER y").
> 
> If sub class is not known as last step the sub class for every
> thing else is shown by lines like:
>>> 9	default x
>>>> 9	byte	x	Corel WordPerfect: Unknown filetype %d
> 
> So for unknown VRS i insert lines. In the unofficial documentation
> WPFF_DocumentStructure.htm that i mentioned in older patches VRS
> files are listed. There for VRS file like STANDARD.VRS type 26 is
> listed and for 36 WPD is listed. Oh, this this seems to be a
> changing accident. Furthermore i looked how other call VRS samples.
> I found something like "Corel WordPerfect video resource device
> driver" or "Video Resource e.g. video device driver - WordPerfect".
> So i choose what seems to fit best the file name suffix.  When
> looking inside sample near the beginning i found string like "IBM
> CGA (& compatibles)". So i know that this classification is
> alright. So i express this by lines like:
>>> 9	byte	36	WordPerfect Video Resource
> !:mime		application/x-wordperfect-vrs
> !:ext		vrs
>>>> 0x20		string	>A	"%.23s"
> 
> After "bad" experience with unofficial WP documentation i changed my
> doing in adding new types like following. There are still more
> unknown file types listed. If i myself found no sample i add the
> file type tests just as comment lines like:
> # External spell code module (WP5.1)
> #>>9	byte	46	WordPerfect external spell
> # external spell dictionary .LEX
> #>>9	byte	47	WordPerfect external spell dictionary
> # Macintosh SOFT graphics file (SOFT (Sequential Object Format)
> #>>9	byte	48	WordPerfect SOFT graphics
> #>>9	byte	49	reserved
> #>>9	byte	50	reserved
> # WPWin 5.1 Application Resource Library added for WPWin 5.1
> #>>9	byte	51	WordPerfect application resource library
> 
> For unknown file types where i found samples i add lines. So after
> VRS samples i add lines for cases like:
>>> 9	byte	4	WordPerfect VAX keyboard definition
>>> 9	byte	21	WordPerfect Overlay file
>>> 9	byte	41	WordPerfect Install options
>>> 9	byte	42	WordPerfect Resource
> 
> After applying the above mentioned modifications by patch
> file-5.42-wordprocessors-wordperfect.diff then i get a more precise
> output and many unknown file types are now recognised like:
> 
> BUTTRFLY.WPG:     WordPerfect graphic image
> 		  , at 0x10 document area, v1.0
> FOOTEND.WPM:      WordPerfect macro, v1.1
> HP4L593.ALL:      WordPerfect printer data, v3.3
> SHORTCUT.WPK:     WordPerfect keyboard file
> 		  , 23381 bytes, v1.1
> STANDARD.IRS:     WordPerfect Resource
> 		  "Mouse Driver (MOUSE.COM)", v5.0
> STANDARD.VRS:     WordPerfect Video Resource
> 		  "IBM CGA (& compatibles)", v5.0
> WORDPFCT.WPD:     WordPerfect document, v2.1
> WORKBOOK.PRS:     WordPerfect printer data
> 		  "Workbook Printer", v3.2
> WP.FIL:           WordPerfect Overlay file, v3.0
> WP.MRS:           WordPerfect macro resource data, v1.1
> WP3.wpd:          WordPerfect 3.5 document, v2.2
> WP51.INS:         WordPerfect Install options
> 		  "C:\WP51\", v1.0
> WPHELP.FIL:       WordPerfect help file, v5.0
> WPSMALL.DRS:      WordPerfect driver resource data, v3.3
> test-vax-kbd.bin: WordPerfect VAX keyboard definition, v7.9
> wpen.qrs:         WordPerfect equation resource data
> 		  (...Fraction:  x OVER y...),
> 		  at 0x17c4 document area, v1.0
> 
> And with --extension option i get in many cases the correct suffix
> like:
> BUTTRFLY.WPG:     wpg
> FOOTEND.WPM:      wpm
> HP4L593.ALL:      all
> SHORTCUT.WPK:     wpk
> STANDARD.IRS:     irs
> STANDARD.VRS:     vrs
> WORDPFCT.WPD:     wpd/wpt/wkb/icr/tut/sty/tst/crs
> WORKBOOK.PRS:     prs
> WP.FIL:           fil
> WP.MRS:           mrs
> WP3.wpd:          wpd
> WP51.INS:         ins
> WPHELP.FIL:       fil
> WPSMALL.DRS:      drs
> test-vax-kbd.bin: ???
> wpen.qrs:         qrs
> 
> I hope my diff file can be applied in future version of
> file utility.
> 
> Unfortunately for WordPerfect document ( file type 10) i found many
> different extensions ( like wpd/wpt/wkb/icr/tut/sty/tst/crs). I do
> not know how to distinguish these different suffix.
> 
> Furthermore the DROID x-fmt-395-signature-id-132.wpg example is
> misidentified as WPG. So additional test ( like check for existing
> document area) for that case must be added. But for that a "complete"
> rewrite of the magic lines must be done.
> 
> With best wishes
> Jörg Jenderek
> - --
> Jörg Jenderek
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> 
> iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCYw4qSgAKCRCv8rHJQhrU
> 1jY6AJ4ps4OUSnjoKNRkUaNcD0+LQx4LTgCgsJLxw7Ny2JWI8WO3N1eGs2/l5kQ=
> =Svfi
> -----END PGP SIGNATURE-----
> <trid-v-wordperfect.txt.gz><file-5_42-wordprocessors-wordperfect_diff.DEFANGED-0><file-5_42-wordprocessors-wordperfect_diff_sig.DEFANGED-1>--
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20220831/55ef2646/attachment-0001.asc>


More information about the File mailing list