From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:MPQ (MoPaQ)" |
|---|
| claim | "The MPQ name hash starts with s1 = 0x7FED7FED and s2 = 0xEEEEEEEE; for each byte c (ASCII upper-cased, '/' turned into '\'): s1 = table[type + c] ^ (s1 + s2); s2 = c + s1 + s2 + (s2 << 5) + 3. The result is s1. Type 0x000 = table index, 0x100 / 0x200 = name checks, 0x300 = key." |
|---|
| scope | | level | "library" |
|---|
| applies_to | "Format:MPQ (MoPaQ)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | function | "HashString (StormLib)" |
|---|
| effect | "32-bit hash of a file path for lookup and key derivation" |
|---|
| condition | "Blizzard's storm.dll and WorldEdit read name bytes as signed, so names with bytes >= 0x80 do not hash the same as in StormLib" |
|---|
|
|---|
| evidence | | type | "documentation" |
|---|
| detail | "StormLib commit 116135c, src/SBaseCommon.cpp: HashString and the comment about the signed-character behaviour of storm.dll/WorldEdit; MPQ_HASH_* constants in src/StormCommon.h." |
|---|
|
| type | "runtime_test" |
|---|
| detail | "Test vectors: hash("(hash table)", 0x300) = 0xC3AF3770, hash("(block table)", 0x300) = 0xEC83B3A3 (match MPQ_KEY_HASH_TABLE/MPQ_KEY_BLOCK_TABLE in StormLib.h)." |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Storm string hash" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T03:10:32.949Z" |
|---|
| verifications | |
|---|