basicblock module

binaryninja.basicblock.BasicBlock(view, handle)
binaryninja.basicblock.BasicBlockEdge(...)
class binaryninja.basicblock.BasicBlock(view, handle)[source]

Bases: object

annotations

List of automatic annotations for the start of this block (read-only)

arch

Basic block architecture (read-only)

disassembly_text

disassembly_text property which returns a list of function.DisassemblyTextLine objects for the current basic block. :Example:

>>> current_basic_block.disassembly_text
[<0x100000f30: _main:>, ...]
end

Basic block end (read-only)

function

Basic block function (read-only)

get_disassembly_text(settings=None)[source]

get_disassembly_text returns a list of function.DisassemblyTextLine objects for the current basic block. :Example:

>>>current_basic_block.get_disassembly_text() [<0x100000f30: _main:>, <0x100000f30: push rbp>, ... ]
has_undetermined_outgoing_edges

Whether basic block has undetermined outgoing edges (read-only)

highlight

Gets or sets the highlight color for basic block

Example:
>>> current_basic_block.highlight = HighlightStandardColor.BlueHighlightColor
>>> current_basic_block.highlight
<color: blue>
length

Basic block length (read-only)

mark_recent_use()[source]
outgoing_edges

List of basic block outgoing edges (read-only)

set_auto_highlight(color)[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:or highlight.HighlightColor color (HighlightStandardColor) – Color value to use for highlighting
set_end(end)[source]

set_end sets the end of the current BasicBlock to the supplied location

Parameters:

end – New end address of the BasicBlock

Example:
>>> current_basic_block.set_end(here)
set_user_highlight(color)[source]

set_user_highlight highlights the current BasicBlock with the supplied color

Parameters:

or highlight.HighlightColor color (HighlightStandardColor) – Color value to use for highlighting

Example:
>>> current_basic_block.set_user_highlight(highlight.HighlightColor(red=0xff, blue=0xff, green=0))
>>> current_basic_block.set_user_highlight(HighlightStandardColor.BlueHighlightColor)
start

Basic block start (read-only)

class binaryninja.basicblock.BasicBlockEdge(branch_type, target, arch)[source]

Bases: object