Class InvalidByteMatcher

java.lang.Object
ghidra.features.base.memsearch.matcher.ByteMatcher
ghidra.features.base.memsearch.matcher.InvalidByteMatcher

public class InvalidByteMatcher extends ByteMatcher
Objects of this class are the result of SearchFormats not being able to fully parse input text. There are two cases. The first is the user type an illegal character for the selected search format. In that case this matcher is both an invalid search and an invalid input and the description will explain the error. The second case is the input is valid text, but not complete so that a fully valid byte matcher could not be created. In this case, the search is still invalid, but the input is valid. The description will reflect this situation.
  • Constructor Details

    • InvalidByteMatcher

      public InvalidByteMatcher(String errorMessage)
      Construct an invalid matcher from invalid input text.
      Parameters:
      errorMessage - the message describing the invalid input
    • InvalidByteMatcher

      public InvalidByteMatcher(String errorMessage, boolean isValidInput)
      Construct an invalid matcher from invalid input text or partial input text.
      Parameters:
      errorMessage - the message describing why this matcher is invalid
      isValidInput - return true if the reason this is invalid is simply that the input text is not complete. For example, the user types "-" as they are starting to input a negative number.
  • Method Details

    • match

      Description copied from class: ByteMatcher
      Returns an Iterable for returning matches within the given byte sequence.
      Specified by:
      match in class ByteMatcher
      Parameters:
      bytes - the byte sequence to search
      Returns:
      an iterable for return matches in the given sequence
    • getDescription

      public String getDescription()
      Description copied from class: ByteMatcher
      Returns a description of what this byte matcher matches. (Typically a sequence of bytes)
      Specified by:
      getDescription in class ByteMatcher
      Returns:
      a description of what this byte matcher matches
    • getToolTip

      public String getToolTip()
      Description copied from class: ByteMatcher
      Returns additional information about this byte matcher. (Typically the mask bytes)
      Specified by:
      getToolTip in class ByteMatcher
      Returns:
      additional information about this byte matcher
    • isValidInput

      public boolean isValidInput()
      Description copied from class: ByteMatcher
      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 the ByteMatcher.isValidSearch() would return false.
      Overrides:
      isValidInput in class ByteMatcher
      Returns:
      true if this byte matcher has valid text
    • isValidSearch

      public boolean isValidSearch()
      Description copied from class: ByteMatcher
      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.
      Overrides:
      isValidSearch in class ByteMatcher
      Returns:
      true if this byte matcher is valid and can be used to perform a search.