Flexible and easily extensible runtime detouring library. Wrap, replace and manipulate (Mono.Cecil) methods at runtime.
$ dotnet add package MonoMod.RuntimeDetourMonoMod.RuntimeDetour.Hook - An easy-to-use method hookMonoMod.RuntimeDetour.ILHook - Modifies the IL of a methodMonoMod.RuntiemDetour.DetourContext - Persistent, shared detour configuration// Create a Hook.
using (var d = new Hook(methodInfoFrom, methodInfoTo))
{
// When the detour goes out-of-scope (and thus has Dispose() called), the detour is undone.
// If the object is collected by the garbage collector, the detour is also undone.
}
Visit the GitHub and look for RuntimeDetour for more documentation.