Class BpsConfigBuilder
java.lang.Object
ghidra.util.bytesearch.bytepatternsearch.BpsConfigBuilder
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionghidra.util.bytesearch.bytepatternsearch.BpsConfigbuild()Builds the finalBpsConfig.setBigEndianSearch(boolean isBeSearch) Specify whether to search for patterns as Big Endian.setLittleEndianSearch(boolean isLeSearch) Specify whether to search for patterns as Little Endian.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.
-
Constructor Details
-
BpsConfigBuilder
public BpsConfigBuilder(int programWordSize) Constructor.- Parameters:
programWordSize- the word size of the program; must be greater than 0
-
-
Method Details
-
setPerformExtension
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
BpsConfigfor details.- Parameters:
isByteExtension- true signals to zero-extend byte patterns to fill program word size- Returns:
- this builder instance
-
setLittleEndianSearch
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
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 finalBpsConfig.- Returns:
- the new search configuration
-