Package ghidra.util.bytesearch
Class GenericByteSequencePattern<T>
- java.lang.Object
-
- ghidra.util.bytesearch.DittedBitSequence
-
- ghidra.util.bytesearch.Pattern
-
- ghidra.util.bytesearch.GenericByteSequencePattern<T>
-
- Type Parameters:
T
- the class of match action, used to specify a specialized momento to be used by the action when it is "applied".
public class GenericByteSequencePattern<T> extends Pattern
Templated simple DittedBitSequence Pattern for a byte/mask pattern and associated action. The DittedBitSequence is provided by value and mask in byte arrays. This class is normally used to find some number of SequencePatterns within a seqence of bytes. When the byte/mask pattern is matched, the GenericMatchAction will be "applied".
-
-
Field Summary
-
Fields inherited from class ghidra.util.bytesearch.DittedBitSequence
popcount
-
-
Constructor Summary
Constructors Constructor Description GenericByteSequencePattern(byte[] bytesSequence, byte[] mask, GenericMatchAction<DataType> action)
Construct a sequence of bytes with a mask, and associated action to be called if this pattern matches.GenericByteSequencePattern(byte[] bytesSequence, GenericMatchAction<T> action)
Construct a sequence of bytes with no mask, and associated action to be called if this pattern matches.
-
Method Summary
-
Methods inherited from class ghidra.util.bytesearch.Pattern
getMarkOffset, getMatchActions, getPostRules, readPatterns, readPostPatterns, restoreXml, restoreXmlAttributes, setMatchActions
-
Methods inherited from class ghidra.util.bytesearch.DittedBitSequence
concatenate, equals, getHexString, getIndex, getMaskBytes, getNumFixedBits, getNumInitialFixedBits, getNumUncertainBits, getSize, getValueBytes, hashCode, isMatch, restoreXmlData, setIndex, toString, writeBits
-
-
-
-
Constructor Detail
-
GenericByteSequencePattern
public GenericByteSequencePattern(byte[] bytesSequence, GenericMatchAction<T> action)
Construct a sequence of bytes with no mask, and associated action to be called if this pattern matches.- Parameters:
bytesSequence
- sequence of bytes to matchaction
- action to apply if the match succeeds
-
GenericByteSequencePattern
public GenericByteSequencePattern(byte[] bytesSequence, byte[] mask, GenericMatchAction<DataType> action)
Construct a sequence of bytes with a mask, and associated action to be called if this pattern matches.- Parameters:
bytesSequence
- sequence of bytes to matchmask
- mask, bits that are 1 must match the byteSequence bitsaction
- to apply if the match succeeds
-
-