Skip to content

Flowchart

flowchart

Classes:

  • BasicBlock

    Provides access to basic block properties and navigation

  • FlowChart

    Provides analysis and iteration over basic blocks within

  • FlowChartFlags

    Flags for flowchart generation from IDA SDK.

BasicBlock

BasicBlock(
    database: Optional[Database],
    id: int,
    block: qbasic_block_t,
    flowchart: qflow_chart_t,
)

Bases: BasicBlock, DatabaseEntity

Provides access to basic block properties and navigation between connected blocks within a control flow graph.

Initialize basic block.

Args: id: Block ID within the flowchart block: The underlying qbasic_block_t object flowchart: Parent flowchart

Methods:

Attributes:

database property

database: Database

Get the database reference, guaranteed to be non-None when called from methods decorated with @check_db_open.

Returns: The active database instance.

Note: This property should only be used in methods decorated with @check_db_open, which ensures m_database is not None.

m_database instance-attribute

m_database = database

count_predecessors

count_predecessors() -> int

Count the number of predecessor blocks.

count_successors

count_successors() -> int

Count the number of successor blocks.

get_instructions

get_instructions() -> Optional[Iterator[insn_t]]

Retrieves all instructions within this basic block.

Returns: An instruction iterator for this block.

get_predecessors

get_predecessors() -> Iterator[BasicBlock]

Iterator over predecessor blocks.

get_successors

get_successors() -> Iterator[BasicBlock]

Iterator over successor blocks.

FlowChart

FlowChart(
    database: Optional[Database],
    func: func_t = None,
    bounds: Optional[tuple[ea_t, ea_t]] = None,
    flags: FlowChartFlags = NONE,
)

Bases: FlowChart, DatabaseEntity

Provides analysis and iteration over basic blocks within functions or address ranges.

Initialize FlowChart for analyzing basic blocks within functions or address ranges.

Args: database: Database instance to associate with this flowchart. Can be None. func: IDA function object (func_t) to analyze. Defaults to None. bounds: Address range tuple (start_ea, end_ea) defining the analysis scope. Defaults to None. flags: FlowChart creation flags controlling analysis behavior. Defaults to FlowChartFlags.NONE.

Note: At least one of func or bounds must be specified.

Attributes:

database property

database: Database

Get the database reference, guaranteed to be non-None when called from methods decorated with @check_db_open.

Returns: The active database instance.

Note: This property should only be used in methods decorated with @check_db_open, which ensures m_database is not None.

m_database instance-attribute

m_database = database

FlowChartFlags

Bases: IntFlag

Flags for flowchart generation from IDA SDK.

Attributes:

NOEXT class-attribute instance-attribute

NOEXT = FC_NOEXT

NONE class-attribute instance-attribute

NONE = 0

PREDS class-attribute instance-attribute

PREDS = FC_PREDS