(self, pos)
Modules ContextMenu
Modules ContextMenu
Modules ContextMenu
def _on_modules_contextmenu(self, pos):
        """ Modules ContextMenu
        """
        index = self.modules_list.indexAt(pos).row()
        glbl_pt = self.modules_list.mapToGlobal(pos)
        context_menu = QMenu(self)
        if index != -1:
            context_menu.addAction(
                'Dump Binary', lambda: self._on_dumpmodule(
                    self.modules_model.item(index, 1).text(),
                    self.modules_model.item(index, 2).text()))
            context_menu.addSeparator()
            context_menu.addAction(
                'Copy address', lambda: utils.copy_hex_to_clipboard(
                    self.modules_model.item(index, 1).text()))
            context_menu.addAction(
                'Copy Name', lambda: utils.copy_str_to_clipboard(
                    self.modules_model.item(index, 0).text()))
            context_menu.addAction(
                'Copy Path', lambda: utils.copy_str_to_clipboard(
                    self.modules_model.item(index, 3).text()))
            context_menu.addSeparator()
            file_path = self.modules_model.item(index, 3).text()
            if self._app_window.dwarf._platform == 'linux':
                context_menu.addAction(
                    'Show ELF Info', lambda: self._on_parse_elf(file_path))
                context_menu.addSeparator()
            # elif file_path and (file_path.endswith('.dll') or file_path.endswith('.exe')):
            #   context_menu.addAction('Show PE Info', lambda: self._on_parse_pe(file_path))
            #   context_menu.addSeparator()

            if self.modules_list.search_enabled:
                context_menu.addSeparator()
                context_menu.addAction(
                    'Search', self.modules_list._on_cm_search)
                context_menu.addSeparator()

        context_menu.addAction('Refresh', self.update_modules)
        context_menu.exec_(glbl_pt)
def _on_modules_contextmenu ( self , pos ) : index = self . modules_list . indexAt ( pos ) . row ( ) glbl_pt = self . modules_list . mapToGlobal ( pos ) context_menu = QMenu ( self ) if index != - 1 : context_menu . addAction ( 'Dump Binary' , lambda : self . _on_dumpmodule ( self . modules_model . item ( index , 1 ) . text ( ) , self . modules_model . item ( index , 2 ) . text ( ) ) ) context_menu . addSeparator ( ) context_menu . addAction ( 'Copy address' , lambda : utils . copy_hex_to_clipboard ( self . modules_model . item ( index , 1 ) . text ( ) ) ) context_menu . addAction ( 'Copy Name' , lambda : utils . copy_str_to_clipboard ( self . modules_model . item ( index , 0 ) . text ( ) ) ) context_menu . addAction ( 'Copy Path' , lambda : utils . copy_str_to_clipboard ( self . modules_model . item ( index , 3 ) . text ( ) ) ) context_menu . addSeparator ( ) file_path = self . modules_model . item ( index , 3 ) . text ( ) if self . _app_window . dwarf . _platform == 'linux' : context_menu . addAction ( 'Show ELF Info' , lambda : self . _on_parse_elf ( file_path ) ) context_menu . addSeparator ( ) # elif file_path and (file_path.endswith('.dll') or file_path.endswith('.exe')): #   context_menu.addAction('Show PE Info', lambda: self._on_parse_pe(file_path)) #   context_menu.addSeparator() if self . modules_list . search_enabled : context_menu . addSeparator ( ) context_menu . addAction ( 'Search' , self . modules_list . _on_cm_search ) context_menu . addSeparator ( ) context_menu . addAction ( 'Refresh' , self . update_modules ) context_menu . exec_ ( glbl_pt )