MonoMod.RuntimeDetour A fully managed detour. Multiple Detours for a method to detour from can exist at any given time. Detours can be layered. If you're writing your own detour manager or need to detour native functions, it's better to create instances of NativeDetour instead. Mark the detour as applied in the detour chain. This can be done automatically when creating an instance. Undo the detour without freeing it, allowing you to reapply it later. Free the detour, while also permanently undoing it. This makes any further operations on this detour invalid. Undo and free this temporary detour. Generate a new DynamicMethod with which you can invoke the previous state. Generate a new DynamicMethod with which you can invoke the previous state. Generate a new DynamicMethod with which you can invoke the previous state. A "raw" native detour, acting as a wrapper around NativeDetourData with a few helpers. Only one NativeDetour for a method to detour from can exist at any given time. NativeDetours cannot be layered. If you don't need the trampoline generator or any of the management helpers, use DetourManager.Native directly. Unless you're writing your own detour manager or need to detour native functions, it's better to create instances of Detour instead. Apply the native detour. This can be done automatically when creating an instance. Undo the native detour without freeing the detour native data, allowing you to reapply it later. Changes the source of this native detour to a new source address. This does not repair the old source location. This also assumes that is simply a new address for the same method as this was constructed with. The new source location. Changed the target of this native detour to a new target. The new target address. Free the detour's data without undoing it. This makes any further operations on this detour invalid. Undo and free this temporary detour. Generate a new DynamicMethod with which you can invoke the previous state. If the NativeDetour holds a reference to a managed method, a copy of the original method is returned. If the NativeDetour holds a reference to a native function, an "undo-call-redo" trampoline with a matching signature is returned. Generate a new delegate with which you can invoke the previous state. If the NativeDetour holds a reference to a managed method, a copy of the original method is returned. If the NativeDetour holds a reference to a native function, an "undo-call-redo" trampoline with a matching signature is returned. Write the given value at the address to + offs, afterwards advancing offs by sizeof(byte). Write the given value at the address to + offs, afterwards advancing offs by sizeof(ushort). Write the given value at the address to + offs, afterwards advancing offs by sizeof(ushort). Write the given value at the address to + offs, afterwards advancing offs by sizeof(ulong). Generate a DynamicMethod to easily call the given native function from another DynamicMethod. The pointer to the native function to call. A MethodBase with the target function's signature. The detoured DynamicMethod. Fill the DynamicMethodDefinition with a throw. Emit a call to DetourManager.Native.Copy using the given parameters. Emit a call to DetourManager.Native.Apply using a copy of the given data. The data forming a "raw" native detour, created and consumed by DetourManager.Native. The method to detour from. Set when the structure is created by the IDetourNativePlatform. The target method to be called instead. Set when the structure is created by the IDetourNativePlatform. The type of the detour. Determined when the structure is created by the IDetourNativePlatform. The size of the detour. Calculated when the structure is created by the IDetourNativePlatform. DetourManager.Native-specific data.