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

Serial Number Padding Ignores Remaining Bits #13

Open
lowlines opened this issue Oct 19, 2024 · 0 comments
Open

Serial Number Padding Ignores Remaining Bits #13

lowlines opened this issue Oct 19, 2024 · 0 comments

Comments

@lowlines
Copy link

While porting the packed item code, I noticed that the encoded serial numbers differed slightly to those generated by the game. If you decode and then re-encode a serail number where the number of packed data bits is not a multiple of 8, the remaining bits of that last byte are not getting set to 1 as part of the padding step when generating the crc32 checksum.

This won't corrupt the packed item at all, but it may result in a different serial number / checksum whenever that item is touched. If you do account for the ignored bits, you should then get 1:1 accurate serial numbers with how the game generates them.

BL2(hwAAAACeowCEZgI/ChEIsGIYxBCA4QDDIYb///////+3YoDFQInh)

padding = b"\xff" * (33 - len(item))

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

1 participant