Table of Contents

Constructor NativeHook

Namespace
MonoMod.RuntimeDetour
Assembly
MonoMod.RuntimeDetour.dll

NativeHook(nint, Delegate)

Constructs a NativeHook of function, detouring it to hook.
public NativeHook(nint function, Delegate hook)

Parameters

function nint
A pointer to the native function to hook.
hook Delegate
The delegate which acts as the target of the hook.

NativeHook(nint, Delegate, DetourConfig?)

Constructs a NativeHook of function, detouring it to hook using the provided config.
public NativeHook(nint function, Delegate hook, DetourConfig? config)

Parameters

function nint
A pointer to the native function to hook.
hook Delegate
The delegate which acts as the target of the hook.
config DetourConfig
The DetourConfig to use for this detour.

NativeHook(nint, Delegate, bool)

Constructs a NativeHook of function, detouring it to hook.
public NativeHook(nint function, Delegate hook, bool applyByDefault)

Parameters

function nint
A pointer to the native function to hook.
hook Delegate
The delegate which acts as the target of the hook.
applyByDefault bool
Whether or not this hook should be applied when the constructor finishes.

NativeHook(nint, Delegate, DetourConfig?, bool)

Constructs a NativeHook of function, detouring it to hook using the provided config.
public NativeHook(nint function, Delegate hook, DetourConfig? config, bool applyByDefault)

Parameters

function nint
A pointer to the native function to hook.
hook Delegate
The delegate which acts as the target of the hook.
config DetourConfig
The DetourConfig to use for this detour.
applyByDefault bool
Whether or not this hook should be applied when the constructor finishes.

NativeHook(nint, Delegate, IDetourFactory, DetourConfig?, bool)

Constructs a NativeHook of function, detouring it to hook using the provided config and detour factory.
public NativeHook(nint function, Delegate hook, IDetourFactory factory, DetourConfig? config, bool applyByDefault)

Parameters

function nint
A pointer to the native function to hook.
hook Delegate
The delegate which acts as the target of the hook.
factory IDetourFactory
The IDetourFactory to use to interact with this hook.
config DetourConfig
The DetourConfig to use for this detour.
applyByDefault bool
Whether or not this hook should be applied when the constructor finishes.