-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdllMain.cpp
More file actions
30 lines (23 loc) · 852 Bytes
/
dllMain.cpp
File metadata and controls
30 lines (23 loc) · 852 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
29
30
// Created by SleepyFish on 19-3-2025 for the SimpleInjectionClientBase project
#include "Windows.h"
#include "source/me/sleepyfish/Client.h"
void Init(HMODULE mod) {
Client::inst->setup();
Client::inst->mainLoop();
Client::inst->cleanup();
FreeLibrary(mod);
}
BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved) {
// checks if the dll action is attach
if (dwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hModule);
// create thread for the main loop passing argument hModule to the init function
HANDLE hThread = CreateThread (
nullptr, 0, (LPTHREAD_START_ROUTINE) (Init), hModule, 0, nullptr
);
// close the thread
if (hThread != nullptr)
CloseHandle(hThread);
}
return true;
}