|
SafetyHook
|
A hook class that copies an entire VMT for a given object and replaces it. More...
#include <vmt_hook.hpp>
Classes | |
| struct | Error |
| Error type for VmtHook. More... | |
Public Member Functions | |
| VmtHook (const VmtHook &)=delete | |
| VmtHook (VmtHook &&other) noexcept | |
| VmtHook & | operator= (const VmtHook &)=delete |
| VmtHook & | operator= (VmtHook &&other) noexcept |
| void | apply (void *object) |
| Applies the hook. | |
| void | remove (void *object) |
| Removes the hook. | |
| void | reset () |
| Removes the hook from all objects. | |
| template<typename T> | |
| std::expected< VmHook, Error > | hook_method (size_t index, T new_function) |
| Hooks a method in the VMT. | |
Static Public Member Functions | |
| static std::expected< VmtHook, Error > | create (void *object) |
| Creates a new VmtHook object. Will clone the VMT of the given object and replace it. | |
A hook class that copies an entire VMT for a given object and replaces it.
| void safetyhook::VmtHook::apply | ( | void * | object | ) |
Applies the hook.
| object | The object to apply the hook to. |
Creates a new VmtHook object. Will clone the VMT of the given object and replace it.
| object | The object to hook. |
|
inlinenodiscard |
Hooks a method in the VMT.
| index | The index of the method to hook. |
| new_function | The new function to use. |
| void safetyhook::VmtHook::remove | ( | void * | object | ) |
Removes the hook.
| object | The object to remove the hook from. |