Scan for pattern pattern
with applied mask mask
in the byte reader data, starting from offset offset
relative to the current position.
The bytes in pattern
and mask
are interpreted left-to-right, regardless of endianness. All four bytes of the
pattern must be present in the byte reader data for it to match, even if the first or last bytes are masked out.
It is an error to call this function without making sure that there is enough data (offset+size bytes) in the byte reader.
this | |
mask |
mask to apply to data before matching against |
pattern |
pattern to match (after mask is applied) |
offset |
offset from which to start scanning, relative to the current position |
size |
number of bytes to scan from offset |
value |
pointer to uint32 to return matching data |
offset of the first match, or -1 if no match was found. |