gomule-d2r
gomule-d2r copied to clipboard
D2BitReader.write() Is Totally Buggy.
(I'm cross-posting this issue from sourceforge since the sourceforge issue tracker looks kind of dead and I'm not sure anyone's reading it.)
D2BitReader.write() is totally buggy.
To demonstrate, try overwriting an item's fingerprint with 0x00000000 or 0xDEADBEEF or whatever, and then reading back what was written. What you read back will be wildly wrong.
Frankly, I'm surprised that we're not seeing a ton of data corruption when this is used by things like D2Item.set_row().
Here is a correct, though inefficient, implementation of write() if you'd like to borrow it.
@ChthonVII Hey thanks for the implementation
I'll mention silos too in case he didn't catch the issue on sourceforge @silospen
Thank you! Yeah, I saw the last time I looked at it that it's totally wrong in places. To be honest, I was too scared to change it because I couldn't understand how it could possibly be working? As @pairofdocs says, thank you so much for this!