From d7c26d6dea5204ffc60659b682b125bbd378efe0 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Wed, 12 Jul 2017 11:33:30 +0200 Subject: [PATCH] [AntiCheat] Disable protection during unit tests --- src/Components/Loader.cpp | 2 +- src/Main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Components/Loader.cpp b/src/Components/Loader.cpp index 6000beba..b2f69a35 100644 --- a/src/Components/Loader.cpp +++ b/src/Components/Loader.cpp @@ -181,7 +181,7 @@ namespace Components return result; } - bool Loader::IsPerformingUnitTests() + bool inline Loader::IsPerformingUnitTests() { #if defined(DEBUG) || defined(FORCE_UNIT_TESTS) return Flags::HasFlag("tests"); diff --git a/src/Main.cpp b/src/Main.cpp index 0bbfd104..08919017 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -60,7 +60,7 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l #ifndef DISABLE_ANTICHEAT []() { - if (!Components::Dedicated::IsEnabled()) + if (!Components::Dedicated::IsEnabled() && !Components::Loader::IsPerformingUnitTests()) { Components::AntiCheat::ProtectProcess(); Components::AntiCheat::PatchThreadCreation(); @@ -84,7 +84,7 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l #ifndef DISABLE_ANTICHEAT []() { - if (!Components::Dedicated::IsEnabled()) + if (!Components::Dedicated::IsEnabled() && !Components::Loader::IsPerformingUnitTests()) { Components::AntiCheat::VerifyThreadIntegrity(); }