2017-10-02 16:18:40 +00:00
|
|
|
#include "EntrypointWidget.h"
|
|
|
|
#include "ui_EntrypointWidget.h"
|
2017-07-13 18:49:12 +00:00
|
|
|
|
2017-10-01 19:09:42 +00:00
|
|
|
#include "MainWindow.h"
|
|
|
|
#include "utils/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-03-21 20:32:32 +00:00
|
|
|
for (auto i : CutterCore::getInstance()->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,
|
|
|
|
int /* column */)
|
2017-07-13 18:49:12 +00:00
|
|
|
{
|
|
|
|
EntrypointDescription ep = item->data(0, Qt::UserRole).value<EntrypointDescription>();
|
2017-10-09 18:08:35 +00:00
|
|
|
CutterCore::getInstance()->seek(ep.vaddr);
|
2017-07-13 18:49:12 +00:00
|
|
|
}
|