Method ComputeDetourInfo
ComputeDetourInfo(nint, nint, int)
NativeDetourInfo ComputeDetourInfo(nint from, nint target, int maxSizeHint = -1)
Parameters
from
nint- The address to detour from.
target
nint- The address to detour to.
maxSizeHint
int- The maximum amount of readable/writable memory at
from
, or -1. This is to be used as a hint, and may be ignored.
Returns
- NativeDetourInfo
- The computed NativeDetourInfo.
Remarks
The typical calling sequence is ComputeDetourInfo(nint, nint, int), allocate a buffer, GetDetourBytes(NativeDetourInfo, Span<byte>, out IDisposable?), then PatchData(PatchTargetKind, nint, ReadOnlySpan<byte>, Span<byte>) to apply the detour.
Usually, callers should use CreateSimpleDetour(nint, nint, int, nint) or CreateNativeDetour(nint, nint, int, nint) instead.
- See Also