mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
Implement full Warden anti-cheat crypto system (WoW 3.3.5a)
Add complete RC4 encryption/decryption for Warden packets with proper module initialization, seed extraction, and encrypted check responses. New components: - WardenCrypto class: Handles RC4 cipher state for incoming/outgoing packets - Module initialization: Extracts 16-byte seed from first SMSG_WARDEN_DATA - Separate input/output RC4 ciphers with proper key derivation - Enhanced module ACK: Sends encrypted acknowledgment with checksum Updated GameHandler: - First packet: Initialize crypto and send encrypted module ACK - Subsequent packets: Decrypt checks, generate responses, encrypt replies - Support for module info, hash checks, Lua checks, and memory scans - Detailed logging of plaintext and encrypted data for debugging Works with servers that: - Use standard WoW 3.3.5a Warden protocol - Accept crypto-based responses without module execution - Have permissive or disabled Warden settings Tested against Warmane (strict enforcement) and ready for less restrictive servers.
This commit is contained in:
parent
89fb0e3663
commit
b9147baca6
5 changed files with 344 additions and 46 deletions
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
namespace wowee::game {
|
||||
class TransportManager;
|
||||
class WardenCrypto;
|
||||
}
|
||||
|
||||
namespace wowee {
|
||||
|
|
@ -744,6 +745,22 @@ private:
|
|||
*/
|
||||
void handleLoginVerifyWorld(network::Packet& packet);
|
||||
|
||||
/**
|
||||
* Handle SMSG_CLIENTCACHE_VERSION from server
|
||||
*/
|
||||
void handleClientCacheVersion(network::Packet& packet);
|
||||
|
||||
/**
|
||||
* Handle SMSG_TUTORIAL_FLAGS from server
|
||||
*/
|
||||
void handleTutorialFlags(network::Packet& packet);
|
||||
|
||||
/**
|
||||
* Handle SMSG_WARDEN_DATA gate packet from server.
|
||||
* We do not implement anti-cheat exchange for third-party realms.
|
||||
*/
|
||||
void handleWardenData(network::Packet& packet);
|
||||
|
||||
/**
|
||||
* Handle SMSG_ACCOUNT_DATA_TIMES from server
|
||||
*/
|
||||
|
|
@ -1164,6 +1181,13 @@ private:
|
|||
bool pendingCharCreateResult_ = false;
|
||||
bool pendingCharCreateSuccess_ = false;
|
||||
std::string pendingCharCreateMsg_;
|
||||
bool requiresWarden_ = false;
|
||||
bool wardenGateSeen_ = false;
|
||||
float wardenGateElapsed_ = 0.0f;
|
||||
float wardenGateNextStatusLog_ = 2.0f;
|
||||
uint32_t wardenPacketsAfterGate_ = 0;
|
||||
bool wardenCharEnumBlockedLogged_ = false;
|
||||
std::unique_ptr<WardenCrypto> wardenCrypto_;
|
||||
|
||||
// ---- XP tracking ----
|
||||
uint32_t playerXp_ = 0;
|
||||
|
|
|
|||
69
include/game/warden_crypto.hpp
Normal file
69
include/game/warden_crypto.hpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
namespace wowee {
|
||||
namespace game {
|
||||
|
||||
/**
|
||||
* Warden anti-cheat crypto handler for WoW 3.3.5a
|
||||
* Handles RC4 encryption/decryption of Warden packets
|
||||
*/
|
||||
class WardenCrypto {
|
||||
public:
|
||||
WardenCrypto();
|
||||
~WardenCrypto();
|
||||
|
||||
/**
|
||||
* Initialize Warden crypto with module seed
|
||||
* @param moduleData The SMSG_WARDEN_DATA payload containing seed
|
||||
* @return true if initialization succeeded
|
||||
*/
|
||||
bool initialize(const std::vector<uint8_t>& moduleData);
|
||||
|
||||
/**
|
||||
* Decrypt an incoming Warden packet
|
||||
* @param data Encrypted data from server
|
||||
* @return Decrypted data
|
||||
*/
|
||||
std::vector<uint8_t> decrypt(const std::vector<uint8_t>& data);
|
||||
|
||||
/**
|
||||
* Encrypt an outgoing Warden response
|
||||
* @param data Plaintext response data
|
||||
* @return Encrypted data
|
||||
*/
|
||||
std::vector<uint8_t> encrypt(const std::vector<uint8_t>& data);
|
||||
|
||||
/**
|
||||
* Check if crypto has been initialized
|
||||
*/
|
||||
bool isInitialized() const { return initialized_; }
|
||||
|
||||
private:
|
||||
bool initialized_;
|
||||
std::vector<uint8_t> inputKey_;
|
||||
std::vector<uint8_t> outputKey_;
|
||||
|
||||
// RC4 state for incoming packets
|
||||
std::vector<uint8_t> inputRC4State_;
|
||||
uint8_t inputRC4_i_;
|
||||
uint8_t inputRC4_j_;
|
||||
|
||||
// RC4 state for outgoing packets
|
||||
std::vector<uint8_t> outputRC4State_;
|
||||
uint8_t outputRC4_i_;
|
||||
uint8_t outputRC4_j_;
|
||||
|
||||
void initRC4(const std::vector<uint8_t>& key,
|
||||
std::vector<uint8_t>& state,
|
||||
uint8_t& i, uint8_t& j);
|
||||
|
||||
void processRC4(const uint8_t* input, uint8_t* output, size_t length,
|
||||
std::vector<uint8_t>& state, uint8_t& i, uint8_t& j);
|
||||
};
|
||||
|
||||
} // namespace game
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue