From 6f8561653832414d9f7fb172ad3fefc38c9cd33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Tue, 11 Sep 2018 11:30:28 +0200 Subject: [PATCH] Better xref address descriptions --- src/Cutter.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Cutter.cpp b/src/Cutter.cpp index 0386b9d0..56a6947f 100644 --- a/src/Cutter.cpp +++ b/src/Cutter.cpp @@ -2010,7 +2010,17 @@ QList 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 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; }