2025-07-22 22:06:34 +03:00

31 lines
1.0 KiB
C++

#include "math.h"
//used: getexportaddr
#include "memory.h"
bool MATH::Setup()
{
bool bSuccess = true;
const void* hTier0Lib = MEM::GetModuleBaseHandle(TIER0_DLL);
if (hTier0Lib == nullptr)
return false;
fnRandomSeed = reinterpret_cast<decltype(fnRandomSeed)>(MEM::GetExportAddress(hTier0Lib, CS_XOR("RandomSeed")));
bSuccess &= (fnRandomSeed != nullptr);
fnRandomFloat = reinterpret_cast<decltype(fnRandomFloat)>(MEM::GetExportAddress(hTier0Lib, CS_XOR("RandomFloat")));
bSuccess &= (fnRandomFloat != nullptr);
fnRandomFloatExp = reinterpret_cast<decltype(fnRandomFloatExp)>(MEM::GetExportAddress(hTier0Lib, CS_XOR("RandomFloatExp")));
bSuccess &= (fnRandomFloatExp != nullptr);
fnRandomInt = reinterpret_cast<decltype(fnRandomInt)>(MEM::GetExportAddress(hTier0Lib, CS_XOR("RandomInt")));
bSuccess &= (fnRandomInt != nullptr);
fnRandomGaussianFloat = reinterpret_cast<decltype(fnRandomGaussianFloat)>(MEM::GetExportAddress(hTier0Lib, CS_XOR("RandomGaussianFloat")));
bSuccess &= (fnRandomGaussianFloat != nullptr);
return bSuccess;
}