iw4x-client/src/Components/Modules/AntiCheat.hpp

71 lines
1.6 KiB
C++
Raw Normal View History

#ifndef DEBUG
// Hide AntiCheat in embeded symbol names
#define AntiCheat SubComponent
#endif
2016-08-07 10:50:04 -04:00
namespace Components
{
class AntiCheat : public Component
{
public:
AntiCheat();
~AntiCheat();
2016-08-15 10:40:30 -04:00
2016-09-16 05:04:28 -04:00
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* getName() { return "AntiCheat"; };
#endif
2016-08-07 10:50:04 -04:00
static void CrashClient();
static void InitLoadLibHook();
2016-08-08 12:59:02 -04:00
static void ReadIntegrityCheck();
static void ScanIntegrityCheck();
static void FlagIntegrityCheck();
2016-08-07 15:46:30 -04:00
2016-08-07 10:50:04 -04:00
private:
2016-08-08 12:59:02 -04:00
enum IntergrityFlag
{
NO_FLAG = (0),
INITIALIZATION = (1 << 0),
MEMORY_SCAN = (1 << 1),
SCAN_INTEGRITY_CHECK = (1 << 2),
READ_INTEGRITY_CHECK = (1 << 3),
MAX_FLAG,
};
2016-11-05 07:56:12 -04:00
static Utils::Time::Interval LastCheck;
2016-08-07 10:50:04 -04:00
static std::string Hash;
2016-08-08 12:59:02 -04:00
static unsigned long Flags;
2016-08-07 10:50:04 -04:00
2016-11-05 07:56:12 -04:00
static void PerformScan();
2016-08-07 10:50:04 -04:00
static void PatchWinAPI();
2016-10-30 16:15:30 -04:00
static unsigned long ProtectProcess();
2016-08-08 08:49:53 -04:00
2016-08-07 10:50:04 -04:00
static void NullSub();
2016-08-07 19:57:00 -04:00
static void AssertCalleeModule(void* callee);
2016-08-07 15:46:30 -04:00
2016-08-07 10:50:04 -04:00
static void UninstallLibHook();
static void InstallLibHook();
#ifdef DEBUG_LOAD_LIBRARY
static HANDLE LoadLibary(std::wstring library, void* callee);
static HANDLE WINAPI LoadLibaryAStub(const char* library);
static HANDLE WINAPI LoadLibaryWStub(const wchar_t* library);
#endif
2016-08-14 09:27:37 -04:00
static void LostD3DStub();
2016-08-07 10:50:04 -04:00
static void CinematicStub();
2016-08-07 15:46:30 -04:00
static void SoundInitStub(int a1, int a2, int a3);
static void SoundInitDriverStub();
2016-08-07 19:57:00 -04:00
static void DObjGetWorldTagPosStub();
2016-08-07 15:46:30 -04:00
static void AimTargetGetTagPosStub();
2016-08-07 10:50:04 -04:00
static Utils::Hook LoadLibHook[4];
};
}