From a910436c14944ad59601c45aef32b05b15bc2024 Mon Sep 17 00:00:00 2001 From: qubka Date: Tue, 17 Sep 2024 19:39:15 +0100 Subject: [PATCH] Add method to check source hooks --- external/plugify | 2 +- src/mm_plugin.cpp | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/external/plugify b/external/plugify index e939220..db5af9d 160000 --- a/external/plugify +++ b/external/plugify @@ -1 +1 @@ -Subproject commit e939220a6e8f3937d035fce52cd1d3459e53798d +Subproject commit db5af9dddc80b47925cf8a317a7ba4f1ca0a3b5c diff --git a/src/mm_plugin.cpp b/src/mm_plugin.cpp index 92e0bfb..d70a9f6 100644 --- a/src/mm_plugin.cpp +++ b/src/mm_plugin.cpp @@ -393,7 +393,7 @@ namespace plugifyMM { Print("Module", *module, plugify::ModuleUtils::ToString); CONPRINTF(" Language: {}\n", module->GetLanguage()); - CONPRINTF(" File: {}\n\n", module->GetFilePath().string()); + CONPRINTF(" File: {}\n\n", std::filesystem::path(module->GetFilePath()).string()); } else { @@ -687,12 +687,6 @@ namespace plugifyMM bool PlugifyMMPlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late) { -#if PLUGIFY_PLATFORM_LINUX - //const plugify::Assembly libc(LIBC_SO, plugify::LoadFlag::Lazy); - //std::malloc = libc.GetFunctionByName("malloc").CCast(); - //std::free = libc.GetFunctionByName("free").CCast(); -#endif - PLUGIN_SAVEVARS(); GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER); @@ -827,4 +821,9 @@ SMM_API PluginId Plugify_Id() SMM_API SourceHook::ISourceHook *Plugify_SourceHook() { return plugifyMM::g_SHPtr; -} \ No newline at end of file +} + +SMM_API bool Plugify_SourcePatched(void *vfnptr) +{ + return plugifyMM::g_SHPtr->GetOrigVfnPtrEntry(vfnptr) != nullptr; +}