Ghidra 11.3.2
Ghidra internal decompiler documentation.
|
A feature describing some aspect of a function or other unit of code. More...
#include <signature.hh>
Public Member Functions | |
Signature (hashword h) | |
Constructor. | |
uint4 | getHash (void) const |
Get the underyling 32-bit hash of the feature. | |
void | print (ostream &s) const |
Print the feature hash and a brief description of this feature to the given stream. | |
int4 | compare (const Signature *op2) const |
Compare two features. | |
virtual | ~Signature (void) |
Destructor. | |
virtual void | encode (Encoder &encoder) const |
virtual void | decode (Decoder &decoder) |
Encode this feature to the given stream. | |
virtual void | printOrigin (ostream &s) const |
Restore this feature from the given stream. | |
Static Public Member Functions | |
static bool | comparePtr (Signature *a, Signature *b) |
Compare two Signature pointers via their underlying hash values. | |
Private Attributes | |
uint4 | sig |
Underlying 32-bit hash. | |
A feature describing some aspect of a function or other unit of code.
The underlying representation is just a 32-bit hash of the information representing the feature, but derived classes may be contain other meta-data describing where and how the feature was formed. Two features are generally unordered (they are either equal or not equal), but an ordering is used internally to normalize the vector representation and accelerate comparison.
int4 ghidra::Signature::compare | ( | const Signature * | op2 | ) | const |
Compare two features.
The underlying hashes of the two features are compared as unsigned values.
op2 | is the other feature to compare with this |
References sig.
|
virtual |
Encode this feature to the given stream.
The hash value corresponding to this feature is read from the stream.
decoder | is the stream decoder |
References ghidra::Decoder::closeElement(), ghidra::Decoder::openElement(), ghidra::Decoder::readUnsignedInteger(), and sig.
|
virtual |
The hash value is encoded to the stream, along with any descriptive information about how the feature was formed.
encoder | is the stream encoder |
Reimplemented in ghidra::VarnodeSignature, ghidra::BlockSignature, and ghidra::CopySignature.
References ghidra::Encoder::closeElement(), getHash(), ghidra::Encoder::openElement(), and ghidra::Encoder::writeUnsignedInteger().
void ghidra::Signature::print | ( | ostream & | s | ) | const |
Print the feature hash and a brief description of this feature to the given stream.
s | is the given stream to write to |
References printOrigin(), and sig.
|
inlinevirtual |
Restore this feature from the given stream.
Print a brief description of this feature to the given stream
Reimplemented in ghidra::VarnodeSignature, ghidra::BlockSignature, and ghidra::CopySignature.
References sig.
Referenced by print().