[AntiCheat] Use simpler compiler expression

This commit is contained in:
momo5502 2017-06-23 10:04:43 +02:00
parent a47b0f2aaa
commit 47c8fcc644
8 changed files with 10 additions and 8 deletions

View File

@ -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!)

View File

@ -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
}

View File

@ -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();

View File

@ -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();

View File

@ -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);

View File

@ -766,7 +766,7 @@ namespace Components
}
});
#if !defined(DEBUG) && !defined(DISABLE_ANTICHEAT)
#ifndef DISABLE_ANTICHEAT
Scheduler::OnFrame(AntiCheat::QuickCodeScanner2);
#endif

View File

@ -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
}

View File

@ -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<DWORD>(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();