563{
565
568
570 buff >> Length;
572 buff >> Checksum;
573
574 if (Length != (buff.
size() - buff.
rpos()))
575 {
577
579 {
581 }
582
583 return;
584 }
585
587 {
590
592 {
594 }
595
596 return;
597 }
598
599
600 {
602 buff >> result;
604 if (result == 0x00)
605 {
606 LOG_DEBUG(
"warden",
"TIMING CHECK FAIL result 0x00");
607
608 return;
609 }
610
612 buff >> newClientTicks;
613
616
617 LOG_DEBUG(
"warden",
"ServerTicks {}", ticksNow);
619 LOG_DEBUG(
"warden",
"Ticks {}", newClientTicks);
620 LOG_DEBUG(
"warden",
"Ticks diff {}", ourTicks - newClientTicks);
621 }
622
624
626 {
628
629
631 {
633 }
634
636 switch (type)
637 {
639 {
641 buff >> Mem_Result;
642
643 if (Mem_Result != 0)
644 {
646 checkFailed = checkId;
647 continue;
648 }
649
651
654 {
656 checkFailed = checkId;
658 continue;
659 }
660
663 break;
664 }
669 {
670 uint8 const byte = 0xE9;
672 {
674 {
676 }
677
679 {
681 }
682
684 {
686 }
687
688 checkFailed = checkId;
690 continue;
691 }
692
694
696 {
698 }
700 {
702 }
704 {
706 }
707 break;
708 }
710 {
712
713 if (result == 0)
714 {
716 }
717
719 break;
720 }
722 {
724 buff >> Mpq_Result;
725
726 if (Mpq_Result != 0)
727 {
729 checkFailed = checkId;
730 continue;
731 }
732
735 {
737 checkFailed = checkId;
739 continue;
740 }
741
744 break;
745 }
746 }
747 }
748
750 {
752 }
753
755 {
756 LOG_DEBUG(
"warden",
"Warden was interrupted by ForceChecks, ignoring results.");
757
759
761 {
763 }
764 }
765
766
769
771}
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
#define LOG_DEBUG(filterType__,...)
Definition: Log.h:169
std::uint16_t uint16
Definition: Define.h:108
@ CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF
Definition: IWorld.h:375
#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
#define sWorld
Definition: World.h:443
Milliseconds GetGameTimeMS()
Definition: GameTime.cpp:43
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
static constexpr std::size_t SHA1_DIGEST_LENGTH_BYTES
Definition: CryptoConstants.h:26
uint32 GetAccountId() const
Definition: WorldSession.h:361
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
Definition: WardenCheckMgr.h:44
uint8 Length
Definition: WardenCheckMgr.h:48
uint8 Type
Definition: WardenCheckMgr.h:45
Definition: WardenCheckMgr.h:59
BigNumber Result
Definition: WardenCheckMgr.h:60
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
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