Forum > Miscellaneous
[Legion] WDB5 format
<< < (3/7) > >>
Rangorn:
[deleted]
schlumpf:
Weird shit, but okay, that's blizzard.
Simca:
It is uint16; uint40 is an illusion created by record alignment.
When Blizzard writes records to files, the end of the record is aligned to the largest field size used.
In this file in question, the ID field starts at 0x1B into the record and lasts for 2 bytes according to the field structure block ((32 - 0x10) / 8 = 2). This puts the end of the field at 0x1D. However, the record size field in the header says the record is 0x20. The difference is because of the alignment I just mentioned. The largest field size used in the record is 4 bytes. The nearest values divisible by 4 bytes are 0x1C (which the ID field goes past) and 0x20, so the record is padded by 3 bytes to make it properly align at 0x20.
So yes, you can read it with that structure, but it would be better to read it as uint16 and then skip to the end of the record.
schlumpf:
Also, get onto irc, as you seem to be one of the intrersting people doing stuff (^ー^)ノ
Rangorn:
--- Quote from: "Simca" ---It is uint16; uint40 is an illusion created by record alignment.
When Blizzard writes records to files, the end of the record is aligned to the largest field size used.
In this file in question, the ID field starts at 0x1B into the record and lasts for 2 bytes according to the field structure block ((32 - 0x10) / 8 = 2). This puts the end of the field at 0x1D. However, the record size field in the header says the record is 0x20. The difference is because of the alignment I just mentioned. The largest field size used in the record is 4 bytes. The nearest values divisible by 4 bytes are 0x1C (which the ID field goes past) and 0x20, so the record is padded by 3 bytes to make it properly align at 0x20.
So yes, you can read it with that structure, but it would be better to read it as uint16 and then skip to the end of the record. --- End quote ---
Ok i get it, thanks for your explanation :) I think this could be helpful to write a fake-column with the amount of padding for each DB
Navigation
[0] Message Index
[#] Next page
[*] Previous page
|