Module ida_gdl
[frames] | no frames]

Module ida_gdl

IDA Plugin SDK API wrapper: gdl

Classes
  node_iterator
Proxy of C++ node_iterator class
  qbasic_block_t
Proxy of C++ qbasic_block_t class
  qflow_chart_t
Proxy of C++ qflow_chart_t class
  BasicBlock
Basic block class.
  FlowChart
Flowchart class used to determine basic blocks.
Functions
 
gen_gdl(g, fname)
Create GDL file for graph.
int
display_gdl(fname)
Display GDL file by calling wingraph32.
bool
gen_flow_graph(filename, title, pfn, ea1, ea2, gflags)
Build and display a flow graph.
bool
gen_simple_call_chart(filename, wait, title, gflags)
Build and display a simple function call graph.
bool
gen_complex_call_chart(filename, wait, title, ea1, ea2, flags, recursion_depth=-1)
Build and display a complex xref graph.
bool
is_noret_block(btype)
Does this block never return?
bool
is_ret_block(btype)
Does this block return?
Variables
  fcb_normal = 0
  fcb_indjump = 1
  fcb_ret = 2
  fcb_cndret = 3
  fcb_noret = 4
  fcb_enoret = 5
  fcb_extern = 6
  fcb_error = 7
  CHART_PRINT_NAMES = 4096
print labels for each block?
  CHART_GEN_DOT = 8192
generate .dot file (file extension is forced to .dot)
  CHART_GEN_GDL = 16384
generate .gdl file (file extension is forced to .gdl)
  CHART_WINGRAPH = 32768
call grapher to display the graph
  CHART_NOLIBFUNCS = 1024
don't include library functions in the graph
  CHART_REFERENCING = 1
references to the addresses in the list
  CHART_REFERENCED = 2
references from the addresses in the list
  CHART_RECURSIVE = 4
analyze added blocks
  CHART_FOLLOW_DIRECTION = 8
analyze references to added blocks only in the direction of the reference who discovered the current block
  CHART_IGNORE_XTRN = 16
  CHART_IGNORE_DATA_BSS = 32
  CHART_IGNORE_LIB_TO = 64
ignore references to library functions
  CHART_IGNORE_LIB_FROM = 128
ignore references from library functions
  CHART_PRINT_COMMENTS = 256
  CHART_PRINT_DOTS = 512
print dots if xrefs exist outside of the range recursion depth
  FC_PRINT = 1
print names (used only by display_flow_chart())
  FC_NOEXT = 2
do not compute external blocks.
  FC_PREDS = 4
compute predecessor lists
  FC_APPND = 8
multirange flowchart (set by append_to_flowchart)
  FC_CHKBREAK = 16
build_qflow_chart() may be aborted by user
  __package__ = None
Function Details

gen_gdl(g, fname)

 

Create GDL file for graph.

Parameters:
  • g, (C++ - const gdl_graph_t *)
  • fname, (C++ - const char *)

display_gdl(fname)

 

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()' .

Parameters:
  • fname, (C++ - const char *)
Returns: int
error code from os, 0 if ok

gen_flow_graph(filename, title, pfn, ea1, ea2, gflags)

 

Build and display a flow graph.

Parameters:
  • 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)
Returns: bool
success. if fails, a warning message is displayed on the screen

gen_simple_call_chart(filename, wait, title, gflags)

 

Build and display a simple function call graph.

Parameters:
  • 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)
Returns: bool
success. if fails, a warning message is displayed on the screen

gen_complex_call_chart(filename, wait, title, ea1, ea2, flags, recursion_depth=-1)

 

Build and display a complex xref graph.

Parameters:
  • 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)
Returns: bool
success. if fails, a warning message is displayed on the screen

is_noret_block(btype)

 

Does this block never return?

Parameters:
  • btype, (C++ - fc_block_type_t)
Returns: bool

is_ret_block(btype)

 

Does this block return?

Parameters:
  • btype, (C++ - fc_block_type_t)
Returns: bool

Variables Details

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

Value:
2