Skip to content

Commit

Permalink
Fix warden scans terminator logic.
Browse files Browse the repository at this point in the history
This fixes module 2B1837AFD92A1BC289C7BD6F75D33209 where one of the scan opcodes is 0. Thanks to Blu for researching it.
  • Loading branch information
ratkosrb committed Aug 23, 2023
1 parent 346f99c commit eeb6d45
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/Anticheat/WardenAnticheat/Warden.cpp
Expand Up @@ -323,7 +323,7 @@ void Warden::RequestScans(std::vector<std::shared_ptr<Scan const>>&& scans)
if (m_clientOS == CLIENT_OS_WIN && !m_maiev)
{
// indicates to the client that there are no further requests in this packet
buff << m_xor;
buff << uint8(m_module->scanTerminator ^ m_xor);
}

BeginTimeoutClock();
Expand Down
17 changes: 17 additions & 0 deletions src/game/Anticheat/WardenAnticheat/WardenModule.cpp
Expand Up @@ -102,6 +102,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
3 changes: 3 additions & 0 deletions src/game/Anticheat/WardenAnticheat/WardenModule.hpp
Expand Up @@ -73,6 +73,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

0 comments on commit eeb6d45

Please sign in to comment.