Skip to content
Concord

Class MonoModDetourBackend

Namespace
Concord.Detour
Assembly
Concord.Detour.dll

Detour backend that delegates native method redirection to MonoMod.Core, the same engine Harmony uses. MonoMod.Core resolves the runtime generic context, so methods declared on a generic type are redirected correctly.

public sealed class MonoModDetourBackend : IDetourBackend
Inheritance
MonoModDetourBackend
Implements
Inherited Members

Methods

Apply(MethodBase, MethodInfo)

Redirects calls from a target method to its wrapper.

public IDetourHandle Apply(MethodBase original, MethodInfo replacement)

Parameters

original MethodBase

The method to redirect.

replacement MethodInfo

The wrapper to execute instead.

Returns

IDetourHandle

A handle that reports detour state and restores the original method when disposed.

ApplyComposed(MethodBase, IReadOnlyList<Injection>)

Installs or replaces the single detour for target, composing one wrapper from every currently-live injection on that target plus added. Disposing the returned handle removes the injections it owns and recomposes (or removes) the target's detour.

public IDetourHandle ApplyComposed(MethodBase target, IReadOnlyList<Injection> added)

Parameters

target MethodBase

The method to redirect.

added IReadOnlyList<Injection>

The injections this call contributes to the target's composed wrapper.

Returns

IDetourHandle

A handle that reports detour state and removes only the injections it owns when disposed.