diff --git a/angrmanagement/ui/widgets/qstring_table.py b/angrmanagement/ui/widgets/qstring_table.py index 2a254f39e..21cd72b2f 100644 --- a/angrmanagement/ui/widgets/qstring_table.py +++ b/angrmanagement/ui/widgets/qstring_table.py @@ -15,11 +15,12 @@ class QStringModel(QAbstractTableModel): - HEADER = ["Address", "Size (Bytes)", "String"] + HEADER = ["Address", "Size (Bytes)", "Length", "String"] ADDRESS_COL = 0 SIZE_COL = 1 - STRING_COL = 2 + LENGTH_COL = 2 + STRING_COL = 3 def __init__(self, cfg, func=None): super().__init__() @@ -147,6 +148,7 @@ def _get_column_data(self, v: "MemoryData", col: int) -> Any: mapping = { self.ADDRESS_COL: lambda x: x.addr, self.SIZE_COL: lambda x: x.size, + self.LENGTH_COL: lambda x: len(self._get_decoded_string_content(x)) if x.content is not None else "", self.STRING_COL: lambda x: filter_string_for_display(self._get_decoded_string_content(x)) if x.content is not None else "", @@ -182,7 +184,7 @@ def __init__(self, instance, parent, selection_callback=None): # let the last column (string) fill table width self.horizontalHeader().setSectionResizeMode(QHeaderView.Fixed) - self.horizontalHeader().setSectionResizeMode(2, QHeaderView.Stretch) + self.horizontalHeader().setSectionResizeMode(QStringModel.STRING_COL, QHeaderView.Stretch) self.doubleClicked.connect(self._on_string_selected)