Table of Contents

Method TryMatchAt

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

TryMatchAt(ReadOnlySpan<byte>, out ulong, out BytePattern, out int)

Tries to match this pattern over the provided span.
public bool TryMatchAt(ReadOnlySpan<byte> data, out ulong address, out BytePattern matchingPattern, out int length)

Parameters

data ReadOnlySpan<byte>
The data to try to match at the start of.
address ulong
The address which is parsed out of the data.
matchingPattern BytePattern
The BytePattern which matched the buffer.
length int
The length of the matched pattern.

Returns

bool
true if data matched at the start; 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

TryMatchAt(ReadOnlySpan<byte>, Span<byte>, out BytePattern, out int)

Tries to match this pattern over the provided span.
public bool TryMatchAt(ReadOnlySpan<byte> data, Span<byte> addrBuf, out BytePattern matchingPattern, out int length)

Parameters

data ReadOnlySpan<byte>
The data to try to match at the start of.
addrBuf Span<byte>
A buffer to write address bytes to.
matchingPattern BytePattern
The BytePattern which matched the buffer.
length int
The length of the matched pattern.

Returns

bool
true if data matched at the start; false otherwise.
See Also