pairofdocs / gomule-d2r

GoMule enabled for D2R
GNU Affero General Public License v3.0
59 stars 16 forks source link

D2BitReader.write() Is Totally Buggy. #19

Open ChthonVII opened 2 years ago

ChthonVII commented 2 years ago

(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.

pairofdocs commented 2 years ago

@ChthonVII Hey thanks for the implementation

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

silospen commented 2 years ago

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!