Added strings info Fix #240

This commit is contained in:
xarkes 2018-02-09 15:22:45 +01:00
parent dd6b591d9d
commit b15900be54
4 changed files with 24 additions and 1 deletions

View File

@ -1065,6 +1065,9 @@ QList<StringDescription> CutterCore::getAllStrings()
StringDescription str;
str.vaddr = bs->vaddr;
str.string = bs->string;
str.type = bs->type;
str.length = bs->length;
str.size = bs->size;
ret << str;
}
}

View File

@ -117,6 +117,9 @@ struct StringDescription
{
RVA vaddr;
QString string;
char type;
ut32 length;
ut32 size;
};
struct FlagspaceDescription

View File

@ -40,6 +40,12 @@ QVariant StringsModel::data(const QModelIndex &index, int role) const
return RAddressString(str.vaddr);
case STRING:
return str.string;
case TYPE:
return str.type;
case LENGTH:
return str.length;
case SIZE:
return str.size;
default:
return QVariant();
}
@ -61,6 +67,12 @@ QVariant StringsModel::headerData(int section, Qt::Orientation, int role) const
return tr("Address");
case STRING:
return tr("String");
case TYPE:
return tr("Type");
case LENGTH:
return tr("Length");
case SIZE:
return tr("Size");
default:
return QVariant();
}
@ -161,4 +173,9 @@ void StringsWidget::refreshStrings()
ui->stringsTreeView->resizeColumnToContents(0);
ui->stringsTreeView->resizeColumnToContents(1);
if (ui->stringsTreeView->columnWidth(1) > 300)
ui->stringsTreeView->setColumnWidth(1, 300);
ui->stringsTreeView->resizeColumnToContents(2);
ui->stringsTreeView->resizeColumnToContents(3);
ui->stringsTreeView->resizeColumnToContents(4);
}

View File

@ -25,7 +25,7 @@ private:
QList<StringDescription> *strings;
public:
enum Columns { OFFSET = 0, STRING, COUNT };
enum Columns { OFFSET = 0, STRING, TYPE, LENGTH, SIZE, COUNT };
static const int StringDescriptionRole = Qt::UserRole;
StringsModel(QList<StringDescription> *strings, QObject *parent = 0);