Fix Classic field extraction, Warden PE patches, and auth/opcode corrections

Update field extraction in both CREATE_OBJECT and VALUES handlers to check
specific fields (maxHealth, level, faction, etc.) before power/maxpower range
checks. In Classic 1.12.1, power indices 23-27 are adjacent to maxHealth (28),
and maxPower indices 29-33 are adjacent to level (34) and faction (35), so
range checks like "key >= powerBase && key < powerBase+7" were incorrectly
capturing those fields.

Add build-aware WoW.exe selection and runtime global patching for Warden
SYSTEM_INFO, EndScene, WorldEnables, and LastHardwareAction chains. Fix
Classic opcodes and auth session addon data format for CMaNGOS compatibility.
This commit is contained in:
Kelsi 2026-02-20 00:18:03 -08:00
parent 38ad368c82
commit e8864941dc
5 changed files with 279 additions and 49 deletions

View file

@ -17,8 +17,9 @@ public:
WardenMemory();
~WardenMemory();
/** Search standard candidate dirs for WoW.exe and load it. */
bool load();
/** Search standard candidate dirs for WoW.exe and load it.
* @param build Client build number (e.g. 5875 for Classic 1.12.1) to select the right exe. */
bool load(uint16_t build = 0);
/** Load PE image from a specific file path. */
bool loadFromFile(const std::string& exePath);
@ -44,7 +45,10 @@ private:
bool parsePE(const std::vector<uint8_t>& fileData);
void initKuserSharedData();
std::string findWowExe() const;
void patchRuntimeGlobals();
void writeLE32(uint32_t va, uint32_t value);
std::string findWowExe(uint16_t build) const;
static uint32_t expectedImageSizeForBuild(uint16_t build);
};
} // namespace game