[AntiCheat] Fix linux usage
This commit is contained in:
parent
d697c94388
commit
66dd013925
@ -466,7 +466,6 @@ namespace Components
|
||||
unsigned long AntiCheat::ProtectProcess()
|
||||
{
|
||||
#ifdef PROCTECT_PROCESS
|
||||
if (Dedicated::IsEnabled()) return 0;
|
||||
Utils::Memory::Allocator allocator;
|
||||
|
||||
HANDLE hToken = nullptr;
|
||||
|
19
src/Main.cpp
19
src/Main.cpp
@ -2,20 +2,9 @@
|
||||
|
||||
namespace Main
|
||||
{
|
||||
void SetEnvironment()
|
||||
{
|
||||
wchar_t exeName[512];
|
||||
GetModuleFileName(GetModuleHandle(nullptr), exeName, sizeof(exeName) / 2);
|
||||
|
||||
wchar_t* exeBaseName = wcsrchr(exeName, L'\\');
|
||||
exeBaseName[0] = L'\0';
|
||||
|
||||
SetCurrentDirectory(exeName);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
Main::SetEnvironment();
|
||||
Utils::SetEnvironment();
|
||||
Utils::Cryptography::Initialize();
|
||||
Components::Loader::Initialize();
|
||||
|
||||
@ -70,9 +59,12 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l
|
||||
|
||||
#ifndef DISABLE_ANTICHEAT
|
||||
[]()
|
||||
{
|
||||
if (!Components::Dedicated::IsEnabled())
|
||||
{
|
||||
Components::AntiCheat::ProtectProcess();
|
||||
Components::AntiCheat::PatchThreadCreation();
|
||||
}
|
||||
}();
|
||||
#endif
|
||||
|
||||
@ -92,8 +84,11 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l
|
||||
{
|
||||
#ifndef DISABLE_ANTICHEAT
|
||||
[]()
|
||||
{
|
||||
if (!Components::Dedicated::IsEnabled())
|
||||
{
|
||||
Components::AntiCheat::VerifyThreadIntegrity();
|
||||
}
|
||||
}();
|
||||
#endif
|
||||
}
|
||||
|
@ -104,6 +104,17 @@ namespace Utils
|
||||
return address;
|
||||
}
|
||||
|
||||
void SetEnvironment()
|
||||
{
|
||||
wchar_t exeName[512];
|
||||
GetModuleFileName(GetModuleHandle(nullptr), exeName, sizeof(exeName) / 2);
|
||||
|
||||
wchar_t* exeBaseName = wcsrchr(exeName, L'\\');
|
||||
exeBaseName[0] = L'\0';
|
||||
|
||||
SetCurrentDirectory(exeName);
|
||||
}
|
||||
|
||||
HMODULE GetNTDLL()
|
||||
{
|
||||
static uint8_t ntdll[] = { 0x91, 0x8B, 0x9B, 0x93, 0x93, 0xD1, 0x9B, 0x93, 0x93 }; // ntdll.dll
|
||||
|
@ -19,6 +19,8 @@ namespace Utils
|
||||
void* GetThreadStartAddress(HANDLE hThread);
|
||||
HMODULE GetNTDLL();
|
||||
|
||||
void SetEnvironment();
|
||||
|
||||
void OpenUrl(std::string url);
|
||||
|
||||
bool HasIntercection(unsigned int base1, unsigned int len1, unsigned int base2, unsigned int len2);
|
||||
|
Loading…
Reference in New Issue
Block a user