feat: added inline hook manager

This commit is contained in:
2025-11-18 20:01:46 +01:00
parent 1c3afef164
commit 50fb354983
2 changed files with 136 additions and 0 deletions

31
src/detail/hooking.hpp Normal file
View File

@@ -0,0 +1,31 @@
#pragma once
#include <cstddef>
#include <vector>
namespace fxn
{
struct HookInfo
{
void* targetFunction;
void* hookFunction;
std::vector<std::byte> originalBytes;
};
class HookingManager
{
private:
std::vector<HookInfo> m_Hooks;
protected:
HookingManager();
~HookingManager();
public:
static HookingManager& GetInstance();
static void Destroy();
public:
bool InstallHook(void* targetFunction, void* hookFunction);
bool RemoveHook(void* targetFunction);
};
}