Table of Contents

Method TryFindMatch

Namespace
MonoMod.Core.Utils
Assembly
MonoMod.Core.dll

TryFindMatch(ReadOnlySpan<byte>, out ulong, out int, out int)

Tries to find a match of this pattern within the provided span.
public bool TryFindMatch(ReadOnlySpan<byte> data, out ulong address, out int offset, out int length)

Parameters

data ReadOnlySpan<byte>
The data to find a match in.
address ulong
The address which is parsed out of the data.
offset int
The offset within the span that the pattern matched at.
length int
The length of the matched pattern.

Returns

bool
true if a match was found; false otherwise.

Remarks

address is constructed starting at the byte with the lowest address. This means that big-endian machines may need the address to be shifted if the address is smaller than 64 bits.

TryFindMatch(ReadOnlySpan<byte>, Span<byte>, out int, out int)

Tries to find a match of this pattern within the provided span.
public bool TryFindMatch(ReadOnlySpan<byte> data, Span<byte> addrBuf, out int offset, out int length)

Parameters

data ReadOnlySpan<byte>
The data to find a match in.
addrBuf Span<byte>
A buffer to write address bytes to.
offset int
The offset within the span that the pattern matched at.
length int
The length of the matched pattern.

Returns

bool
true if a match was found; false otherwise.