basicblock module¶
|
The |
|
- class BasicBlock(handle: LP_BNBasicBlock, view: Optional[BinaryView] = None)[source]¶
Bases:
object
The
BasicBlock
object is returned during analysis and should not be directly instantiated.- Parameters:
handle (LP_BNBasicBlock) –
view (Optional[BinaryView]) –
- get_disassembly_text(settings: Optional[DisassemblySettings] = None) List[DisassemblyTextLine] [source]¶
get_disassembly_text
returns a list of DisassemblyTextLine objects for the current basic block.- Parameters:
settings (DisassemblySettings) – (optional) DisassemblySettings object
- Example:
>>> current_basic_block.get_disassembly_text() [<0x100000f30: _main:>, <0x100000f30: push rbp>, ... ]
- Return type:
- get_iterated_dominance_frontier(blocks: List[BasicBlock]) List[BasicBlock] [source]¶
Calculates the iterated dominance frontier of the given blocks (this is used to determine φ node placement)
- Parameters:
blocks (List[BasicBlock]) –
- Return type:
- set_auto_highlight(color: HighlightColor) None [source]¶
set_auto_highlight
highlights the current BasicBlock with the supplied color.Warning
Use only in analysis plugins. Do not use in regular plugins, as colors won’t be saved to the database.
- Parameters:
color (HighlightColor) – Color value to use for highlighting
color –
- Return type:
None
- set_user_highlight(color: HighlightColor) None [source]¶
set_user_highlight
highlights the current BasicBlock with the supplied color- Parameters:
color (HighlightColor) – Color value to use for highlighting
color –
- Example:
>>> current_basic_block.set_user_highlight(_highlight.HighlightColor(red=0xff, blue=0xff, green=0)) >>> current_basic_block.set_user_highlight(HighlightStandardColor.BlueHighlightColor)
- Return type:
None
- property annotations: List[List[InstructionTextToken]]¶
List of automatic annotations for the start of this block (read-only)
- property arch: Architecture¶
Basic block architecture (read-only)
- property disassembly_text: List[DisassemblyTextLine]¶
disassembly_text
property which returns a list of function.DisassemblyTextLine objects for the current basic block.- Example:
>>> current_basic_block.disassembly_text [<0x100000f30: _main:>, ...]
- property dominance_frontier: List[BasicBlock]¶
Dominance frontier for this basic block (read-only)
- property dominator_tree_children: List[BasicBlock]¶
List of child blocks in the dominator tree for this basic block (read-only)
- property dominators: List[BasicBlock]¶
List of dominators for this basic block (read-only)
- property has_invalid_instructions: bool¶
Whether basic block has any invalid instructions (read-only)
- property has_undetermined_outgoing_edges: bool¶
Whether basic block has undetermined outgoing edges (read-only)
- property highlight: HighlightColor¶
Gets or sets the highlight color for basic block
- Example:
>>> current_basic_block.highlight = HighlightStandardColor.BlueHighlightColor >>> current_basic_block.highlight <color: blue>
- property immediate_dominator: Optional[BasicBlock]¶
Immediate dominator of this basic block (read-only)
- property immediate_post_dominator: Optional[BasicBlock]¶
Immediate dominator of this basic block (read-only)
- property incoming_edges: List[BasicBlockEdge]¶
List of basic block incoming edges (read-only)
- property outgoing_edges: List[BasicBlockEdge]¶
List of basic block outgoing edges (read-only)
- property post_dominance_frontier: List[BasicBlock]¶
Post dominance frontier for this basic block (read-only)
- property post_dominator_tree_children: List[BasicBlock]¶
List of child blocks in the post dominator tree for this basic block (read-only)
- property post_dominators: List[BasicBlock]¶
List of dominators for this basic block (read-only)
- property source_block: Optional[BasicBlock]¶
Basic block source block (read-only)
- property strict_dominators: List[BasicBlock]¶
List of strict dominators for this basic block (read-only)
- property view: Optional[BinaryView]¶
BinaryView that contains the basic block (read-only)
- class BasicBlockEdge(type: BranchType, source: 'BasicBlock', target: 'BasicBlock', back_edge: bool, fall_through: bool)[source]¶
Bases:
object
- Parameters:
type (BranchType) –
source (BasicBlock) –
target (BasicBlock) –
back_edge (bool) –
fall_through (bool) –
- source: BasicBlock¶
- target: BasicBlock¶
- type: BranchType¶