Package ghidra.util.bytesearch
Class Match
- java.lang.Object
-
- ghidra.util.bytesearch.Match
-
public class Match extends java.lang.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 Summary
Constructors Constructor Description Match(DittedBitSequence sequence, long offset)
Construct a Match of a DittedBitSequence at an offset within a byte stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkPostRules(long streamoffset)
Check that the possible post rules are satisfiedjava.lang.String
getHexString()
long
getMarkOffset()
MatchAction[]
getMatchActions()
long
getMatchStart()
int
getNumPostBits()
If the sequence corresponds to a PatternPair, return the number of postbitsDittedBitSequence
getSequence()
int
getSequenceIndex()
int
getSequenceSize()
-
-
-
Constructor Detail
-
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 matchedoffset
- from the start of byte stream where the matched occured
-
-
Method Detail
-
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 java.lang.String getHexString()
- Returns:
- ditted bit sequence as a string
-
getSequence
public DittedBitSequence getSequence()
- Returns:
- the sequence that was matched
-
-