Author Topic: lib-ar-bsd.trid.xml for BSD library (*.a)  (Read 23 times)

jenderek

  • Jr. Member
  • **
  • Posts: 65
lib-ar-bsd.trid.xml for BSD library (*.a)
« on: December 17, 2018, 01:27:17 am »
Hello trid users,

some days ago i run TrID on hundreds of ar-archives and libraries described
in general by ark-ar-archiver.trid.xml as "ar archive". Furthermore one
library libjpeg.a was is also described with rate 44.0% wrong as "MapInfo
Sea Chart" by kap.trid.xml ( see appended output/trid-old.txt).

On Wikipedia site about "Ar (Unix)" a variant for BSD libraries is
mentioned. This is matched by examples like libarclite_macosx.a described in
this text. So i add to new lib-ar-bsd.trid.xml definition wikipedia page as
reference by line:

   <RefURL>https://en.wikipedia.org/wiki/Ar_(Unix)</RefURL>

In this variant the symbol lookup table name starts with string
"__.SYMDEF". For examples on newer MacOS X i only found libraries with
longer name support. This gives extra pattern "#1/". So i build with ar
utility a sample like test7MAC-lib.a with short name.

Compared with magic pattern ark-ar-archiver.trid.xml i use 8 bytes including
single LF control character (0x0A). This is now expressed by XML construct:

   <Bytes>213C617263683E0A</Bytes>
   <ASCII> ! . a r c h</ASCII>
   <Pos>0</Pos>

The characteristic name for BSD symbol lookup table is now described in global
string section by line:

   <String>__.SYMDEF</String>

With the tool ar, the libraries content can be unpacked. This is now
described by line:

   <Mime>application/x-archive</Mime>

I only inspected a few samples on newer MacOS X system. There i only found
".a" as file name extension. This is expressed by line:

   <Ext>A</Ext>

But i do not know if this is true for all such libraries.

With new trid definition all inspected BSD libraries are now described more
precisely. And example libjpeg.a is only misidentified as "MapInfo Sea Chart"
with lower rate of 22.0% ( see appended output/trid-new.txt)

TrID definition, some examples and output are stored in archive
a_lib_mac.zip. I hope that the XML file can be used in future version of
triddefs.

With best wishes
Jörg Jenderek