Method CreateNativeDetour
CreateNativeDetour(nint, nint, int, nint)
Creates a PlatformTriple.NativeDetour. This is basically identical to CreateSimpleDetour(nint, nint, int, nint),
except that it generates an alternate entrypoint for
from.public PlatformTriple.NativeDetour CreateNativeDetour(nint from, nint to, int detourMaxSize = -1, nint fromRw = 0)
Parameters
fromnint- The address to detour.
tonint- The target of the detour.
detourMaxSizeint- The maximum size available for the detour.
fromRwnint- The address to write the detour to, if that is different from
from. Otherwise, the default value of default should be passed. Refer to OnMethodCompiledCallback for more information.
Returns
- PlatformTriple.NativeDetour
- A PlatformTriple.NativeDetour instance managing the generated detour.
Remarks
This method will always create an alternate entrypoint in AltEntry when CreateAltEntryPoint
is available.
CreateNativeDetour(nint, nint, ref nint, int, nint)
Creates a PlatformTriple.NativeDetour. This is basically identical to CreateSimpleDetour(nint, nint, int, nint),
except that it generates an alternate entrypoint for
from.[SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "allocHandle is correctly transferred around, as needed")]
public PlatformTriple.NativeDetour CreateNativeDetour(nint from, nint to, ref nint altEntryResult, int detourMaxSize = -1, nint fromRw = 0)
Parameters
fromnint- The address to detour.
tonint- The target of the detour.
altEntryResultnint- A reference to a location to write the generated alternate entrypoint when it is created.
detourMaxSizeint- The maximum size available for the detour.
fromRwnint- The address to write the detour to, if that is different from
from. Otherwise, the default value of default should be passed. Refer to OnMethodCompiledCallback for more information.
Returns
- PlatformTriple.NativeDetour
- A PlatformTriple.NativeDetour instance managing the generated detour.
Remarks
This method will always create an alternate entrypoint in AltEntry when CreateAltEntryPoint
is available. The created alternate entrypoint will be written to altEntryResult BEFORE the detour is applied.