Initial commit, hook into StarWarsI.exe
This commit is contained in:
26
dllmain.cpp
Normal file
26
dllmain.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "proxy.h"
|
||||
#include "lua_hook.h"
|
||||
#include <windows.h>
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved) {
|
||||
switch (fdwReason) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hinstDll);
|
||||
|
||||
if (!Proxy_Init()) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!LuaHook_Init()) {
|
||||
OutputDebugStringA("[SWEAW Hooks] WARNING: LuaHook_Init() failed - Lua hooks are not active.\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
LuaHook_Shutdown();
|
||||
Proxy_Shutdown();
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
Reference in New Issue
Block a user