Repository navigation
hashes: add the 64-bit name hash (MurmurHash3 x64 128) - #30
Open
Justin-160inteva wants to merge 1 commit into
Open
Justin-160inteva wants to merge 1 commit into
Justin-160inteva wants to merge 1 commit into
Conversation
RPF9 entries carry two name hashes: the 32-bit joaat column this crate already reads, and an 8-byte column (0x73bcb72dce74f11f) whose function was unidentified. That column is MurmurHash3 x64 128, low half, over the lowercased name. Typed resources hash the stem only, because the extension lives in a separate TOC field (ma_sqr_merged.#dr hashes as "ma_sqr_merged"); plain files such as .awc and .xml hash the full name. Adds murmur3_x64_128 / name_hash64 with reference-vector tests, and gives `forge9 hash` a --64 flag so dictionaries for the 64-bit column can be built. Checked against live data: setup2.xml -> 0x216b42926703a335, install.dat -> 0x336373b5566693f1, both matching the entries they name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
RPF9 entries carry two name hashes. This crate reads the 32-bit
joaatcolumn; the 8-bytecolumn
0x73bcb72dce74f11fhas been listed as unidentified (entry.rsline ~147, and theopen issue "Identify the 64-bit TOC column 0x73bcb72dce74f11f").
That column is MurmurHash3 x64 128, low half, over the lowercased name. Two rules apply:
.#dr,.#bdr,.#map,.#td,.#bn, …)ma_sqr_merged.#drhashes asma_sqr_merged, because the extension lives in a separate TOC field.awc,.xml,.dat, …)Why it matters
Naming through the 32-bit column alone cannot resolve most entries. With this hash, a
hexhash namedictionary keyed on 64-bit values resolves 667,764 of 1,250,091 entries(34.84% → 88.25%) on a retail Xbox install.
Validation
""→0x0,"hello"→0xcbd8a7b341bd9b02,"The quick brown fox jumps over the lazy dog"→0xe34bbc7bbc071b6csetup2.xml→0x216b42926703a335,install.dat→0x336373b5566693f1,each matching the entry it names
cargo test --releasepasses (70 + 11)Scope
Adds
murmur3_x64_128/name_hash64, their tests, and a--64flag onforge9 hashso64-bit dictionaries can be built. Wiring the column into
catalogandlistis a follow-upPR — I did not touch
entry.rshere to keep this reviewable.