Module ida_gdl

Global Variables

CHART_FOLLOW_DIRECTION

CHART_FOLLOW_DIRECTION = 8

CHART_GEN_DOT

CHART_GEN_DOT = 8192

CHART_GEN_GDL

CHART_GEN_GDL = 16384

CHART_IGNORE_DATA_BSS

CHART_IGNORE_DATA_BSS = 32

CHART_IGNORE_LIB_FROM

CHART_IGNORE_LIB_FROM = 128

CHART_IGNORE_LIB_TO

CHART_IGNORE_LIB_TO = 64

CHART_IGNORE_XTRN

CHART_IGNORE_XTRN = 16

CHART_NOLIBFUNCS

CHART_NOLIBFUNCS = 1024

CHART_PRINT_COMMENTS

CHART_PRINT_COMMENTS = 256

CHART_PRINT_DOTS

CHART_PRINT_DOTS = 512

CHART_PRINT_NAMES

CHART_PRINT_NAMES = 4096

CHART_RECURSIVE

CHART_RECURSIVE = 4

CHART_REFERENCED

CHART_REFERENCED = 2

CHART_REFERENCING

CHART_REFERENCING = 1

CHART_WINGRAPH

CHART_WINGRAPH = 32768

EDGE_BACK

EDGE_BACK = 3

EDGE_CROSS

EDGE_CROSS = 4

EDGE_FORWARD

EDGE_FORWARD = 2

EDGE_NONE

EDGE_NONE = 0

EDGE_SUBGRAPH

EDGE_SUBGRAPH = 5

EDGE_TREE

EDGE_TREE = 1

FC_APPND

FC_APPND = 8

FC_CALL_ENDS

FC_CALL_ENDS = 32

FC_CHKBREAK

FC_CHKBREAK = 16

FC_NOEXT

FC_NOEXT = 2

FC_NOPREDS

FC_NOPREDS = 64

FC_OUTLINES

FC_OUTLINES = 128

FC_PREDS

FC_PREDS = 0

FC_PRINT

FC_PRINT = 1

FC_RESERVED

FC_RESERVED = 4

fcb_cndret

fcb_cndret = 3

fcb_enoret

fcb_enoret = 5

fcb_error

fcb_error = 7

fcb_extern

fcb_extern = 6

fcb_indjump

fcb_indjump = 1

fcb_noret

fcb_noret = 4

fcb_normal

fcb_normal = 0

fcb_ret

fcb_ret = 2

Functions

display_gdl(fname: char const *) ‑> int

display_gdl(fname) -> int Display GDL file by calling wingraph32. The exact name of the grapher is taken from the configuration file and set up by setup_graph_subsystem(). The path should point to a temporary file: when wingraph32 succeeds showing the graph, the input file will be deleted.

fname: (C++: const char *) char const *
return: error code from os, 0 if ok

gen_complex_call_chart(filename: char const *, wait: char const *, title: char const *, ea1: ea_t, ea2: ea_t, flags: int, recursion_depth: int32 = -1) ‑> bool

gen_complex_call_chart(filename, wait, title, ea1, ea2, flags, recursion_depth=-1) -> bool Build and display a complex xref graph.

filename: (C++: const char *) output file name. the file extension is not used. maybe
                nullptr.
wait: (C++: const char *) message to display during graph building
title: (C++: const char *) graph title
ea1: (C++: ea_t) ,ea2: address range
flags: (C++: int) combination of Call chart building flags and Flow graph building
             flags. if none of CHART_GEN_DOT, CHART_GEN_GDL, CHART_WINGRAPH is
             specified, the function will return false.
flags: (C++: int) combination of Call chart building flags and Flow graph building
             flags. if none of CHART_GEN_DOT, CHART_GEN_GDL, CHART_WINGRAPH is
             specified, the function will return false.
recursion_depth: (C++: int32) optional limit of recursion
return: success. if fails, a warning message is displayed on the screen

gen_flow_graph(filename: char const *, title: char const *, pfn: func_t *, ea1: ea_t, ea2: ea_t, gflags: int) ‑> bool

gen_flow_graph(filename, title, pfn, ea1, ea2, gflags) -> bool Build and display a flow graph.

filename: (C++: const char *) output file name. the file extension is not used. maybe
                nullptr.
title: (C++: const char *) graph title
pfn: (C++: func_t *) function to graph
ea1: (C++: ea_t) ,ea2: if pfn == nullptr, then the address range
gflags: (C++: int) combination of Flow graph building flags. if none of
              CHART_GEN_DOT, CHART_GEN_GDL, CHART_WINGRAPH is specified, the
              function will return false
gflags: (C++: int) combination of Flow graph building flags. if none of
              CHART_GEN_DOT, CHART_GEN_GDL, CHART_WINGRAPH is specified, the
              function will return false
return: success. if fails, a warning message is displayed on the screen

gen_gdl(g: gdl_graph_t, fname: char const *) ‑> void

gen_gdl(g, fname) Create GDL file for graph.

g: (C++: const gdl_graph_t *) gdl_graph_t const *
fname: (C++: const char *) char const *

gen_simple_call_chart(filename: char const *, wait: char const *, title: char const *, gflags: int) ‑> bool

gen_simple_call_chart(filename, wait, title, gflags) -> bool Build and display a simple function call graph.

filename: (C++: const char *) output file name. the file extension is not used. maybe
                nullptr.
wait: (C++: const char *) message to display during graph building
title: (C++: const char *) graph title
gflags: (C++: int) combination of CHART_NOLIBFUNCS and Flow graph building flags. if
              none of CHART_GEN_DOT, CHART_GEN_GDL, CHART_WINGRAPH is
              specified, the function will return false.
return: success. if fails, a warning message is displayed on the screen

is_noret_block(btype: fc_block_type_t) ‑> bool

is_noret_block(btype) -> bool Does this block never return?

btype: (C++: fc_block_type_t) enum fc_block_type_t

is_ret_block(btype: fc_block_type_t) ‑> bool

is_ret_block(btype) -> bool Does this block return?

btype: (C++: fc_block_type_t) enum fc_block_type_t

Classes

BasicBlock(id, bb, fc)

: Basic block class. It is returned by the Flowchart class

Methods

  • preds(self) Iterates the predecessors list


  • succs(self) Iterates the successors list


FlowChart(f=None, bounds=None, flags=0)

: Flowchart class used to determine basic blocks. Check ex_gdl_qflow_chart.py for sample usage.

Constructor
 f: A func_t type, use get_func(ea) to get a reference
 bounds: A tuple of the form (start, end). Used if "f" is None
 flags: one of the FC_xxxx flags.

Instance variables

  • size


Methods

  • refresh(self) Refreshes the flow chart


cancellable_graph_t()

: Proxy of C++ cancellable_graph_t class.

__init__(self) -> cancellable_graph_t

 self: PyObject *

Ancestors (in MRO)

* ida_gdl.gdl_graph_t

Descendants

* ida_gdl.qflow_chart_t

Instance variables

  • cancelled: bool cancelled


edge_t(x: int = 0, y: int = 0)

: Proxy of C++ edge_t class.

__init__(self, x=0, y=0) -> edge_t

 x: int
 y: int

Instance variables

  • dst: int dst


  • src: int src


edgevec_t()

: Proxy of C++ edgevec_t class.

__init__(self) -> edgevec_t

gdl_graph_t()

: Proxy of C++ gdl_graph_t class.

__init__(self) -> gdl_graph_t

 self: PyObject *

Descendants

* ida_gdl.cancellable_graph_t
* ida_graph.drawable_graph_t
* ida_hexrays.simple_graph_t

Methods

  • begin(self) ‑> ida_gdl.node_iterator begin(self) -> node_iterator


  • edge(self, node: int, i: int, ispred: bool) ‑> int edge(self, node, i, ispred) -> int

    node: int i: int ispred: bool


  • empty(self) ‑> bool empty(self) -> bool


  • end(self) ‑> ida_gdl.node_iterator end(self) -> node_iterator


  • entry(self) ‑> int entry(self) -> int


  • exists(self, node: int) ‑> bool exists(self, node) -> bool

    node: int


  • exit(self) ‑> int exit(self) -> int


  • front(self) ‑> int front(self) -> int


  • get_edge_color(self, i: int, j: int) ‑> bgcolor_t get_edge_color(self, i, j) -> bgcolor_t

    i: int j: int


  • get_node_color(self, n: int) ‑> bgcolor_t get_node_color(self, n) -> bgcolor_t

    n: int


  • get_node_label(self, n: int) ‑> char * get_node_label(self, n) -> char *

    n: int


  • nedge(self, node: int, ispred: bool) ‑> size_t nedge(self, node, ispred) -> size_t

    node: int ispred: bool


  • node_qty(self) ‑> int node_qty(self) -> int


  • npred(self, node: int) ‑> int npred(self, node) -> int

    node: int


  • nsucc(self, node: int) ‑> int nsucc(self, node) -> int

    node: int


  • pred(self, node: int, i: int) ‑> int pred(self, node, i) -> int

    node: int i: int


  • print_edge(self, fp: FILE *, i: int, j: int) ‑> bool print_edge(self, fp, i, j) -> bool

    fp: FILE * i: int j: int


  • print_graph_attributes(self, fp: FILE *) ‑> void print_graph_attributes(self, fp)

    fp: FILE *


  • print_node(self, fp: FILE *, n: int) ‑> bool print_node(self, fp, n) -> bool

    fp: FILE * n: int


  • print_node_attributes(self, fp: FILE *, n: int) ‑> void print_node_attributes(self, fp, n)

    fp: FILE * n: int


  • size(self) ‑> int size(self) -> int


  • succ(self, node: int, i: int) ‑> int succ(self, node, i) -> int

    node: int i: int


node_iterator(_g: gdl_graph_t, n: int)

: Proxy of C++ node_iterator class.

__init__(self, _g, n) -> node_iterator

 _g: gdl_graph_t const *
 n: int

node_ordering_t()

: Proxy of C++ node_ordering_t class.

__init__(self) -> node_ordering_t

Methods

  • clear(self) ‑> void clear(self)


  • clr(self, _node: int) ‑> bool clr(self, _node) -> bool

    _node: int


  • node(self, _order: size_t) ‑> int node(self, _order) -> int

    _order: size_t


  • order(self, _node: int) ‑> int order(self, _node) -> int

    _node: int


  • resize(self, n: int) ‑> void resize(self, n)

    n: int


  • set(self, _node: int, num: int) ‑> void set(self, _node, num)

    _node: int num: int


  • size(self) ‑> size_t size(self) -> size_t


qbasic_block_t()

: Proxy of C++ qbasic_block_t class.

__init__(self) -> qbasic_block_t

Ancestors (in MRO)

* ida_range.range_t

qflow_chart_t(*args)

: Proxy of C++ qflow_chart_t class.

__init__(self) -> qflow_chart_t
__init__(self, _title, _pfn, _ea1, _ea2, _flags) -> qflow_chart_t

 _title: char const *
 _pfn: func_t *
 _ea1: ea_t
 _ea2: ea_t
 _flags: int

Ancestors (in MRO)

* ida_gdl.cancellable_graph_t
* ida_gdl.gdl_graph_t

Instance variables

  • bounds: range_t bounds


  • flags: int flags


  • nproper: int nproper


  • pfn: func_t * pfn


  • title: qstring title


Methods

  • append_to_flowchart(self, ea1: ea_t, ea2: ea_t) ‑> void append_to_flowchart(self, ea1, ea2)

    ea1: ea_t ea2: ea_t


  • calc_block_type(self, blknum: size_t) ‑> fc_block_type_t calc_block_type(self, blknum) -> fc_block_type_t

    blknum: size_t


  • create(self, *args) ‑> void create(self, _title, _pfn, _ea1, _ea2, _flags)

    _title: char const * _pfn: func_t * _ea1: ea_t _ea2: ea_t _flags: int

    create(self, _title, ranges, _flags)

    _title: char const * ranges: rangevec_t const & _flags: int


  • is_noret_block(self, blknum: size_t) ‑> bool is_noret_block(self, blknum) -> bool

    blknum: size_t


  • is_ret_block(self, blknum: size_t) ‑> bool is_ret_block(self, blknum) -> bool

    blknum: size_t


  • print_names(self) ‑> bool print_names(self) -> bool


  • refresh(self) ‑> void refresh(self)


Last updated