diff --git a/README.md b/README.md index 10b994be..c4c4eee9 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ | ------------- | ------------- | | `--copy-to=PATH` | Optional, copy the DLL to a custom folder after build, define the path here if wanted. | | `--copy-pdb` | Copy debug information for binaries as well to the path given via --copy-to. | +| `--ac-disable` | Disable anticheat. | | `--ac-debug-detections` | Log anticheat detections. | | `--ac-debug-load-library` | Log libraries that get loaded. | | `--force-unit-tests` | Always compile unit tests. | diff --git a/premake5.lua b/premake5.lua index ad6be8a7..c7e774ff 100644 --- a/premake5.lua +++ b/premake5.lua @@ -43,6 +43,11 @@ newoption { description = "Copy debug information for binaries as well to the path given via --copy-to." } +newoption { + trigger = "ac-disable", + description = "Disable anticheat." +} + newoption { trigger = "ac-debug-detections", description = "Log anticheat detections." @@ -311,6 +316,9 @@ workspace "iw4x" } -- Debug flags + if _OPTIONS["ac-disable"] then + defines { "DISABLE_ANTICHEAT" } + end if _OPTIONS["ac-debug-detections"] then defines { "DEBUG_DETECTIONS" } end diff --git a/src/Components/Loader.cpp b/src/Components/Loader.cpp index 8ea85865..5c60b50b 100644 --- a/src/Components/Loader.cpp +++ b/src/Components/Loader.cpp @@ -48,7 +48,9 @@ namespace Components Loader::Register(new Renderer()); Loader::Register(new UIFeeder()); Loader::Register(new UIScript()); +#ifndef DISABLE_ANTICHEAT Loader::Register(new AntiCheat()); +#endif Loader::Register(new Dedicated()); Loader::Register(new Discovery()); Loader::Register(new Exception()); diff --git a/src/Components/Modules/Discovery.cpp b/src/Components/Modules/Discovery.cpp index fe11ad27..5cd95f97 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! -#ifndef DEBUG +#if !defined(DEBUG) && !defined(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 f13b3b22..6f597f2a 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! -#ifndef DEBUG +#if !defined(DEBUG) && !defined(DISABLE_ANTICHEAT) Utils::Hook(0x5ACBA3, [] () // Somewhere in the renderer, past other renderer hooks! { AntiCheat::FlagIntegrityCheck(); diff --git a/src/Components/Modules/ServerList.cpp b/src/Components/Modules/ServerList.cpp index 728efaf4..ddcc6aac 100644 --- a/src/Components/Modules/ServerList.cpp +++ b/src/Components/Modules/ServerList.cpp @@ -723,7 +723,7 @@ namespace Components Renderer::OnFrame(ServerList::Frame); // This is placed here in case the anticheat has been disabled! -#ifndef DEBUG +#if !defined(DEBUG) && !defined(DISABLE_ANTICHEAT) Renderer::OnFrame(AntiCheat::ReadIntegrityCheck); #endif }