Search code examples
binaryparadox

Paradox DB file signature


I'm searching in web for magic numbers for Paradox DB files (.db), but there are no results.

What binary signature for these files?


Solution

  • I hate to answer this question because identifying the type of a file by its contents is inherently unreliable -- a binary signature tells you only that the file MAY be of a certain type, but there's no guarantee that another file won't happen to contain that string.

    Also, binary signature recognition of *.DB files is weak because almost all the bytes carry highly variable information, and most of the constant bytes are zero:

     byte  constant
    offset  value
      --     --
       2     00
       3     08
       E     00
       F     01
      14     00
      2A     00
      2B     00
      2C     00
    

    (all values in this answer are given in hexidecimal)

    There's probably lots of non *.DB files that will accidentally match this pattern.

    A couple more bytes are easily interpreted and provide additional information:

    byte offset 4:
      00 = indexed .DB data file
      01 = primary index .PX file
      02 = non-indexed .DB data file
      03 = non-incrementing secondary index .Xnn file
      04 = secondary index .Ynn file (inc or non-inc)
      05 = incrementing secondary index .Xnn file
      06 = non-incrementing secondary index .XGn file
      07 = secondary index .YGn file (inc or non inc)
      08 = incrementing secondary index .XGn file
    
    byte offset 39:
      03      version 3.0
      04      version 3.5
      05..09  version 4.x
      0A..0B  version 5.x
      0C      version 7.x
    

    Borland never published the internal format of its data base files. I think that to reliably identify a *.DB file by its contents you would have to try to open it with Borland's data base engine.

    -Al.