Class FastNativeDetour
Namespace: BepInEx.IL2CPP.Hook
Assembly: BepInEx.IL2CPP.dll
Syntax
public class FastNativeDetour : IDetour
Constructors
Declaration
public FastNativeDetour(IntPtr originalFunctionPtr, IntPtr detourFunctionPtr)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr |
originalFunctionPtr |
|
System.IntPtr |
detourFunctionPtr |
Properties
Declaration
protected byte[] BackupBytes { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Declaration
public IntPtr DetourFunctionPtr { get; protected set; }
Property Value
Type | Description |
---|---|
System.IntPtr |
Declaration
public bool IsApplied { get; protected set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Declaration
public bool IsValid { get; protected set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Declaration
public IntPtr OriginalFunctionPtr { get; protected set; }
Property Value
Type | Description |
---|---|
System.IntPtr |
Declaration
protected int TrampolineJmpSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Declaration
protected MethodInfo TrampolineMethod { get; set; }
Property Value
Type | Description |
---|---|
System.Reflection.MethodInfo |
Declaration
public IntPtr TrampolinePtr { get; protected set; }
Property Value
Type | Description |
---|---|
System.IntPtr |
Declaration
public int TrampolineSize { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Declaration
public void Apply()
Declaration
public void Apply(ManualLogSource debuggerLogSource)
Parameters
Type | Name | Description |
---|---|---|
ManualLogSource |
debuggerLogSource |
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 |
Declaration
public void Dispose()
Declaration
public void Free()
Declaration
public MethodBase GenerateTrampoline(MethodBase signature = null)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodBase |
signature |
Returns
Type | Description |
---|---|
System.Reflection.MethodBase |
Declaration
public T GenerateTrampoline<T>()
where T : Delegate
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Declaration
public void Undo()