Package ghidra.program.util.string
Class AbstractStringSearcher
java.lang.Object
ghidra.program.util.string.AbstractStringSearcher
- Direct Known Subclasses:
PascalStringSearcher
,StringSearcher
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractStringSearcher
(Program program, CharSetRecognizer charSet, int minimumStringSize, int alignment, boolean includeUTF8, boolean includeUTF16, boolean includeUTF32) -
Method Summary
Modifier and TypeMethodDescriptionint
protected FoundString
getFoundString
(MemBuffer buf, Sequence sequence, DataType stringDataType) protected abstract void
processSequence
(FoundStringCallback callback, Sequence sequence, MemBuffer buf) search
(AddressSetView addressSet, FoundStringCallback callback, boolean searchLoadedMemoryBlocksOnly, TaskMonitor monitor) Searches the given addressSet for strings.updateAddressesToSearch
(AddressSetView addressSet, boolean useLoadedBlocksOnly) Returns a new address set that is the intersection of the given set with the desired memory block addresses (loaded or unloaded).
-
Constructor Details
-
AbstractStringSearcher
protected AbstractStringSearcher(Program program, CharSetRecognizer charSet, int minimumStringSize, int alignment, boolean includeUTF8, boolean includeUTF16, boolean includeUTF32)
-
-
Method Details
-
search
public AddressSetView search(AddressSetView addressSet, FoundStringCallback callback, boolean searchLoadedMemoryBlocksOnly, TaskMonitor monitor) Searches the given addressSet for strings.Note: The address set searched will be modified before searching in the following ways:
- if the given set is null, it will be re-initialized to encompass all of program memory
- the set will be further culled to only include loaded memory blocks, if specified
- Parameters:
addressSet
- the address set to search over; if null, will initialized to all memorycallback
- the callback invoked when a string is foundsearchLoadedMemoryBlocksOnly
- if true, will exclude unloaded memory blocks from the searchmonitor
- the user monitor- Returns:
- the updated address set used for the search
-
updateAddressesToSearch
public AddressSetView updateAddressesToSearch(AddressSetView addressSet, boolean useLoadedBlocksOnly) Returns a new address set that is the intersection of the given set with the desired memory block addresses (loaded or unloaded).Note: This desired set of memory blocks is known by inspecting the
StringTableOptions.useLoadedBlocksOnly()
attribute set by the user.- Parameters:
addressSet
- the address set to updateuseLoadedBlocksOnly
- if true, only return addresses in loaded memory blocks- Returns:
- new the new address set
-
processSequence
protected abstract void processSequence(FoundStringCallback callback, Sequence sequence, MemBuffer buf) -
getFoundString
-
getAlignment
public int getAlignment()
-