Skip to content

Commit

Permalink
Add method to check source hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
qubka committed Sep 17, 2024
1 parent 1f5f956 commit a910436
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions src/mm_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ namespace plugifyMM
{
Print<plugify::ModuleState>("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
{
Expand Down Expand Up @@ -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<MallocFunc>();
//std::free = libc.GetFunctionByName("free").CCast<FreeFunc>();
#endif

PLUGIN_SAVEVARS();

GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
Expand Down Expand Up @@ -827,4 +821,9 @@ SMM_API PluginId Plugify_Id()
SMM_API SourceHook::ISourceHook *Plugify_SourceHook()
{
return plugifyMM::g_SHPtr;
}
}

SMM_API bool Plugify_SourcePatched(void *vfnptr)
{
return plugifyMM::g_SHPtr->GetOrigVfnPtrEntry(vfnptr) != nullptr;
}

0 comments on commit a910436

Please sign in to comment.