[File] [PATCH] Magdir/maple help database *.hdb versus XBase index *.cdx
Christos Zoulas
christos at zoulas.com
Sun Aug 15 06:04:45 UTC 2021
On Aug 4, 2:04am, joerg.jen.der.ek at gmx.net (=?UTF-8?Q?J=c3=b6rg_Jenderek?=) wrote:
-- Subject: [File] [PATCH] Magdir/maple help database *.hdb versus XBase inde
Added, thanks!
christos
| This is a multi-part message in MIME format.
| --------------E7A1B5A9770BDBCA1F8026CA
| Content-Type: text/plain; charset=utf-8; format=flowed
| Content-Transfer-Encoding: quoted-printable
|
| Hello,
|
| some days ago i inspected some Maple examples. Now i looked at Maple
| help examples with hdb extension.
|
| When running running file command version 5.40 on such examples and
| related files i get an output like:
|
| algolib.hdb: Maple help database
| exterior.hdb: Maple help database
| hsum.hdb: Maple help database
| LieAlg.hdb: Maple help database
| maple.hdb: Maple help database
| CUSTREG.CDX: Maple help database
| HIGHWAY.CDX: Maple help database
| MailTo.CDX: Maple help database
| PARCEL.CDX: Maple help database
| Security.CDX: Maple help database
|
| With --extension only ??? is displayed and with -i option
| application/octet-stream is shown for examples.
|
| For comparison reason i run the file format identification utility
| TrID ( See https://mark0.net/soft-trid-e.html).
| All HDB examples are described by TrID also as "Maple Help Database"
| by hdb-maple.trid.xml. The CDX examples, which are misidentified by
| file command, are described correctly as "Compound index MS Visual
| FoxPro 7" by cdx-vfp7.trid.xml or as "Sybase iAnywhere index files"
| by sybase-ianywhere-cdx.trid.xml (See appended hdb-trid-v.txt.gz ).
|
| The detection of examples happens by lines inside Magdir/maple like:
| 0 string \000\004\000\000 Maple help database
|
| So 4 bytes are used for detection, but that low value with 3 null
| bytes is obviously not very unique enough. That pattern is also true
| for many xBASE Compound Index files (*.CDX).
|
| Unfortunately i found no file format specification. At least on
| software producer page maplesoft i found a short page about the HDB
| files. So at least i used the information of TrID database for
| further information. That is expressed by additional comment lines likes
| # URL: https://www.maplesoft.com/support/help/maple/view.aspx?
| # path=3DFormats/HDB
| # Ref.: https://mark0.net/download/triddefs_xml.7z
| # /defs/h/hdb-maple.trid.xml
|
| According to TrID definition the HDB examples contain string
| sequences like "Maple Input" and "Maple Output". This should be
| unique enough to distinguish HDB from CDX examples. Unfortunately
| these sequence can occur at "very high" offsets. So i look for
| another test. In many example at fixed 1k range i found keyword
| version. So i use this as first test and if this not possible then i
| look for Maple keyword. So the magic lines now becomes like:
| 0 string \000\004\000\000
| >1028 string version Maple help database
| !:mime application/x-maple-hdb
| !:ext hdb
| >1028 default x
| >>4 search/0xCC41 Maple KEY_Maple help database
| !:mime application/x-maple-hdb
| !:ext hdb
| Furthermore instead of generic mime typ application/octet-stream a
| use defined one is shown.
|
| After applying the above mentioned modifications by patch
| file-5.40-maple-hdb.diff then all HDB examples are still recognized
| and misidentifications of CDX examples vanished like:
|
| algolib.hdb: Maple help database
| exterior.hdb: Maple help database
| hsum.hdb: Maple help database
| LieAlg.hdb: Maple help database
| maple.hdb: Maple help database
| CUSTREG.CDX: data
| HIGHWAY.CDX: data
| MailTo.CDX: data
| PARCEL.CDX: data
| Security.CDX: data
|
| I hope my diff file can be applied in future version of file utility.
|
| I will try to create magic lines for CDX examples in a future session.
|
| With best wishes
| J=C3=B6rg Jenderek
| =2D-
| J=C3=B6rg Jenderek
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| --------------E7A1B5A9770BDBCA1F8026CA
| Content-Type: application/DEFANGED-342; charset="UTF-8"; name="file-5_40-maple-hdb_diff.DEFANGED-342"
| Content-Transfer-Encoding: base64
| Content-Disposition: attachment; filename="file-5_40-maple-hdb_diff.DEFANGED-342"
|
| LS0tIGZpbGUtNS40MC9tYWdpYy9NYWdkaXIvbWFwbGUub2xkCTIwMjEtMDItMjIgMjM6NDk6
| MjQgKzAwMDAKKysrIGZpbGUtNS40MC9tYWdpYy9NYWdkaXIvbWFwbGUJMjAyMS0wOC0wMyAy
| Mzo0MzowNyArMDAwMApAQCAtMTUsNSArMTUsMjIgQEAKIAogIyAuaGRiCi0wCXN0cmluZ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RiCishOmV4dAloZGIKIAogIyAubWhwCg==
|
| --------------E7A1B5A9770BDBCA1F8026CA
| Content-Type: application/DEFANGED-343; name="file-5_40-maple-hdb_diff_sig.DEFANGED-343"
| Content-Transfer-Encoding: base64
| Content-Disposition: attachment; filename="file-5_40-maple-hdb_diff_sig.DEFANGED-343"
|
| owGVlM9r1EAUx2N/CBMq2IsUQZhShNo0mWw2tXXB7faH0pbWQ60iUpHZZLIJm2SGZLab+heo
| eFC8eigIUg9SPAqiHkT0rFbwIvgfKAjiQZxJtu2lFQ0kmeS993nv+14md490K139W9+fvps+
| /mH70JPuL/UBLwiJPmbYph5hJpa+WzfcwPMw+PRG13W4a0cRbgQOWsINN0hQ7mzQ0AWWaZV0
| 09ItC1rlin2mYtlQM8Whapr21/BO6IRulvPQcsUc74TWalAvjY2OQU1cBblWU6EKh6AhylN1
| E6Q8CeIGWBW+4rQ7dxMsSS70Scigizmu45So2hC8xMQTqYAFSpIGXCCxSxLSzC3LixUAfM5Z
| WkGo3W4beWkp9bjh0AilLcZowpFEFlWjtYC0DZyybJJh7p89T5MI8xTNzU5L4DLxBDt2RDZJ
| FdAIJ03TiAlHLm3HIcUuEtW7LvHS61kUGuM3kFwjHwlxxRQM6WAIoyReoLJ0sOIHKfTyZLCN
| U5gQFmKHuDCIYSG7NAHr65D7pPM8J9vQiRgeMaSEU6p2YPNkrrQZMJhNT108B2doxGgrduG8
| 6FaWDxKOGDOzV2SSkNKmYEg6XCNJGtBY1aol05rYoYPO64NGEpK4wX1IPVgE7GGGqhJkg1ZI
| QipJg+NgtT4KhQozs00TtmKSMeJwof1kS/gPVqIgIhAzFgYO5gKCqLByXZAJjlRtH4ds73OX
| dpJxkC8LDWIeuBVyALLdpkQ0If/bmSZZb9PELcaRiw6aohVpKzKKZFUbpAQnjo/MbGbGLhXN
| 2r9lhQjwDyKKnRL5TL15rUfp71JOHBvsefb74eXhqjLn3Bp4ufMH6O2Su1xRwdGdN32bysZ2
| Wfm2sdL7+uqre89HPh+ufb39YlF50Ec3H2/N3/n5/u2jyY9Tp+fR/V8//gA=
|
| --------------E7A1B5A9770BDBCA1F8026CA
| Content-Type: application/x-gzip;
| name="hdb-trid-v.txt.gz"
| Content-Transfer-Encoding: base64
| Content-Disposition: attachment;
| filename="hdb-trid-v.txt.gz"
|
| H4sICCzYCWECAGhkYi10cmlkLXYudHh0AO1Z227iSBB9R+If6mUlWK3bNpdAkFYbJ2QmmYRR
| FJjs7NOowQ3uwe72tpuL9+u32iYhkcZDVkKbhzQPYOjqS52qU8dl6rWJuh667RY48IHHDK5D
| JjSfc6Zg3SKtDv7euGhCy/Pajn8C5zmMyJ0UmsWxrNeGbM4F11yKDOZyJcIBgN/xvV69Fgga
| 5/9wsSCE1Gv1mll9ADReyJhPSRRO6zU47RPvF2iQq+F5E0Y0xf2vWJzCkGo6pRmDxmnfa5+6
| ftdt9Zs44fE14gkDnacMANdM05jPqDmFu3USs4xTrv/4umcx1SyEL/e3A4i0TrOB6242G1IY
| Z3KuyUwmbrZKU6m0G+EZ3GLIXXO2ITRLt3+kVEe/f5AqoTpz8cAvlk+oWmbmcgCTiBssjB1s
| aAaKpTGd4eZc7Fz0+zDNQUfsucu7GY1fidl97+se4WJ19Kv0kGjFQ7JN4mfnMBBn5eUA/O7T
| SLDSkVTwOPJJMrWAT0yETLHls/mXzojyeGf13ViR70wQNCNsebZItkQw/cz+SmIU7uiiiIKJ
| MQafnJqANmEyuZBJClTNIr5mgPCmimUZ4tCYcuH4N01oYFJ5rv+quMqZZtrJtGI0+VlgMa5z
| RKFEMyO77TXOIlIt3A1fcrc82rfdWBXSGFFHa3Nupzjw8iDirSrAR7iVhD1rfgx4YqxSKRBo
| /NEkZBXUO0dN0nllSB7pxbaaKS6V5Zfll+XX8fkVZavEcstyy3Lr+Ny65SyIF5Zdll2WXcdn
| V5kallyWXJZcRyfXxZfx5P7yI7kYfsXJJ33SMtHAb00Y5wWjeCDyTYSBx3wM2RbmhQeNk17f
| c9vd5gFsDWeyYqGCMJzuFqsig+ELU3EOSyE3ApAOQbimQhtHnkg+zjPNEjxEMBxXJn65q/O0
| ozMLt4cjYp7//DgmNwK/w40UioY/TemWR3yb0m+R0uB7pGOgP7/+7I6CC/wwKjE754KqHHxo
| +F677XZfLQyzaTHzkDBgyTOgpizkdA/x08ZVub4/GQoAhUxTEVIVmsoOTMxkyMXCGHGhZRbt
| iGcGzRVoRUU2x0oLgYZUZmXUfIiZWGCiNnznpN0EOS+sBUUvcZdMS8XC33AVDMIG/UBdMWOk
| KgOeMHD8wwLiv4WAeKRvQj4eTTDWLJHlw+AgNR7uS8alWHCBtwf9vtvvVNeMRDu0mHnQ2W7n
| PxaKF66Wo2dLxkWW0uTM3FEEG6oYun4g44uK+sK8RKEo3A9fh03ANxgqpLXC8nLqto5bXaoT
| /mE7rAJ2vQ0PItrueG+vh1fXH6/+DP7a6WGvVyZXoYemYJo/CnY6OBrDA89WNEbN2t4pCT1T
| XnrdE7fTqkww1CBnPU97h7nUrwTjM5/JmBpMqFhIUYWGKMzwhrU0OzN5lsuVSiTeSKqzJMdA
| x1O5fQVOJuVShiIsRYwsIly7OIlrquW36G+3wINE2nhjinCnLMJW//53/YOe1b/3p3+28h+j
| 8pvlJtI2QrYRso2QFQLbCNlG6F3L4V1wf3F5a/sg2wfZPsjKn+2D3k3hH7PZSnGd207IdkK2
| E7JSYDsh2wm9S0H8F806MBthMgAA
|
| --------------E7A1B5A9770BDBCA1F8026CA
| Content-Type: text/plain; charset="us-ascii"
| MIME-Version: 1.0
| Content-Transfer-Encoding: 7bit
| Content-Disposition: inline
|
| --
| File mailing list
| File at astron.com
| https://mailman.astron.com/mailman/listinfo/file
|
| --------------E7A1B5A9770BDBCA1F8026CA
| Content-Type: text/sanitizer-log; charset="iso-8859-1"
| Content-Transfer-Encoding: 8bit
| Content-Disposition: attachment; filename="sanitizer.log"
|
| This message has been 'sanitized'. This means that potentially
| dangerous content has been rewritten or removed. The following
| log describes which actions were taken.
|
| Sanitizer (start="1628035487"):
| Part (pos="4581"):
| SanitizeFile (filename="unnamed.txt", mimetype="text/plain"):
| Match (names="unnamed.txt", rule="9"):
| Enforced policy: accept
|
| Part (pos="8026"):
| SanitizeFile (filename="file-5.40-maple-hdb.diff", mimetype="text/plain"):
| Match (rule="default"):
| Enforced policy: defang
|
| Replaced mime type with: application/DEFANGED-342
| Replaced file name with: file-5_40-maple-hdb_diff.DEFANGED-342
|
| Part (pos="9546"):
| SanitizeFile (filename="file-5.40-maple-hdb.diff.sig", mimetype="application/octet-stream"):
| Match (rule="default"):
| Enforced policy: defang
|
| Replaced mime type with: application/DEFANGED-343
| Replaced file name with: file-5_40-maple-hdb_diff_sig.DEFANGED-343
|
| Part (pos="10708"):
| SanitizeFile (filename="hdb-trid-v.txt.gz", mimetype="application/x-gzip"):
| Match (names="hdb-trid-v.txt.gz", rule="9"):
| Enforced policy: accept
|
| Part (pos="12540"):
| SanitizeFile (filename="unnamed.txt", mimetype="text/plain"):
| Match (names="unnamed.txt", rule="9"):
| Enforced policy: accept
|
| Total modifications so far: 2
|
|
| Anomy 0.0.0 : Sanitizer.pm
| $Id: Sanitizer.pm,v 1.94 2006/01/02 16:43:10 bre Exp $
|
| --------------E7A1B5A9770BDBCA1F8026CA--
-- End of excerpt from =?UTF-8?Q?J=c3=b6rg_Jenderek?=
More information about the File
mailing list