clean up code

This commit is contained in:
EricPlayZ
2024-04-24 04:17:21 +03:00
parent 4308c7b21a
commit 0f5435fa09
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ namespace GamePH {
GetModuleFileNameA(GetModuleHandleA(nullptr), exePath, sizeof(exePath));
DWORD dummy{};
DWORD size = GetFileVersionInfoSizeA(exePath, &dummy);
const DWORD size = GetFileVersionInfoSizeA(exePath, &dummy);
if (!size)
return 0;
@ -19,9 +19,7 @@ namespace GamePH {
VS_FIXEDFILEINFO* fileInfo = nullptr;
UINT fileInfoSize = 0;
if (!VerQueryValueA(data.data(), "\\", reinterpret_cast<void**>(&fileInfo), &fileInfoSize))
return 0;
if (fileInfo == nullptr)
if (!VerQueryValueA(data.data(), "\\", reinterpret_cast<LPVOID*>(&fileInfo), &fileInfoSize) || !fileInfo)
return 0;
const DWORD major = HIWORD(fileInfo->dwFileVersionMS);

View File

@ -43,7 +43,9 @@ namespace GamePH {
LifeSetHealthHook.pOriginal(pLifeHealth, health);
}
#pragma endregion
#pragma region IsNotOutOfBounds
static bool detourIsNotOutOfBounds(LPVOID pInstance, DWORD64 a2);
static Utils::Hook::MHook<LPVOID, bool(*)(LPVOID, DWORD64)> IsNotOutOfBoundsHook{ "IsNotOutOfBounds", &Offsets::Get_IsNotOutOfBounds, &detourIsNotOutOfBounds };