diff --git a/first_plugin_ida/first.py b/first_plugin_ida/first.py index 169a0dd..877ba9b 100644 --- a/first_plugin_ida/first.py +++ b/first_plugin_ida/first.py @@ -67,6 +67,9 @@ from hashlib import sha256, md5, sha1 from base64 import b64encode, b64decode +from requests.packages.urllib3.exceptions import InsecureRequestWarning +requests.packages.urllib3.disable_warnings(InsecureRequestWarning) + # Constants #------------------------------------------------------------------------------- FIRST_INDEX = { @@ -2703,6 +2706,7 @@ def __init__(self, header, data, parent=None): self.select_all_flag = False self.rows_selected = set() + self.last_selected_row = None def set_row_selected(self, row): '''Causes a row to be selected or deselected. @@ -3147,10 +3151,7 @@ def __init__(self, dialog): def __data(self, thread, data): if ('failed' in data) and data['failed']: - if 'msg' not in data: - return - - msg = '[1st] Error: {}'.format(data['msg']) + msg = '[1st] Error: {}'.format(result['msg']) idaapi.execute_ui_requests((FIRSTUI.Requests.Print(msg),)) return @@ -4144,7 +4145,18 @@ def table_clicked(self, index, table_view, data_model): self.select_all.setChecked(False) self.select_all.stateChanged.connect(self.select_all_callback) - data_model.set_row_selected(index.row()) + modifiers = QtGui.QGuiApplication.keyboardModifiers() + row_nr = index.row() + if modifiers == Qt.ShiftModifier and data_model.last_selected_row is not None: + if row_nr >= data_model.last_selected_row: + for x in xrange(data_model.last_selected_row + 1, row_nr + 1): + data_model.set_row_selected(x) + else: + for x in xrange(row_nr, data_model.last_selected_row): + data_model.set_row_selected(x) + else: + data_model.set_row_selected(row_nr) + data_model.last_selected_row = row_nr table_view.reset() def get_selected_data(self):