예제 #1
0
파일: ida_api.py 프로젝트: wangjenmin/tenet
    def show(self):
        dock_position = self._dock_position

        if ida_pro.IDA_SDK_VERSION < 760:
            WOPN_SZHINT = 0x200

            # create the dockable widget, without actually showing it
            self.Show(self.title,
                      options=ida_kernwin.PluginForm.WOPN_CREATE_ONLY)

            # use some kludge to display our widget, and enforce the use of its sizehint
            ida_widget = self.GetWidget()
            ida_kernwin.display_widget(ida_widget, WOPN_SZHINT)
            self.visible = True

        # no hax required for IDA 7.6 and newer
        else:
            self.Show(self.title)
            self.visible = True
            dock_position |= ida_kernwin.DP_SZHINT

        # move the window to a given location if specified
        if dock_position is not None:
            ida_kernwin.set_dock_pos(self.title, self._dock_target,
                                     dock_position)
예제 #2
0
파일: ida_api.py 프로젝트: wangjenmin/tenet
    def set_dock_position(self, dest_ctrl=None, position=0):
        self._dock_target = dest_ctrl
        self._dock_position = position

        if not self.visible:
            return

        ida_kernwin.set_dock_pos(self.title, dest_ctrl, position)
예제 #3
0
 def zoom_and_dock(self, vu_title, zoom, dock_position=None):
     widget = ida_kernwin.find_widget(self.title)
     if widget and dock_position:
         gli = ida_moves.graph_location_info_t()
         if ida_graph.viewer_get_gli(gli, widget):
             gli.zoom = zoom
             ida_graph.viewer_set_gli(widget, gli)
         ida_kernwin.set_dock_pos(self.title, vu_title, dock_position)
         self.Refresh()
예제 #4
0
def cg_zoom_and_dock(title, vu_title, dock_position=None):
    widget = ida_kernwin.find_widget(title)
    if widget:
        if dock_position is not None:
            gli = ida_moves.graph_location_info_t()
            if ida_graph.viewer_get_gli(gli, widget):
                gli.zoom = 1.0
                ida_graph.viewer_set_gli(widget, gli)
        ida_kernwin.set_dock_pos(title, vu_title, dock_position)
예제 #5
0
파일: explorer.py 프로젝트: mewbak/lucid
    def show(self):
        self.refresh()

        # show the dockable widget
        flags = ida_kernwin.PluginForm.WOPN_DP_RIGHT | 0x200  # WOPN_SZHINT
        ida_kernwin.display_widget(self._twidget, flags)
        ida_kernwin.set_dock_pos(self.WINDOW_TITLE, "IDATopLevelDockArea",
                                 ida_kernwin.DP_RIGHT)

        self._code_sync.hook()
예제 #6
0
 def zoom_and_dock(self, target):
     widget = ida_kernwin.get_current_widget()
     if widget and self.dock_position:
         gli = ida_moves.graph_location_info_t()
         if ida_graph.viewer_get_gli(gli, widget):
             gli.zoom = self.zoom
             ida_graph.viewer_set_gli(widget, gli)
         ida_kernwin.set_dock_pos(ida_kernwin.get_widget_title(widget),
                                  ida_kernwin.get_widget_title(target),
                                  self.dock_position)
         self.Refresh()
예제 #7
0
    def run(self, arg):
        plg = HyaraWidget()
        plg.Show("Hyara")

        try:
            widget_a = ida_kernwin.find_widget("IDA View-A")
            widget_Hyara = ida_kernwin.find_widget("Hyara")
            if widget_Hyara and widget_a:
                ida_kernwin.set_dock_pos("Hyara", "IDA View-A", ida_kernwin.DP_RIGHT)
        except:
            print("find_widget option is available version 7.0 or later")
예제 #8
0
파일: genmc.py 프로젝트: wondayer/genmc
    def _dock_widgets(self, graph, dockpos=kw.DP_RIGHT):
        if graph:
            gv = graph.GetWidget()
            kw.set_dock_pos(kw.get_widget_title(gv), self.title, dockpos)

            gli = ida_moves.graph_location_info_t()
            if ida_graph.viewer_get_gli(gli, gv):
                gli.zoom = 0  # auto-position
                ida_graph.viewer_set_gli(gv, gli, ida_graph.GLICTL_CENTER)
                ida_graph.refresh_viewer(gv)
            return True
        return False
예제 #9
0
        print("View %s not available. Opening." % title)
        ida_kernwin.open_disasm_window(label)

#
# ...and that they are both in graph mode
#
widget_a = ida_kernwin.find_widget("IDA View-A")
ida_kernwin.set_view_renderer_type(widget_a, ida_kernwin.TCCRT_GRAPH)

widget_b = ida_kernwin.find_widget("IDA View-B")
ida_kernwin.set_view_renderer_type(widget_b, ida_kernwin.TCCRT_GRAPH)

#
# Put view B to the right of view A
#
ida_kernwin.set_dock_pos("IDA View-B", "IDA View-A", ida_kernwin.DP_RIGHT)

#
# Start monitoring IDA View-A
#
wrap_a = IDAViewA_monitor_t()
wrap_a.Bind()


#
# This is to get a properly initialized set of views to begin with.
# At this point, all UI resize/move events resulting of 'set_dock_pos()'
# haven't yet been processed, and thus the views don't know their final
# geometries. We'll give them a bit of time to process those events, and
# then we'll request that "IDA View-A" shows the whole graph (and
# "IDA View-B" will obviously follow.)
예제 #10
0
파일: subtree.py 프로젝트: mfkiwl/lucid
    def show(self):
        self.Show()
        ida_kernwin.set_dock_pos(self.WINDOW_TITLE, "Microcode Explorer", ida_kernwin.DP_INSIDE)

        # XXX: bit of a hack for now... lool
        QtCore.QTimer.singleShot(50, self._center_graph)