#include <cstdint>
#include <windows.h>
template<typename T>
void write_memory(std::uintptr_t addr, const T value) {
DWORD vp;
VirtualProtect(reinterpret_cast<void *>(addr), sizeof(T), PAGE_EXECUTE_READWRITE, &vp);
*reinterpret_cast<T *>(addr) = value;
VirtualProtect(reinterpret_cast<void *>(addr), sizeof(T), vp, nullptr);
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReasonForCall, LPVOID) {
static constexpr auto ratio = 62.5f;
if (dwReasonForCall == DLL_PROCESS_ATTACH) {
write_memory<std::uintptr_t>(0x5892FF + 2, reinterpret_cast<std::uintptr_t>(&ratio));
} else if (dwReasonForCall == DLL_PROCESS_DETACH) {
write_memory<std::uintptr_t>(0x5892FF + 2, 0x858628);
}
return TRUE;
}