31 lines
613 B
C++
31 lines
613 B
C++
#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);
|
|
};
|
|
} |