Module index

Module ida_gdl

IDA Plugin SDK API wrapper: gdl

Global variables

var CHART_FOLLOW_DIRECTION
analyze references to added blocks only in the direction of the reference who discovered the current block
var CHART_GEN_DOT
generate .dot file (file extension is forced to .dot)
var CHART_GEN_GDL
generate .gdl file (file extension is forced to .gdl)
var CHART_IGNORE_DATA_BSS
CHART_IGNORE_DATA_BSS = 32
var CHART_IGNORE_LIB_FROM
ignore references from library functions
var CHART_IGNORE_LIB_TO
ignore references to library functions
var CHART_IGNORE_XTRN
CHART_IGNORE_XTRN = 16
var CHART_NOLIBFUNCS
don't include library functions in the graph
var CHART_PRINT_COMMENTS
CHART_PRINT_COMMENTS = 256
var CHART_PRINT_DOTS
print dots if xrefs exist outside of the range recursion depth
var CHART_PRINT_NAMES
print labels for each block?
var CHART_RECURSIVE
analyze added blocks
var CHART_REFERENCED
references from the addresses in the list
var CHART_REFERENCING
references to the addresses in the list
var CHART_WINGRAPH
call grapher to display the graph
var FC_APPND
multirange flowchart (set by append_to_flowchart)
var FC_CALL_ENDS
call instructions terminate basic blocks
var FC_CHKBREAK
build_qflow_chart() may be aborted by user
var FC_NOEXT
do not compute external blocks. Use this to prevent jumps leaving the function from appearing in the flow chart. Unless specified, the targets of those outgoing jumps will be present in the flow chart under the form of one-instruction blocks
var FC_NOPREDS
do not compute predecessor lists
var FC_PREDS
FC_PREDS = 0
var FC_PRINT
print names (used only by display_flow_chart())
var FC_RESERVED
FC_RESERVED = 4
var fcb_cndret
fcb_cndret = 3
var fcb_enoret
fcb_enoret = 5
var fcb_error
fcb_error = 7
var fcb_extern
fcb_extern = 6
var fcb_indjump
fcb_indjump = 1
var fcb_noret
fcb_noret = 4
var fcb_normal
fcb_normal = 0
var fcb_ret
fcb_ret = 2

Functions

def display_gdl(*args) ‑> 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()' .
display_gdl(fname) -> int
fname (C++: const char *)
return: error code from os, 0 if ok
def gen_complex_call_chart(*args) ‑> bool
Build and display a complex xref graph.
gen_complex_call_chart(filename, wait, title, ea1, ea2, flags, recursion_depth=-1) -> bool
filename: output file name. the file extension is not used.
maybe NULL. (C++: const char *)
wait: message to display during graph building (C++: const char
*)
title: graph title (C++: const char *)
ea1: address range (C++: ea_t)
ea2: address range (C++: ea_t)
flags: 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. (C++: int)
recursion_depth: optional limit of recursion (C++: int32)
return: success. if fails, a warning message is displayed on the
screen
def gen_flow_graph(*args) ‑> bool
Build and display a flow graph.
gen_flow_graph(filename, title, pfn, ea1, ea2, gflags) -> bool
filename: output file name. the file extension is not used.
maybe NULL. (C++: const char *)
title: graph title (C++: const char *)
pfn: function to graph (C++: func_t *)
ea1: if pfn == NULL, then the address range (C++: ea_t)
ea2: if pfn == NULL, then the address range (C++: ea_t)
gflags: combination of Flow graph building flags . if none of
CHART_GEN_DOT , CHART_GEN_GDL , CHART_WINGRAPH is specified, the function will return false (C++: int)
return: success. if fails, a warning message is displayed on the
screen
def gen_gdl(*args) ‑> void
Create GDL file for graph.
gen_gdl(g, fname)
g (C++: const gdl_graph_t *)
fname (C++: const char *)
def gen_simple_call_chart(*args) ‑> bool
Build and display a simple function call graph.
gen_simple_call_chart(filename, wait, title, gflags) -> bool
filename: output file name. the file extension is not used.
maybe NULL. (C++: const char *)
wait: message to display during graph building (C++: const char
*)
title: graph title (C++: const char *)
gflags: 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. (C++: int)
return: success. if fails, a warning message is displayed on the
screen
def is_noret_block(*args) ‑> bool
Does this block never return?
is_noret_block(btype) -> bool
btype (C++: fc_block_type_t)
def is_ret_block(*args) ‑> bool
Does this block return?
is_ret_block(btype) -> bool
btype (C++: fc_block_type_t)

Classes

class BasicBlock (id, bb, fc)
Basic block class. It is returned by the Flowchart class

Instance variables

var endEA
var end_ea
end_ea of basic block
var id
Basic block ID
var startEA
var start_ea
start_ea of basic block
var type
Block type (check fc_block_type_t enum)

Methods

def preds(self)
Iterates the predecessors list
def succs(self)
Iterates the successors list
class 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

var size
Number of blocks in the flow chart

Methods

def refresh(self)
Refreshes the flow chart
class cancellable_graph_t (*args)
Proxy of C++ cancellable_graph_t class.
__init__(self) -> cancellable_graph_t
self: PyObject *

Ancestors

Subclasses

Instance variables

var cancelled
cancellable_graph_t_cancelled_get(self) -> bool

Inherited members

class gdl_graph_t (*args)
Proxy of C++ gdl_graph_t class.
__init__(self) -> gdl_graph_t
self: PyObject *

Subclasses

Methods

def begin(self, *args) ‑> node_iterator
begin(self) -> node_iterator
def edge(self, *args) ‑> int
edge(self, node, i, ispred) -> int
node (C++: int)
i (C++: int)
ispred (C++: bool)
def empty(self, *args) ‑> bool
empty(self) -> bool
def end(self, *args) ‑> node_iterator
end(self) -> node_iterator
def entry(self, *args) ‑> int
entry(self) -> int
def exists(self, *args) ‑> bool
exists(self, node) -> bool
node (C++: int)
def exit(self, *args) ‑> int
exit(self) -> int
def front(self, *args) ‑> int
front(self) -> int
def get_edge_color(self, *args) ‑> bgcolor_t
get_edge_color(self, i, j) -> bgcolor_t
i (C++: int)
j (C++: int)
def get_node_color(self, *args) ‑> bgcolor_t
get_node_color(self, n) -> bgcolor_t
n (C++: int)
def get_node_label(self, *args) ‑> char *
get_node_label(self, n) -> char *
n (C++: int)
def nedge(self, *args) ‑> size_t
nedge(self, node, ispred) -> size_t
node (C++: int)
ispred (C++: bool)
def node_qty(self, *args) ‑> int
node_qty(self) -> int
def npred(self, *args) ‑> int
npred(self, node) -> int
node (C++: int)
def nsucc(self, *args) ‑> int
nsucc(self, node) -> int
node (C++: int)
def pred(self, *args) ‑> int
pred(self, node, i) -> int
node (C++: int)
i (C++: int)
def print_edge(self, *args) ‑> bool
print_edge(self, fp, i, j) -> bool
fp (C++: FILE *)
i (C++: int)
j (C++: int)
def print_graph_attributes(self, *args) ‑> void
print_graph_attributes(self, fp)
fp (C++: FILE *)
def print_node(self, *args) ‑> bool
print_node(self, fp, n) -> bool
fp (C++: FILE *)
n (C++: int)
def print_node_attributes(self, *args) ‑> void
print_node_attributes(self, fp, n)
fp (C++: FILE *)
n (C++: int)
def size(self, *args) ‑> int
size(self) -> int
def succ(self, *args) ‑> int
succ(self, node, i) -> int
node (C++: int)
i (C++: int)
class node_iterator (*args)
Proxy of C++ node_iterator class.
__init__(self, _g, n) -> node_iterator
_g: gdl_graph_t const * n: int
class qbasic_block_t (*args)
Proxy of C++ qbasic_block_t class.
__init__(self) -> qbasic_block_t

Ancestors

Inherited members

class qflow_chart_t (*args)
Proxy of C++ qflow_chart_t class.
__init__(self) -> qflow_chart_t
_title: char const * _pfn: func_t * _ea1: ea_t _ea2: ea_t _flags: int

Ancestors

Instance variables

var bounds
qflow_chart_t_bounds_get(self) -> range_t
var flags
qflow_chart_t_flags_get(self) -> int
var nproper
qflow_chart_t_nproper_get(self) -> int
var pfn
qflow_chart_t_pfn_get(self) -> func_t *
var title
qflow_chart_t_title_get(self) -> qstring *

Methods

def append_to_flowchart(self, *args) ‑> void
append_to_flowchart(self, ea1, ea2)
ea1 (C++: ea_t)
ea2 (C++: ea_t)
def calc_block_type(self, *args) ‑> fc_block_type_t
calc_block_type(self, blknum) -> fc_block_type_t
blknum (C++: size_t)
def create(self, *args) ‑> void
create(self, _title, _pfn, _ea1, _ea2, _flags)
_title (C++: const char *)
_pfn (C++: func_t *)
_ea1 (C++: ea_t)
_ea2 (C++: ea_t)
_flags (C++: int)
create(self, _title, ranges, _flags)
_title (C++: const char *) ranges: rangevec_t const &
_flags (C++: int)
def is_noret_block(self, *args) ‑> bool
is_noret_block(self, blknum) -> bool
blknum (C++: size_t)
def is_ret_block(self, *args) ‑> bool
is_ret_block(self, blknum) -> bool
blknum (C++: size_t)
def print_names(self, *args) ‑> bool
print_names(self) -> bool
def refresh(self, *args) ‑> void
refresh(self)

Inherited members