SafetyHook
Loading...
Searching...
No Matches
safetyhook::VmHook Class Referencefinal

A hook class that allows for hooking a single method in a VMT. More...

#include <vmt_hook.hpp>

Public Member Functions

 VmHook (const VmHook &)=delete
 VmHook (VmHook &&other) noexcept
VmHookoperator= (const VmHook &)=delete
VmHookoperator= (VmHook &&other) noexcept
void reset ()
 Removes the hook.
template<typename T>
original () const
 Gets the original method pointer.
template<typename RetT = void, typename... Args>
RetT call (Args... args)
 Calls the original method.
template<typename RetT = void, typename... Args>
RetT ccall (Args... args)
 Calls the original method with the __cdecl calling convention.
template<typename RetT = void, typename... Args>
RetT thiscall (Args... args)
 Calls the original method with the __thiscall calling convention.
template<typename RetT = void, typename... Args>
RetT stdcall (Args... args)
 Calls the original method with the __stdcall calling convention.
template<typename RetT = void, typename... Args>
RetT fastcall (Args... args)
 Calls the original method with the __fastcall calling convention.

Friends

class VmtHook

Detailed Description

A hook class that allows for hooking a single method in a VMT.

Member Function Documentation

◆ call()

template<typename RetT = void, typename... Args>
RetT safetyhook::VmHook::call ( Args... args)
inline

Calls the original method.

Template Parameters
RetTThe return type of the method.
ArgsThe argument types of the method.
Parameters
argsThe arguments to pass to the method.
Returns
The return value of the method.
Note
This will call the original method with the default calling convention.

◆ ccall()

template<typename RetT = void, typename... Args>
RetT safetyhook::VmHook::ccall ( Args... args)
inline

Calls the original method with the __cdecl calling convention.

Template Parameters
RetTThe return type of the method.
ArgsThe argument types of the method.
Parameters
argsThe arguments to pass to the method.
Returns
The return value of the method.

◆ fastcall()

template<typename RetT = void, typename... Args>
RetT safetyhook::VmHook::fastcall ( Args... args)
inline

Calls the original method with the __fastcall calling convention.

Template Parameters
RetTThe return type of the method.
ArgsThe argument types of the method.
Parameters
argsThe arguments to pass to the method.
Returns
The return value of the method.

◆ stdcall()

template<typename RetT = void, typename... Args>
RetT safetyhook::VmHook::stdcall ( Args... args)
inline

Calls the original method with the __stdcall calling convention.

Template Parameters
RetTThe return type of the method.
ArgsThe argument types of the method.
Parameters
argsThe arguments to pass to the method.
Returns
The return value of the method.

◆ thiscall()

template<typename RetT = void, typename... Args>
RetT safetyhook::VmHook::thiscall ( Args... args)
inline

Calls the original method with the __thiscall calling convention.

Template Parameters
RetTThe return type of the method.
ArgsThe argument types of the method.
Parameters
argsThe arguments to pass to the method.
Returns
The return value of the method.

The documentation for this class was generated from the following file: