A DynamicHook allows to hook a virtual function on any C++ object. Currently CBaseEntity and CGameRules have a convenience API for easy entity hooking, but it's possible to provide a raw this-pointer to hook any object in memory too. Internally this intercepts function calls by replacing the function pointer in the virtual table of the object with our own function.
| Symbol | Description |
|---|---|
| DynamicHook | Creates a vtable hook. |
| FromConf | Setup a vtable hook for a function as described in a "Functions" section in gamedata. The "Functions" section is parsed once the gamedata file is loaded and cached globally. |
| HookEntity | Hook an entity. Entity hooks are auto-removed when the entity is destroyed. If you need to read the return value of the function, choose a post hook. |
| HookGamerules | Hook gamerules object. Game rules hooks are auto-removed on map end. If you need to read the return value of the function, choose a post hook. |
| HookRaw | Hook a raw this-pointer. If you need to read the return value of the function, choose a post hook. |
| RemoveHook | Remove hook by hook id. |