gomule-d2r icon indicating copy to clipboard operation
gomule-d2r copied to clipboard

D2BitReader.write() Is Totally Buggy.

Open ChthonVII opened this issue 3 years ago • 2 comments

(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 avatar Nov 19 '21 04:11 ChthonVII

@ChthonVII Hey thanks for the implementation

I'll mention silos too in case he didn't catch the issue on sourceforge @silospen

pairofdocs avatar Nov 21 '21 21:11 pairofdocs

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!

silospen avatar Nov 21 '21 22:11 silospen