### BeginInvoke Method Source: https://monomod.github.io/api/MonoMod.MissingDependencyResolver.html Asynchronously starts the invocation of the delegate. ```APIDOC ## Method BeginInvoke(MonoModder, ModuleDefinition, String, String, AsyncCallback, Object) ### Declaration ```csharp public virtual IAsyncResult BeginInvoke(MonoModder modder, ModuleDefinition main, string name, string fullName, AsyncCallback callback, object object) ``` ### Parameters | Type | Name | Description | |---|---|---| | MonoModder | modder | | | Mono.Cecil.ModuleDefinition | main | | | System.String | name | | | System.String | fullName | | | System.AsyncCallback | callback | | | System.Object | object | | ### Returns | Type | Description | |---|---| | System.IAsyncResult | ``` -------------------------------- ### GetNativeStart Method (Delegate) Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.DetourHelper.html Retrieves the native pointer for a given delegate. This is used to get the entry point of the underlying native code. ```csharp public static IntPtr GetNativeStart(this Delegate method) ``` -------------------------------- ### GetNativeStart Method (MethodBase) Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.DetourHelper.html Retrieves the native pointer for a given MethodBase. This is a common way to get the address of a method for detour purposes. ```csharp public static IntPtr GetNativeStart(this MethodBase method) ``` -------------------------------- ### BeginInvoke Method Source: https://monomod.github.io/api/MonoMod.Cil.ILContext.Manipulator.html Starts an asynchronous invocation of the delegate. This method is virtual and can be overridden. ```csharp public virtual IAsyncResult BeginInvoke(ILContext il, AsyncCallback callback, object object) ``` -------------------------------- ### PlatformHelper.Current Property Source: https://monomod.github.io/api/MonoMod.Utils.PlatformHelper.html Gets the current platform the application is running on. This property is read-only. ```csharp public static Platform Current { get; } ``` -------------------------------- ### PlatformHelper.LibrarySuffix Property Source: https://monomod.github.io/api/MonoMod.Utils.PlatformHelper.html Gets the platform-specific suffix for library files (e.g., ".dll", ".so", ".dylib"). This property is read-only. ```csharp public static string LibrarySuffix { get; } ``` -------------------------------- ### Search Instructions Source: https://monomod.github.io/api/MonoMod.Cil.ILCursor.html Searches for instruction sequences matching provided predicates, throwing KeyNotFoundException if no match is found. ```csharp public void FindNext(out ILCursor[] cursors, params Func[] predicates) ``` ```csharp public void FindPrev(out ILCursor[] cursors, params Func[] predicates) ``` -------------------------------- ### Get Fast Delegate - C# Source: https://monomod.github.io/api/MonoMod.Utils.FastReflectionHelper.html Use this method to get a fast delegate from a MethodInfo. The directBoxValueAccess parameter controls whether direct access to boxed value types is enabled. ```csharp public static FastReflectionDelegate GetFastDelegate(this MethodInfo method, bool directBoxValueAccess = true) ``` -------------------------------- ### GetType(String) Source: https://monomod.github.io/api/MonoMod.Utils.ReflectionHelper.html Gets a Type by its full name. ```APIDOC ## GetType(String) ### Description Gets a Type by its full name. ### Method GET ### Endpoint N/A (Static method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Type** (System.Type) - The resolved Type. #### Response Example None ``` -------------------------------- ### DetourNativeWindowsPlatform Constructor Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.Platforms.DetourNativeWindowsPlatform.html Initializes a new instance of the DetourNativeWindowsPlatform class. ```csharp public DetourNativeWindowsPlatform(IDetourNativePlatform inner) ``` -------------------------------- ### Goto Next with Predicates Source: https://monomod.github.io/api/MonoMod.Cil.ILCursor.html Searches forward for a sequence of instructions matching the provided predicates and moves the cursor to them. Use this when you need to find specific instruction patterns. ```csharp public ILCursor GotoNext(MoveType moveType, params Func[] predicates) ``` -------------------------------- ### Set EntryPoint property Source: https://monomod.github.io/api/MonoMod.Utils.DynDllImportAttribute.html Sets the entry point for the dynamic import. ```csharp public string EntryPoint { set; } ``` -------------------------------- ### DynData.Target Property Source: https://monomod.github.io/api/MonoMod.Utils.DynData-1.html Gets the target object associated with this DynData instance. ```csharp public TTarget Target { get; } ``` -------------------------------- ### DynData.Item Property (Indexer) Source: https://monomod.github.io/api/MonoMod.Utils.DynData-1.html Gets or sets a dynamic property by its name. ```csharp public object this[string name] { get; set; } ``` -------------------------------- ### Priority Property Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.Detour.html Gets or sets the priority of the detour. This property is read-write. ```APIDOC ## Priority Property ### Description Gets or sets the priority of the detour. This property is read-write. ### Declaration ```csharp public int Priority { get; set; } ``` ### Property Value - **Type**: System.Int32 - **Description**: (No description provided) ``` -------------------------------- ### Instruction and Context Management Source: https://monomod.github.io/api/MonoMod.Cil.ILContext.html Methods for interacting with IL instructions and managing the context state. ```APIDOC ## IndexOf(Instruction) ### Description Determine the index of a given instruction. ### Method public int IndexOf(Instruction instr) ### Parameters - **instr** (Mono.Cecil.Cil.Instruction) - Required - The instruction to get the index of. ### Returns - **System.Int32** - The instruction index, or the end of the method body if it hasn't been found. ## Invoke(ILContext.Manipulator) ### Description Invoke a given manipulator callback. ### Method public void Invoke(ILContext.Manipulator manip) ### Parameters - **manip** (ILContext.Manipulator) - Required - The manipulator to run in this context. ## MakeReadOnly() ### Description Mark this ILContext as read-only and prevent this context from further accessing the originally passed method. ### Method public void MakeReadOnly() ``` -------------------------------- ### Get Current Process Handle Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.Platforms.DetourNativeWindowsPlatform.html Retrieves the handle for the current process. ```csharp public static IntPtr GetCurrentProcess() ``` -------------------------------- ### TryGotoNext(Func[]) Source: https://monomod.github.io/api/MonoMod.Cil.ILCursor.html Searches forward for a sequence of instructions matching the given predicates and moves the cursor. ```APIDOC ## TryGotoNext(Func[]) ### Description Search forward and moves the cursor to the next sequence of instructions matching the corresponding predicates. ### Method System.Boolean ### Parameters #### Path Parameters - **predicates** (System.Func[]) - Required - Predicates to match instructions ### Returns #### Success Response (200) - **This value is not explicitly described, but implies success.** (System.Boolean) - This value is not explicitly described, but implies success. ``` -------------------------------- ### CreateILCopy Method Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.DetourHelper.html Creates a copy of the IL instructions for a given method. This is useful for analyzing or modifying method bodies. ```csharp public static MethodInfo CreateILCopy(this MethodBase method) ``` -------------------------------- ### Get Method Declaration Source: https://monomod.github.io/api/MonoMod.InlineRT.MonoModRule.Data.html Retrieves an object associated with the specified key. ```csharp public static object Get(string k) ``` -------------------------------- ### PrePatch Methods Source: https://monomod.github.io/api/MonoMod.MonoModder.html Pre-patches modules, nested types, or types before the main patching process. ```csharp public virtual void PrePatchModule(ModuleDefinition mod) ``` ```csharp protected virtual void PrePatchNested(TypeDefinition type) ``` ```csharp public virtual void PrePatchType(TypeDefinition type, bool forceAdd = false) ``` -------------------------------- ### Proxy and Label Management Source: https://monomod.github.io/api/MonoMod.Utils.Cil.ILGeneratorShim.html Methods for getting the underlying ILGenerator and managing labels. ```APIDOC ## GetProxy() ### Description Get a "real" ILGenerator for this ILGeneratorShim. ### Method `ILGenerator GetProxy()` ### Returns - **System.Reflection.Emit.ILGenerator** - A "real" ILGenerator. ``` ```APIDOC ## GetProxyType(Type) ### Description Get the proxy type for a given ILGeneratorShim type. The proxy type implements ILGenerator. ### Method `static Type GetProxyType(Type tShim)` ### Parameters #### Path Parameters - **tShim** (System.Type) - Description: The ILGeneratorShim type. ### Returns - **System.Type** - The "real" ILGenerator type. ``` ```APIDOC ## GetProxyType() ### Description Get the proxy type for a given ILGeneratorShim type. The proxy type implements ILGenerator. ### Method `static Type GetProxyType() where TShim : ILGeneratorShim` ### Type Parameters - **TShim** (Type) - Description: The ILGeneratorShim type. ### Returns - **System.Type** - The "real" ILGenerator type. ``` ```APIDOC ## MarkLabel(Label) ### Description Marks a label at the current position in the instruction stream. ### Method `abstract void MarkLabel(Label loc)` ### Parameters #### Path Parameters - **loc** (System.Reflection.Emit.Label) - Description: ### Response #### Success Response (200) - **None** - This method does not return a value. ``` -------------------------------- ### TryGotoNext(MoveType, Func[]) Source: https://monomod.github.io/api/MonoMod.Cil.ILCursor.html Searches forward and moves the cursor to the next sequence of instructions matching the corresponding predicates. ```APIDOC ## TryGotoNext(MoveType, Func[]) ### Description Search forward and moves the cursor to the next sequence of instructions matching the corresponding predicates. ### Method System.Boolean ### Parameters #### Path Parameters - **moveType** (MoveType) - Required - The type of move operation - **predicates** (System.Func[]) - Required - Predicates to match instructions ### Returns #### Success Response (200) - **True if a match was found** (System.Boolean) - True if a match was found ``` -------------------------------- ### DetourNativeMonoPosixPlatform Constructor Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.Platforms.DetourNativeMonoPosixPlatform.html Initializes a new instance of the DetourNativeMonoPosixPlatform class with an inner platform implementation. ```csharp public DetourNativeMonoPosixPlatform(IDetourNativePlatform inner) ``` -------------------------------- ### MonoModPublic Constructor Source: https://monomod.github.io/api/MonoMod.MonoModPublic.html This is the default constructor for the MonoModPublic attribute. No specific setup is required. ```csharp public MonoModPublic() ``` -------------------------------- ### DynData.Data Property Source: https://monomod.github.io/api/MonoMod.Utils.DynData-1.html Gets the dictionary storing the dynamic data associated with the target object. ```csharp public Dictionary Data { get; } ``` -------------------------------- ### Goto Instruction Source: https://monomod.github.io/api/MonoMod.Cil.ILCursor.html Moves the cursor to a target instruction. This is the primary method for all cursor movements. ```csharp public ILCursor Goto(Instruction insn, MoveType moveType, bool setTarget = false) ``` -------------------------------- ### Get String Representation Source: https://monomod.github.io/api/MonoMod.Cil.ILContext.html Returns a string containing the method ID and body representation. ```csharp public override string ToString() ``` -------------------------------- ### TryCreateILCopy Method Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.DetourHelper.html Attempts to create a copy of the IL instructions for a given method, returning a boolean indicating success and the resulting MethodInfo. This is a safer alternative to CreateILCopy when the operation might fail. ```csharp public static bool TryCreateILCopy(this MethodBase method, out MethodInfo dm) ``` -------------------------------- ### Get Instruction Index Source: https://monomod.github.io/api/MonoMod.Cil.ILContext.html Retrieves the index of a specific instruction within the method body. ```csharp public int IndexOf(Instruction instr) ``` -------------------------------- ### FastReflectionDelegate Class Overview Source: https://monomod.github.io/api/MonoMod.Utils.FastReflectionDelegate.html Provides an overview of the FastReflectionDelegate class, its namespace, assembly, and inheritance. ```APIDOC ## Class FastReflectionDelegate ### Inheritance System.Object FastReflectionDelegate ###### **Namespace** : MonoMod.Utils ###### **Assembly** : MonoMod.Utils.dll ##### Syntax ```csharp public sealed class FastReflectionDelegate : MulticastDelegate ``` ``` -------------------------------- ### PostProcessor Constructor Source: https://monomod.github.io/api/MonoMod.PostProcessor.html Documentation for the PostProcessor constructor. ```APIDOC ### Constructors #### PostProcessor(Object, IntPtr) ##### Declaration ``` public PostProcessor(object object, IntPtr method) ``` ##### Parameters Type | Name | Description ---|---|--- System.Object | object | System.IntPtr | method | ``` -------------------------------- ### DynData.Setters Property Source: https://monomod.github.io/api/MonoMod.Utils.DynData-1.html Gets the dictionary of actions used to set property values on the target object. ```csharp public Dictionary> Setters { get; } ``` -------------------------------- ### Goto Previous with Predicates Source: https://monomod.github.io/api/MonoMod.Cil.ILCursor.html Searches backward for a sequence of instructions matching the provided predicates and moves the cursor to them. Useful for finding instructions preceding a certain pattern. ```csharp public ILCursor GotoPrev(MoveType moveType, params Func[] predicates) ``` -------------------------------- ### DynData.Getters Property Source: https://monomod.github.io/api/MonoMod.Utils.DynData-1.html Gets the dictionary of functions used to retrieve property values from the target object. ```csharp public Dictionary> Getters { get; } ``` -------------------------------- ### Get Getter MethodInfo Source: https://monomod.github.io/api/MonoMod.Cil.RuntimeILReferenceBag.html Retrieves the MethodInfo for a getter. This can be used for dynamically accessing properties or fields. ```csharp public MethodInfo GetGetter() ``` -------------------------------- ### DetourNativeWindowsPlatform Constructors Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.Platforms.DetourNativeWindowsPlatform.html Constructors for the DetourNativeWindowsPlatform class. ```APIDOC ## DetourNativeWindowsPlatform(IDetourNativePlatform) ### Description Initializes a new instance of the DetourNativeWindowsPlatform class. ### Method DetourNativeWindowsPlatform ### Parameters #### Path Parameters - **inner** (IDetourNativePlatform) - Description: The inner platform to use. ### Request Example ```json { "inner": "IDetourNativePlatform_instance" } ``` ### Response #### Success Response (200) - **DetourNativeWindowsPlatform** - A new instance of the DetourNativeWindowsPlatform class. ### Response Example ```json { "instance": "DetourNativeWindowsPlatform_instance" } ``` ``` -------------------------------- ### DynamicMethodDefinition Module Property Source: https://monomod.github.io/api/MonoMod.Utils.DynamicMethodDefinition.html Gets the ModuleDefinition from Mono.Cecil. This property provides access to the module where the method is defined. ```csharp public ModuleDefinition Module { get; } ``` -------------------------------- ### DynDllMapping Constructor Source: https://monomod.github.io/api/MonoMod.Utils.DynDllMapping.html Initializes a new instance of the DynDllMapping class. This is the default constructor. ```csharp public DynDllMapping() ``` -------------------------------- ### MonoModRule.Data Class Methods Source: https://monomod.github.io/api/MonoMod.InlineRT.MonoModRule.Data.html Provides documentation for the static methods Get and Set within the MonoModRule.Data class. ```APIDOC ## GET /api/dataget ### Description Retrieves a value associated with a given key. ### Method GET ### Endpoint /api/dataget ### Parameters #### Query Parameters - **k** (string) - Required - The key of the data to retrieve. ### Response #### Success Response (200) - **value** (object) - The retrieved value associated with the key. #### Response Example ```json { "value": "some_data" } ``` ## POST /api/dataset ### Description Sets a value associated with a given key. ### Method POST ### Endpoint /api/dataset ### Parameters #### Request Body - **k** (string) - Required - The key of the data to set. - **v** (object) - Required - The value to associate with the key. ### Request Example ```json { "k": "my_key", "v": "my_value" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the data was set successfully. #### Response Example ```json { "message": "Data set successfully." } ``` ``` -------------------------------- ### MatchLdelemAny Methods Source: https://monomod.github.io/api/MonoMod.Cil.ILPatternMatchingExt.html Methods to match Ldelem.Any instructions. ```APIDOC ## MatchLdelemAny ### Description Matches an Ldelem.Any instruction against a TypeReference, string, or Type. ### Parameters - **instr** (Instruction) - Required - The instruction to check. - **value** (TypeReference/String/Type) - Required - The criteria to match against. ``` -------------------------------- ### PostProcessor Constructor Source: https://monomod.github.io/api/MonoMod.PostProcessor.html Initializes a new instance of the PostProcessor delegate. ```csharp public PostProcessor(object object, IntPtr method) ``` -------------------------------- ### MonoModNoNew Constructor Declaration Source: https://monomod.github.io/api/MonoMod.MonoModNoNew.html The default constructor for the MonoModNoNew attribute. No specific setup is required when using this attribute. ```csharp public MonoModNoNew() ``` -------------------------------- ### MonoModConstructor Default Constructor Source: https://monomod.github.io/api/MonoMod.MonoModConstructor.html The default constructor for the MonoModConstructor attribute. No specific setup is required when using this attribute. ```csharp public MonoModConstructor() ``` -------------------------------- ### Get Delegate Invoker MethodInfo Source: https://monomod.github.io/api/MonoMod.Cil.RuntimeILReferenceBag.html Retrieves the MethodInfo for a delegate invoker. This is useful for runtime delegate creation or invocation. ```csharp public MethodInfo GetDelegateInvoker() where T : Delegate ``` -------------------------------- ### Delegate Creation from MethodBase Source: https://monomod.github.io/api/MonoMod.Utils.Extensions.html Methods for creating delegates from MethodBase instances. ```APIDOC ## Create Delegate from MethodBase ### Description Creates a delegate of the specified type from this method. ### Method `CreateDelegate` ### Parameters #### Path Parameters - **method** (System.Reflection.MethodBase) - Required - The method to create the delegate from. - **delegateType** (System.Type) - Required - The type of the delegate to create. ### Returns #### Success Response (200) - **Delegate** - The delegate for this method. ``` ```APIDOC ## Create Delegate from MethodBase with Target ### Description Creates a delegate of the specified type with the specified target from this method. ### Method `CreateDelegate` ### Parameters #### Path Parameters - **method** (System.Reflection.MethodBase) - Required - The method to create the delegate from. - **delegateType** (System.Type) - Required - The type of the delegate to create. - **target** (System.Object) - Required - The object targeted by the delegate. ### Returns #### Success Response (200) - **Delegate** - The delegate for this method. ``` ```APIDOC ## Create Generic Delegate from MethodBase ### Description Creates a delegate of the specified type from this method. ### Method `CreateDelegate` ### Type Parameters - **T** - The type of the delegate to create. ### Parameters #### Path Parameters - **method** (System.Reflection.MethodBase) - Required - The method to create the delegate from. ### Returns #### Success Response (200) - **Delegate** - The delegate for this method. ``` ```APIDOC ## Create Generic Delegate from MethodBase with Target ### Description Creates a delegate of the specified type with the specified target from this method. ### Method `CreateDelegate` ### Type Parameters - **T** - The type of the delegate to create. ### Parameters #### Path Parameters - **method** (System.Reflection.MethodBase) - Required - The method to create the delegate from. - **target** (System.Object) - Required - The object targeted by the delegate. ### Returns #### Success Response (200) - **Delegate** - The delegate for this method. ``` -------------------------------- ### Open a Native Library Source: https://monomod.github.io/api/MonoMod.Utils.DynDll.html Opens a native library by its name, with options to skip path remapping and specify platform-specific flags. Use this to obtain a handle to a library. ```csharp public static IntPtr OpenLibrary(string name, bool skipMapping = false, Nullable flags = null) ``` -------------------------------- ### Get Generic Reference Source: https://monomod.github.io/api/MonoMod.Cil.RuntimeILReferenceBag.html Retrieves a stored reference by its ID. The type parameter T specifies the expected type of the reference. ```csharp public T Get(int id) ``` -------------------------------- ### RelinkMapEntry Default Constructor Source: https://monomod.github.io/api/MonoMod.RelinkMapEntry.html Initializes a new instance of the RelinkMapEntry class with default values. No specific setup is required. ```csharp public RelinkMapEntry() ``` -------------------------------- ### MonoModOnPlatform Constructor Declaration Source: https://monomod.github.io/api/MonoMod.MonoModOnPlatform.html Constructor for initializing the attribute with a list of target platforms. ```csharp public MonoModOnPlatform(params Platform[] p) ``` -------------------------------- ### DetourNativeARMPlatform Class Overview Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.Platforms.DetourNativeARMPlatform.html Provides an overview of the DetourNativeARMPlatform class, its inheritance, and implementation. ```APIDOC ## Class DetourNativeARMPlatform ### Inheritance System.Object DetourNativeARMPlatform ### Implements IDetourNativePlatform ### Namespace MonoMod.RuntimeDetour.Platforms ### Assembly MonoMod.RuntimeDetour.dll ### Syntax ```csharp public sealed class DetourNativeARMPlatform : Object, IDetourNativePlatform ``` ``` -------------------------------- ### MonoModAdded Constructor Declaration Source: https://monomod.github.io/api/MonoMod.MonoModAdded.html This is the C# declaration for the default constructor of the MonoModAdded class. No specific setup is required to instantiate it. ```csharp public MonoModAdded() ``` -------------------------------- ### DynamicMethodDefinition Method Property Source: https://monomod.github.io/api/MonoMod.Utils.DynamicMethodDefinition.html Gets the MethodBase representing the method. This property returns the reflection-based MethodBase associated with this dynamic method definition. ```csharp public MethodBase Method { get; } ``` -------------------------------- ### Create Method Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.Platforms.DetourNativeLibcPlatform.html Creates a NativeDetourData structure for a detour between two addresses. ```csharp public NativeDetourData Create(IntPtr from, IntPtr to, Nullable type) ``` -------------------------------- ### ILContext Class Overview Source: https://monomod.github.io/api/MonoMod.Cil.ILContext.html Provides an overview of the ILContext class, its inheritance, and namespace. ```APIDOC ## Class ILContext An IL manipulation "context" with various helpers and direct access to the MethodBody. ##### Inheritance System.Object ILContext ##### Implements System.IDisposable ###### **Namespace** : MonoMod.Cil ###### **Assembly** : MonoMod.Utils.dll ##### Syntax ``` public class ILContext : Object, IDisposable ``` ``` -------------------------------- ### Instruction Matching Methods Source: https://monomod.github.io/api/MonoMod.Cil.ILPatternMatchingExt.html A collection of static methods to match specific CIL instructions such as Newobj, Nop, Not, Or, Pop, and others. ```APIDOC ## MatchNewobj ### Description Matches a Newobj instruction against various criteria including MethodReference, MethodBase, type name, or Type. ### Parameters #### Parameters - **instr** (Mono.Cecil.Cil.Instruction) - Required - The instruction to check. - **value/typeFullName/type** (Various) - Optional - The criteria to match against. ### Returns - **System.Boolean** - Returns true if the instruction matches the criteria. ## MatchNo / MatchNop / MatchNot / MatchOr / MatchPop / MatchReadonly / MatchRefanytype / MatchRefanyval ### Description Utility methods to identify specific CIL opcodes or patterns within an instruction stream. ### Parameters #### Parameters - **instr** (Mono.Cecil.Cil.Instruction) - Required - The instruction to evaluate. - **value** (Various) - Optional - The expected value or reference to match. ### Returns - **System.Boolean** - Returns true if the instruction matches the specified opcode or pattern. ``` -------------------------------- ### DetourNativeLibcPlatform Class Overview Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.Platforms.DetourNativeLibcPlatform.html Provides an overview of the DetourNativeLibcPlatform class and its methods. ```APIDOC ## Class DetourNativeLibcPlatform ### Description Represents a platform-specific detour implementation for systems utilizing the libc library. ### Namespace MonoMod.RuntimeDetour.Platforms ### Assembly MonoMod.RuntimeDetour.dll ### Syntax ```csharp public sealed class DetourNativeLibcPlatform : Object, IDetourNativePlatform ``` ### Constructors #### DetourNativeLibcPlatform(IDetourNativePlatform) ##### Description Initializes a new instance of the `DetourNativeLibcPlatform` class. ##### Parameters - **inner** (IDetourNativePlatform) - The inner platform implementation to delegate to. ### Methods #### Apply(NativeDetourData) ##### Description Applies a native detour. ##### Parameters - **detour** (NativeDetourData) - The detour data to apply. #### Copy(IntPtr, IntPtr, Byte) ##### Description Copies memory from a source address to a destination address. ##### Parameters - **src** (IntPtr) - The source memory address. - **dst** (IntPtr) - The destination memory address. - **type** (byte) - The type of copy operation. #### Create(IntPtr, IntPtr, Nullable) ##### Description Creates a new native detour data structure. ##### Parameters - **from** (IntPtr) - The starting address of the detour. - **to** (IntPtr) - The target address of the detour. - **type** (Nullable) - An optional type specifier for the detour. ##### Returns - **NativeDetourData** - The created detour data. #### FlushICache(IntPtr, UInt32) ##### Description Flushes the instruction cache for a given memory range. ##### Parameters - **src** (IntPtr) - The starting address of the memory range. - **size** (uint) - The size of the memory range. #### Free(NativeDetourData) ##### Description Frees a native detour. ##### Parameters - **detour** (NativeDetourData) - The detour data to free. #### MakeExecutable(IntPtr, UInt32) ##### Description Marks a memory region as executable. ##### Parameters - **src** (IntPtr) - The starting address of the memory region. - **size** (uint) - The size of the memory region. #### MakeWritable(IntPtr, UInt32) ##### Description Marks a memory region as writable. ##### Parameters - **src** (IntPtr) - The starting address of the memory region. - **size** (uint) - The size of the memory region. #### MemAlloc(UInt32) ##### Description Allocates a block of unmanaged memory. ##### Parameters - **size** (uint) - The size of the memory block to allocate. ##### Returns - **IntPtr** - A pointer to the allocated memory. #### MemFree(IntPtr) ##### Description Frees a block of unmanaged memory. ##### Parameters - **ptr** (IntPtr) - A pointer to the memory block to free. ### Implements - IDetourNativePlatform ``` -------------------------------- ### DynamicMethodDefinition Definition Property Source: https://monomod.github.io/api/MonoMod.Utils.DynamicMethodDefinition.html Gets the underlying MethodDefinition from Mono.Cecil. This property provides access to the detailed definition of the method, including its instructions and metadata. ```csharp public MethodDefinition Definition { get; } ``` -------------------------------- ### Instruction Matching Methods Source: https://monomod.github.io/api/MonoMod.Cil.ILPatternMatchingExt.html This section provides documentation for various methods used to match Mono.Cecil.Cil.Instruction objects. These methods often involve checking conditions like greater than, less than, or equality, and can optionally output a value. ```APIDOC ## MatchBgt(Instruction, out ILLabel) ### Description Checks if an instruction matches a 'greater than' condition and optionally outputs the ILLabel. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBgtUn(Instruction, ILLabel) ### Description Checks if an instruction matches an unsigned 'greater than' condition. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBgtUn(Instruction, out ILLabel) ### Description Checks if an instruction matches an unsigned 'greater than' condition and optionally outputs the ILLabel. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBle(Instruction, ILLabel) ### Description Checks if an instruction matches a 'less than or equal to' condition. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBle(Instruction, out ILLabel) ### Description Checks if an instruction matches a 'less than or equal to' condition and optionally outputs the ILLabel. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBleUn(Instruction, ILLabel) ### Description Checks if an instruction matches an unsigned 'less than or equal to' condition. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBleUn(Instruction, out ILLabel) ### Description Checks if an instruction matches an unsigned 'less than or equal to' condition and optionally outputs the ILLabel. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBlt(Instruction, ILLabel) ### Description Checks if an instruction matches a 'less than' condition. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBlt(Instruction, out ILLabel) ### Description Checks if an instruction matches a 'less than' condition and optionally outputs the ILLabel. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBltUn(Instruction, ILLabel) ### Description Checks if an instruction matches an unsigned 'less than' condition. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBltUn(Instruction, out ILLabel) ### Description Checks if an instruction matches an unsigned 'less than' condition and optionally outputs the ILLabel. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBneUn(Instruction, ILLabel) ### Description Checks if an instruction matches an unsigned 'not equal' condition. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBneUn(Instruction, out ILLabel) ### Description Checks if an instruction matches an unsigned 'not equal' condition and optionally outputs the ILLabel. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBox(Instruction, TypeReference) ### Description Checks if an instruction matches a 'box' operation for a given TypeReference. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBox(Instruction, out TypeReference) ### Description Checks if an instruction matches a 'box' operation and optionally outputs the TypeReference. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` ```APIDOC ## MatchBox(Instruction, String) ### Description Checks if an instruction matches a 'box' operation for a given string representation of a type. ### Method GET ### Endpoint /websites/monomod_github_io_api ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **System.Boolean** (boolean) - True if the instruction matches, false otherwise. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Get Flag Value - MonoModRule.Flag Source: https://monomod.github.io/api/MonoMod.InlineRT.MonoModRule.Flag.html Retrieves the boolean value associated with a given flag key. Use this method to check the state of a specific flag. ```csharp public static bool Get(string k) ``` -------------------------------- ### Constructor Declaration Source: https://monomod.github.io/api/MonoMod.RuntimeDetour.Platforms.DetourNativeLibcPlatform.html Constructor for initializing the platform with an inner IDetourNativePlatform. ```csharp public DetourNativeLibcPlatform(IDetourNativePlatform inner) ``` -------------------------------- ### Get Function Pointer from Library Source: https://monomod.github.io/api/MonoMod.Utils.DynDll.html Retrieves the memory address (pointer) of a function within a loaded native library. Requires a valid library handle and the function name. ```csharp public static IntPtr GetFunction(this IntPtr lib, string name) ``` -------------------------------- ### DynamicMethodDefinition OriginalMethod Property Source: https://monomod.github.io/api/MonoMod.Utils.DynamicMethodDefinition.html Gets the original MethodBase from which this dynamic method definition was created, if applicable. This is useful when creating a dynamic method as a modified version of an existing method. ```csharp public MethodBase OriginalMethod { get; } ``` -------------------------------- ### Instruction Matching Methods Source: https://monomod.github.io/api/MonoMod.Cil.ILPatternMatchingExt.html A collection of methods used to match specific CIL instructions such as loading local variables, loading objects, or loading null. ```APIDOC ## MatchLdindU2(Instruction) ### Description Checks if the instruction is a LdindU2 operation. ### Parameters #### Parameters - **instr** (Mono.Cecil.Cil.Instruction) - Required ### Response - **System.Boolean** - Returns true if the instruction matches. ## MatchLdloc(Instruction, Int32) ### Description Checks if the instruction is a Ldloc operation with a specific index. ### Parameters #### Parameters - **instr** (Mono.Cecil.Cil.Instruction) - Required - **value** (System.Int32) - Required ### Response - **System.Boolean** - Returns true if the instruction matches. ## MatchLdobj(Instruction, TypeReference) ### Description Checks if the instruction is a Ldobj operation matching the provided TypeReference. ### Parameters #### Parameters - **instr** (Mono.Cecil.Cil.Instruction) - Required - **value** (Mono.Cecil.TypeReference) - Required ### Response - **System.Boolean** - Returns true if the instruction matches. ``` -------------------------------- ### Library Loading and Mapping Source: https://monomod.github.io/api/MonoMod.Utils.DynDll.html This section details the parameters and return values for a function that loads a library and optionally skips mapping. ```APIDOC ## POST /websites/monomod_github_io_api/load_library ### Description Loads a library with specified parameters and returns a boolean indicating success. ### Method POST ### Endpoint /websites/monomod_github_io_api/load_library ### Parameters #### Request Body - **name** (System.String) - Required - The library name. - **lib** (System.IntPtr) - Required - The library handle, or null if it failed loading. - **skipMapping** (System.Boolean) - Required - Whether to skip using the mapping or not. - **flags** (System.Nullable) - Optional - Any optional platform-specific flags. ### Response #### Success Response (200) - **return_value** (System.Boolean) - True if the handle was obtained, false otherwise. #### Response Example ```json { "return_value": true } ``` ``` -------------------------------- ### Safely Get Function Pointer from Library Source: https://monomod.github.io/api/MonoMod.Utils.DynDll.html Attempts to retrieve the memory address of a function within a loaded native library. Returns true if the function is found and its pointer is obtained, false otherwise. ```csharp public static bool TryGetFunction(this IntPtr lib, string name, out IntPtr ptr) ``` -------------------------------- ### MatchLdelema Instructions Source: https://monomod.github.io/api/MonoMod.Cil.ILPatternMatchingExt.html Methods to match ldelema instructions, with options for retrieving the type reference. ```APIDOC ## MatchLdelema(Instruction, TypeReference) ### Description Checks if the instruction is an `ldelema` operation with a specific `TypeReference`. ### Method GET ### Endpoint N/A (Extension Method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **bool** (System.Boolean) - True if the instruction matches `ldelema` with the specified `TypeReference`, false otherwise. #### Response Example N/A ``` ```APIDOC ## MatchLdelema(Instruction, out TypeReference) ### Description Checks if the instruction is an `ldelema` operation and retrieves the `TypeReference`. ### Method GET ### Endpoint N/A (Extension Method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **bool** (System.Boolean) - True if the instruction matches `ldelema`, false otherwise. - **value** (Mono.Cecil.TypeReference) - The `TypeReference` if the match is successful. #### Response Example N/A ``` -------------------------------- ### Goto Label Source: https://monomod.github.io/api/MonoMod.Cil.ILCursor.html Moves the cursor to a target label's instruction. Defaults to moving after the label. ```csharp public ILCursor GotoLabel(ILLabel label, MoveType moveType, bool setTarget = false) ``` -------------------------------- ### ILContext Constructor Source: https://monomod.github.io/api/MonoMod.Cil.ILContext.html Details the constructor for ILContext, which initializes it with a MethodDefinition. ```APIDOC ## ILContext(MethodDefinition) ### Description Initializes a new instance of the ILContext class. ### Method `ILContext` ### Parameters #### Path Parameters - **method** (Mono.Cecil.MethodDefinition) - Required - The method definition to associate with this context. ```