#include "core/Function.hxx"
#include "core/BasicBlock.hxx"
#include "core/Comment.hxx"
-#include "core/events/NewFunctionEvent.hxx"
#include "core/events/ChangeCommentEvent.hxx"
#include "qt.hxx"
blocks.insert(std::make_pair(bl->getStartAddress(), bl));
}
NewFunctionEvent event(fun->getStartAddress(), fun);
- emit newFunctionEvent(&event);
+ emit newFunctionEvent(event);
}
void InformationManager::finishBasicBlock(BasicBlock*) {
#include "qt.hxx"
#include "disassembler/Disassembler.hxx"
+#include "core/events/NewFunctionEvent.hxx"
+
class Interpreter;
class Function;
public:
#endif
void renameFunctionEvent(RenameFunctionEvent* event);
- void newFunctionEvent(NewFunctionEvent* event);
+ void newFunctionEvent(NewFunctionEvent event);
void changeCommentEvent(ChangeCommentEvent* event);
void resetEvent();
public:
setWindowTitle(tr("FRIDA"));
- QTreeWidgetItem * external = new QTreeWidgetItem(listWidget, QStringList("External Functions"));
+ external = new QTreeWidgetItem(listWidget, QStringList("External Functions"));
external->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
external->setBackground(0, QBrush(QColor(0xff, 0xdd, 0xdd)));
connect(mgr, &InformationManager::resetEvent,
mgr->getDisassembler(), SLOT(disassembleFunctionAt(uint64_t)));
});
connect(mgr, &InformationManager::newFunctionEvent,
- [=] (NewFunctionEvent* event) {
- std::string name = event->function->getName();
- if (event->function->isDynamic()) {
- auto item = new QTreeWidgetItem(external, QStringList(name.c_str()));
- item->setBackground(0, QBrush(QColor(0xff, 0xdd, 0xdd)));
- } else {
- addFunction(event->function);
- }
- });
+ this, &Mainwindow::handleNewFunctionEvent);
connect(mgr, &InformationManager::renameFunctionEvent,
[&](RenameFunctionEvent* event) {
if (objects_list_by_address.find(event->address) == objects_list_by_address.end())
});
}
+void Mainwindow::handleNewFunctionEvent(NewFunctionEvent event) {
+ std::string name = event.function->getName();
+ if (event.function->isDynamic()) {
+ auto item = new QTreeWidgetItem(external, QStringList(name.c_str()));
+ item->setBackground(0, QBrush(QColor(0xff, 0xdd, 0xdd)));
+ } else {
+ addFunction(event.function);
+ }
+}
+
void Mainwindow::quit()
{
QMessageBox messageBox;
#include <log4cxx/logger.h>
+#include "core/events/NewFunctionEvent.hxx"
+
class Disassembler;
class Function;
class InformationManager;
QDockWidget * dockWidget;
FridaDock * fdock;
+ QTreeWidgetItem * external;
+
QAction *exitAction;
QAction *openAction;
QAction *loadAction;
void requestNewGroup();
void renameFunction(Function* function);
void renameGroup(QTreeWidgetItem* item);
+
+ void handleNewFunctionEvent(NewFunctionEvent event);
};
#endif /* INCLUDE__Mainwindow_hxx_ */