Skip to main content
The PatternMatcher object is used to define and match patterns in binary code, typically for identifying instruction sequences.

Functions

Reference

new

Constructs a new pattern matcher from a pattern string. Patterns are whitespace-separated tokens where each token is either:
  • Two hexadecimal characters (AA, A., .A, ..). . wildcards a nibble, so .. matches any byte, .F matches any low nibble ending in F, etc.
  • An 8-bit binary literal (0101.1..). . wildcards a single bit, allowing sub-byte precision.
Hex and binary tokens can be mixed inside the same pattern.

Example