Skip to content

HookTargetRecords Class

An API for hooks to share information about target methods.

C#
public static class HookTargetRecords

Inheritance object

Initializes MonoDetour’s hooks on MonoMod to allow tracking of “original” instructions of methods.

C#
public static void InitializeIfNeeded()

It is only necessary to call this if you need to use GetHookTargetInfo(MethodDefinition) without using any MonoDetourHooks which would have initialized this automatically.
This also initializes some other unrelated but useful tweaks MonoDetour expects.

Gets a HookTargetRecords.HookTargetInfo for a target method.

C#
public static HookTargetRecords.HookTargetInfo GetHookTargetInfo(ILContext il)

il MonoMod.Cil.ILContext
The MonoMod.Cil.ILContext for the target method.

HookTargetRecords.HookTargetInfo
A HookTargetRecords.HookTargetInfo for the target method.

Gets a HookTargetRecords.HookTargetInfo for a target method.

C#
public static HookTargetRecords.HookTargetInfo GetHookTargetInfo(MethodDefinition method)

method MethodDefinition
The target MethodDefinition.

HookTargetRecords.HookTargetInfo
A HookTargetRecords.HookTargetInfo for the target method.