Method TryFindMatch
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
dataReadOnlySpan<byte>- The data to find a match in.
addressulong- The address which is parsed out of the data.
offsetint- The offset within the span that the pattern matched at.
lengthint- The length of the matched pattern.
Returns
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
dataReadOnlySpan<byte>- The data to find a match in.
addrBufSpan<byte>- A buffer to write address bytes to.
offsetint- The offset within the span that the pattern matched at.
lengthint- The length of the matched pattern.