Python源码示例:idaapi.GraphViewer()

示例1
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
def __init__(self, flow_graph, title):
        idaapi.GraphViewer.__init__(self, title)
        self.flow_graph = flow_graph
        self.result = None
        self.names = {} 
示例3
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
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
def Show(self):
        if not idaapi.GraphViewer.Show(self):
            return False

        self.cmd_refresh = self.AddCommand("Refresh", "Ctrl+R")
        return True


# -------------------------------------------------------------------------- 
示例6
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
def Show(self):
    if not idaapi.GraphViewer.Show(self):
      return False
    return True

#------------------------------------------------------------------------------- 
示例8
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
def Show(self):
        if not idaapi.GraphViewer.Show(self):
            return False

        return True 
示例10
def Show(self):
        if not idaapi.GraphViewer.Show(self):
            return False

        self._register_handlers()
        self.color_nodes()
        return True 
示例11
def __init__(self, ircfg, title, result):
        idaapi.GraphViewer.__init__(self, title)
        self.ircfg = ircfg
        self.result = result
        self.names = {} 
示例12
def Show(self):
        if not idaapi.GraphViewer.Show(self):
            return False
        return True