-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdllmain.cpp
51 lines (33 loc) · 1 KB
/
dllmain.cpp
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "pch.h"
#include <Windows.h>
#include <iostream>
#include <string>
#include "Overlay/rendering.h"
void client_main() {
auto open_console = [] {
AllocConsole();
FILE* f = nullptr;
freopen_s(&f, "CONOUT$", "w", stdout);
};
open_console();
if (!InitSdk()) {
std::cout << "failed to initialize sdk" << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
return;
}
std::cout << "initialized sdk" << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
std::thread render_thread(render);
std::cout << "started render thread" << std::endl;
while (true) {
gvar::cache_globals();
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
}
BOOL APIENTRY DllMain(HMODULE module, DWORD ul_reason_for_call, LPVOID resrved)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)client_main, 0, 0, 0);
}
return TRUE;
}