564{
566
569
571 buff >> Length;
573 buff >> Checksum;
574
575 if (Length != (buff.
size() - buff.
rpos()))
576 {
578
580 {
582 }
583
584 return;
585 }
586
588 {
591
593 {
595 }
596
597 return;
598 }
599
600
601 {
603 buff >> result;
605 if (result == 0x00)
606 {
607 LOG_DEBUG(
"warden",
"TIMING CHECK FAIL result 0x00");
608
609 return;
610 }
611
613 buff >> newClientTicks;
614
617
618 LOG_DEBUG(
"warden",
"ServerTicks {}", ticksNow);
620 LOG_DEBUG(
"warden",
"Ticks {}", newClientTicks);
621 LOG_DEBUG(
"warden",
"Ticks diff {}", ourTicks - newClientTicks);
622 }
623
625
627 {
629
630
632 {
634 }
635
637 switch (type)
638 {
640 {
642 buff >> Mem_Result;
643
644 if (Mem_Result != 0)
645 {
647 checkFailed = checkId;
648 continue;
649 }
650
652
655 {
657 checkFailed = checkId;
659 continue;
660 }
661
664 break;
665 }
670 {
671 uint8 const byte = 0xE9;
673 {
675 {
677 }
678
680 {
682 }
683
685 {
687 }
688
689 checkFailed = checkId;
691 continue;
692 }
693
695
697 {
699 }
701 {
703 }
705 {
707 }
708 break;
709 }
711 {
713
714 if (result == 0)
715 {
717 }
718
720 break;
721 }
723 {
725 buff >> Mpq_Result;
726
727 if (Mpq_Result != 0)
728 {
730 checkFailed = checkId;
731 continue;
732 }
733
736 {
738 checkFailed = checkId;
740 continue;
741 }
742
745 break;
746 }
747 }
748 }
749
751 {
753 }
754
756 {
757 LOG_DEBUG(
"warden",
"Warden was interrupted by ForceChecks, ignoring results.");
758
760
762 {
764 }
765 }
766
767
770
772}
constexpr auto IN_MILLISECONDS
Definition Common.h:53
std::uint16_t uint16
Definition Define.h:108
@ CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF
Definition IWorld.h:377
#define LOG_DEBUG(filterType__,...)
Definition Log.h:169
#define sWardenCheckMgr
Definition WardenCheckMgr.h:89
@ DRIVER_CHECK
Definition Warden.h:53
@ PAGE_CHECK_A
Definition Warden.h:49
@ PAGE_CHECK_B
Definition Warden.h:50
@ LUA_EVAL_CHECK
Definition Warden.h:52
@ MPQ_CHECK
Definition Warden.h:51
@ MEM_CHECK
Definition Warden.h:48
@ MODULE_CHECK
Definition Warden.h:56
std::vector< uint8 > ToByteVector(int32 minSize=0, bool littleEndian=true) const
Definition BigNumber.cpp:191
std::array< uint8, Size > ToByteArray(bool littleEndian=true) const
Definition BigNumber.h:123
std::size_t size() const
Definition ByteBuffer.h:444
void read_skip()
Definition ByteBuffer.h:339
void rfinish()
Definition ByteBuffer.h:325
std::size_t wpos() const
Definition ByteBuffer.h:330
std::size_t rpos() const
Definition ByteBuffer.h:317
uint8 * contents()
Definition ByteBuffer.h:424
T read()
Definition ByteBuffer.h:351
std::map< uint16, WardenCheck > CachedChecks
The cached payloads that are accessed by payload id.
Definition WardenPayloadMgr.h:135
static uint16 constexpr WardenPayloadOffsetMin
The minimum id available for custom payloads.
Definition WardenPayloadMgr.h:115
std::list< uint16 > _CurrentChecks
Definition WardenWin.h:90
uint32 _checkTimer
Definition Warden.h:145
uint32 _clientResponseTimer
Definition Warden.h:146
void ApplyPenalty(uint16 checkId, std::string const &reason)
Definition Warden.cpp:196
WardenPayloadMgr _payloadMgr
Definition Warden.h:139
bool _checkInProgress
Definition Warden.h:151
static bool IsValidCheckSum(uint32 checksum, uint8 const *data, const uint16 length)
Definition Warden.cpp:140
WorldSession * _session
Definition Warden.h:138
uint32 GetAccountId() const
Definition WorldSession.h:375
#define sWorld
Definition World.h:363
Milliseconds GetGameTimeMS()
Definition GameTime.cpp:43
static constexpr std::size_t SHA1_DIGEST_LENGTH_BYTES
Definition CryptoConstants.h:26
Definition WardenCheckMgr.h:59
BigNumber Result
Definition WardenCheckMgr.h:60
Definition WardenCheckMgr.h:44
uint8 Length
Definition WardenCheckMgr.h:48
uint8 Type
Definition WardenCheckMgr.h:45