Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::BlockSignatureEntry Class Reference

A node for control-flow feature generation. More...

#include <signature.hh>

Collaboration diagram for ghidra::BlockSignatureEntry:
[legend]

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.
 
BlockBasicgetBlock (void) const
 Get the underlying basic block which this overlays.
 
hashword getHash (void) const
 Get the current hash value.
 

Private Attributes

BlockBasicbl
 The root basic block.
 
hashword hash [2]
 Current and previous hash.
 

Detailed Description

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.

Member Function Documentation

◆ hashIn()

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.

Parameters
neighis the list of nodes coming in to this

References bl, ghidra::FlowBlock::getInRevIndex(), hash, and ghidra::FlowBlock::sizeOut().

Referenced by ghidra::GraphSigManager::signatureBlockIterate().

◆ localHash()

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.

Parameters
modifiersare the settings being used for signature generation

References bl, hash, ghidra::FlowBlock::sizeIn(), and ghidra::FlowBlock::sizeOut().

Referenced by ghidra::GraphSigManager::initializeBlocks().


The documentation for this class was generated from the following files: