From 47c8fcc6444bcd94d70e25ca8e694c1bd4164f66 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Fri, 23 Jun 2017 10:04:43 +0200 Subject: [PATCH] [AntiCheat] Use simpler compiler expression --- src/Components/Modules/AntiCheat.hpp | 2 ++ src/Components/Modules/Changelog.cpp | 2 +- src/Components/Modules/Discovery.cpp | 2 +- src/Components/Modules/Gametypes.cpp | 2 +- src/Components/Modules/Localization.cpp | 2 +- src/Components/Modules/Menus.cpp | 2 +- src/Components/Modules/ServerList.cpp | 2 +- src/Main.cpp | 4 ++-- 8 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Components/Modules/AntiCheat.hpp b/src/Components/Modules/AntiCheat.hpp index 93e4d52d..90deb8cc 100644 --- a/src/Components/Modules/AntiCheat.hpp +++ b/src/Components/Modules/AntiCheat.hpp @@ -3,6 +3,8 @@ #ifndef DEBUG // Hide AntiCheat in embeded symbol names #define AntiCheat SubComponent +#else +#define DISABLE_ANTICHEAT #endif // Uncomment to enable process protection (conflicts with steam!) diff --git a/src/Components/Modules/Changelog.cpp b/src/Components/Modules/Changelog.cpp index 31c5e65c..2a996293 100644 --- a/src/Components/Modules/Changelog.cpp +++ b/src/Components/Modules/Changelog.cpp @@ -56,7 +56,7 @@ namespace Components // Changelog UIFeeder::Add(62.0f, Changelog::GetChangelogCount, Changelog::GetChangelogText, Changelog::SelectChangelog); -#if !defined(DEBUG) && !defined(DISABLE_ANTICHEAT) +#ifndef DISABLE_ANTICHEAT Scheduler::OnFrame(AntiCheat::QuickCodeScanner1); #endif } diff --git a/src/Components/Modules/Discovery.cpp b/src/Components/Modules/Discovery.cpp index 899f9759..833b7103 100644 --- a/src/Components/Modules/Discovery.cpp +++ b/src/Components/Modules/Discovery.cpp @@ -86,7 +86,7 @@ namespace Components // This is placed here in case the anticheat has been disabled! // Make sure this is called after the memory scan! -#if !defined(DEBUG) && !defined(DISABLE_ANTICHEAT) +#ifndef DISABLE_ANTICHEAT Utils::Hook(0x5ACB9E, []() // Somewhere in the renderer, past the scan check { AntiCheat::ScanIntegrityCheck(); diff --git a/src/Components/Modules/Gametypes.cpp b/src/Components/Modules/Gametypes.cpp index 83cb619a..e9d85f3a 100644 --- a/src/Components/Modules/Gametypes.cpp +++ b/src/Components/Modules/Gametypes.cpp @@ -101,7 +101,7 @@ namespace Components // This is placed here in case the anticheat has been disabled! // Make sure this is called after every onther anticheat check! -#if !defined(DEBUG) && !defined(DISABLE_ANTICHEAT) +#ifndef DISABLE_ANTICHEAT Utils::Hook(0x5ACBA3, []() // Somewhere in the renderer, past other renderer hooks! { AntiCheat::FlagIntegrityCheck(); diff --git a/src/Components/Modules/Localization.cpp b/src/Components/Modules/Localization.cpp index 87631d12..3f49f61e 100644 --- a/src/Components/Modules/Localization.cpp +++ b/src/Components/Modules/Localization.cpp @@ -286,7 +286,7 @@ namespace Components } }); -// #if !defined(DEBUG) && !defined(DISABLE_ANTICHEAT) +// #ifndef DISABLE_ANTICHEAT // if (!Dedicated::IsEnabled() && !ZoneBuilder::IsEnabled() && !Utils::IsWineEnvironment() && !Loader::PerformingUnitTests()) // { // AntiCheat::PatchVirtualProtect(VirtualProtect, VirtualProtectEx); diff --git a/src/Components/Modules/Menus.cpp b/src/Components/Modules/Menus.cpp index 9a0265a7..33aa0fd4 100644 --- a/src/Components/Modules/Menus.cpp +++ b/src/Components/Modules/Menus.cpp @@ -766,7 +766,7 @@ namespace Components } }); -#if !defined(DEBUG) && !defined(DISABLE_ANTICHEAT) +#ifndef DISABLE_ANTICHEAT Scheduler::OnFrame(AntiCheat::QuickCodeScanner2); #endif diff --git a/src/Components/Modules/ServerList.cpp b/src/Components/Modules/ServerList.cpp index 6e5140e5..3df95f4e 100644 --- a/src/Components/Modules/ServerList.cpp +++ b/src/Components/Modules/ServerList.cpp @@ -855,7 +855,7 @@ namespace Components Scheduler::OnFrame(ServerList::Frame); // This is placed here in case the anticheat has been disabled! -#if !defined(DEBUG) && !defined(DISABLE_ANTICHEAT) && defined(PROCTECT_PROCESS) +#if !defined(DISABLE_ANTICHEAT) && defined(PROCTECT_PROCESS) Scheduler::OnFrame(AntiCheat::ReadIntegrityCheck, true); #endif } diff --git a/src/Main.cpp b/src/Main.cpp index c65b5333..9a151023 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -68,7 +68,7 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l // Ensure we're working with our desired binary if (Utils::Hook::Get(0x4C0FFF) != 0x6824748B) return FALSE; -#if !defined(DEBUG) && !defined(DISABLE_ANTICHEAT) +#ifndef DISABLE_ANTICHEAT []() { Components::AntiCheat::ProtectProcess(); @@ -90,7 +90,7 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l } else if(ul_reason_for_call == DLL_THREAD_ATTACH) { -#if !defined(DEBUG) && !defined(DISABLE_ANTICHEAT) +#ifndef DISABLE_ANTICHEAT []() { Components::AntiCheat::VerifyThreadIntegrity();