Ghidra 11.3.2
Ghidra internal decompiler documentation.
|
A node for control-flow feature generation. More...
#include <signature.hh>
Public Member Functions | |
BlockSignatureEntry (BlockBasic *b) | |
Construct from a basic block. | |
void | localHash (uint4 modifiers) |
Compute an initial hash based on local properties of the basic block. | |
void | flip (void) |
Store hash from previous iteration and prepare for next iteration. | |
void | hashIn (vector< BlockSignatureEntry * > &neigh) |
Hash info from other nodes into this. | |
BlockBasic * | getBlock (void) const |
Get the underlying basic block which this overlays. | |
hashword | getHash (void) const |
Get the current hash value. | |
Private Attributes | |
BlockBasic * | bl |
The root basic block. | |
hashword | hash [2] |
Current and previous hash. | |
A node for control-flow feature generation.
A BlockSignatureEntry is rooted at a specific basic block in the control-flow of a function. During feature generation it iteratively hashes information about the basic block and its nearest neighbors through the edges of the control-flow graph.
void ghidra::BlockSignatureEntry::hashIn | ( | vector< BlockSignatureEntry * > & | neigh | ) |
Hash info from other nodes into this.
The previous hash value for this node is mixed together with previous hash values from other given nodes. The result becomes the current hash value for this node. The given nodes must correspond one-to-one with incoming blocks of this.
neigh | is the list of nodes coming in to this |
References bl, ghidra::FlowBlock::getInRevIndex(), hash, and ghidra::FlowBlock::sizeOut().
Referenced by ghidra::GraphSigManager::signatureBlockIterate().
void ghidra::BlockSignatureEntry::localHash | ( | uint4 | modifiers | ) |
Compute an initial hash based on local properties of the basic block.
The current hash value is set, incorporating the number of incoming edges and the number of outgoing edges, as integer values.
modifiers | are the settings being used for signature generation |
References bl, hash, ghidra::FlowBlock::sizeIn(), and ghidra::FlowBlock::sizeOut().
Referenced by ghidra::GraphSigManager::initializeBlocks().