Class BpsConfigBuilder

java.lang.Object
ghidra.util.bytesearch.bytepatternsearch.BpsConfigBuilder

public class BpsConfigBuilder extends Object
A helper class to build up the potentially complicated BpsConfig.

Manage the generation of a search configuration for use by Ghidra's Byte Pattern Search capability.

The design of the Byte pattern Searcher and its supporting sub-capabilities and classes can be found in the "Search For Byte Patterns" page in the help viewer.

  • Constructor Details

    • BpsConfigBuilder

      public BpsConfigBuilder(int programWordSize)
      Constructor.
      Parameters:
      programWordSize - the word size of the program; must be greater than 0
  • Method Details

    • setPerformExtension

      public BpsConfigBuilder setPerformExtension(boolean isByteExtension)
      Specify whether to perform a zero-extension of byte patterns to fit the program word size if the pattern's word size is smaller than the program's.

      A true setting will perform quantization of sizes to build out the pattern's word size iteratively until it fills the program's word size. See BpsConfig for details.

      Parameters:
      isByteExtension - true signals to zero-extend byte patterns to fill program word size
      Returns:
      this builder instance
    • setLittleEndianSearch

      public BpsConfigBuilder setLittleEndianSearch(boolean isLeSearch)
      Specify whether to search for patterns as Little Endian.
      Parameters:
      isLeSearch - true signals the transformation of patterns to be LE prior to search
      Returns:
      this builder instance
    • setBigEndianSearch

      public BpsConfigBuilder setBigEndianSearch(boolean isBeSearch)
      Specify whether to search for patterns as Big Endian. Default is true.
      Parameters:
      isBeSearch - true signals patterns to be searched as BE (their assumed default endianness)
      Returns:
      this builder instance
    • build

      public ghidra.util.bytesearch.bytepatternsearch.BpsConfig build()
      Builds the final BpsConfig.
      Returns:
      the new search configuration