-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource.cpp
More file actions
28 lines (22 loc) · 696 Bytes
/
source.cpp
File metadata and controls
28 lines (22 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <Windows.h>
#include <thread>
static __int64 rebase(__int64 address, __int64 base = 0x1E9DE1A0000)
{
return (address - base + reinterpret_cast<__int64>(GetModuleHandle(0)));
}
static auto get_task_scheduler = reinterpret_cast<__int64(__cdecl*)()>(rebase(0x1E9DEA3EA40));
void initialize()
{
__int64 task_scheduler = get_task_scheduler();
double framerate_value = 300;
float framerate = 1 / *reinterpret_cast<double*>(task_scheduler + 0x158);
*reinterpret_cast<double*>(task_scheduler + 0x158) = 1 / framerate_value;
}
__int64 APIENTRY DllMain(HMODULE module, uint32_t reason, LPVOID)
{
if (reason == DLL_PROCESS_ATTACH)
{
std::thread(initialize).detach();
}
return 1;
}