IDA SDK

- Main Page
- Header Files
- Classes
- Modules

- File List
- File Members

Classes | Functions | Macros | Typedefs | Enumerations | Variables
gdl.hpp File Reference

## Detailed Description

Low level graph drawing operations.

## Classes
class | intseq_t
| Ordered sequence of integer constants. More...
class | intset_t
| Set of integer constants. More...
class | intmap_t
| Map of integer constants to integer constants. More...
class | node_set_t
| Set of graph nodes. More...
class | node_iterator
| Node iterator (used to draw graphs) More...
class | gdl_graph_t
| gdl graph interface - includes only functions required to draw it More...

## Functions
idaman void ida_export | gen_gdl (const gdl_graph_t *g, const char *fname)
| Create GDL file for graph.
idaman int ida_export | display_gdl (const char *fname)
| Display GDL file by calling wingraph32. More...
idaman bool ida_export | gen_flow_graph (const char *filename, const char *title, func_t *pfn, ea_t ea1, ea_t ea2, int gflags)
| Build and display a flow graph. More...
idaman bool ida_export | gen_simple_call_chart (const char *filename, const char *wait, const char *title, int gflags)
| Build and display a simple function call graph. More...
idaman bool ida_export | gen_complex_call_chart (const char *filename, const char *wait, const char *title, ea_t ea1, ea_t ea2, int flags, int32 recursion_depth=-1)
| Build and display a complex xref graph. More...
idaman void ida_export | setup_graph_subsystem (const char *_grapher, bgcolor_t(idaapi *get_graph_color)(int color))
| Setup the user-defined graph colors and graph viewer program. More...

## Macros
#define | DECLARE_HELPER(decl)
#define | CHART_PRINT_NAMES 0x1000
| print labels for each block?
#define | CHART_GEN_DOT 0x2000
| generate .dot file (file extension is forced to .dot)
#define | CHART_GEN_GDL 0x4000
| generate .gdl file (file extension is forced to .gdl)
#define | CHART_WINGRAPH 0x8000
| call grapher to display the graph
#define | CHART_NOLIBFUNCS 0x0400
| don't include library functions in the graph
#define | CHART_REFERENCING 0x0001
| references to the addresses in the list
#define | CHART_REFERENCED 0x0002
| references from the addresses in the list
#define | CHART_RECURSIVE 0x0004
| analyze added blocks
#define | CHART_FOLLOW_DIRECTION 0x0008
| analyze references to added blocks only in the direction of the reference who discovered the current block
#define | CHART_IGNORE_XTRN 0x0010
#define | CHART_IGNORE_DATA_BSS 0x0020
#define | CHART_IGNORE_LIB_TO 0x0040
| ignore references to library functions
#define | CHART_IGNORE_LIB_FROM 0x0080
| ignore references from library functions
#define | CHART_PRINT_COMMENTS 0x0100
#define | CHART_PRINT_DOTS 0x0200
| print dots if xrefs exist outside of the range recursion depth

## Typedefs
typedef qvector< intseq_t > | array_of_intseq_t
typedef qvector< intmap_t > | array_of_intmap_t
typedef qvector< node_set_t > | array_of_node_set_t

## Enumerations
enum | fc_block_type_t { fcb_normal, fcb_indjump, fcb_ret, fcb_cndret, fcb_noret, fcb_enoret, fcb_extern, fcb_error }
| Flow chart block types. More...

## Variables
int | default_graph_format
| Format to generate when not specified in the flags. More...

## Macro Definition Documentation

#define DECLARE_HELPER | ( |  | decl | ) |

Value:
decl node_iterator *ida_export node_iterator_goup(node_iterator *); \
decl void ida_export create_qflow_chart(qflow_chart_t &); \
decl bool ida_export append_to_flowchart(qflow_chart_t &, ea_t, ea_t); \
decl fc_block_type_t ida_export fc_calc_block_type(const qflow_chart_t &, size_t); \
decl bool ida_export create_multirange_qflow_chart(qflow_chart_t &, const areavec_t &);
areavec_t
Vector of area_t instances.
Definition: area.hpp:103
ea_t
uint32 ea_t
effective address
Definition: pro.h:403
ida_export
#define ida_export
functions marked with this keyword are available as part of the IDA SDK
Definition: pro.h:257
fc_block_type_t
fc_block_type_t
Flow chart block types.
Definition: gdl.hpp:33
node_iterator
Node iterator (used to draw graphs)
Definition: gdl.hpp:137

## Enumeration Type Documentation

enum fc_block_type_t

Flow chart block types.

Enumerator
fcb_normal | normal block
fcb_indjump | block ends with indirect jump
fcb_ret | return block
fcb_cndret | conditional return block
fcb_noret | noreturn block
fcb_enoret | external noreturn block (does not belong to the function)
fcb_extern | external normal block
fcb_error | block passes execution past the function end

## Function Documentation

idaman int ida_export display_gdl | ( | const char * | 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().

Returns
  error code from os, 0 if ok

idaman bool ida_export gen_flow_graph | ( | const char * | filename,
|  | const char * | title,
|  | func_t * | pfn,
|  | ea_t | ea1,
|  | ea_t | ea2,
|  | int | gflags
| ) |  |

Build and display a flow graph.

Parameters

  filename | output file name. the file extension is not used. maybe NULL.
  title | graph title
  pfn | function to graph
  ea1,ea2 | if pfn == NULL, then the address range
  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

Returns
  success. if fails, a warning message is displayed on the screen

idaman bool ida_export gen_simple_call_chart | ( | const char * | filename,
|  | const char * | wait,
|  | const char * | title,
|  | int | gflags
| ) |  |

Build and display a simple function call graph.

Parameters

  filename | output file name. the file extension is not used. maybe NULL.
  wait | message to display during graph building
  title | graph title
  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.

Returns
  success. if fails, a warning message is displayed on the screen

idaman bool ida_export gen_complex_call_chart | ( | const char * | filename,
|  | const char * | wait,
|  | const char * | title,
|  | ea_t | ea1,
|  | ea_t | ea2,
|  | int | flags,
|  | int32 | recursion_depth = `-1`
| ) |  |

Build and display a complex xref graph.

Parameters

  filename | output file name. the file extension is not used. maybe NULL.
  wait | message to display during graph building
  title | graph title
  ea1,ea2 | address range
  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.
  recursion_depth | optional limit of recursion

Returns
  success. if fails, a warning message is displayed on the screen

idaman void ida_export setup_graph_subsystem | ( | const char * | _grapher,
|  | bgcolor_t(idaapi *)(int color) | get_graph_color
| ) |  |

Setup the user-defined graph colors and graph viewer program.

This function is called by the GUI at the beginning, so no need to call it again.

## Variable Documentation

int default_graph_format

Format to generate when not specified in the flags.

(e.g. called from UI). the default is set in ida.cfg. 0 - GDL, 1 - DOT.