mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 03:16:10 +00:00
Fix strings list #322
This commit is contained in:
parent
5d1bf80b5b
commit
bc8b890557
@ -1054,22 +1054,20 @@ QList<RelocDescription> CutterCore::getAllRelocs()
|
|||||||
QList<StringDescription> CutterCore::getAllStrings()
|
QList<StringDescription> CutterCore::getAllStrings()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
RListIter *it;
|
|
||||||
QList<StringDescription> ret;
|
QList<StringDescription> ret;
|
||||||
|
QJsonArray stringsArray = cmdj("izzj")["strings"].toArray();
|
||||||
|
for (QJsonValue value : stringsArray)
|
||||||
|
{
|
||||||
|
QJsonObject stringObject = value.toObject();
|
||||||
|
|
||||||
RBinString *bs;
|
StringDescription string;
|
||||||
if (core_ && core_->bin && core_->bin->cur && core_->bin->cur->o)
|
string.string = QString(QByteArray::fromBase64(stringObject["string"].toVariant().toByteArray()));
|
||||||
{
|
string.vaddr = stringObject["vaddr"].toVariant().toULongLong();
|
||||||
CutterRListForeach(core_->bin->cur->o->strings, it, RBinString, bs)
|
string.type = stringObject["type"].toString();
|
||||||
{
|
string.size = stringObject["size"].toVariant().toUInt();
|
||||||
StringDescription str;
|
string.length = stringObject["length"].toVariant().toUInt();
|
||||||
str.vaddr = bs->vaddr;
|
|
||||||
str.string = bs->string;
|
ret << string;
|
||||||
str.type = bs->type;
|
|
||||||
str.length = bs->length;
|
|
||||||
str.size = bs->size;
|
|
||||||
ret << str;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -41,12 +41,7 @@ QVariant StringsModel::data(const QModelIndex &index, int role) const
|
|||||||
case STRING:
|
case STRING:
|
||||||
return str.string;
|
return str.string;
|
||||||
case TYPE:
|
case TYPE:
|
||||||
if (str.type == "a")
|
return str.type.toUpper();
|
||||||
return "ASCII";
|
|
||||||
else if (str.type == "u")
|
|
||||||
return "UTF-8";
|
|
||||||
else
|
|
||||||
return str.type;
|
|
||||||
case LENGTH:
|
case LENGTH:
|
||||||
return str.length;
|
return str.length;
|
||||||
case SIZE:
|
case SIZE:
|
||||||
|
Loading…
Reference in New Issue
Block a user