diff --git a/mai2hook/dllmain.c b/mai2hook/dllmain.c index 2ad76be..c93873b 100644 --- a/mai2hook/dllmain.c +++ b/mai2hook/dllmain.c @@ -13,14 +13,13 @@ #include "hook/process.h" #include "hook/table.h" -#include "hook/iohook.h" #include "hooklib/dvd.h" -#include "hooklib/serial.h" #include "hooklib/spike.h" #include "hooklib/path.h" #include "hooklib/reg.h" #include "hooklib/procaddr.h" +#include "hooklib/serial.h" #include "mai2hook/config.h" #include "mai2hook/io4.h" @@ -47,14 +46,6 @@ static DWORD CALLBACK mai2_pre_startup(void) mai2_hook_config_load(&mai2_hook_cfg, L".\\segatools.ini"); - HMODULE mono = LoadLibraryW(L".\\MonoBleedingEdge\\EmbedRuntime\\mono-2.0-bdwgc.dll"); // load this so we can hook it maybe - if (mono == NULL) { - dprintf("Failed to load mono-2.0-bdwgc.dll\n"); - } else { - serial_hook_apply_hooks(mono); - iohook_apply_hooks(mono); - } - /* Hook Win32 APIs */ dvd_hook_init(&mai2_hook_cfg.dvd, mai2_hook_mod); diff --git a/mai2hook/unity.c b/mai2hook/unity.c index 5d1157d..1f6137b 100644 --- a/mai2hook/unity.c +++ b/mai2hook/unity.c @@ -3,11 +3,13 @@ #include #include "hook/table.h" +#include "hook/iohook.h" #include "hooklib/dll.h" #include "hooklib/path.h" #include "hooklib/reg.h" #include "hooklib/procaddr.h" +#include "hooklib/serial.h" #include "util/dprintf.h" @@ -20,13 +22,13 @@ static HMODULE (WINAPI *next_LoadLibraryExW)(const wchar_t *name, HANDLE hFile, static const struct hook_symbol unity_kernel32_syms[] = { { - .name = "LoadLibraryW", + .name = "LoadLibraryW", .patch = my_LoadLibraryW, - .link = (void **) &next_LoadLibraryW, + .link = (void **) &next_LoadLibraryW, },{ - .name = "LoadLibraryExW", + .name = "LoadLibraryExW", .patch = my_LoadLibraryExW, - .link = (void **) &next_LoadLibraryExW, + .link = (void **) &next_LoadLibraryExW, } }; @@ -105,6 +107,8 @@ static HMODULE WINAPI my_LoadLibraryW(const wchar_t *name) path_hook_insert_hooks(result); reg_hook_insert_hooks(result); proc_addr_insert_hooks(result); + serial_hook_apply_hooks(result); + iohook_apply_hooks(result); } }