DynamicHook Class

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.

Methods 6

Name Description

Creates a vtable hook.


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.


Hook an entity.


Hook gamerules object.


Hook a raw this-pointer. If you need to read the return value of the function, choose a post hook.


Remove hook by hook id.