Skip to content

hashes: add the 64-bit name hash (MurmurHash3 x64 128) - #30

Open
Justin-160inteva wants to merge 1 commit into
nineforge0:mainfrom
Justin-160inteva:feat/murmur3-64-name-hash
Open

Justin-160inteva wants to merge 1 commit into
nineforge0:mainfrom
Justin-160inteva:feat/murmur3-64-name-hash

Conversation

@Justin-160inteva

Copy link
Copy Markdown

What

RPF9 entries carry two name hashes. This crate reads the 32-bit joaat column; the 8-byte
column 0x73bcb72dce74f11f has been listed as unidentified (entry.rs line ~147, and the
open issue "Identify the 64-bit TOC column 0x73bcb72dce74f11f").

That column is MurmurHash3 x64 128, low half, over the lowercased name. Two rules apply:

entry kind bytes hashed
typed resource (.#dr, .#bdr, .#map, .#td, .#bn, …) the stem — ma_sqr_merged.#dr hashes as ma_sqr_merged, because the extension lives in a separate TOC field
plain file (.awc, .xml, .dat, …) the full name including extension

Why it matters

Naming through the 32-bit column alone cannot resolve most entries. With this hash, a
hexhash name dictionary keyed on 64-bit values resolves 667,764 of 1,250,091 entries
(34.84% → 88.25%) on a retail Xbox install.

Validation

  • Reference vectors: "" → 0x0, "hello" → 0xcbd8a7b341bd9b02,
    "The quick brown fox jumps over the lazy dog" → 0xe34bbc7bbc071b6c
  • Live data: setup2.xml → 0x216b42926703a335, install.dat → 0x336373b5566693f1,
    each matching the entry it names
  • Lowercasing checked; cargo test --release passes (70 + 11)

Scope

Adds murmur3_x64_128 / name_hash64, their tests, and a --64 flag on forge9 hash so
64-bit dictionaries can be built. Wiring the column into catalog and list is a follow-up
PR — I did not touch entry.rs here to keep this reviewable.

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

Successfully merging this pull request may close these issues.

1 participant