From 0ef4af9c998bf5847b40f7e5bad0367d7633b429 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 14 Feb 2026 18:35:08 -0800 Subject: [PATCH] Fix CharSections DBC layout and Warden SHA1 hash computation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CharSections fields were mapped incorrectly (Variation/Color at 4-5, textures at 6-8) — corrected to textures at 4-6, Flags at 7, Variation at 8, Color at 9. Fixed in both dbc_layout.cpp and all expansion JSON configs. Also fix Warden HASH_REQUEST to SHA1 over seed+moduleImage instead of just seed. --- Data/expansions/classic/dbc_layouts.json | 4 ++-- Data/expansions/tbc/dbc_layouts.json | 4 ++-- Data/expansions/turtle/dbc_layouts.json | 4 ++-- Data/expansions/wotlk/dbc_layouts.json | 4 ++-- src/game/game_handler.cpp | 8 ++++++-- src/pipeline/dbc_layout.cpp | 5 +++-- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Data/expansions/classic/dbc_layouts.json b/Data/expansions/classic/dbc_layouts.json index 0aa17c74..5a38f46c 100644 --- a/Data/expansions/classic/dbc_layouts.json +++ b/Data/expansions/classic/dbc_layouts.json @@ -12,8 +12,8 @@ }, "CharSections": { "RaceID": 1, "SexID": 2, "BaseSection": 3, - "VariationIndex": 4, "ColorIndex": 5, - "Texture1": 6, "Texture2": 7, "Texture3": 8 + "Texture1": 4, "Texture2": 5, "Texture3": 6, + "Flags": 7, "VariationIndex": 8, "ColorIndex": 9 }, "SpellIcon": { "ID": 0, "Path": 1 }, "FactionTemplate": { diff --git a/Data/expansions/tbc/dbc_layouts.json b/Data/expansions/tbc/dbc_layouts.json index a49d1c7a..b302dded 100644 --- a/Data/expansions/tbc/dbc_layouts.json +++ b/Data/expansions/tbc/dbc_layouts.json @@ -12,8 +12,8 @@ }, "CharSections": { "RaceID": 1, "SexID": 2, "BaseSection": 3, - "VariationIndex": 4, "ColorIndex": 5, - "Texture1": 6, "Texture2": 7, "Texture3": 8 + "Texture1": 4, "Texture2": 5, "Texture3": 6, + "Flags": 7, "VariationIndex": 8, "ColorIndex": 9 }, "SpellIcon": { "ID": 0, "Path": 1 }, "FactionTemplate": { diff --git a/Data/expansions/turtle/dbc_layouts.json b/Data/expansions/turtle/dbc_layouts.json index 0aa17c74..5a38f46c 100644 --- a/Data/expansions/turtle/dbc_layouts.json +++ b/Data/expansions/turtle/dbc_layouts.json @@ -12,8 +12,8 @@ }, "CharSections": { "RaceID": 1, "SexID": 2, "BaseSection": 3, - "VariationIndex": 4, "ColorIndex": 5, - "Texture1": 6, "Texture2": 7, "Texture3": 8 + "Texture1": 4, "Texture2": 5, "Texture3": 6, + "Flags": 7, "VariationIndex": 8, "ColorIndex": 9 }, "SpellIcon": { "ID": 0, "Path": 1 }, "FactionTemplate": { diff --git a/Data/expansions/wotlk/dbc_layouts.json b/Data/expansions/wotlk/dbc_layouts.json index 7a5271a3..0ce13fca 100644 --- a/Data/expansions/wotlk/dbc_layouts.json +++ b/Data/expansions/wotlk/dbc_layouts.json @@ -12,8 +12,8 @@ }, "CharSections": { "RaceID": 1, "SexID": 2, "BaseSection": 3, - "VariationIndex": 4, "ColorIndex": 5, - "Texture1": 6, "Texture2": 7, "Texture3": 8 + "Texture1": 4, "Texture2": 5, "Texture3": 6, + "Flags": 7, "VariationIndex": 8, "ColorIndex": 9 }, "SpellIcon": { "ID": 0, "Path": 1 }, "FactionTemplate": { diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 52ed41f9..963ac33d 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -2281,9 +2281,13 @@ void GameHandler::handleWardenData(network::Packet& packet) { break; } - // SHA1 fallback (unlikely to work for vanilla modules, but log for debugging) + // SHA1(seed + moduleImage) — the server verifies this against its own copy { - auto hash = auth::Crypto::sha1(seed); + std::vector hashInput; + hashInput.insert(hashInput.end(), seed.begin(), seed.end()); + hashInput.insert(hashInput.end(), wardenModuleData_.begin(), wardenModuleData_.end()); + auto hash = auth::Crypto::sha1(hashInput); + LOG_INFO("Warden: SHA1 fallback hash over ", hashInput.size(), " bytes (seed+module)"); std::vector resp; resp.push_back(0x04); resp.insert(resp.end(), hash.begin(), hash.end()); diff --git a/src/pipeline/dbc_layout.cpp b/src/pipeline/dbc_layout.cpp index 26d37014..8b9e5669 100644 --- a/src/pipeline/dbc_layout.cpp +++ b/src/pipeline/dbc_layout.cpp @@ -23,9 +23,10 @@ void DBCLayout::loadWotlkDefaults() { { "InventoryIcon", 5 }, { "GeosetGroup1", 7 }, { "GeosetGroup3", 9 }}}; // CharSections.dbc + // Binary layout: ID(0) Race(1) Sex(2) Section(3) Tex1(4) Tex2(5) Tex3(6) Flags(7) Variation(8) Color(9) layouts_["CharSections"] = {{{ "RaceID", 1 }, { "SexID", 2 }, { "BaseSection", 3 }, - { "VariationIndex", 4 }, { "ColorIndex", 5 }, - { "Texture1", 6 }, { "Texture2", 7 }, { "Texture3", 8 }}}; + { "Texture1", 4 }, { "Texture2", 5 }, { "Texture3", 6 }, + { "Flags", 7 }, { "VariationIndex", 8 }, { "ColorIndex", 9 }}}; // SpellIcon.dbc (Icon.dbc in code but actually SpellIcon) layouts_["SpellIcon"] = {{{ "ID", 0 }, { "Path", 1 }}};