aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorscizzydo <34661795+scizzydo@users.noreply.github.com>2020-08-16 05:50:08 -0700
committerGitHub <noreply@github.com>2020-08-16 14:50:08 +0200
commit4125a81bb132c8d108f5bb07787f00a9fadf5838 (patch)
tree6140fd26aad35ea19b07ec06293fce5eb7e6b311 /src
parent5e40eb20e2789b86d4786d86b4bbb8ae83de5e1e (diff)
Core/Warden: Fix for LUA_STR_CHECK (#25247)
The check above is what I use to actually get a real result for LUA_STR_CHECK, which when I used variables that would have a string to them it actually fails the check. When checking for items like a function if it exists of course it won't work... In addition, fixing the Unk2 to Unk3 causes people to be able to adjust the address of the check to the address 0x00419210 to make warden perform the FrameScript__Execute to run lua on the client. This seems to be the big request like in https://github.com/TrinityCore/TrinityCore/issues/23035
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Warden/WardenWin.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp
index d1f7487c115..b25d6322c2c 100644
--- a/src/server/game/Warden/WardenWin.cpp
+++ b/src/server/game/Warden/WardenWin.cpp
@@ -105,7 +105,7 @@ void WardenWin::InitializeModule()
Request.String_library2 = 0;
Request.Function2 = 0x00419D40; // 0x00400000 + 0x00419D40 FrameScript::GetText
Request.Function2_set = 1;
- Request.CheckSumm2 = BuildChecksum(&Request.Unk2, 8);
+ Request.CheckSumm2 = BuildChecksum(&Request.Unk3, 8);
Request.Command3 = WARDEN_SMSG_MODULE_INITIALIZE;
Request.Size3 = 8;
@@ -420,18 +420,17 @@ void WardenWin::HandleCheckResult(ByteBuffer &buff)
if (Lua_Result != 0)
{
- TC_LOG_DEBUG("warden", "RESULT LUA_STR_CHECK fail, CheckId %u account Id %u", id, _session->GetAccountId());
- checkFailed = id;
- continue;
- }
-
- uint8 luaStrLen = buff.read<uint8>();
- if (luaStrLen != 0)
- {
- std::string str;
- str.resize(luaStrLen);
- buff.read(reinterpret_cast<uint8*>(str.data()), luaStrLen);
- TC_LOG_DEBUG("warden", "Lua string: %s", str.c_str());
+ uint8 luaStrLen = buff.read<uint8>();
+ if (luaStrLen != 0)
+ {
+ std::string str;
+ str.resize(luaStrLen);
+ buff.read(reinterpret_cast<uint8*>(str.data()), luaStrLen);
+ TC_LOG_DEBUG("warden", "Lua string: %s", str.c_str());
+ TC_LOG_DEBUG("warden", "RESULT LUA_STR_CHECK fail, CheckId %u account Id %u", id, _session->GetAccountId());
+ checkFailed = id;
+ continue;
+ }
}
TC_LOG_DEBUG("warden", "RESULT LUA_STR_CHECK passed, CheckId %u account Id %u", id, _session->GetAccountId());
break;