Module ida_graph
[frames] | no frames]

Module ida_graph

IDA Plugin SDK API wrapper: graph

Classes
  GraphViewer
  TPointDouble
Proxy of C++ TPointDouble class.
  edge_info_t
Proxy of C++ edge_info_t class.
  edge_infos_wrapper_t
Proxy of C++ edge_infos_wrapper_t class.
  edge_layout_point_t
Proxy of C++ edge_layout_point_t class.
  edge_segment_t
Proxy of C++ edge_segment_t class.
  edge_t
Proxy of C++ edge_t class.
  graph_item_t
Proxy of C++ graph_item_t class.
  graph_node_visitor_t
Proxy of C++ graph_node_visitor_t class.
  graph_path_visitor_t
Proxy of C++ graph_path_visitor_t class.
  graph_visitor_t
Proxy of C++ graph_visitor_t class.
  group_crinfo_t
Proxy of C++ group_crinfo_t class.
  interval_t
Proxy of C++ interval_t class.
  mutable_graph_t
Proxy of C++ mutable_graph_t class.
  node_info_t
Proxy of C++ node_info_t class.
  node_layout_t
Proxy of C++ qvector< rect_t > class.
  node_ordering_t
Proxy of C++ node_ordering_t class.
  point_t
Proxy of C++ point_t class.
  pointseq_t
Proxy of C++ pointseq_t class.
  pointvec_t
Proxy of C++ qvector< point_t > class.
  rect_t
Proxy of C++ rect_t class.
  row_info_t
Proxy of C++ row_info_t class.
  screen_graph_selection_base_t
Proxy of C++ qvector< selection_item_t > class.
  screen_graph_selection_t
Proxy of C++ screen_graph_selection_t class.
  selection_item_t
Proxy of C++ selection_item_t class.
  user_graph_place_t
Proxy of C++ user_graph_place_t class.
Functions
double
calc_dist(p, q)
Calculate distance between p and q.
 
clr_node_info(gid, node, flags)
Clear node info for the given node.
mutable_graph_t
create_disasm_graph(ea)
create_disasm_graph(ranges) -> mutable_graph_t
graph_viewer_t *
create_graph_viewer(title, id, callback, ud, title_height, parent=None)
Create a custom graph viewer.
mutable_graph_t
create_mutable_graph(id)
Create a new empty graph with given id.
user_graph_place_t
create_user_graph_place(node, lnnum)
Get a copy of a 'user_graph_place_t' (returns a pointer to static storage)
 
del_node_info(gid, node)
Delete the 'node_info_t' for the given node.
 
delete_mutable_graph(g)
Delete graph object.use this only if you are dealing with 'mutable_graph_t' instances that have not been used together with a 'graph_viewer_t' .
graph_viewer_t *
get_graph_viewer(parent)
Get custom graph viewer for given form.
bool
get_node_info(out, gid, node)
Get node info.
mutable_graph_t
get_viewer_graph(gv)
Get graph object for given custom graph viewer.
 
pyg_close(_self)
 
pyg_select_node(_self, nid)
bool
pyg_show(_self)
 
refresh_viewer(gv)
Redraw the graph in the given view.
 
set_node_info(gid, node, ni, flags)
Set node info.
 
set_viewer_graph(gv, g)
Set the underlying graph object for the given viewer.
bool
viewer_attach_menu_item(g, name)
Attach a previously-registered action to the view's context menu.
 
viewer_center_on(gv, node)
Center the graph view on the given node.
bool
viewer_create_groups(gv, out_group_nodes, gi)
This will perform an operation similar to what happens when a user manually selects a set of nodes, right-clicks and selects "Create group".
 
viewer_del_node_info(gv, n)
Delete node info for node in given viewer (see 'del_node_info()' )
bool
viewer_delete_groups(gv, groups, new_current=-1)
Wrapper around mutable_graph_t::delete_group.
 
viewer_fit_window(gv)
Fit graph viewer to its parent form.
int
viewer_get_curnode(gv)
Get number of currently selected node (-1 if none)
bool
viewer_get_gli(out, gv, flags=0)
Get location info for given graph view If flags contains GLICTL_CENTER, then the gli that will be retrieved, will be the one at the center of the view.
bool
viewer_get_node_info(gv, out, n)
Get node info for node in given viewer (see 'get_node_info()' )
bool
viewer_get_selection(gv, sgs)
Get currently selected items for graph viewer.
 
viewer_set_gli(gv, gli, flags=0)
Set location info for given graph view If flags contains GLICTL_CENTER, then the gli will be set to be the center of the view.
bool
viewer_set_groups_visibility(gv, groups, expand, new_current=-1)
Wrapper around mutable_graph_t::change_visibility.
 
viewer_set_node_info(gv, n, ni, flags)
Set node info for node in given viewer (see 'set_node_info()' )
int
viewer_set_titlebar_height(gv, height)
Set height of node title bars ( 'grcode_set_titlebar_height' )
Variables
  COLLAPSED_NODE = -2147483648
  GLICTL_CENTER = 1
  MTG_DOT_NODE = 2
  MTG_GROUP_NODE = 1
  MTG_NON_DISPLAYABLE_NODE = 8
  NIFF_SHOW_CONTENTS = 1
  NIF_ALL = 31
  NIF_BG_COLOR = 1
  NIF_EA = 4
  NIF_FLAGS = 16
  NIF_FRAME_COLOR = 2
  NIF_TEXT = 8
  SWIG_PYTHON_LEGACY_BOOL = 1
  __package__ = None
  arrow_height = 10
  arrow_width = 8
  cvar = ??
  edge_back = 3
  edge_cross = 4
  edge_error = 0
  edge_forward = 2
  edge_subgraph = 5
  edge_tree = 1
  git_edge = 1
  git_elp = 5
  git_node = 2
  git_none = 0
  git_text = 4
  git_tool = 3
  grcode_attach_menu_item = 301
  grcode_calculating_layout = 0
  grcode_center_on = 264
  grcode_change_group_visibility = 281
  grcode_changed_graph = 2
  grcode_clear = 269
  grcode_clicked = 4
  grcode_create_circle_layout = 272
  grcode_create_digraph_layout = 270
  grcode_create_disasm_graph1 = 287
  grcode_create_disasm_graph2 = 288
  grcode_create_graph_viewer = 256
  grcode_create_group = 275
  grcode_create_mutable_graph = 259
  grcode_create_tree_layout = 271
  grcode_create_user_graph_place = 286
  grcode_creating_group = 6
  grcode_dblclicked = 5
  grcode_del_custom_layout = 266
  grcode_del_node_info = 291
  grcode_delete_group = 280
  grcode_delete_mutable_graph = 298
  grcode_deleting_group = 7
  grcode_destroyed = 18
  grcode_edge_infos_wrapper_clear = 300
  grcode_edge_infos_wrapper_copy = 299
  grcode_empty = 278
  grcode_find_subgraph_node = 274
  grcode_fit_window = 262
  grcode_get_curnode = 263
  grcode_get_custom_layout = 276
  grcode_get_gli = 303
  grcode_get_graph_groups = 277
  grcode_get_graph_viewer = 257
  grcode_get_node_info = 290
  grcode_get_node_representative = 273
  grcode_get_selection = 265
  grcode_get_viewer_graph = 258
  grcode_gotfocus = 9
  grcode_group_visibility = 8
  grcode_is_visible_node = 279
  grcode_layout_calculated = 1
  grcode_lostfocus = 10
  grcode_node_qty = 283
  grcode_nrect = 284
  grcode_refresh_viewer = 261
  grcode_reserved = 3
  grcode_set_custom_layout = 267
  grcode_set_edge = 282
  grcode_set_gli = 302
  grcode_set_graph_groups = 268
  grcode_set_node_info = 289
  grcode_set_titlebar_height = 285
  grcode_set_viewer_graph = 260
  grcode_user_draw = 16
  grcode_user_gentext = 12
  grcode_user_hint = 17
  grcode_user_refresh = 11
  grcode_user_size = 14
  grcode_user_text = 13
  grcode_user_title = 15
  grcode_viewer_create_groups = 292
  grcode_viewer_create_groups_vec = 295
  grcode_viewer_delete_groups = 293
  grcode_viewer_delete_groups_vec = 296
  grcode_viewer_groups_visibility = 294
  grcode_viewer_groups_visibility_vec = 297
  layout_circle = 3
  layout_digraph = 1
  layout_none = 0
  layout_orthogonal = 5
  layout_polar_tree = 4
  layout_radial_tree = 6
  layout_tree = 2
  xgap = 10
  ygap = 30
Function Details

calc_dist(p, q)

 

Calculate distance between p and q.

Parameters:
  • p, (C++ - point_t)
  • q, (C++ - point_t)
Returns: double

clr_node_info(gid, node, flags)

 

Clear node info for the given node.

Parameters:
  • gid - id of desired graph (C++: graph_id_t)
  • node - node number (C++: int)
  • flags - combination of Node info flags , identifying which fields of node_info_t will be cleared (C++: uint32)

create_disasm_graph(ea)

 

create_disasm_graph(ranges) -> mutable_graph_t

Create a graph for the function that contains 'ea'.

Parameters:
  • ea, (C++ - ea_t)
Returns: mutable_graph_t

create_graph_viewer(title, id, callback, ud, title_height, parent=None)

 

Create a custom graph viewer.

Parameters:
  • title - the widget title (C++: const char *)
  • id - graph id (C++: uval_t)
  • callback - callback to handle graph notifications ( graph_notification_t ) (C++: hook_cb_t *)
  • ud - user data passed to callback (C++: void *)
  • title_height - node title height (C++: int)
  • parent, (C++ - TWidget *)
Returns: graph_viewer_t *
new viewer

create_mutable_graph(id)

 

Create a new empty graph with given id.

Parameters:
  • id, (C++ - uval_t)
Returns: mutable_graph_t

create_user_graph_place(node, lnnum)

 

Get a copy of a 'user_graph_place_t' (returns a pointer to static storage)

Parameters:
  • node, (C++ - int)
  • lnnum, (C++ - int)
Returns: user_graph_place_t

del_node_info(gid, node)

 

Delete the 'node_info_t' for the given node.

Parameters:
  • gid, (C++ - graph_id_t)
  • node, (C++ - int)

delete_mutable_graph(g)

 

Delete graph object.use this only if you are dealing with 'mutable_graph_t' instances that have not been used together with a 'graph_viewer_t' . If you have called 'set_viewer_graph()' with your graph, the graph's lifecycle will be managed by the viewer, and you shouldn't interfere with it

Parameters:
  • g, (C++ - mutable_graph_t *)

get_graph_viewer(parent)

 

Get custom graph viewer for given form.

Parameters:
  • parent, (C++ - TWidget *)
Returns: graph_viewer_t *

get_node_info(out, gid, node)

 

Get node info.

Parameters:
  • out - result (C++: node_info_t *)
  • gid - id of desired graph (C++: graph_id_t)
  • node - node number (C++: int)
Returns: bool
success

get_viewer_graph(gv)

 

Get graph object for given custom graph viewer.

Parameters:
  • gv, (C++ - graph_viewer_t *)
Returns: mutable_graph_t

refresh_viewer(gv)

 

Redraw the graph in the given view.

Parameters:
  • gv, (C++ - graph_viewer_t *)

set_node_info(gid, node, ni, flags)

 

Set node info.

Parameters:
  • gid - id of desired graph (C++: graph_id_t)
  • node - node number (C++: int)
  • ni - node info to use (C++: const node_info_t &)
  • flags - combination of Node info flags , identifying which fields of 'ni' will be used (C++: uint32)

set_viewer_graph(gv, g)

 

Set the underlying graph object for the given viewer.

Parameters:
  • gv, (C++ - graph_viewer_t *)
  • g, (C++ - mutable_graph_t *)

viewer_attach_menu_item(g, name)

 

Attach a previously-registered action to the view's context menu. See 'kernwin.hpp' for how to register actions.

Parameters:
  • g, (C++ - graph_viewer_t *)
  • name - action name (C++: const char *)
Returns: bool
success

viewer_center_on(gv, node)

 

Center the graph view on the given node.

Parameters:
  • gv, (C++ - graph_viewer_t *)
  • node, (C++ - int)

viewer_create_groups(gv, out_group_nodes, gi)

 

This will perform an operation similar to what happens when a user manually selects a set of nodes, right-clicks and selects "Create group". This is a wrapper around mutable_graph_t::create_group that will, in essence:clone the current graphfor each 'group_crinfo_t' , attempt creating group in that new graphif all were successful, animate to that new graph.this accepts parameters that allow creating of multiple groups at once; which means only one graph animation will be triggered.

Parameters:
  • gv, (C++ - graph_viewer_t *)
  • out_group_nodes, (C++ - intvec_t *)
  • gi, (C++ - const groups_crinfos_t &)
Returns: bool

viewer_del_node_info(gv, n)

 

Delete node info for node in given viewer (see 'del_node_info()' )

Parameters:
  • gv, (C++ - graph_viewer_t *)
  • n, (C++ - int)

viewer_delete_groups(gv, groups, new_current=-1)

 

Wrapper around mutable_graph_t::delete_group. This function will:clone the current graphattempt deleting the groups in that new graphif successful, animate to that new graph.

Parameters:
  • gv, (C++ - graph_viewer_t *)
  • groups, (C++ - const intvec_t &)
  • new_current, (C++ - int)
Returns: bool

viewer_fit_window(gv)

 

Fit graph viewer to its parent form.

Parameters:
  • gv, (C++ - graph_viewer_t *)

viewer_get_curnode(gv)

 

Get number of currently selected node (-1 if none)

Parameters:
  • gv, (C++ - graph_viewer_t *)
Returns: int

viewer_get_gli(out, gv, flags=0)

 

Get location info for given graph view If flags contains GLICTL_CENTER, then the gli that will be retrieved, will be the one at the center of the view. Otherwise it will be the top-left.

Parameters:
  • out, (C++ - graph_location_info_t *)
  • gv, (C++ - graph_viewer_t *)
  • flags, (C++ - uint32)
Returns: bool

viewer_get_node_info(gv, out, n)

 

Get node info for node in given viewer (see 'get_node_info()' )

Parameters:
  • gv, (C++ - graph_viewer_t *)
  • out, (C++ - node_info_t *)
  • n, (C++ - int)
Returns: bool

viewer_get_selection(gv, sgs)

 

Get currently selected items for graph viewer.

Parameters:
  • gv, (C++ - graph_viewer_t *)
  • sgs, (C++ - screen_graph_selection_t *)
Returns: bool

viewer_set_gli(gv, gli, flags=0)

 

Set location info for given graph view If flags contains GLICTL_CENTER, then the gli will be set to be the center of the view. Otherwise it will be the top-left.

Parameters:
  • gv, (C++ - graph_viewer_t *)
  • gli, (C++ - const graph_location_info_t *)
  • flags, (C++ - uint32)

viewer_set_groups_visibility(gv, groups, expand, new_current=-1)

 

Wrapper around mutable_graph_t::change_visibility. This function will:clone the current graphattempt changing visibility of the groups in that new graphif successful, animate to that new graph.

Parameters:
  • gv, (C++ - graph_viewer_t *)
  • groups, (C++ - const intvec_t &)
  • expand, (C++ - bool)
  • new_current, (C++ - int)
Returns: bool

viewer_set_node_info(gv, n, ni, flags)

 

Set node info for node in given viewer (see 'set_node_info()' )

Parameters:
  • gv, (C++ - graph_viewer_t *)
  • n, (C++ - int)
  • ni, (C++ - const node_info_t &)
  • flags, (C++ - uint32)

viewer_set_titlebar_height(gv, height)

 

Set height of node title bars ( 'grcode_set_titlebar_height' )

Parameters:
  • gv, (C++ - graph_viewer_t *)
  • height, (C++ - int)
Returns: int