Fixed Anti-Cheat on Windows 7

This commit is contained in:
sr0 2016-03-11 21:49:14 +01:00
parent 7b759d6880
commit 3db0667929
3 changed files with 8 additions and 5 deletions

View File

@ -5,6 +5,7 @@ namespace Components
int AntiCheat::LastCheck;
std::string AntiCheat::Hash;
Utils::Hook AntiCheat::LoadLibHook[4];
bool AntiCheat::InjectPatches = false;
// This function does nothing, it only adds the two passed variables and returns the value
// The only important thing it does is to clean the first parameter, and then return
@ -143,12 +144,13 @@ namespace Components
AntiCheat::LoadLibHook[0].Install();
AntiCheat::LoadLibHook[1].Install();
AntiCheat::LoadLibHook[2].Install();
AntiCheat::LoadLibHook[3].Install();
//AntiCheat::LoadLibHook[2].Install();
//AntiCheat::LoadLibHook[3].Install();
}
AntiCheat::AntiCheat()
{
AntiCheat::InjectPatches = false;
AntiCheat::EmptyHash();
#ifdef DEBUG
@ -157,8 +159,8 @@ namespace Components
AntiCheat::CrashClient();
});
#else
QuickPatch::OnFrame(AntiCheat::Frame);
Utils::Hook(0x507BD5, AntiCheat::PatchWinAPI, HOOK_CALL).Install()->Quick();
QuickPatch::OnFrame(AntiCheat::Frame);
// TODO: Probably move that :P
AntiCheat::InitLoadLibHook();

View File

@ -23,5 +23,6 @@ namespace Components
static void NullSub();
static Utils::Hook LoadLibHook[4];
static bool InjectPatches;
};
}

View File

@ -67,8 +67,8 @@ namespace Components
Game::R_AddCmdDrawText("DEBUG-BUILD", 0x7FFFFFFF, font, 15.0f, 10.0f + Game::R_TextHeight(font), 1.0f, 1.0f, 0.0f, color, Game::ITEM_TEXTSTYLE_SHADOWED);
});
#else
Utils::Hook::Set(0x6D70AC, Exception::SetUnhandledExceptionFilterStub);
SetUnhandledExceptionFilter(&Exception::ExceptionFilter);
/*Utils::Hook::Set(0x6D70AC, Exception::SetUnhandledExceptionFilterStub);
SetUnhandledExceptionFilter(&Exception::ExceptionFilter);*/
#endif
Command::Add("mapTest", [] (Command::Params params)