Better xref address descriptions

This commit is contained in:
Florian Märkl 2018-09-11 11:30:28 +02:00
parent a6a8d5a760
commit 6f85616538

View File

@ -2010,7 +2010,17 @@ QList<XrefDescription> CutterCore::getXRefs(RVA addr, bool to, bool whole_functi
continue;
xref.from = xrefObject["from"].toVariant().toULongLong();
xref.from_str = Core()->cmd("fd " + QString::number(xrefObject["from"].toInt())).trimmed();
if (!to) {
xref.from_str = RAddressString(xref.from);
} else {
QString fcn = xrefObject["fcn_name"].toString();
if (!fcn.isEmpty()) {
RVA fcnAddr = xrefObject["fcn_addr"].toVariant().toULongLong();
xref.from_str = fcn + " + 0x" + QString::number(xref.from - fcnAddr, 16);
} else {
xref.from_str = RAddressString(xref.from);
}
}
if (!whole_function && !to && xref.from != addr)
continue;
@ -2019,7 +2029,7 @@ QList<XrefDescription> CutterCore::getXRefs(RVA addr, bool to, bool whole_functi
xref.to = addr;
else
xref.to = xrefObject["to"].toVariant().toULongLong();
xref.to_str = Core()->cmd("fd " + xrefObject["to"].toString()).trimmed();
xref.to_str = Core()->cmd("fd " + QString::number(xref.to)).trimmed();
ret << xref;
}