DynamicDetour Class

A DynamicDetour is a way to hook and block any function in memory. Given the address of a function, it can call a callback in your script whenever the function gets called. The callback has access to all parameters of the function as well as the return value.

Internally this works by replacing the first instructions of the function with a jump to our own code. This means that the signature used to find the function address in the first place might not match anymore after a detour. If you need to detour the same function in different plugins make sure to wildcard \x2a the first 6 bytes of the signature to accommodate for the patched jump introduced by the detour.

Methods 4

Name Description
Disable

Disable the detour of the function described in this detour setup.

DynamicDetour

Creates a detour.

Enable

Enable the detour of the function described in this detour setup. If you need to read the return value of the function, choose a post hook.

FromConf

Setup a detour 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.