thebaddie;3305838 said:
maybe i found a way to fix DB Master 12 compatibility problem, i'll test it harder
here's a example with Giacomazzi (lecce) from FIFA12 using text import/export DB Master 12 functionality
Il capitanoooo!
FIFA DB STRUCTURE (taken from Rinaldo's forum)
Address Length Description
-------------------------------------
0x00 8 bytes Signature
0x08 4 bytes Length of the file
0x10 4 bytes Number of tables
0x14 4 bytes crc
Starting from 0x18 an 8 byte structure, one for each table
+0x00 4 bytes Table shortname
+0x04 4 bytes Table descriptor offset(from the end of this vector)
0x39c 4 bytes crc
Table descriptor 36 bytes
+0x00 4 bytes Unknown (0x02,0x22, 0x42)
+0x04 4 bytes Total size of a record in bytes
+0x08 4 bytes Total size of a record in bits including padding bits
+0x0C 4 bytes Size of compressed string block
+0x10 2 bytes Number of records
+0x12 2 bytes Number of records
+0x14 2 bytes Fixed = 0
+0x16 2 bytes Fixed = 0xFF 0xFF
+0x18 4 bytes Number of fields
+0x1c 4 bytes Unknown
+0x20 4 bytes crc
A 16 bytes structure, one for each field
+0x00 4 bytes Field type (0 = string, 3 = integer, 4 = real, 13 = short compressed string, 14 = long compressed string)
+0x04 4 bytes Field Bit offset from the begin of the record
+0x08 4 bytes Field shortname
+0x0C 4 bytes Field depth (in bits)
At the end of the vector 4 bytes crc
Records data follow
CRC calculation function in C#
public int CalcHash(byte[] bytes)
{
int x, fileHash = -1;
for (uint i = 0; i < bytes.Length; i++)
{
x = 7;
fileHash ^= bytes
<< 24;
do
{
if ( fileHash >= 0 )
{
fileHash *= 2;
}
else
{
fileHash *= 2;
fileHash ^= 0x4C11DB7;
}
x--;
} while ( x >= 0 );
}
return (fileHash);
}
Compressed strings are encoded using a Huffmann Encoding based on a Binary Tree. This is the structure of the tree as saved in the database.
4 bytes for each node:
Node descriptor for a binary value of 0
+0x00 1 byte Index of next node or 0 if the node is a leaf.
+0x01 1 byte Ascii value of leaf nodes or 0 if the node is not a leaf.
Node descriptor for a binary value of 1
+0x02 1 byte Index of next node or 0 if the node is a leaf.
+0x03 1 byte Ascii value of leaf nodes or 0 if the node is not a leaf.