Initial commit, hook into StarWarsI.exe

This commit is contained in:
2026-02-27 21:53:08 -06:00
parent f4c90a15cd
commit cb9c3879ce
14 changed files with 690 additions and 1 deletions

26
dllmain.cpp Normal file
View 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;
}