[File] [PATCH] of Magdir/wordprocessors for Corel WordPerfect dictionary advise *.ADV

Jörg Jenderek joerg.jen.der.ek at gmx.net
Sat Aug 6 23:24:56 UTC 2022


-----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".
In the sub directory there exist more similar files but with other
file name extensions like adv, hyd, icr, lex, mor and sav.

For control reason i look for other Word Perfect files there.
The ADV samples are used for giving advise to user. The file names
are like:
WT21de.adv Wt13de.adv Wt13es.adv Wt13fr.adv wt13us.adv
These start with 2 letter phrase WT followed by digits
which corresponds to Word Perfect version. For version 2021 this
digits are 21 and for an older version i found digits 13. The last
2 capitals obviously correspond to used language. For English we
get uk, de for German, fr for French, nl for Netherlands and so on.
When running file command (version 5.42) on such examples i get an
output like:

WT21de.adv: Unknown Corel/Wordperfect product 34, file type 11, v6.0
Wt13de.adv: Unknown Corel/Wordperfect product 34, file type 11, v6.0
Wt13es.adv: Unknown Corel/Wordperfect product 34, file type 11, v6.0
Wt13fr.adv: Unknown Corel/Wordperfect product 34, file type 11, v6.0
Wt13nl.adv: Unknown Corel/Wordperfect product 34, file type 11, v6.0
wt13kd.adv: Unknown Corel/Wordperfect product 34, file type 11, v6.0
wt13uk.adv: Unknown Corel/Wordperfect product 34, file type 11, v6.0
wt13us.adv: Unknown Corel/Wordperfect product 34, file type 11, v6.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 and the examples are described with high rate
as "WordPerfect dictionary advise" by adv-wp.trid.xml
(See appended trid-v-wordperfect-adv.txt.gz).

Unfortunately i found no information especially about file format
specification for such WordPerfect ADV files. TrID list the used
file name extension and often with -v option the related URL pointing
to some information. This is expressed by comment lines inside
Magdir/wordprocessors like:
# URL:		https://en.wikipedia.org/wiki/WordPerfect
# Reference:	https://github.com/OneWingedShark/WordPerfect/
#		blob/master/doc/SDK_Help/FileFormats/
#		WPFF_DocumentStructure.htm
# Reference:	http://mark0.net/download/triddefs_xml.7z
#		defs/a/adv-wp.trid.xml

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. If sub class is not known as last step the sub class is shown
by line like:
 >8	default x
 >>8	byte	x	Unknown Corel/Wordperfect product %d,
 >>>9	byte	x	file type %d

So for my ADV examples i must insert before lines like:
 >8	byte	34
 >>9	byte	11	Corel WordPerfect dictionary advise
 !:mime	application/x-wordperfect-adv
 !:ext	adv
Instead of generic mime type application/octet-stream i show an user
defined one.

According to unofficial WordPerfect File Format documentation at
offset 16 pointer is stored. So when inspecting this area for ADV
samples we get advise text depending on language like "This is too
informal for most writing." for English examples. Unfortunately
often some tags like 580A comes before pure text. So i show excerpt
from such advise text by additional line like:
 >>>(16.s+16)	string	x	(...%-.33s...)

After applying the above mentioned modifications by patch
file-5.42-wordprocessors-adv.diff then i get a more precise output
like:

WT21de.adv: Corel WordPerfect dictionary advise
	    (...schen Dezimalzahlen und ganzen Za...), v6.0
Wt13de.adv: Corel WordPerfect dictionary advise
	    (...schen Dezimalzahlen und ganzen Za...), v6.0
Wt13es.adv: Corel WordPerfect dictionary advise
	    (...ica porcentaje debe ir inmediatam...), v6.0
Wt13fr.adv: Corel WordPerfect dictionary advise
	    (...rd_ en genre et en nombre dans ce...), v6.0
Wt13nl.adv: Corel WordPerfect dictionary advise
	    (... een hoofdletter. Als dit niet he...), v6.0
wt13kd.adv: Corel WordPerfect dictionary advise
	    (...schen Dezimalzahlen und ganzen Za...), v6.0
wt13uk.adv: Corel WordPerfect dictionary advise
	    (...s too informal for most writing.|...), v6.0
wt13us.adv: Corel WordPerfect dictionary advise
	    (...s too informal for most writing.|...), v6.0

I hope my diff file can be applied in future version of
file utility.

With best wishes
Jörg Jenderek
- --
Jörg Jenderek
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCYu74RwAKCRCv8rHJQhrU
1hgIAJ9Ddvoto6P3j4SXrTx0E4HzxtlK5QCeNBL+ghyLVZxnxTO87XU6O9dnQk8=
=pPQr
-----END PGP SIGNATURE-----
-------------- next part --------------
-- 
File mailing list
File at astron.com
https://mailman.astron.com/mailman/listinfo/file

-------------- next part --------------
--- file-5.42/magic/Magdir/wordprocessors.old	2021-12-06 16:25:22.000000000 +0100
+++ file-5.42/magic/Magdir/wordprocessors	2022-08-07 00:46:18.271993200 +0200
@@ -27,8 +27,11 @@
 !:apple	????AWWP
 !:ext	wps
 
 # Corel/WordPerfect
+# URL:		https://en.wikipedia.org/wiki/WordPerfect
+# Reference:	https://github.com/OneWingedShark/WordPerfect/blob/master/doc/SDK_Help/FileFormats/WPFF_DocumentStructure.htm
+#		http://mark0.net/download/triddefs_xml.7z/defs/w/wp-generic.trid.xml
 0	string	\xffWPC
 # WordPerfect
 >8	byte	1
 >>9	byte	1	WordPerfect macro
@@ -200,8 +203,22 @@
 >8	byte	33
 >>9	byte	10	IntelliTAG (SGML) compiled DTD
 >>9	default	x
 >>>9	byte	x	IntelliTAG: Unknown filetype %d
+# Summary:	Corel WordPerfect WritingTools advise part
+# From:		Joerg Jenderek
+# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/a/adv-wp.trid.xml
+>8	byte	34
+>>9	byte	11	Corel WordPerfect dictionary advise
+#!:mime	application/octet-stream
+!:mime	application/x-wordperfect-adv
+#!:mime	application/vnd.wordperfect.adv
+# like: WT21de.adv Wt13de.adv Wt13es.adv Wt13fr.adv wt13us.adv
+!:ext	adv
+# advise text part often start with tag like: 580A
+#>>>(16.s)	ubequad	x	ADVISE PART %#llx
+# part of advise text like: "This is too informal for most writing."
+>>>(16.s+16)	string	x	(...%-.33s...)
 # everything else
 >8	default x
 >>8	byte	x	Unknown Corel/Wordperfect product %d,
 >>>9	byte	x	file type %d
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.42-wordprocessors-adv.diff.sig
Type: application/octet-stream
Size: 933 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220807/d055b736/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trid-v-wordperfect-adv.txt.gz
Type: application/x-gzip
Size: 718 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220807/d055b736/attachment.bin>


More information about the File mailing list