[File] [PATCH] Magdir/maple library *.lib; newer versions + extension
Jörg Jenderek
joerg.jen.der.ek at gmx.net
Sun Aug 29 14:38:48 UTC 2021
Hello,
some days ago i inspected some Maple help examples. Now i looked at
Maple library examples with lib extension.
When running running file command version 5.40 on my examples and
related test files i get an output like:
exterior.lib: data
maple.lib: MIPSEB MIPS-III ECOFF executable not stripped -
version 114.100
test-v4.lib: MapleVr4 library
test-v5.lib: data
Tutors.lib: data
Furthermore with extension option only 3 byte sequences ??? is shown
and with -i option only generic mime type application/octet-stream is
displayed.
For comparison reason i run the file format identification utility
TrID ( See https://mark0.net/soft-trid-e.html).
The detected example test-v4.lib is described by TrID as "Maple V R4
Library" by lib-maple-v-r4.trid.xml. The example test-v5.lib is
described as "Maple V R5 Library" by second definition
lib-maple-v-r5.trid.xml (See appended lib-maple-trid-v.txt.gz ).
It also displays related URL and used file name extension LIB.
For the examples a page about the numeric computing software maple on
Wikipedia was mentioned by TrID as related URL. Unfortunately i found
no file format documentation. So i used TrID definition file as
reference. So this information is now expressed by additional comment
lines inside Magdir/maple like:
# URL: https://en.wikipedia.org/wiki/Maple_(software)
# Reference: http://mark0.net/download/triddefs_xml.7z
# /defs/l/lib-maple-v-r4.trid.xml
The detection of release 4 example happens by lines inside
Magdir/maple like:
0 string \000MVR4\nI MapleVr4 library
According to TrID definition this now becomes like:
# URL: https://en.wikipedia.org/wiki/Maple_(software)
# Reference: http://mark0.net/download/triddefs_xml.7z
# /defs/l/lib-maple-v-r4.trid.xml
0 string \000MVR4\nI MapleVr4 library
!:mime application/x-maple-lib
!:ext lib
Instead of generic mime type application/octet-stream i choose a user
defined one.
According to TrID there exist also a newer "version 5" variant.
Converting the TrID XML constructs this is now expressed by magic
lines like:
# URL: https://en.wikipedia.org/wiki/Maple_(software)
# Reference: http://mark0.net/download/triddefs_xml.7z
# /defs/l/lib-maple-v-r5.trid.xml
0 string \000MVR5\n Maple Vr5 library
!:mime application/x-maple-lib
!:ext lib
For undetected lib examples i get a similar pattern. Here pattern is
found at other offset (1024) and obviously such libraries
are newer version 7. So that is expressed by lines like:
0x400 string M7R0\nI Maple Vr7 library
!:mime application/x-maple-lib
!:ext lib
So i choose as file type description "Maple Vr7 library" in the same
manner as for older versions.
At offset 6 the null terminated library name (like
../Maplets/Tutors.lib /Users/mark/math/Msh/Exterior/1.2/exterior.lib
C:\Maple12/Cliffordlib\maple.lib) is stored. That is expressed by
additional line like:
>5 string x %s
At offset 281 some null terminated strings ( like Exterior Clifford
FunctionArithmetics) are stored. Before at offset 277 the number of
strings is stored as 4 byte integer. In my examples the number was 1,
20 and 40. That information is shown by line like:
>0x115 ulelong x \b, %u string
>0x115 ulelong >1 \bs
>0x119 string x 1st '%s'
After applying the above mentioned modifications by patch
file-5.40-maple-lib.diff then all my newer Maple library examples are
now are described correctly and first like:
exterior.lib: Maple Vr7 library
/Users/mark/math/Msh/Exterior/1.2/exterior.lib,
1 string 1st 'Exterior'
maple.lib: Maple Vr7 library
C:\Maple12/Cliffordlib\maple.lib,
40 strings 1st 'Clifford
MIPSEB MIPS-III ECOFF executable not stripped -
version 114.100
test-v4.lib: Maple Vr4 library
test-v5.lib: Maple Vr5 library
Tutors.lib: Maple Vr7 library
../Maplets/Tutors.lib,
20 strings 1st 'FunctionArithmetics'
I hope my diff file can be applied in future version of file utility.
With best wishes
Jörg Jenderek
--
Jörg Jenderek
-------------- next part --------------
--- file-5.40/magic/Magdir/maple.old 2021-02-22 23:49:24 +0000
+++ file-5.40/magic/Magdir/maple 2021-08-29 14:25:04 +0000
@@ -8,5 +8,40 @@
# maple library .lib
-0 string \000MVR4\nI MapleVr4 library
+# URL: https://en.wikipedia.org/wiki/Maple_(software)
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/l/lib-maple-v-r4.trid.xml
+# Update: Joerg Jenderek
+0 string \000MVR4\nI Maple Vr4 library
+#!:mime application/octet-stream
+!:mime application/x-maple-lib
+!:ext lib
+
+# URL: https://en.wikipedia.org/wiki/Maple_(software)
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/l/lib-maple-v-r5.trid.xml
+# From: Joerg Jenderek
+0 string \000MVR5\n Maple Vr5 library
+#!:mime application/octet-stream
+!:mime application/x-maple-lib
+!:ext lib
+
+# From: Joerg Jenderek
+0x400 string M7R0\nI Maple Vr7 library
+#!:mime application/octet-stream
+!:mime application/x-maple-lib
+!:ext lib
+# null terminated library name like: C:\Maple12/Cliffordlib\maple.lib ../Maplets/Tutors.lib
+>5 string x %s
+# probably library name padding with nil or points (0x2E)
+#>0xF8 uquad x \b, PADDING 0x%16.16llx
+# null terminated strings like: Exterior Clifford FunctionArithmetics
+# like: 1 20 40
+>0x115 ulelong x \b, %u string
+# plural s
+>0x115 ulelong >1 \bs
+>0x119 string x 1st '%s'
+# probably second name section padding with nil or points (0x2E)
+#>0x3F0 uquad x \b, 2nd PADDING 0x%16.16llx
+# line feed separated ASCII string with maximal 79 length
+#>0x407 string x \b, section "%s"
+>0x454 ubyte !0x0a \b, at 0x454 0x%x
# .ind
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.40-maple-lib.diff.sig
Type: application/octet-stream
Size: 828 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20210829/112cc279/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lib-maple-trid-v.txt.gz
Type: application/x-gzip
Size: 502 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20210829/112cc279/attachment.bin>
More information about the File
mailing list