feat: added inline hook manager
This commit is contained in:
31
src/detail/hooking.hpp
Normal file
31
src/detail/hooking.hpp
Normal 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);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user