2017-10-02 16:18:40 +00:00
|
|
|
#include "EntrypointWidget.h"
|
|
|
|
#include "ui_EntrypointWidget.h"
|
2017-07-13 18:49:12 +00:00
|
|
|
|
2019-02-22 16:50:45 +00:00
|
|
|
#include "core/MainWindow.h"
|
2018-10-17 07:55:53 +00:00
|
|
|
#include "common/Helpers.h"
|
2017-07-13 18:49:12 +00:00
|
|
|
|
|
|
|
#include <QTreeWidget>
|
|
|
|
#include <QPen>
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Entrypoint Widget
|
|
|
|
*/
|
|
|
|
|
2018-03-16 21:46:57 +00:00
|
|
|
EntrypointWidget::EntrypointWidget(MainWindow *main, QAction *action) :
|
|
|
|
CutterDockWidget(main, action),
|
|
|
|
ui(new Ui::EntrypointWidget)
|
2017-07-13 18:49:12 +00:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
setScrollMode();
|
|
|
|
|
2017-11-19 12:56:10 +00:00
|
|
|
connect(Core(), SIGNAL(refreshAll()), this, SLOT(fillEntrypoint()));
|
2017-07-13 18:49:12 +00:00
|
|
|
}
|
|
|
|
|
2017-11-19 12:56:10 +00:00
|
|
|
EntrypointWidget::~EntrypointWidget() {}
|
2017-07-13 18:49:12 +00:00
|
|
|
|
|
|
|
void EntrypointWidget::fillEntrypoint()
|
|
|
|
{
|
|
|
|
ui->entrypointTreeWidget->clear();
|
2018-11-26 22:34:34 +00:00
|
|
|
for (const EntrypointDescription &i : Core()->getAllEntrypoint()) {
|
2017-12-02 19:15:12 +00:00
|
|
|
QTreeWidgetItem *item = new QTreeWidgetItem();
|
|
|
|
item->setText(0, RAddressString(i.vaddr));
|
|
|
|
item->setText(1, i.type);
|
2017-07-13 18:49:12 +00:00
|
|
|
item->setData(0, Qt::UserRole, QVariant::fromValue(i));
|
2017-12-02 19:15:12 +00:00
|
|
|
ui->entrypointTreeWidget->addTopLevelItem(item);
|
2017-07-13 18:49:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
qhelpers::adjustColumns(ui->entrypointTreeWidget, 0, 10);
|
|
|
|
}
|
|
|
|
|
|
|
|
void EntrypointWidget::setScrollMode()
|
|
|
|
{
|
|
|
|
qhelpers::setVerticalScrollMode(ui->entrypointTreeWidget);
|
|
|
|
}
|
|
|
|
|
2018-03-21 20:32:32 +00:00
|
|
|
void EntrypointWidget::on_entrypointTreeWidget_itemDoubleClicked(QTreeWidgetItem *item,
|
2018-04-23 07:54:06 +00:00
|
|
|
int column)
|
2017-07-13 18:49:12 +00:00
|
|
|
{
|
2018-04-23 07:54:06 +00:00
|
|
|
if (column < 0)
|
|
|
|
return;
|
|
|
|
|
2017-07-13 18:49:12 +00:00
|
|
|
EntrypointDescription ep = item->data(0, Qt::UserRole).value<EntrypointDescription>();
|
2018-04-12 06:33:30 +00:00
|
|
|
Core()->seek(ep.vaddr);
|
2017-07-13 18:49:12 +00:00
|
|
|
}
|