本文整理匯總了Python中idaapi.GraphViewer方法的典型用法代碼示例。如果您正苦於以下問題:Python idaapi.GraphViewer方法的具體用法?Python idaapi.GraphViewer怎麽用?Python idaapi.GraphViewer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類idaapi
的用法示例。
在下文中一共展示了idaapi.GraphViewer方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def __init__(self, title):
self._title = title
idaapi.GraphViewer.__init__(self, self._title)
self._targets = set()
self._sources = set()
# This might take a while...
self._idb_graph = sark.graph.get_idb_graph()
self._lca_graph = nx.DiGraph()
self._handlers = [add_function_handler(self),
add_address_handler(self)]
self._current_node_id = 0
self._disabled_sources = set()
self._remove_target_handler = remove_target_handler(self)
self._enable_source_handler = enable_source_handler(self)
self._disable_source_handler = disable_source_handler(self)
self._node_ids = {}
示例2: __init__
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def __init__(self, flow_graph, title):
idaapi.GraphViewer.__init__(self, title)
self.flow_graph = flow_graph
self.result = None
self.names = {}
示例3: Show
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def Show(self):
if not idaapi.GraphViewer.Show(self):
return False
self.cmd_test = self.AddCommand("Test", "F2")
if self.cmd_test == 0:
print "Failed to add popup menu item!"
return True
示例4: __init__
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def __init__(self, parent, info, close_open=True):
self.cur_arena = parent.cur_arena
self.heap = parent.heap
self.info = info
self.bin_type = info['type']
self.SetCurrentRendererType(idaapi.TCCRT_GRAPH)
idaapi.GraphViewer.__init__(self, self.title, close_open)
示例5: Show
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def Show(self):
if not idaapi.GraphViewer.Show(self):
return False
self.cmd_refresh = self.AddCommand("Refresh", "Ctrl+R")
return True
# --------------------------------------------------------------------------
示例6: __init__
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def __init__(self, title, classes, final_list):
idaapi.GraphViewer.__init__(self, title)
self.selected = None
self.classes = classes
self.final_list = final_list
self.nodes = {}
self.nodes_ea = {}
self.graph = {}
self.last_cmd = 0
dones = set()
for ea, tokens in self.classes:
refs = DataRefsTo(ea)
refs_funcs = set()
for ref in refs:
func = idaapi.get_func(ref)
if func is not None:
refs_funcs.add(func.start_ea)
if len(refs_funcs) == 1:
func_ea = list(refs_funcs)[0]
if func_ea in dones:
continue
dones.add(func_ea)
func_name = get_func_name(func_ea)
tmp = demangle_name(func_name, INF_SHORT_DN)
if tmp is not None:
func_name = tmp
element = [func_ea, func_name, "::".join(tokens), [get_string(ea)]]
self.final_list.append(element)
示例7: Show
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def Show(self):
if not idaapi.GraphViewer.Show(self):
return False
return True
#-------------------------------------------------------------------------------
示例8: __init__
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def __init__(self, graph, title="GraphViewer", handler=None, padding=PADDING):
"""Initialize the graph viewer.
To avoid bizarre IDA errors (crashing when creating 2 graphs with the same title,)
a counter is appended to the title (similar to "Hex View-1".)
Args:
graph: A NetworkX graph to display.
title: The graph title.
handler: The default node handler to use when accessing node data.
"""
title = self._make_unique_title(title)
idaapi.GraphViewer.__init__(self, title)
self._graph = graph
if handler is None:
handler = self.DEFAULT_HANDLER
# Here we make sure the handler is an instance of `BasicNodeHandler` or inherited
# types. While generally being bad Python practice, we still need it here as an
# invalid handler can cause IDA to crash.
if not isinstance(handler, BasicNodeHandler):
raise TypeError("Node handler must inherit from `BasicNodeHandler`.")
self._default_handler = handler
self._padding = padding
示例9: Show
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def Show(self):
if not idaapi.GraphViewer.Show(self):
return False
return True
示例10: Show
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def Show(self):
if not idaapi.GraphViewer.Show(self):
return False
self._register_handlers()
self.color_nodes()
return True
示例11: __init__
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def __init__(self, ircfg, title, result):
idaapi.GraphViewer.__init__(self, title)
self.ircfg = ircfg
self.result = result
self.names = {}
示例12: Show
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import GraphViewer [as 別名]
def Show(self):
if not idaapi.GraphViewer.Show(self):
return False
return True