TrinityCore
WardenWin.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "WardenWin.h"
19#include "Common.h"
20#include "ByteBuffer.h"
21#include "Containers.h"
22#include "CryptoRandom.h"
23#include "DatabaseEnv.h"
24#include "GameTime.h"
25#include "HMAC.h"
26#include "Log.h"
27#include "Opcodes.h"
28#include "Player.h"
29#include "SessionKeyGenerator.h"
30#include "SmartEnum.h"
31#include "Util.h"
32#include "WardenModuleWin.h"
33#include "WardenCheckMgr.h"
34#include "World.h"
35#include "WorldPacket.h"
36#include "WorldSession.h"
37#include <sstream>
38
39 // GUILD is the shortest string that has no client validation (RAID only sends if in a raid group)
40static constexpr char _luaEvalPrefix[] = "local S,T,R=SendAddonMessage,function()";
41static constexpr char _luaEvalMidfix[] = " end R=S and T()if R then S('_TW',";
42static constexpr char _luaEvalPostfix[] = ",'GUILD')end";
43
44static_assert((sizeof(_luaEvalPrefix)-1 + sizeof(_luaEvalMidfix)-1 + sizeof(_luaEvalPostfix)-1 + WARDEN_MAX_LUA_CHECK_LENGTH) == 255);
45
46WardenWin::WardenWin() : Warden(), _serverTicks(0)
47{
48 for (WardenCheckCategory category : EnumUtils::Iterate<WardenCheckCategory>())
49 {
50 auto& [checks, checksIt] = _checks[category];
51 checks = sWardenCheckMgr->GetAvailableChecks(category);
53 checksIt = checks.begin();
54 }
55}
56
57void WardenWin::Init(WorldSession* session, SessionKey const& K)
58{
59 _session = session;
60 // Generate Warden Key
62 WK.Generate(_inputKey.data(), _inputKey.size());
63 WK.Generate(_outputKey.data(), _outputKey.size());
64
66
69 TC_LOG_DEBUG("warden", "Server side warden for client {} initializing...", session->GetAccountId());
70 TC_LOG_DEBUG("warden", "C->S Key: {}", ByteArrayToHexStr(_inputKey));
71 TC_LOG_DEBUG("warden", "S->C Key: {}", ByteArrayToHexStr(_outputKey));
72 TC_LOG_DEBUG("warden", " Seed: {}", ByteArrayToHexStr(_seed));
73 TC_LOG_DEBUG("warden", "Loading Module...");
74
76
77 TC_LOG_DEBUG("warden", "Module Key: {}", ByteArrayToHexStr(_module->Key));
78 TC_LOG_DEBUG("warden", "Module ID: {}", ByteArrayToHexStr(_module->Id));
80}
81
83{
84 // data assign
85 module.CompressedData = Module.Module.data();
86 module.CompressedSize = Module.Module.size();
87 module.Key = Module.ModuleKey;
88}
89
91{
92 TC_LOG_DEBUG("warden", "Initialize module");
93
94 // Create packet structure
97 Request.Size1 = 20;
98 Request.Unk1 = 1;
99 Request.Unk2 = 0;
100 Request.Type = 1;
101 Request.String_library1 = 0;
102 Request.Function1[0] = 0x00024F80; // 0x00400000 + 0x00024F80 SFileOpenFile
103 Request.Function1[1] = 0x000218C0; // 0x00400000 + 0x000218C0 SFileGetFileSize
104 Request.Function1[2] = 0x00022530; // 0x00400000 + 0x00022530 SFileReadFile
105 Request.Function1[3] = 0x00022910; // 0x00400000 + 0x00022910 SFileCloseFile
106 Request.CheckSumm1 = BuildChecksum(&Request.Unk1, 20);
107
109 Request.Size2 = 8;
110 Request.Unk3 = 4;
111 Request.Unk4 = 0;
112 Request.String_library2 = 0;
113 Request.Function2 = 0x00419210; // 0x00400000 + 0x00419210 FrameScript::Execute
114 Request.Function2_set = 1;
115 Request.CheckSumm2 = BuildChecksum(&Request.Unk3, 8);
116
118 Request.Size3 = 8;
119 Request.Unk5 = 1;
120 Request.Unk6 = 1;
121 Request.String_library3 = 0;
122 Request.Function3 = 0x0046AE20; // 0x00400000 + 0x0046AE20 PerformanceCounter
123 Request.Function3_set = 1;
124 Request.CheckSumm3 = BuildChecksum(&Request.Unk5, 8);
125
126 EndianConvert(Request.Size1);
127 EndianConvert(Request.CheckSumm1);
128 EndianConvert(Request.Function1[0]);
129 EndianConvert(Request.Function1[1]);
130 EndianConvert(Request.Function1[2]);
131 EndianConvert(Request.Function1[3]);
132 EndianConvert(Request.Size2);
133 EndianConvert(Request.CheckSumm2);
134 EndianConvert(Request.Function2);
135 EndianConvert(Request.Size3);
136 EndianConvert(Request.CheckSumm3);
137 EndianConvert(Request.Function3);
138
139 // Encrypt with warden RC4 key.
140 EncryptData(reinterpret_cast<uint8*>(&Request), sizeof(WardenInitModuleRequest));
141
143 pkt.append(reinterpret_cast<uint8*>(&Request), sizeof(WardenInitModuleRequest));
144 _session->SendPacket(&pkt);
145}
146
148{
149 TC_LOG_DEBUG("warden", "Request hash");
150
151 // Create packet structure
154 Request.Seed = _seed;
155
156 // Encrypt with warden RC4 key.
157 EncryptData(reinterpret_cast<uint8*>(&Request), sizeof(WardenHashRequest));
158
160 pkt.append(reinterpret_cast<uint8*>(&Request), sizeof(WardenHashRequest));
161 _session->SendPacket(&pkt);
162}
163
165{
166 // Verify key
168 buff.read(response);
169 if (response != Module.ClientKeySeedHash)
170 {
171 char const* penalty = ApplyPenalty(nullptr);
172 TC_LOG_WARN("warden", "{} failed hash reply. Action: {}", _session->GetPlayerInfo(), penalty);
173 return;
174 }
175
176 TC_LOG_DEBUG("warden", "Request hash reply: succeed");
177
178 // Change keys here
181
184
185 _initialized = true;
186}
187
189{
190 switch (type)
191 {
192 case DRIVER_CHECK: return 1;
193 case LUA_EVAL_CHECK: return 1 + sizeof(_luaEvalPrefix)-1 + sizeof(_luaEvalMidfix)-1 + 4 + sizeof(_luaEvalPostfix)-1;
194 case MPQ_CHECK: return 1;
195 case PAGE_CHECK_A: return (4 + 1);
196 case PAGE_CHECK_B: return (4 + 1);
198 case MEM_CHECK: return (1 + 4 + 1);
199 default: return 0;
200 }
201}
202
204{
205 uint16 size = 1 + GetCheckPacketBaseSize(check.Type); // 1 byte check type
206 if (!check.Str.empty())
207 size += (check.Str.length() + 1); // 1 byte string length
208 if (!check.Data.empty())
209 size += check.Data.size();
210 return size;
211}
212
214{
215 TC_LOG_DEBUG("warden", "Request data from {} (account {}) - loaded: {}", _session->GetPlayerName(), _session->GetAccountId(), _session->GetPlayer() && !_session->PlayerLoading());
216
217 // If all checks for a category are done, fill its todo list again
218 for (WardenCheckCategory category : EnumUtils::Iterate<WardenCheckCategory>())
219 {
220 auto& [checks, checksIt] = _checks[category];
221 if ((checksIt == checks.end()) && !checks.empty())
222 {
223 TC_LOG_DEBUG("warden", "Finished all {} checks, re-shuffling", EnumUtils::ToConstant(category));
225 checksIt = checks.begin();
226 }
227 }
228
230 _currentChecks.clear();
231
232 // Build check request
233 ByteBuffer buff;
235
236 for (WardenCheckCategory category : EnumUtils::Iterate<WardenCheckCategory>())
237 {
239 continue;
240
241 auto& [checks, checksIt] = _checks[category];
242 for (uint32 i = 0, n = sWorld->getIntConfig(GetWardenCategoryCountConfig(category)); i < n; ++i)
243 {
244 if (checksIt == checks.end()) // all checks were already sent, list will be re-filled on next Update() run
245 break;
246 _currentChecks.push_back(*(checksIt++));
247 }
248 }
249
251
252 uint16 expectedSize = 4;
254 [&expectedSize](uint16 id)
255 {
256 uint8 const thisSize = GetCheckPacketSize(sWardenCheckMgr->GetCheckData(id));
257 if ((expectedSize + thisSize) > 450) // warden packets are truncated to 512 bytes clientside
258 return true;
259 expectedSize += thisSize;
260 return false;
261 }
262 );
263
264 for (uint16 const id : _currentChecks)
265 {
266 WardenCheck const& check = sWardenCheckMgr->GetCheckData(id);
267 if (check.Type == LUA_EVAL_CHECK)
268 {
269 buff << uint8(sizeof(_luaEvalPrefix) - 1 + check.Str.size() + sizeof(_luaEvalMidfix) - 1 + check.IdStr.size() + sizeof(_luaEvalPostfix) - 1);
270 buff.append(_luaEvalPrefix, sizeof(_luaEvalPrefix) - 1);
271 buff.append(check.Str.data(), check.Str.size());
272 buff.append(_luaEvalMidfix, sizeof(_luaEvalMidfix) - 1);
273 buff.append(check.IdStr.data(), check.IdStr.size());
274 buff.append(_luaEvalPostfix, sizeof(_luaEvalPostfix) - 1);
275 }
276 else if (!check.Str.empty())
277 {
278 buff << uint8(check.Str.size());
279 buff.append(check.Str.data(), check.Str.size());
280 }
281 }
282
283 uint8 xorByte = _inputKey[0];
284
285 // Add TIMING_CHECK
286 buff << uint8(0x00);
287 buff << uint8(TIMING_CHECK ^ xorByte);
288
289 uint8 index = 1;
290
291 for (uint16 const id : _currentChecks)
292 {
293 WardenCheck const& check = sWardenCheckMgr->GetCheckData(id);
294
295 WardenCheckType const type = check.Type;
296 buff << uint8(type ^ xorByte);
297 switch (type)
298 {
299 case MEM_CHECK:
300 {
301 buff << uint8(0x00);
302 buff << uint32(check.Address);
303 buff << uint8(sWardenCheckMgr->GetCheckResult(id).size());
304 break;
305 }
306 case PAGE_CHECK_A:
307 case PAGE_CHECK_B:
308 {
309 buff.append(check.Data.data(), check.Data.size());
310 buff << uint32(check.Address);
311 buff << uint8(check.Length);
312 break;
313 }
314 case MPQ_CHECK:
315 case LUA_EVAL_CHECK:
316 {
317 buff << uint8(index++);
318 break;
319 }
320 case DRIVER_CHECK:
321 {
322 buff.append(check.Data.data(), check.Data.size());
323 buff << uint8(index++);
324 break;
325 }
326 case MODULE_CHECK:
327 {
328 std::array<uint8, 4> seed = Trinity::Crypto::GetRandomBytes<4>();
329 buff.append(seed);
331 break;
332 }
333 /*case PROC_CHECK:
334 {
335 buff.append(check->i.AsByteArray(0, false).get(), check->i.GetNumBytes());
336 buff << uint8(index++);
337 buff << uint8(index++);
338 buff << uint32(check->Address);
339 buff << uint8(check->Length);
340 break;
341 }*/
342 default:
343 break; // Should never happen
344 }
345 }
346 buff << uint8(xorByte);
347 buff.hexlike();
348
349 auto idstring = [this]() -> std::string
350 {
351 std::stringstream stream;
352 for (uint16 const id : _currentChecks)
353 stream << id << " ";
354 return stream.str();
355 };
356
357 if (buff.size() == expectedSize)
358 {
359 TC_LOG_DEBUG("warden", "Finished building warden packet, size is {} bytes", buff.size());
360 TC_LOG_DEBUG("warden", "Sent checks: {}", idstring());
361 }
362 else
363 {
364 TC_LOG_WARN("warden", "Finished building warden packet, size is {} bytes, but expected {} bytes!", buff.size(), expectedSize);
365 TC_LOG_WARN("warden", "Sent checks: {}", idstring());
366 }
367
368 // Encrypt with warden RC4 key
369 EncryptData(buff.contents(), buff.size());
370
372 pkt.append(buff);
373 _session->SendPacket(&pkt);
374
375 _dataSent = true;
376}
377
379{
380 TC_LOG_DEBUG("warden", "Handle data");
381
382 _dataSent = false;
384
385 uint16 Length;
386 buff >> Length;
387 uint32 Checksum;
388 buff >> Checksum;
389
390 if (Length != (buff.size() - buff.rpos()))
391 {
392 buff.rfinish();
393 char const* penalty = ApplyPenalty(nullptr);
394 TC_LOG_WARN("warden", "{} sends manipulated warden packet. Action: {}", _session->GetPlayerInfo(), penalty);
395 return;
396 }
397
398 if (!IsValidCheckSum(Checksum, buff.contents() + buff.rpos(), Length))
399 {
400 buff.rfinish();
401 char const* penalty = ApplyPenalty(nullptr);
402 TC_LOG_WARN("warden", "{} failed checksum. Action: {}", _session->GetPlayerInfo(), penalty);
403 return;
404 }
405
406 // TIMING_CHECK
407 {
408 uint8 result;
409 buff >> result;
411 if (result == 0x00)
412 {
413 char const* penalty = ApplyPenalty(nullptr);
414 TC_LOG_WARN("warden", "{} failed timing check. Action: {}", _session->GetPlayerInfo(), penalty);
415 return;
416 }
417
418 uint32 newClientTicks;
419 buff >> newClientTicks;
420
421 uint32 ticksNow = GameTime::GetGameTimeMS();
422 uint32 ourTicks = newClientTicks + (ticksNow - _serverTicks);
423
424 TC_LOG_DEBUG("warden", "Server tick count now: {}", ticksNow);
425 TC_LOG_DEBUG("warden", "Server tick count at req: {}", _serverTicks);
426 TC_LOG_DEBUG("warden", "Client ticks in response: {}", newClientTicks);
427 TC_LOG_DEBUG("warden", "Round trip response time: {} ms", ourTicks - newClientTicks);
428 }
429
430 uint16 checkFailed = 0;
431 for (uint16 const id : _currentChecks)
432 {
433 WardenCheck const& check = sWardenCheckMgr->GetCheckData(id);
434
435 switch (check.Type)
436 {
437 case MEM_CHECK:
438 {
439 uint8 Mem_Result;
440 buff >> Mem_Result;
441
442 if (Mem_Result != 0)
443 {
444 TC_LOG_DEBUG("warden", "RESULT MEM_CHECK not 0x00, CheckId {} account Id {}", id, _session->GetAccountId());
445 checkFailed = id;
446 continue;
447 }
448
449 WardenCheckResult const& expected = sWardenCheckMgr->GetCheckResult(id);
450
451 std::vector<uint8> response;
452 response.resize(expected.size());
453 buff.read(response.data(), response.size());
454
455 if (response != expected)
456 {
457 TC_LOG_DEBUG("warden", "RESULT MEM_CHECK fail CheckId {} account Id {}", id, _session->GetAccountId());
458 TC_LOG_DEBUG("warden", "Expected: {}", ByteArrayToHexStr(expected));
459 TC_LOG_DEBUG("warden", "Got: {}", ByteArrayToHexStr(response));
460 checkFailed = id;
461 continue;
462 }
463
464 TC_LOG_DEBUG("warden", "RESULT MEM_CHECK passed CheckId {} account Id {}", id, _session->GetAccountId());
465 break;
466 }
467 case PAGE_CHECK_A:
468 case PAGE_CHECK_B:
469 case DRIVER_CHECK:
470 case MODULE_CHECK:
471 {
472 if (buff.read<uint8>() != 0xE9)
473 {
474 TC_LOG_DEBUG("warden", "RESULT {} fail, CheckId {} account Id {}", EnumUtils::ToConstant(check.Type), id, _session->GetAccountId());
475 checkFailed = id;
476 continue;
477 }
478
479 TC_LOG_DEBUG("warden", "RESULT {} passed CheckId {} account Id {}", EnumUtils::ToConstant(check.Type), id, _session->GetAccountId());
480 break;
481 }
482 case LUA_EVAL_CHECK:
483 {
484 uint8 const result = buff.read<uint8>();
485 if (result == 0)
486 buff.read_skip(buff.read<uint8>()); // discard attached string
487
488 TC_LOG_DEBUG("warden", "LUA_EVAL_CHECK CheckId {} account Id {} got in-warden dummy response ({})", id, _session->GetAccountId(), result);
489 break;
490 }
491 case MPQ_CHECK:
492 {
493 uint8 Mpq_Result;
494 buff >> Mpq_Result;
495
496 if (Mpq_Result != 0)
497 {
498 TC_LOG_DEBUG("warden", "RESULT MPQ_CHECK not 0x00 account id {}", _session->GetAccountId());
499 checkFailed = id;
500 continue;
501 }
502
503 std::vector<uint8> result;
505 buff.read(result.data(), result.size());
506 if (result != sWardenCheckMgr->GetCheckResult(id)) // SHA1
507 {
508 TC_LOG_DEBUG("warden", "RESULT MPQ_CHECK fail, CheckId {} account Id {}", id, _session->GetAccountId());
509 checkFailed = id;
510 continue;
511 }
512
513 TC_LOG_DEBUG("warden", "RESULT MPQ_CHECK passed, CheckId {} account Id {}", id, _session->GetAccountId());
514 break;
515 }
516 default: // Should never happen
517 break;
518 }
519 }
520
521 if (checkFailed > 0)
522 {
523 WardenCheck const& check = sWardenCheckMgr->GetCheckData(checkFailed);
524 char const* penalty = ApplyPenalty(&check);
525 TC_LOG_WARN("warden", "{} failed Warden check {} ({}). Action: {}", _session->GetPlayerInfo(), checkFailed, EnumUtils::ToConstant(check.Type), penalty);
526 }
527
528 // Set hold off timer, minimum timer should at least be 1 second
529 uint32 holdOff = sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF);
530 _checkTimer = (holdOff < 1 ? 1 : holdOff) * IN_MILLISECONDS;
531}
532
533size_t WardenWin::DEBUG_ForceSpecificChecks(std::vector<uint16> const& checks)
534{
535 std::array<std::vector<uint16>::iterator, NUM_CHECK_CATEGORIES> swapPositions;
536 for (WardenCheckCategory category : EnumUtils::Iterate<WardenCheckCategory>())
537 swapPositions[category] = _checks[category].first.begin();
538
539 size_t n = 0;
540 for (uint16 check : checks)
541 {
542 for (WardenCheckCategory category : EnumUtils::Iterate<WardenCheckCategory>())
543 {
544 std::vector<uint16>& checks = _checks[category].first;
545 std::vector<uint16>::iterator& swapPos = swapPositions[category];
546 if (auto it = std::find(swapPos, checks.end(), check); it != checks.end())
547 {
548 std::iter_swap(swapPos, it);
549 ++swapPos;
550 ++n;
551 break;
552 }
553 }
554 }
555
556 for (WardenCheckCategory category : EnumUtils::Iterate<WardenCheckCategory>())
557 _checks[category].second = _checks[category].first.begin();
558
559 return n;
560}
std::array< uint8, SESSION_KEY_LENGTH > SessionKey
Definition: AuthDefines.h:25
void EndianConvert(T &val)
Definition: ByteConverter.h:48
@ IN_MILLISECONDS
Definition: Common.h:35
uint8_t uint8
Definition: Define.h:144
uint16_t uint16
Definition: Define.h:143
uint32_t uint32
Definition: Define.h:142
#define TC_LOG_WARN(filterType__,...)
Definition: Log.h:162
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:156
std::string ByteArrayToHexStr(Container const &c, bool reverse=false)
Definition: Util.h:368
constexpr uint8 WARDEN_MAX_LUA_CHECK_LENGTH
constexpr bool IsWardenCategoryInWorldOnly(WardenCheckCategory category)
#define sWardenCheckMgr
constexpr WorldIntConfigs GetWardenCategoryCountConfig(WardenCheckCategory category)
std::vector< uint8 > WardenCheckResult
WardenCheckCategory
@ NUM_CHECK_CATEGORIES
WardenCheckType
@ DRIVER_CHECK
@ PAGE_CHECK_A
@ PAGE_CHECK_B
@ LUA_EVAL_CHECK
@ MPQ_CHECK
@ MEM_CHECK
@ TIMING_CHECK
@ MODULE_CHECK
struct Module_79C0768D657977D697E10BAD956CCED1 Module
static constexpr char _luaEvalPrefix[]
Definition: WardenWin.cpp:40
static constexpr char _luaEvalMidfix[]
Definition: WardenWin.cpp:41
static constexpr uint8 GetCheckPacketBaseSize(WardenCheckType type)
Definition: WardenWin.cpp:188
static constexpr char _luaEvalPostfix[]
Definition: WardenWin.cpp:42
static uint16 GetCheckPacketSize(WardenCheck const &check)
Definition: WardenWin.cpp:203
@ WARDEN_SMSG_HASH_REQUEST
Definition: Warden.h:43
@ WARDEN_SMSG_MODULE_INITIALIZE
Definition: Warden.h:41
@ WARDEN_SMSG_CHEAT_CHECKS_REQUEST
Definition: Warden.h:40
void read_skip()
Definition: ByteBuffer.h:431
size_t rpos() const
Definition: ByteBuffer.h:399
void hexlike() const
Definition: ByteBuffer.cpp:177
void append(T value)
Definition: ByteBuffer.h:143
void rfinish()
Definition: ByteBuffer.h:407
size_t size() const
Definition: ByteBuffer.h:536
uint8 * contents()
Definition: ByteBuffer.h:522
static char const * ToConstant(Enum value)
Definition: SmartEnum.h:120
void Generate(uint8 *buf, uint32 sz)
void Init(uint8 const *seed, size_t len)
Definition: ARC4.cpp:43
static Digest GetDigestOf(Container const &seed, uint8 const *data, size_t len)
Definition: HMAC.h:41
static constexpr size_t DIGEST_LENGTH
Definition: HMAC.h:37
std::array< uint8, DIGEST_LENGTH > Digest
Definition: CryptoHash.h:47
static constexpr size_t DIGEST_LENGTH
Definition: CryptoHash.h:46
void HandleHashResult(ByteBuffer &buff) override
Definition: WardenWin.cpp:164
void InitializeModule() override
Definition: WardenWin.cpp:90
void Init(WorldSession *session, SessionKey const &K) override
Definition: WardenWin.cpp:57
std::vector< uint16 > _currentChecks
Definition: WardenWin.h:83
size_t DEBUG_ForceSpecificChecks(std::vector< uint16 > const &checks) override
Definition: WardenWin.cpp:533
void HandleCheckResult(ByteBuffer &buff) override
Definition: WardenWin.cpp:378
uint32 _serverTicks
Definition: WardenWin.h:81
void InitializeModuleForClient(ClientWardenModule &module) override
Definition: WardenWin.cpp:82
void RequestChecks() override
Definition: WardenWin.cpp:213
void RequestHash() override
Definition: WardenWin.cpp:147
std::array< std::pair< std::vector< uint16 >, std::vector< uint16 >::const_iterator >, NUM_CHECK_CATEGORIES > _checks
Definition: WardenWin.h:82
Definition: Warden.h:85
char const * ApplyPenalty(WardenCheck const *check)
Definition: Warden.cpp:175
Optional< ClientWardenModule > _module
Definition: Warden.h:127
void EncryptData(uint8 *buffer, uint32 length)
Definition: Warden.cpp:137
uint32 _checkTimer
Definition: Warden.h:124
uint32 _clientResponseTimer
Definition: Warden.h:125
void MakeModuleForClient()
Definition: Warden.cpp:43
void RequestModule()
Definition: Warden.cpp:79
Trinity::Crypto::ARC4 _outputCrypto
Definition: Warden.h:123
std::array< uint8, 16 > _inputKey
Definition: Warden.h:119
Trinity::Crypto::ARC4 _inputCrypto
Definition: Warden.h:122
static bool IsValidCheckSum(uint32 checksum, const uint8 *data, const uint16 length)
Definition: Warden.cpp:142
bool _dataSent
Definition: Warden.h:126
bool _initialized
Definition: Warden.h:128
static uint32 BuildChecksum(const uint8 *data, uint32 length)
Definition: Warden.cpp:164
std::array< uint8, 16 > _seed
Definition: Warden.h:121
WorldSession * _session
Definition: Warden.h:118
std::array< uint8, 16 > _outputKey
Definition: Warden.h:120
Player session in the World.
Definition: WorldSession.h:963
std::string GetPlayerInfo() const
Player * GetPlayer() const
bool PlayerLoading() const
Definition: WorldSession.h:969
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
uint32 GetAccountId() const
std::string const & GetPlayerName() const
@ SMSG_WARDEN3_DATA
Definition: Opcodes.h:2063
#define sWorld
Definition: World.h:931
@ CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF
Definition: World.h:385
uint32 GetGameTimeMS()
Definition: GameTime.cpp:49
void RandomShuffle(Iterator begin, Iterator end)
Reorder the elements of the iterator range randomly.
Definition: Containers.h:170
void EraseIf(Container &c, Predicate p)
Definition: Containers.h:279
boost::beast::http::request< RequestBody > Request
Definition: HttpCommon.h:30
constexpr std::size_t size()
Definition: UpdateField.h:796
uint8 const * CompressedData
Definition: Warden.h:78
size_t CompressedSize
Definition: Warden.h:79
std::array< uint8, 16 > Key
Definition: Warden.h:77
Trinity::Crypto::SHA1::Digest ClientKeySeedHash
std::array< uint8, 18756 > Module
std::array< char, 4 > IdStr
std::vector< uint8 > Data
std::string Str
WardenCheckType Type