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
|
|
|
|
*/
|
|
|
|
|
|
|
|
EntrypointWidget::EntrypointWidget(MainWindow *main, QWidget *parent) :
|
|
|
|
DockWidget(parent),
|
2017-10-01 18:08:12 +00:00
|
|
|
ui(new Ui::EntrypointWidget),
|
|
|
|
main(main)
|
2017-07-13 18:49:12 +00:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
// Delegate
|
|
|
|
//CMyDelegate* delegate = new CMyDelegate(ui->importsTreeWidget);
|
|
|
|
//ui->importsTreeWidget->setItemDelegate(delegate);
|
|
|
|
|
|
|
|
ui->entrypointTreeWidget->hideColumn(0);
|
|
|
|
}
|
|
|
|
|
2017-10-02 09:41:28 +00:00
|
|
|
EntrypointWidget::~EntrypointWidget() {}
|
2017-07-13 18:49:12 +00:00
|
|
|
|
|
|
|
void EntrypointWidget::setup()
|
|
|
|
{
|
|
|
|
setScrollMode();
|
|
|
|
|
|
|
|
fillEntrypoint();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EntrypointWidget::refresh()
|
|
|
|
{
|
|
|
|
setup();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EntrypointWidget::fillEntrypoint()
|
|
|
|
{
|
|
|
|
ui->entrypointTreeWidget->clear();
|
|
|
|
for (auto i : this->main->core->getAllEntrypoint())
|
|
|
|
{
|
|
|
|
QTreeWidgetItem *item = qhelpers::appendRow(ui->entrypointTreeWidget, RAddressString(i.vaddr), i.type);
|
|
|
|
item->setData(0, Qt::UserRole, QVariant::fromValue(i));
|
|
|
|
}
|
|
|
|
|
|
|
|
qhelpers::adjustColumns(ui->entrypointTreeWidget, 0, 10);
|
|
|
|
}
|
|
|
|
|
|
|
|
void EntrypointWidget::setScrollMode()
|
|
|
|
{
|
|
|
|
qhelpers::setVerticalScrollMode(ui->entrypointTreeWidget);
|
|
|
|
}
|
|
|
|
|
|
|
|
void EntrypointWidget::on_entrypointTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int /* column */)
|
|
|
|
{
|
|
|
|
EntrypointDescription ep = item->data(0, Qt::UserRole).value<EntrypointDescription>();
|
2017-10-03 18:38:34 +00:00
|
|
|
this->main->seek(ep.vaddr);
|
|
|
|
//this->main->seek(ep.vaddr, ep.type, true);
|
2017-07-13 18:49:12 +00:00
|
|
|
}
|