Fix code analysis warnings
This commit is contained in:
parent
2d32d44da2
commit
8d2d825be6
@ -136,18 +136,25 @@ namespace Components
|
||||
static uint8_t loadLibWStr[] = { 0xB3, 0x90, 0x9E, 0x9B, 0xB3, 0x96, 0x9D, 0x8D, 0x9E, 0x8D, 0x86, 0xA8 }; // LoadLibraryW
|
||||
|
||||
HMODULE kernel32 = GetModuleHandleA(Utils::String::XOR(std::string(reinterpret_cast<char*>(kernel32Str), sizeof kernel32Str), -1).data());
|
||||
FARPROC loadLibA = GetProcAddress(kernel32, Utils::String::XOR(std::string(reinterpret_cast<char*>(loadLibAStr), sizeof loadLibAStr), -1).data());
|
||||
FARPROC loadLibW = GetProcAddress(kernel32, Utils::String::XOR(std::string(reinterpret_cast<char*>(loadLibWStr), sizeof loadLibWStr), -1).data());
|
||||
|
||||
if (kernel32)
|
||||
{
|
||||
FARPROC loadLibA = GetProcAddress(kernel32, Utils::String::XOR(std::string(reinterpret_cast<char*>(loadLibAStr), sizeof loadLibAStr), -1).data());
|
||||
FARPROC loadLibW = GetProcAddress(kernel32, Utils::String::XOR(std::string(reinterpret_cast<char*>(loadLibWStr), sizeof loadLibWStr), -1).data());
|
||||
|
||||
if (loadLibA && loadLibW)
|
||||
{
|
||||
#ifdef DEBUG_LOAD_LIBRARY
|
||||
AntiCheat::LoadLibHook[0].Initialize(loadLibA, LoadLibaryAStub, HOOK_JUMP);
|
||||
AntiCheat::LoadLibHook[1].Initialize(loadLibW, LoadLibaryWStub, HOOK_JUMP);
|
||||
AntiCheat::LoadLibHook[0].Initialize(loadLibA, LoadLibaryAStub, HOOK_JUMP);
|
||||
AntiCheat::LoadLibHook[1].Initialize(loadLibW, LoadLibaryWStub, HOOK_JUMP);
|
||||
#else
|
||||
AntiCheat::LoadLibHook[0].Initialize(loadLibA, loadLibStub, HOOK_JUMP);
|
||||
AntiCheat::LoadLibHook[1].Initialize(loadLibW, loadLibStub, HOOK_JUMP);
|
||||
AntiCheat::LoadLibHook[0].Initialize(loadLibA, loadLibStub, HOOK_JUMP);
|
||||
AntiCheat::LoadLibHook[1].Initialize(loadLibW, loadLibStub, HOOK_JUMP);
|
||||
#endif
|
||||
//AntiCheat::LoadLibHook[2].Initialize(LoadLibraryExA, loadLibExStub, HOOK_JUMP);
|
||||
//AntiCheat::LoadLibHook[3].Initialize(LoadLibraryExW, loadLibExStub, HOOK_JUMP);
|
||||
//AntiCheat::LoadLibHook[2].Initialize(LoadLibraryExA, loadLibExStub, HOOK_JUMP);
|
||||
//AntiCheat::LoadLibHook[3].Initialize(LoadLibraryExW, loadLibExStub, HOOK_JUMP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AntiCheat::ReadIntegrityCheck()
|
||||
|
@ -53,6 +53,16 @@ namespace Components
|
||||
|
||||
CreateProcessA("updater.exe", NULL, NULL, NULL, false, CREATE_NO_WINDOW, NULL, NULL, &sInfo, &pInfo);
|
||||
|
||||
if (pInfo.hThread && pInfo.hThread != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
CloseHandle(pInfo.hThread);
|
||||
}
|
||||
|
||||
if (pInfo.hProcess && pInfo.hProcess != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
CloseHandle(pInfo.hProcess);
|
||||
}
|
||||
|
||||
TerminateProcess(GetCurrentProcess(), exitCode);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace Utils
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned int i = (this->TokenString.size() - 1); i >= 0; i--)
|
||||
for (int i = static_cast<int>(this->TokenString.size() - 1); i >= 0; i--)
|
||||
{
|
||||
if (this->TokenString[i] == 0xFF)
|
||||
{
|
||||
|
@ -159,12 +159,17 @@ namespace Utils
|
||||
{
|
||||
// Generate UUID data
|
||||
UUID uuid;
|
||||
UuidCreate(&uuid);
|
||||
if (!UuidCreate(&uuid))
|
||||
{
|
||||
// Convert to string representation
|
||||
char* strdata = nullptr;
|
||||
if (!UuidToStringA(&uuid, reinterpret_cast<RPC_CSTR*>(&strdata)))
|
||||
{
|
||||
return std::string(strdata);
|
||||
}
|
||||
}
|
||||
|
||||
// Convert to string representation
|
||||
char* strdata = nullptr;
|
||||
UuidToStringA(&uuid, reinterpret_cast<RPC_CSTR*>(&strdata));
|
||||
return std::string(strdata);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user