Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D2BitReader.write() Is Totally Buggy. #19

Open
ChthonVII opened this issue Nov 19, 2021 · 2 comments
Open

D2BitReader.write() Is Totally Buggy. #19

ChthonVII opened this issue Nov 19, 2021 · 2 comments

Comments

@ChthonVII
Copy link

(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
Copy link
Owner

@ChthonVII Hey thanks for the implementation

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

@silospen
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants