styyx-util 1.0
Utility Header for SKSE Plugin development
Loading...
Searching...
No Matches
StyyxUtil::HookUtils Namespace Reference

Functions

template<class T>
void WriteCall5 (const REL::ID a_relID, const uint32_t a_offset)
 Basic Call hook.
template<class O, uint32_t table, uint32_t index, class T>
void WriteVFunc ()
template<typename Ret, typename... Args>
static Ret GenericCall (REL::ID a_id, uint32_t a_offset, Args... args)
template<class T, std::size_t BYTES>
void hook_function_prologue (std::uintptr_t a_src)

Function Documentation

◆ GenericCall()

template<typename Ret, typename... Args>
Ret StyyxUtil::HookUtils::GenericCall ( REL::ID a_id,
uint32_t a_offset,
Args... args )
static

◆ hook_function_prologue()

template<class T, std::size_t BYTES>
void StyyxUtil::HookUtils::hook_function_prologue ( std::uintptr_t a_src)

◆ WriteCall5()

template<class T>
void StyyxUtil::HookUtils::WriteCall5 ( const REL::ID a_relID,
const uint32_t a_offset )

Basic Call hook.

Template Parameters
TThe class this template works with
Parameters
a_relIDRelocation ID for the function
a_offsetOffset for the function address
Note
needs SKSE::AllocTrampoline(14) per usage
Hooked function needs to be called Call and the Relocation needs to be called func
Example Usage:
struct HasPerkHook
{
static bool Call(RE::Actor* a_this, RE::BGSPerk* a_perk)
{
Your Code
return func(a_this, a_perk));
}
static inline REL::Relocation<decltype(Call)> func;
};
void InstallHook(){
WriteCall5<HasPerkHook>(RELOCATION_ID(420, 69), 0x5);
}
void WriteCall5(const REL::ID a_relID, const uint32_t a_offset)
Basic Call hook.
Definition st-hooks.h:34

◆ WriteVFunc()

template<class O, uint32_t table, uint32_t index, class T>
void StyyxUtil::HookUtils::WriteVFunc ( )