-
Notifications
You must be signed in to change notification settings - Fork 17
Add more CLI options and add basic update for BO6 #17
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
base: master
Are you sure you want to change the base?
Conversation
- hashes in MWII and MWIII are not truncated to 60 bits, fix accordingly - string formatting fix so hashes are fully 0-padded to 16 chars
| var idfk = Reader.ReadByte(); // Seems like hash type? 2 for material, 0 for array index, engine # | ||
| var hash = ((hi << 32) | lo) & 0xFFFFFFFFFFFFFFF; | ||
| var hash = ((hi << 32) | lo); //& 0xFFFFFFFFFFFFFFF; | ||
| if (Decompiler.HashEntries.ContainsKey(hash)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package index won't work if you don't apply the mask, you need to add it every time you're asking it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing anywhere the hashes are forced to be truncated to 60 bits. Can you elaborate on this a bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hashes inside the wni files are 60 bits, so by only removing the mask, you won’t be able to query them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah you're right, I had removed that truncation in my local build and forgot I did that. You just need to remove this mask here https://github.com/JariKCoding/CoDLuaDecompiler/blob/master/CoDLuaDecompiler.HashResolver/PackageIndex.cs#L47
Too lazy to add it to this PR especially since this repo is inactive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it still doesn't work, like I said the hashes inside the wni files are 60 bits, so removing this mask won't work. Here are, for example, the first hashes in the bo4_file_names.wni file:
785e3fb024ffd43,ui/uieditor/widgets/playercontextualmenu_item
4bab6f9d42ee007,ui/uieditor/widgets/playercontextualmenu_item.lua
47803d0fb7647f2,ui/uieditor/widgets/pc/startmenu/dropdown/optiondropdown
c8285898a8a11d2,ui/uieditor/widgets/pc/startmenu/dropdown/optiondropdown.lua
They all have the mask
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My proposed changes would only affect the mw2 decomp. The wnis are fully capable of storing full 64 bit hashes and I've been using them with the full 64 bits this whole time.
Hashes in MWII and MWIII aren't truncated to 60 bits

There are many examples I could give as proof, but this is a snippet of the assembly that registers the lua C functions. The args are (luaVM, hash, func address). You can see with rdx being set to many different hash values, some (highlighted) are values that are higher than 0xFFFFFFFFFFFFFFF. Updating the decompiler so that it doesn't truncate the hashes for MWII and MWIII would make it much better to avoid confusion.
Edit: I was making this comment with the regular 0x7FFFFFFFFFFFFFFF truncation in mind, slight brain fart. Point still stands though, but now every single hash in that screenshot is proof except for the second one.