Ghidra 11.3.2
Ghidra internal decompiler documentation.
|
A container for collecting a set of features (a feature vector) for a single function. More...
#include <signature.hh>
Public Member Functions | |
SigManager (void) | |
Constructor. | |
virtual | ~SigManager (void) |
Destructor. | |
virtual void | clear (void) |
Clear all current Signature/feature resources. | |
virtual void | initializeFromStream (istream &s)=0 |
Read configuration information from a character stream. | |
virtual void | setCurrentFunction (const Funcdata *f) |
Set the function used for (future) feature generation. | |
virtual void | generate (void)=0 |
Generate all features for the current function. | |
int4 | numSignatures (void) const |
Get the number of features currently generated. | |
Signature * | getSignature (int4 i) const |
Get the i-th Signature/feature. | |
void | getSignatureVector (vector< uint4 > &feature) const |
Get the feature vector as a simple array of hashes. | |
hashword | getOverallHash (void) const |
Combine all feature hashes into one overall hash. | |
void | sortByHash (void) |
Sort all current features. | |
void | print (ostream &s) const |
Print a brief description of all current features to a stream. | |
void | encode (Encoder &encoder) const |
Encode all current features to the given stream. | |
Static Public Member Functions | |
static uint4 | getSettings (void) |
Get the settings currently being used for signature generation. | |
static void | setSettings (uint4 newvalue) |
Establish settings to use for future signature generation. | |
Protected Member Functions | |
void | addSignature (Signature *sig) |
Add a new feature to the manager. | |
Protected Attributes | |
const Funcdata * | fd |
Current function off of which we are generating features. | |
Private Member Functions | |
void | clearSignatures (void) |
Clear all current Signature/feature objects from this manager. | |
Private Attributes | |
vector< Signature * > | sigs |
Feature set for the current function. | |
Static Private Attributes | |
static uint4 | settings = 0 |
Signature settings (across all managers) | |
A container for collecting a set of features (a feature vector) for a single function.
This manager handles:
The manager can be reused for multiple functions.
|
virtual |
Clear all current Signature/feature resources.
Clear all resources consumed by the manager, including Signature objects and other resources used for generating features. The manager is ready for another round of signature generation.
Reimplemented in ghidra::GraphSigManager.
References clearSignatures().
Referenced by ghidra::GraphSigManager::clear().
|
private |
Clear all current Signature/feature objects from this manager.
Clear any Signature objects specifically.
References sigs.
Referenced by clear(), and ~SigManager().
void ghidra::SigManager::encode | ( | Encoder & | encoder | ) | const |
Encode all current features to the given stream.
Full details about all features currently stored in this manager are written to the stream.
encoder | is the stream encoder |
References ghidra::Encoder::closeElement(), ghidra::Encoder::openElement(), and sigs.
|
pure virtual |
Generate all features for the current function.
Implemented in ghidra::GraphSigManager.
hashword ghidra::SigManager::getOverallHash | ( | void | ) | const |
Combine all feature hashes into one overall hash.
References getSignatureVector().
void ghidra::SigManager::getSignatureVector | ( | vector< uint4 > & | feature | ) | const |
Get the feature vector as a simple array of hashes.
The hash value associated with any features currently held by the manager are written to the provided container. The hash values are sorted.
feature | will contain the collected hash values |
References sigs.
Referenced by getOverallHash().
|
pure virtual |
Read configuration information from a character stream.
Implemented in ghidra::GraphSigManager.
void ghidra::SigManager::print | ( | ostream & | s | ) | const |
Print a brief description of all current features to a stream.
A brief description of each feature and the hash value itself are printed to the stream, one feature per line.
s | is the character stream to write to |
References sigs.
|
virtual |
Set the function used for (future) feature generation.
f | is the function being set |
Reimplemented in ghidra::GraphSigManager.
References fd.
Referenced by ghidra::GraphSigManager::setCurrentFunction().
|
static |
Establish settings to use for future signature generation.
newvalue | are the settings to be used |
References settings.
Referenced by ghidra::SetSignatureSettings::rawAction().