Class Match

java.lang.Object
ghidra.util.bytesearch.Match

public class Match extends Object
Represents a match of a DittedBitSequence at a given offset in a byte sequence. There is a hidden assumption that the sequence is actually a Pattern that might have a ditted-bit-sequence, a set of match actions, and post match rules/checks
  • Constructor Details

    • Match

      public Match(DittedBitSequence sequence, long offset)
      Construct a Match of a DittedBitSequence at an offset within a byte stream. Object normally used when a match occurs during a MemoryBytePatternSearch.
      Parameters:
      sequence - that matched
      offset - from the start of byte stream where the matched occured
  • Method Details

    • getNumPostBits

      public int getNumPostBits()
      If the sequence corresponds to a PatternPair, return the number of postbits
      Returns:
      the number of post bits
    • getMatchActions

      public MatchAction[] getMatchActions()
      Returns:
      actions associated with this match
    • getSequenceSize

      public int getSequenceSize()
      Returns:
      size in bytes of sequence
    • getSequenceIndex

      public int getSequenceIndex()
      Returns:
      index of sequence in a possibly longer set of sequences
    • getMarkOffset

      public long getMarkOffset()
      Returns:
      the offset of the match within a longer byte sequence
    • getMatchStart

      public long getMatchStart()
      Returns:
      offset of match in sequence of bytes
    • checkPostRules

      public boolean checkPostRules(long streamoffset)
      Check that the possible post rules are satisfied
      Parameters:
      streamoffset - offset within from match location to check postrules.
      Returns:
      true if post rules are satisfied
    • getHexString

      public String getHexString()
      Returns:
      ditted bit sequence as a string
    • getSequence

      public DittedBitSequence getSequence()
      Returns:
      the sequence that was matched