From bb0df71da2be4d84e664917138373beb2faadf79 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Thu, 26 Mar 2020 03:13:21 -0600 Subject: [PATCH] suppress mono_* when configured --- texthook/engine/engine.cc | 3 ++- texthook/engine/mono/funcinfo.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/texthook/engine/engine.cc b/texthook/engine/engine.cc index 99075f5..5dffdb3 100644 --- a/texthook/engine/engine.cc +++ b/texthook/engine/engine.cc @@ -16803,10 +16803,11 @@ bool InsertMonoHooks() if (FARPROC addr = ::GetProcAddress(h, func.functionName)) { hp.address = (DWORD)addr; hp.type = func.hookType; + if (loadedConfig) hp.type |= HOOK_EMPTY; hp.filter_fun = NoAsciiFilter; hp.offset = func.textIndex * 4; hp.length_offset = func.lengthIndex * 4; - hp.text_fun = (decltype(hp.text_fun))func.text_fun; + hp.text_fun = func.text_fun; ConsoleOutput("vnreng: Mono: INSERT"); NewHook(hp, func.functionName); ret = true; diff --git a/texthook/engine/mono/funcinfo.h b/texthook/engine/mono/funcinfo.h index 143f0a5..aea7ad7 100644 --- a/texthook/engine/mono/funcinfo.h +++ b/texthook/engine/mono/funcinfo.h @@ -38,7 +38,7 @@ struct MonoFunction { // argument indices start from 0 for SpecialHookMonoString size_t textIndex; // argument index short lengthIndex; // argument index unsigned long hookType; // HookParam type - void *text_fun; // HookParam::text_fun_t + void(*text_fun)(DWORD stack, HookParam* hp, BYTE obsoleteAlwaysZero, DWORD* data, DWORD* split, DWORD* len); // HookParam::text_fun_t }; #define MONO_FUNCTIONS_INITIALIZER \