[File] [PATCH] Magdir/ole2compounddocs CorelCAD Drawing *.ccd only described generic

Jörg Jenderek joerg.jen.der.ek at gmx.net
Thu Apr 13 15:53:53 UTC 2023


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

some weeks ago i send patch of Magdir/windows for "CloneCD CD-image
Description", which is accepted and now included inside newest
Magdir. The used extension is 3 byte suffix ccd. Unfortunately this
extension is also used for other file formats like CorelCAD Drawing.

When running file command version 5.44 with -e cdf option on such
48 samples and related files i get an output like:

3DUSENG.CCT:  OLE 2 Compound Document, v3.62, SecID 0x2,
	      Mini FAT start sector 0x5 :
	      UNKNOWN, clsid
	      0x20f414de1cacce11be26db67235e2689
	      {DE14F420-AC1C-11CE-BE26-DB67235E2689}
	      with names
	      Contents ViewInfo CustomViewDescriptions
	      \377\377\3 \377\377\3 \377\377\3
DOG.CCD:      OLE 2 Compound Document, v3.62, SecID 0,
	      12 FAT sectors, Mini FAT start sector 0x2d1 :
	      UNKNOWN, clsid
	      0x20f414de1cacce11be26db67235e2689
	      {DE14F420-AC1C-11CE-BE26-DB67235E2689}
	      with names
	      Contents ViewInfo CustomViewDescriptions
	      \323 \377\377\3 \377\377\3
DOGFVIEW.CCD: OLE 2 Compound Document, v3.62, SecID 0x1,
	      0 Mini FAT sector : UNKNOWN with names
TRUCK.CCD:    OLE 2 Compound Document, v3.62, SecID 0x2,
	      22 FAT sectors, Mini FAT start sector 0x4 :
	      UNKNOWN, clsid
	      0x20f414de1cacce11be26db67235e2689
	      {DE14F420-AC1C-11CE-BE26-DB67235E2689}
	      with names
	      Contents LayerInfo ViewInfo
	      \377\377\3 ! A
USENGTUT.CCT: OLE 2 Compound Document, v3.62, SecID 0x2,
	      Mini FAT start sector 0x5 :
	      UNKNOWN, clsid
	      0x20f414de1cacce11be26db67235e2689
	      {DE14F420-AC1C-11CE-BE26-DB67235E2689}
	      with names
	      Contents ViewInfo CustomViewDescriptions
	      \377\377\3 \377\377\3 \377\377\3

When running file command version 5.44 with -e soft option on such
samples and related files i get an output like:

3DUSENG.CCT:  Composite Document File V2 Document, Little Endian,
	      Os: Windows, Version 4.0, Code page: 1252,
	      Revision Number: 10, Total Editing Time: 48:12,
	      Last Saved Time/Date: Tue Mar 26 18:43:06 1996,
	      Create Time/Date: Fri Mar 22 19:52:18 1996,
	      Number of Pages: 0, Number of Words: 0,
	      Number of Characters: 0,
	      Name of Creating Application: CorelCAD, Security: 0
DOG.CCD:      Composite Document File V2 Document, Little Endian,
	      Os: Windows, Version 4.0, Code page: 1252,
	      Revision Number: 2, Total Editing Time: 43:55,
	      Last Saved Time/Date: Wed Oct 16 18:16:17 1996,
	      Create Time/Date: Tue Apr  9 22:48:04 1996,
	      Number of Pages: 0, Number of Words: 0,
	      Number of Characters: 0,
	      Name of Creating Application: CorelCAD, Security: 0
DOGFVIEW.CCD: Composite Document File V2 Document,
	      Cannot read section info
TRUCK.CCD:    Composite Document File V2 Document, Little Endian,
	      Os: Windows, Version 4.0, Code page: 1252,
	      Revision Number: 5, Total Editing Time: 18:18:18,
	      Last Saved Time/Date: Wed Oct 16 16:39:04 1996,
	      Create Time/Date: Thu Mar 28 19:56:54 1996,
	      Number of Pages: 0, Number of Words: 0,
	      Number of Characters: 0,
	      Name of Creating Application: CorelCAD, Security: 0
USENGTUT.CCT: Composite Document File V2 Document, Little Endian,
	      Os: Windows, Version 4.0, Code page: 1252,
	      Keywords: Tutorial, Comments:
	      Use this template for the CorelCAD Tutorial when
	      asked to use the US Engineering template.,
	      Revision Number: 10, Total Editing Time: 48:12,
	      Last Saved Time/Date: Tue Mar 26 18:43:06 1996,
	      Create Time/Date: Fri Mar 22 19:52:18 1996,
	      Number of Pages: 0, Number of Words: 0,
	      Number of Characters: 0,
	      Name of Creating Application: CorelCAD, Security: 0

Furthermore with -i option only generic application/x-ole-storage or
wrong application/vnd.ms-office is shown. With --extension option
only 3 byte sequence ??? is shown.

For comparison reason i run the file format identification utility
TrID ( See https://mark0.net/soft-trid-e.html). This identifies also
all examples with low priority as "Generic OLE2 / Multistream
Compound" by docfile.trid.xml. All CCD examples except DOGFVIEW.CCD
are described as "CorelCAD Drawing" by ccd-corelcad.trid.xml (See
appended trid-v-ccd.txt.gz).

For comparison reason i also run the file format identification
utility DROID ( See https://sourceforge.net/projects/droid/). This
identifies all examples generic as "OLE2 Compound Document Format" by
PUID fmt/111.

With the help of TrID tool i also found a page about CorelCAD on file
formats archive team web site and on Wikipedia.  That informations
are expressed by comment lines inside Magdir/ole2compounddocs like:
# URL:		http://fileformats.archiveteam.org/wiki/CorelCAD
#		https://en.wikipedia.org/wiki/CorelCAD
# Reference:	http://mark0.net/download/triddefs_xml.7z/
#		defs/c/ccd-corelcad.trid.xml
There also a link to download CorelCAD 30-Day Trial Disc with such
samples is listed.

The drawing are recognized as "OLE 2 Compound Document"
by starting bytes (\320\317\021\340\241\261\032\341) at the beginning
inside Magdir/ole2compounddocs. Obviously there exist no code
fragment to do sub class identification. So the examples are
described as "UNKNOWN". Luckily nearly all examples except
DOGFVIEW.CCD have a Root storage object CLSID. In that case file
command display afterwords this information by a phrase
like 0x20f414de1cacce11be26db67235e2689 or in curly braces format
{DE14F420-AC1C-11CE-BE26-DB67235E2689}.

That means that in branch handling CLSID code must be added. Luckily
file command print also some directory entry names. In this
examples this are words like Contents, ViewInfo,
CustomViewDescriptions and
LayerInfo encoded as UTF-16. These characteristics are also found in
global string section inside TrID definition by lines like:
<String>C'U'S'T'O'M'V'I'E'W'D'E'S'C'R'I'P'T'I'O'N'S</String>
<String>L'A'Y'E'R'I'N'F'O</String>
<String>C'O'N'T'E'N'T'S</String>
<String>V'I'E'W'I'N'F'O</String>

The last entry related to Corel was WordPerfect 9 Graphic. So i add
afterwards and before StarOffice StarWriter 3.0 document section
lines for my inspected examples. That looks like:
 >>88 	ubequad	0xbe26db67235e2689	: Corel
 >>>80 	ubequad	0x20f414de1cacce11	\bCAD Drawing or Template
 !:mime	application/x-corel-cad
 !:ext	ccd/cct

I found no official or often used mime type. So i display an user
defined one. The extension CCD is used for CorelCAD Drawing whereas
the CCT suffix is used for CorelCAD Drawing templates.

After applying the above mentioned modifications by patch
file-5.44-ole2compounddocs-ccd.diff then all nearly all of my
inspected CorelCAD Drawing and templates are now described with more
details. This now looks with -e cdf option like:

3DUSENG.CCT:  OLE 2 Compound Document, v3.62, SecID 0x2,
	      Mini FAT start sector 0x5 :
	      CorelCAD Drawing or Template
DOG.CCD:      OLE 2 Compound Document, v3.62, SecID 0,
	      12 FAT sectors, Mini FAT start sector 0x2d1 :
	      CorelCAD Drawing or Template
DOGFVIEW.CCD: OLE 2 Compound Document, v3.62, SecID 0x1,
	      0 Mini FAT sector : UNKNOWN with names
TRUCK.CCD:    OLE 2 Compound Document, v3.62, SecID 0x2,
	      22 FAT sectors, Mini FAT start sector 0x4 :
	      CorelCAD Drawing or Template
USENGTUT.CCT: OLE 2 Compound Document, v3.62, SecID 0x2,
	      Mini FAT start sector 0x5 :
	      CorelCAD Drawing or Template

With -e cdf and --extension option this now looks like:
3DUSENG.CCT:  ccd/cct
DOG.CCD:      ccd/cct
DOGFVIEW.CCD: ???
TRUCK.CCD:    ccd/cct
USENGTUT.CCT: ccd/cct

I hope my diff file can be applied in future version of file
utility. So unfortunately no ways are described and found by myself
to distinguish templates (*.cct) from pure CorelCAD Drawing (*.ccd).

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+v8rHJQhrU1gUCZDglkQAKCRCv8rHJQhrU
1iOHAKDMwdd40trwAZczk8+jEyNpLFAnAwCgw6XJrEBDQGqp6fH+UzCFEGKtyTU=
=9pqz
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trid-v-ccd.txt.gz
Type: application/x-gzip
Size: 615 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20230413/54ca6065/attachment.bin>
-------------- next part --------------
--- file-5.44/magic/Magdir/ole2compounddocs.old	2022-12-09 16:56:56.000000000 +0100
+++ file-5.44/magic/Magdir/ole2compounddocs	2023-04-13 17:42:36.713487100 +0200
@@ -565,16 +565,29 @@
 >>>80 	ubequad		0x60fe2e4099191b10	9 Graphic
 #!:mime	application/x-wpg
 #!:mime	image/x-wordperfect-graphics
 !:mime	image/x-wpg
 # https://www.macdisk.com/macsigen.php "WPC2" for Wordperfect 2 *.wpd
 !:apple	????WPC9
 !:ext	wpg
 #
+# From:		Joerg Jenderek
+# URL:		http://fileformats.archiveteam.org/wiki/CorelCAD
+#		https://en.wikipedia.org/wiki/CorelCAD
+# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/c/ccd-corelcad.trid.xml
+# Note:		called "CorelCAD Drawing" by TrID and CorelCAD
+# directory entry names like Contents ViewInfo CustomViewDescriptions LayerInfo
+>>88 	ubequad		0xbe26db67235e2689	: Corel
+>>>80 	ubequad		0x20f414de1cacce11	\bCAD Drawing or Template
+#!:mime	application/x-ole-storage
+!:mime	application/x-corel-cad
+# CCT for CorelCAD Template 
+!:ext	ccd/cct
+#
 # URL:	http://fileformats.archiveteam.org/wiki/StarOffice_binary_formats
 >>88 	ubequad		0x996104021c007002	: StarOffice
 >>>80 	ubequad		0x407e5cdc5cb31b10	StarWriter 3.0 document or template
 # https://www.openoffice.org/framework/documentation/mimetypes/mimetypes.html
 !:mime	application/x-starwriter
 !:ext	sdw/vor
 #
 >>>80 	ubequad		0xa03f543fa6b61b10	StarCalc 3.0 spreadsheet or template
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.44-ole2compounddocs-ccd.diff.sig
Type: application/octet-stream
Size: 911 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20230413/54ca6065/attachment.obj>


More information about the File mailing list