Table of Contents

Method TryFindMatch

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

TryFindMatch(ReadOnlySpan<byte>, out ulong, out BytePattern, 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 BytePattern matchingPattern, 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.
matchingPattern BytePattern
The BytePattern which matched the buffer.
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.
See Also

TryFindMatch(ReadOnlySpan<byte>, Span<byte>, out BytePattern, 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 BytePattern matchingPattern, 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.
matchingPattern BytePattern
The BytePattern which matched the buffer.
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.
See Also