mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 19:36:11 +00:00
Fix #69 (xref name resolving)
This commit is contained in:
parent
e5859a8422
commit
d8d4de9625
@ -1219,6 +1219,7 @@ QList<XrefDescription> CutterCore::getXRefs(RVA addr, bool to, bool whole_functi
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
xref.from = xrefObject["from"].toVariant().toULongLong();
|
xref.from = xrefObject["from"].toVariant().toULongLong();
|
||||||
|
xref.from_str = Core()->cmd("fd " + xrefObject["from"].toString()).trimmed();
|
||||||
|
|
||||||
if (!whole_function && !to && xref.from != addr)
|
if (!whole_function && !to && xref.from != addr)
|
||||||
continue;
|
continue;
|
||||||
@ -1227,6 +1228,7 @@ QList<XrefDescription> CutterCore::getXRefs(RVA addr, bool to, bool whole_functi
|
|||||||
xref.to = addr;
|
xref.to = addr;
|
||||||
else
|
else
|
||||||
xref.to = xrefObject["to"].toVariant().toULongLong();
|
xref.to = xrefObject["to"].toVariant().toULongLong();
|
||||||
|
xref.to_str = Core()->cmd("fd " + xrefObject["to"].toString()).trimmed();
|
||||||
|
|
||||||
ret << xref;
|
ret << xref;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,9 @@ struct EntrypointDescription
|
|||||||
struct XrefDescription
|
struct XrefDescription
|
||||||
{
|
{
|
||||||
RVA from;
|
RVA from;
|
||||||
|
QString from_str;
|
||||||
RVA to;
|
RVA to;
|
||||||
|
QString to_str;
|
||||||
QString type;
|
QString type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -42,12 +42,9 @@ void XrefsDialog::fillRefs(QList<XrefDescription> refs, QList<XrefDescription> x
|
|||||||
XrefDescription xref = refs[i];
|
XrefDescription xref = refs[i];
|
||||||
|
|
||||||
QTreeWidgetItem *tempItem = new QTreeWidgetItem();
|
QTreeWidgetItem *tempItem = new QTreeWidgetItem();
|
||||||
tempItem->setText(0, RAddressString(xref.to));
|
tempItem->setText(0, xref.to_str);
|
||||||
tempItem->setText(1, core->disassembleSingleInstruction(xref.from));
|
tempItem->setText(1, core->disassembleSingleInstruction(xref.from));
|
||||||
tempItem->setText(2, xrefTypeString(xref.type));
|
tempItem->setText(2, xrefTypeString(xref.type));
|
||||||
tempItem->setData(0, Qt::UserRole, QVariant::fromValue(xref));
|
|
||||||
//tempItem->setToolTip( 0, this->core->cmd("pdi 10 @ " + refs.at(i).at(0)) );
|
|
||||||
//tempItem->setToolTip( 1, this->core->cmd("pdi 10 @ " + refs.at(i).at(0)) );
|
|
||||||
ui->fromTreeWidget->insertTopLevelItem(0, tempItem);
|
ui->fromTreeWidget->insertTopLevelItem(0, tempItem);
|
||||||
}
|
}
|
||||||
// Adjust columns to content
|
// Adjust columns to content
|
||||||
@ -64,12 +61,9 @@ void XrefsDialog::fillRefs(QList<XrefDescription> refs, QList<XrefDescription> x
|
|||||||
XrefDescription xref = xrefs[i];
|
XrefDescription xref = xrefs[i];
|
||||||
|
|
||||||
QTreeWidgetItem *tempItem = new QTreeWidgetItem();
|
QTreeWidgetItem *tempItem = new QTreeWidgetItem();
|
||||||
tempItem->setText(0, RAddressString(xref.from));
|
tempItem->setText(0, xref.from_str);
|
||||||
tempItem->setText(1, core->disassembleSingleInstruction(xref.from));
|
tempItem->setText(1, core->disassembleSingleInstruction(xref.from));
|
||||||
tempItem->setText(2, xrefTypeString(xref.type));
|
tempItem->setText(2, xrefTypeString(xref.type));
|
||||||
tempItem->setData(0, Qt::UserRole, QVariant::fromValue(xref));
|
|
||||||
//tempItem->setToolTip( 0, this->core->cmd("pdi 10 @ " + xrefs.at(i).at(0)) );
|
|
||||||
//tempItem->setToolTip( 1, this->core->cmd("pdi 10 @ " + xrefs.at(i).at(0)) );
|
|
||||||
ui->toTreeWidget->insertTopLevelItem(0, tempItem);
|
ui->toTreeWidget->insertTopLevelItem(0, tempItem);
|
||||||
}
|
}
|
||||||
// Adjust columns to content
|
// Adjust columns to content
|
||||||
@ -78,7 +72,6 @@ void XrefsDialog::fillRefs(QList<XrefDescription> refs, QList<XrefDescription> x
|
|||||||
{
|
{
|
||||||
ui->toTreeWidget->resizeColumnToContents(i);
|
ui->toTreeWidget->resizeColumnToContents(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
@ -193,8 +186,8 @@ void XrefsDialog::updatePreview(RVA addr)
|
|||||||
|
|
||||||
void XrefsDialog::updateLabels(QString name)
|
void XrefsDialog::updateLabels(QString name)
|
||||||
{
|
{
|
||||||
ui->label_2->setText(tr("X-Refs to %1:").arg(name));
|
ui->label_xTo->setText(tr("X-Refs to %1:").arg(name));
|
||||||
ui->label_3->setText(tr("X-Refs from %1:").arg(name));
|
ui->label_xFrom->setText(tr("X-Refs from %1:").arg(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
void XrefsDialog::fillRefsForAddress(RVA addr, QString name, bool whole_function)
|
void XrefsDialog::fillRefsForAddress(RVA addr, QString name, bool whole_function)
|
||||||
|
@ -38,12 +38,12 @@
|
|||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="verticalLayoutWidget">
|
<widget class="QWidget" name="verticalLayoutWidget">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="xrefLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_xTo">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">X-Refs to: </string>
|
<string notr="true">X-Refs to: </string>
|
||||||
</property>
|
</property>
|
||||||
@ -81,7 +81,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_xFrom">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">X-Refs from: </string>
|
<string notr="true">X-Refs from: </string>
|
||||||
</property>
|
</property>
|
||||||
@ -121,7 +121,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="verticalLayoutWidget_2">
|
<widget class="QWidget" name="verticalLayoutWidget_2">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="previewLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
Loading…
Reference in New Issue
Block a user