SafetyHook
Loading...
Searching...
No Matches
easy.hpp File Reference

Easy to use API for creating hooks. More...

#include "safetyhook/common.hpp"
#include "safetyhook/inline_hook.hpp"
#include "safetyhook/mid_hook.hpp"
#include "safetyhook/utility.hpp"
#include "safetyhook/vmt_hook.hpp"

Go to the source code of this file.

Functions

InlineHook SAFETYHOOK_API safetyhook::create_inline (void *target, void *destination, InlineHook::Flags flags=InlineHook::Default)
 Easy to use API for creating an InlineHook.
 
template<typename T, typename U>
InlineHook safetyhook::create_inline (T target, U destination, InlineHook::Flags flags=InlineHook::Default)
 Easy to use API for creating an InlineHook.
 
MidHook SAFETYHOOK_API safetyhook::create_mid (void *target, MidHookFn destination, MidHook::Flags flags=MidHook::Default)
 Easy to use API for creating a MidHook.
 
template<typename T>
MidHook safetyhook::create_mid (T target, MidHookFn destination, MidHook::Flags flags=MidHook::Default)
 Easy to use API for creating a MidHook.
 
VmtHook SAFETYHOOK_API safetyhook::create_vmt (void *object)
 Easy to use API for creating a VmtHook.
 
template<typename T>
VmHook safetyhook::create_vm (VmtHook &vmt, size_t index, T destination)
 Easy to use API for creating a VmHook.
 

Detailed Description

Easy to use API for creating hooks.

Function Documentation

◆ create_inline() [1/2]

template<typename T, typename U>
InlineHook safetyhook::create_inline ( T target,
U destination,
InlineHook::Flags flags = InlineHook::Default )
nodiscard

Easy to use API for creating an InlineHook.

Parameters
targetThe address of the function to hook.
destinationThe address of the destination function.
flagsThe flags to use.
Returns
The InlineHook object.

◆ create_inline() [2/2]

InlineHook SAFETYHOOK_API safetyhook::create_inline ( void * target,
void * destination,
InlineHook::Flags flags = InlineHook::Default )
nodiscard

Easy to use API for creating an InlineHook.

Parameters
targetThe address of the function to hook.
destinationThe address of the destination function.
flagsThe flags to use.
Returns
The InlineHook object.

◆ create_mid() [1/2]

template<typename T>
MidHook safetyhook::create_mid ( T target,
MidHookFn destination,
MidHook::Flags flags = MidHook::Default )
nodiscard

Easy to use API for creating a MidHook.

Parameters
targetthe address of the function to hook.
destinationThe destination function.
flagsThe flags to use.
Returns
The MidHook object.

◆ create_mid() [2/2]

MidHook SAFETYHOOK_API safetyhook::create_mid ( void * target,
MidHookFn destination,
MidHook::Flags flags = MidHook::Default )
nodiscard

Easy to use API for creating a MidHook.

Parameters
targetthe address of the function to hook.
destinationThe destination function.
flagsThe flags to use.
Returns
The MidHook object.

◆ create_vm()

template<typename T>
VmHook safetyhook::create_vm ( VmtHook & vmt,
size_t index,
T destination )
nodiscard

Easy to use API for creating a VmHook.

Parameters
vmtThe VmtHook to use to create the VmHook.
indexThe index of the method to hook.
destinationThe destination function.
Returns
The VmHook object.

◆ create_vmt()

VmtHook SAFETYHOOK_API safetyhook::create_vmt ( void * object)
nodiscard

Easy to use API for creating a VmtHook.

Parameters
objectThe object to hook.
Returns
The VmtHook object.