From 540f68c5c73ba1e8edb69aa6b9a1b08582130013 Mon Sep 17 00:00:00 2001 From: Michael Hunhoff Date: Fri, 26 Jun 2020 11:28:11 -0600 Subject: [PATCH] tree view default to sorted asc, trim regex matches --- capa/ida/explorer/model.py | 2 ++ capa/ida/ida_capa_explorer.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/capa/ida/explorer/model.py b/capa/ida/explorer/model.py index ba472644..69e91272 100644 --- a/capa/ida/explorer/model.py +++ b/capa/ida/explorer/model.py @@ -383,6 +383,8 @@ class CapaExplorerDataModel(QtCore.QAbstractItemModel): if isinstance(feature, string_view): # TODO: move string collection to item constructor if isinstance(feature, capa.engine.Regex): + # rstrip "matched="")" because data already displayed in interface + name = name.split(',')[0] + ')' return CapaExplorerStringViewItem(parent, name, ea, feature.match) if isinstance(feature, capa.features.Characteristic): diff --git a/capa/ida/ida_capa_explorer.py b/capa/ida/ida_capa_explorer.py index c322a274..fb2759ec 100644 --- a/capa/ida/ida_capa_explorer.py +++ b/capa/ida/ida_capa_explorer.py @@ -351,6 +351,8 @@ class CapaExplorerForm(idaapi.PluginForm): self._model_data.render_capa_results(rules, capabilities) self._render_capa_summary(rules, capabilities) + self._view_tree.sortByColumn(CapaExplorerDataModel.COLUMN_INDEX_RULE_INFORMATION, Qt.AscendingOrder) + logger.info('render views completed.') def _render_capa_summary(self, ruleset, results):