Author Topic: prf-dbase.trid.xml for dBase Print Form *.PRT  (Read 1021 times)

jenderek

  • Sr. Member
  • ****
  • Posts: 375
prf-dbase.trid.xml for dBase Print Form *.PRT
« on: August 19, 2021, 01:30:36 AM »
Hello trid users,

some days ago i handled some dBase based databases examples. Some examples
have the file name extension PRT.

Most (2 of 3) examples are misidentified as "Z-Code V4 adventure for Infocom
Z-Machine" by TrID definition z4.trid.xml with first XML construct like:
   <Bytes>04</Bytes>
   <Pos>0</Pos>

The .dbf file extension represents the dBase database file.  Luckily on
Wikipedia there exist a page about this Xbase ( dBASE ) File Format.  Some
sites on the net mention only dBASE IV version, but some mention only
general dBASE or also dBASE III+ and dBASE CLASSIC. So that information is
now expressed in new definition by lines like:
   <FileType>dBase Print Form</FileType>
   <Ext>PRF</Ext>
   
Instead of generic application/octet-stream i choose a user defined
one. That is expressed by line like:
   <Mime>application/x-dbase-prf</Mime>

There exist also other file types with PRF name extension like "Atheros
Profile" described by TrID definition prf.trid.xml. So i named my tridscan
generated definition prf-dbase.trid.xml and use the mentioned Wikipedia page
as reference. That is expressed by line like:
   <RefURL>
   https://en.wikipedia.org/wiki/.dbf#Other_file_types_found_in_dBASE
   </RefURL>

For dBASE databases (*.DBF) there exist file format specifications, but for
PRF i found nothing. So i look in generated definition and try to understand
and interpret patterns. The first is expressed by by XML construct like:
   <Bytes>0400</Bytes>
   <Pos>0</Pos>
So this is similar like for Z4 examples. Unfortunately i do not know what
this means or if this always true. So more pattern are needed for unique
identification.

In one example T6.PRF at offset 3 optional printer output file name is
stored (like E:\DBASE\IV\T6.txt) and the pre-pending byte has value 1. For
the other PRF examples these bytes are nil. Afterwards til offset 0x53 comes
more nil bytes. I assume that these bytes are used for longer print output
file names. That is expressed by XML construct like:
   <Bytes>00000000000000000000000000000000000000000000000000000000000
   <Pos>21</Pos>
Maybe with more examples this becomes shorter or vanish.

At offset 86 (=0x56) a string (like Generic.PR2 or ASCII.PR2) is
stored. According to Wikipedia page that is dBase printer driver file name.
That specific characteristic is expressed inside global string section by
line like:
   <String>.PR2</String>

At offset 96 (=0x60) i found in my examples the character 2. Maybe this is
probably last character of a previous dBASE printer driver name. Maybe that
this vanish when inspecting more examples. After the driver name comes an
area with dozen of nil bytes til offset 0x8a. At offset 168(=0xa8) some non
nil values like 0x03020300 or 0x03020100 are stored. That is expressed by
XML construct like:
   <Bytes>32000000000000000000000000000000000000000000000000000    0302</Bytes>
   <ASCII> 2</ASCII>
   <Pos>96</Pos>

Afterwards comes again an area with nil bytes til offset 0x2aa. At the end
appear some non nil byte value sequence 0100ff7f0100000100420000000000. That
is expressed by XML construct like:
   <Bytes>0000000000000000000000   0100FF7F01000001004200</Bytes>
   <Pos>171</Pos>

Al my PRF examples have a file size of 698 bytes. I do not know if this is
always true.

Now with the new definition all my PRF examples are described correctly as
"dBase Print Form" (See appended output/trid-v.txt).

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

With best wishes
Jörg Jenderek

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2730
    • Mark0's Home Page
Re: prf-dbase.trid.xml for dBase Print Form *.PRT
« Reply #1 on: August 19, 2021, 01:50:06 PM »
Thanks!