Skip to content

Commit

Permalink
Fix warden scans terminator logic.
Browse files Browse the repository at this point in the history
vmangos/core@eeb6d45 - all credit goes to this
  • Loading branch information
killerwife committed Sep 10, 2023
1 parent 5590087 commit 83bbe1f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/game/Anticheat/module/Warden/WardenModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class WardenModule
// mapping of scan function to the numerical value of the opcode
uint8_t opcodes[ScanTypeCount];

// invalid opcode value that signifies scans are over
uint8 scanTerminator;

// pregenerated challenge, responses, and encryption keys for this module
std::vector<ChallengeResponseEntry> crk;
};
Expand Down
2 changes: 1 addition & 1 deletion src/game/Anticheat/module/Warden/warden.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void Warden::RequestScans(std::vector<std::shared_ptr<const Scan>> &&scans)
if (_session->GetOS() == CLIENT_OS_WIN)
{
// indicates to the client that there are no further requests in this packet
buff << _xor;
buff << uint8(m_module->scanTerminator ^ m_xor);
}

BeginTimeoutClock();
Expand Down
17 changes: 17 additions & 0 deletions src/game/Anticheat/module/Warden/wardenmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ WardenModule::WardenModule(std::string const &bin, std::string const &kf, std::s

if (Windows())
{
for (uint8 i = 0; i <= UINT8_MAX; i++)
{
if (opcodes[0] != i &&
opcodes[1] != i &&
opcodes[2] != i &&
opcodes[3] != i &&
opcodes[4] != i &&
opcodes[5] != i &&
opcodes[6] != i &&
opcodes[7] != i &&
opcodes[8] != i)
{
scanTerminator = i;
break;
}
}

if (!memoryRead)
throw std::runtime_error("Module data does not include memory read information");

Expand Down

0 comments on commit 83bbe1f

Please sign in to comment.