-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdllmain.cpp
43 lines (29 loc) · 927 Bytes
/
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
#include <windows.h>
#include <thread>
#include "aimassist/aimassist.hpp"
void run()
{
std::this_thread::sleep_for(std::chrono::milliseconds(50));
#if DEBUG
AllocConsole();
SetConsoleCtrlHandler(NULL, true);
FILE* fIn;
FILE* fOut;
freopen_s(&fIn, "conin$", "r", stdin);
freopen_s(&fOut, "conout$", "w", stdout);
freopen_s(&fOut, "conout$", "w", stderr);
#endif
aimassist::instance = std::make_unique<aimassist::c_aimassist>();
if (!aimassist::instance->attach())
return;
aimassist::instance->run();
std::this_thread::sleep_for(std::chrono::milliseconds(50));
aimassist::instance->unload();
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD reasonForCall, LPVOID lpReserved)
{
if(reasonForCall != DLL_PROCESS_ATTACH)
return FALSE;
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)run, 0, 0, 0);
return TRUE;
}