Documentation for interacting with basic blocks . More...
Documentation for interacting with basic blocks .
Classes | |
struct | BinaryNinja::BasicBlockEdge |
class | BinaryNinja::BasicBlock |
struct BinaryNinja::BasicBlockEdge |
Class Members | ||
---|---|---|
BNBranchType | type | |
Ref< BasicBlock > | target | |
bool | backEdge | The source or destination of the edge, depending on context. |
bool | fallThrough |
class BinaryNinja::BasicBlock |
Public Member Functions | |
BasicBlock (BNBasicBlock *block) | |
Ref< Function > | GetFunction () const |
Basic block function. | |
Ref< Architecture > | GetArchitecture () const |
Basic block architecture. | |
uint64_t | GetStart () const |
Starting address of the basic block. | |
uint64_t | GetEnd () const |
Ending address of the basic block. | |
uint64_t | GetLength () const |
Length of the basic block. | |
size_t | GetIndex () const |
Basic block index in list of blocks for the function. | |
std::vector< BasicBlockEdge > | GetOutgoingEdges () const |
List of basic block outgoing edges. | |
std::vector< BasicBlockEdge > | GetIncomingEdges () const |
List of basic block incoming edges. | |
bool | HasUndeterminedOutgoingEdges () const |
Whether basic block has undetermined outgoing edges. | |
bool | CanExit () const |
Whether basic block can return or is tagged as 'No Return'. | |
void | SetCanExit (bool value) |
Sets whether basic block can return or is tagged as 'No Return'. | |
std::set< Ref< BasicBlock > > | GetDominators (bool post=false) const |
List of dominators for this basic block. | |
std::set< Ref< BasicBlock > > | GetStrictDominators (bool post=false) const |
List of dominators for this basic block. | |
Ref< BasicBlock > | GetImmediateDominator (bool post=false) const |
Get the immediate dominator of this basic block. | |
std::set< Ref< BasicBlock > > | GetDominatorTreeChildren (bool post=false) const |
List of child blocks in the dominator tree for this basic block. | |
std::set< Ref< BasicBlock > > | GetDominanceFrontier (bool post=false) const |
Get the dominance frontier for this basic block. | |
void | MarkRecentUse () |
std::vector< std::vector< InstructionTextToken > > | GetAnnotations () |
List of automatic annotations for the start of this block. | |
std::vector< DisassemblyTextLine > | GetDisassemblyText (DisassemblySettings *settings) |
property which returns a list of DisassemblyTextLine objects for the current basic block. | |
BNHighlightColor | GetBasicBlockHighlight () |
Get the current highlight color for the Basic Block. | |
void | SetAutoBasicBlockHighlight (BNHighlightColor color) |
Set the analysis basic block highlight color. | |
void | SetAutoBasicBlockHighlight (BNHighlightStandardColor color, uint8_t alpha=255) |
Set the analysis basic block highlight color. | |
void | SetAutoBasicBlockHighlight (BNHighlightStandardColor color, BNHighlightStandardColor mixColor, uint8_t mix, uint8_t alpha=255) |
Set the analysis basic block highlight color. | |
void | SetAutoBasicBlockHighlight (uint8_t r, uint8_t g, uint8_t b, uint8_t alpha=255) |
Set the analysis basic block highlight color. | |
void | SetUserBasicBlockHighlight (BNHighlightColor color) |
Set the basic block highlight color. | |
void | SetUserBasicBlockHighlight (BNHighlightStandardColor color, uint8_t alpha=255) |
Set the basic block highlight color. | |
void | SetUserBasicBlockHighlight (BNHighlightStandardColor color, BNHighlightStandardColor mixColor, uint8_t mix, uint8_t alpha=255) |
Set the basic block highlight color. | |
void | SetUserBasicBlockHighlight (uint8_t r, uint8_t g, uint8_t b, uint8_t alpha=255) |
Set the basic block highlight color. | |
bool | IsILBlock () const |
Whether the basic block contains IL. | |
bool | IsLowLevelILBlock () const |
Whether the basic block contains Medium Level IL. | |
bool | IsMediumLevelILBlock () const |
Whether the basic block contains High Level IL. | |
Ref< LowLevelILFunction > | GetLowLevelILFunction () const |
Get the Low Level IL Function for this basic block. | |
Ref< MediumLevelILFunction > | GetMediumLevelILFunction () const |
Get the Medium Level IL Function for this basic block. | |
Ref< HighLevelILFunction > | GetHighLevelILFunction () const |
Get the High Level IL Function for this basic block. | |
bool | GetInstructionContainingAddress (uint64_t addr, uint64_t *start) |
Ref< BasicBlock > | GetSourceBlock () const |
Gets the corresponding assembly-level basic block for this basic block (which is itself, if called on an assembly-level basic block). | |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNBasicBlock, BNNewBasicBlockReference, BNFreeBasicBlock > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNBasicBlock * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Static Public Member Functions | |
static std::set< Ref< BasicBlock > > | GetIteratedDominanceFrontier (const std::set< Ref< BasicBlock > > &blocks) |
static bool | IsBackEdge (BasicBlock *source, BasicBlock *target) |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNBasicBlock, BNNewBasicBlockReference, BNFreeBasicBlock > | |
static BNBasicBlock * | GetObject (CoreRefCountObject *obj) |
static BNBasicBlock * | GetObject (const CoreRefCountObject *obj) |
Additional Inherited Members | |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNBasicBlock, BNNewBasicBlockReference, BNFreeBasicBlock > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNBasicBlock * | m_object |
BasicBlock::BasicBlock | ( | BNBasicBlock * | block | ) |
Basic block function.
Ref< Architecture > BasicBlock::GetArchitecture | ( | ) | const |
Basic block architecture.
uint64_t BasicBlock::GetStart | ( | ) | const |
Starting address of the basic block.
uint64_t BasicBlock::GetEnd | ( | ) | const |
Ending address of the basic block.
uint64_t BasicBlock::GetLength | ( | ) | const |
Length of the basic block.
size_t BasicBlock::GetIndex | ( | ) | const |
Basic block index in list of blocks for the function.
vector< BasicBlockEdge > BasicBlock::GetOutgoingEdges | ( | ) | const |
List of basic block outgoing edges.
vector< BasicBlockEdge > BasicBlock::GetIncomingEdges | ( | ) | const |
List of basic block incoming edges.
bool BasicBlock::HasUndeterminedOutgoingEdges | ( | ) | const |
Whether basic block has undetermined outgoing edges.
bool BasicBlock::CanExit | ( | ) | const |
Whether basic block can return or is tagged as 'No Return'.
void BasicBlock::SetCanExit | ( | bool | value | ) |
Sets whether basic block can return or is tagged as 'No Return'.
value | Sets whether basic block can return or is tagged as 'No Return' |
set< Ref< BasicBlock > > BasicBlock::GetDominators | ( | bool | post = false | ) | const |
List of dominators for this basic block.
post | Whether to get post dominators (default: false) |
set< Ref< BasicBlock > > BasicBlock::GetStrictDominators | ( | bool | post = false | ) | const |
List of dominators for this basic block.
post | Whether to get post dominators (default: false) |
Ref< BasicBlock > BasicBlock::GetImmediateDominator | ( | bool | post = false | ) | const |
Get the immediate dominator of this basic block.
post | Whether to get the immediate post dominator |
set< Ref< BasicBlock > > BasicBlock::GetDominatorTreeChildren | ( | bool | post = false | ) | const |
List of child blocks in the dominator tree for this basic block.
post | Whether to get the post dominator tree children |
set< Ref< BasicBlock > > BasicBlock::GetDominanceFrontier | ( | bool | post = false | ) | const |
Get the dominance frontier for this basic block.
post | Whether to get the post dominance frontier |
|
static |
void BasicBlock::MarkRecentUse | ( | ) |
vector< vector< InstructionTextToken > > BasicBlock::GetAnnotations | ( | ) |
List of automatic annotations for the start of this block.
vector< DisassemblyTextLine > BasicBlock::GetDisassemblyText | ( | DisassemblySettings * | settings | ) |
property which returns a list of DisassemblyTextLine objects for the current basic block.
settings | Disassembly settings to use when fetching the text |
BNHighlightColor BasicBlock::GetBasicBlockHighlight | ( | ) |
Get the current highlight color for the Basic Block.
void BasicBlock::SetAutoBasicBlockHighlight | ( | BNHighlightColor | color | ) |
Set the analysis basic block highlight color.
color | Highlight Color |
void BasicBlock::SetAutoBasicBlockHighlight | ( | BNHighlightStandardColor | color, |
uint8_t | alpha = 255 ) |
Set the analysis basic block highlight color.
color | Highlight Color |
alpha | Transparency for the color |
void BasicBlock::SetAutoBasicBlockHighlight | ( | BNHighlightStandardColor | color, |
BNHighlightStandardColor | mixColor, | ||
uint8_t | mix, | ||
uint8_t | alpha = 255 ) |
Set the analysis basic block highlight color.
color | Highlight Color |
mixColor | Highlight Color to mix with `color` |
mix | Mix point |
alpha | Transparency of the colors |
void BasicBlock::SetAutoBasicBlockHighlight | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b, | ||
uint8_t | alpha = 255 ) |
Set the analysis basic block highlight color.
r | Red value, 0-255 |
g | Green value, 0-255 |
b | Blue value, 0-255 |
alpha | Transparency of the color |
void BasicBlock::SetUserBasicBlockHighlight | ( | BNHighlightColor | color | ) |
Set the basic block highlight color.
color | Highlight color |
void BasicBlock::SetUserBasicBlockHighlight | ( | BNHighlightStandardColor | color, |
uint8_t | alpha = 255 ) |
Set the basic block highlight color.
color | Highlight color |
alpha | Transparency of the color |
void BasicBlock::SetUserBasicBlockHighlight | ( | BNHighlightStandardColor | color, |
BNHighlightStandardColor | mixColor, | ||
uint8_t | mix, | ||
uint8_t | alpha = 255 ) |
Set the basic block highlight color.
color | Highlight Color |
mixColor | Highlight Color to mix with `color` |
mix | Mix point |
alpha | Transparency of the colors |
void BasicBlock::SetUserBasicBlockHighlight | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b, | ||
uint8_t | alpha = 255 ) |
Set the basic block highlight color.
r | Red value, 0-255 |
g | Green value, 0-255 |
b | Blue value, 0-255 |
alpha | Transparency of the color |
|
static |
bool BasicBlock::IsILBlock | ( | ) | const |
Whether the basic block contains IL.
bool BasicBlock::IsLowLevelILBlock | ( | ) | const |
Whether the basic block contains Medium Level IL.
bool BasicBlock::IsMediumLevelILBlock | ( | ) | const |
Whether the basic block contains High Level IL.
Ref< LowLevelILFunction > BasicBlock::GetLowLevelILFunction | ( | ) | const |
Ref< MediumLevelILFunction > BasicBlock::GetMediumLevelILFunction | ( | ) | const |
Ref< HighLevelILFunction > BasicBlock::GetHighLevelILFunction | ( | ) | const |
bool BasicBlock::GetInstructionContainingAddress | ( | uint64_t | addr, |
uint64_t * | start ) |
Ref< BasicBlock > BasicBlock::GetSourceBlock | ( | ) | const |
Gets the corresponding assembly-level basic block for this basic block (which is itself, if called on an assembly-level basic block).