4 #include "../Include/Winheaders.h"
5 #include "../Asm/AsmHelper.h"
6 #include "../Asm/LDasm.h"
7 #include "../Include/Macro.h"
10 #include <unordered_map>
39 namespace ReturnMethod
50 typedef std::unordered_map<DWORD, int> mapIdx;
54 BLACKBONE_API ~DetourBase();
83 BLACKBONE_API
bool ToggleHBP(
int index,
bool enable );
96 BLACKBONE_API
static LONG NTAPI
VectoredHandler ( PEXCEPTION_POINTERS excpt );
97 BLACKBONE_API
static LONG NTAPI
Int3Handler ( PEXCEPTION_POINTERS excpt );
98 BLACKBONE_API
static LONG NTAPI
AVHandler ( PEXCEPTION_POINTERS excpt );
99 BLACKBONE_API
static LONG NTAPI
StepHandler ( PEXCEPTION_POINTERS excpt );
102 bool _hooked =
false;
104 void* _callback =
nullptr;
105 void* _callbackClass =
nullptr;
106 void* _original =
nullptr;
107 void* _internalHandler =
nullptr;
108 void* _callOriginal =
nullptr;
111 size_t _origSize = 0;
112 uint8_t* _buf =
nullptr;
113 uint8_t* _origCode =
nullptr;
114 uint8_t* _newCode =
nullptr;
116 HookType::e _type = HookType::Inline;
117 CallOrder::e _order = CallOrder::HookFirst;
118 ReturnMethod::e _retType = ReturnMethod::UseOriginal;
121 BLACKBONE_API
static std::unordered_map<void*, DetourBase*> _breakpoints;
124 BLACKBONE_API
static void* _vecHandler;
static BLACKBONE_API LONG NTAPI Int3Handler(PEXCEPTION_POINTERS excpt)
Int3 exception handler
Definition: LocalHookBase.cpp:208
Definition: LocalHookBase.h:48
static BLACKBONE_API LONG NTAPI StepHandler(PEXCEPTION_POINTERS excpt)
Single step exception handler
Definition: LocalHookBase.cpp:238
BLACKBONE_API bool EnableHook()
Enable disabled hook
Definition: LocalHookBase.cpp:74
static BLACKBONE_API LONG NTAPI AVHandler(PEXCEPTION_POINTERS excpt)
Access violation handler
Definition: LocalHookBase.cpp:228
BLACKBONE_API bool ToggleHBP(int index, bool enable)
Toggle hardware breakpoint for current thread
Definition: LocalHookBase.cpp:90
static BLACKBONE_API LONG NTAPI VectoredHandler(PEXCEPTION_POINTERS excpt)
Exception handlers
Definition: LocalHookBase.cpp:185
BLACKBONE_API bool AllocateBuffer(uint8_t *nearest)
Allocate detour buffer as close to target as possible
Definition: LocalHookBase.cpp:22
BLACKBONE_API void CopyOldCode(uint8_t *Ptr)
Copy original function bytes
Definition: LocalHookBase.cpp:110
Definition: AsmHelper32.cpp:6
BLACKBONE_API bool DisableHook()
Temporarily disable hook
Definition: LocalHookBase.cpp:60