Class ByteMatcher
java.lang.Object
ghidra.features.base.memsearch.matcher.ByteMatcher
- Direct Known Subclasses:
InvalidByteMatcher
,MaskedByteSequenceByteMatcher
,RegExByteMatcher
ByteMatcher is the base class for an object that be used to scan bytes looking for sequences
that match some criteria. As a convenience, it also stores the input string and settings that
were used to generated this ByteMatcher.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
Record class to contain a match specification. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
abstract String
Returns a description of what this byte matcher matches.final String
getInput()
Returns the original input text that generated this ByteMatacher.Returns the settings used to generate this ByteMatcher.abstract String
Returns additional information about this byte matcher.int
hashCode()
boolean
Returns true if this byte matcher has valid (but possibly incomplete) input text.boolean
Returns true if this byte matcher is valid and can be used to perform a search.abstract Iterable
<ByteMatcher.ByteMatch> match
(ExtendedByteSequence bytes) Returns anIterable
for returning matches within the given byte sequence.toString()
-
Constructor Details
-
ByteMatcher
-
-
Method Details
-
getInput
Returns the original input text that generated this ByteMatacher.- Returns:
- the original input text that generated this BytesMatcher
-
getSettings
Returns the settings used to generate this ByteMatcher.- Returns:
- the settings used to generate this ByteMatcher
-
match
Returns anIterable
for returning matches within the given byte sequence.- Parameters:
bytes
- the byte sequence to search- Returns:
- an iterable for return matches in the given sequence
-
getDescription
Returns a description of what this byte matcher matches. (Typically a sequence of bytes)- Returns:
- a description of what this byte matcher matches
-
getToolTip
Returns additional information about this byte matcher. (Typically the mask bytes)- Returns:
- additional information about this byte matcher
-
isValidSearch
public boolean isValidSearch()Returns true if this byte matcher is valid and can be used to perform a search. If false, the the description will return a an error message explaining why this byte matcher is invalid.- Returns:
- true if this byte matcher is valid and can be used to perform a search.
-
isValidInput
public boolean isValidInput()Returns true if this byte matcher has valid (but possibly incomplete) input text. For example, when entering decimal values, the input could be just "-" as the user starts to enter a negative number. In this case the input is valid, but theisValidSearch()
would return false.- Returns:
- true if this byte matcher has valid text
-
toString
-
hashCode
public int hashCode() -
equals
-