aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorscizzydo <34661795+scizzydo@users.noreply.github.com>2020-08-16 05:50:08 -0700
committerShauren <shauren.trinity@gmail.com>2022-01-26 22:13:25 +0100
commit142923714432af2d51dde4102648987280a843ee (patch)
treedb3ac37ca1312cf7a83a9dff3a98d66a58fc4f4c /src
parent3923650aeb75611023aa1d46a4328838c8e0a33c (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 (cherry picked from commit 4125a81bb132c8d108f5bb07787f00a9fadf5838)
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 1118eb1113c..4b14f448a08 100644
--- a/src/server/game/Warden/WardenWin.cpp
+++ b/src/server/game/Warden/WardenWin.cpp
@@ -106,7 +106,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;
@@ -421,18 +421,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;