Class FastNativeDetour

Inheritance
System.Object FastNativeDetour
Namespace: BepInEx.IL2CPP.Hook
Assembly: BepInEx.IL2CPP.dll
Syntax
public class FastNativeDetour : IDetour

Constructors

FastNativeDetour(IntPtr, IntPtr)

Declaration
public FastNativeDetour(IntPtr originalFunctionPtr, IntPtr detourFunctionPtr)
Parameters
Type Name Description
System.IntPtr originalFunctionPtr
System.IntPtr detourFunctionPtr

Properties

BackupBytes

Declaration
protected byte[] BackupBytes { get; set; }
Property Value
Type Description
System.Byte[]

DetourFunctionPtr

Declaration
public IntPtr DetourFunctionPtr { get; protected set; }
Property Value
Type Description
System.IntPtr

IsApplied

Declaration
public bool IsApplied { get; protected set; }
Property Value
Type Description
System.Boolean

IsValid

Declaration
public bool IsValid { get; protected set; }
Property Value
Type Description
System.Boolean

OriginalFunctionPtr

Declaration
public IntPtr OriginalFunctionPtr { get; protected set; }
Property Value
Type Description
System.IntPtr

TrampolineJmpSize

Declaration
protected int TrampolineJmpSize { get; set; }
Property Value
Type Description
System.Int32

TrampolineMethod

Declaration
protected MethodInfo TrampolineMethod { get; set; }
Property Value
Type Description
System.Reflection.MethodInfo

TrampolinePtr

Declaration
public IntPtr TrampolinePtr { get; protected set; }
Property Value
Type Description
System.IntPtr

TrampolineSize

Declaration
public int TrampolineSize { get; protected set; }
Property Value
Type Description
System.Int32

Methods

Apply()

Declaration
public void Apply()

Apply(ManualLogSource)

Declaration
public void Apply(ManualLogSource debuggerLogSource)
Parameters
Type Name Description
ManualLogSource debuggerLogSource

CreateAndApply<T>(IntPtr, T, out T, Nullable<CallingConvention>)

Declaration
public static FastNativeDetour CreateAndApply<T>(IntPtr from, T to, out T original, CallingConvention? callingConvention = default(CallingConvention? ))
    where T : Delegate
Parameters
Type Name Description
System.IntPtr from
T to
T original
System.Nullable<System.Runtime.InteropServices.CallingConvention> callingConvention
Returns
Type Description
FastNativeDetour
Type Parameters
Name Description
T

Dispose()

Declaration
public void Dispose()

Free()

Declaration
public void Free()

GenerateTrampoline(MethodBase)

Declaration
public MethodBase GenerateTrampoline(MethodBase signature = null)
Parameters
Type Name Description
System.Reflection.MethodBase signature
Returns
Type Description
System.Reflection.MethodBase

GenerateTrampoline<T>()

Declaration
public T GenerateTrampoline<T>()
    where T : Delegate
Returns
Type Description
T
Type Parameters
Name Description
T

Undo()

Declaration
public void Undo()