From 771eccc125210d7d224e8a88023ac2aeced66230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanz=C5=8D=20Hattori?= Date: Sun, 2 Jul 2017 13:11:02 +0200 Subject: [PATCH] Renaming QRCore and QRDisasm to IaitoRCore and IaitoRDisasm (#187) * Renaming QRCore and QRDisasm to IaitoRCore and IaitoRDisasm * Included AStyle formatting changes --- src/analthread.cpp | 4 +- src/analthread.h | 6 +- src/dialogs/xrefsdialog.cpp | 4 +- src/dialogs/xrefsdialog.h | 2 +- src/iaito.pro | 6 +- src/{qrcore.h => iaitorcore.h} | 16 ++-- src/{qrdisasm.h => iaitordisasm.h} | 26 ++--- src/mainwindow.cpp | 2 +- src/mainwindow.h | 6 +- src/newfiledialog.cpp | 2 +- src/optionsdialog.h | 2 +- src/qrcore.cpp | 148 ++++++++++++++--------------- src/qrdisasm.cpp | 12 +-- src/radarewebserver.cpp | 4 +- src/radarewebserver.h | 6 +- src/widgets/codegraphic.cpp | 4 +- src/widgets/commentswidget.cpp | 2 +- src/widgets/consolewidget.cpp | 4 +- src/widgets/consolewidget.h | 6 +- src/widgets/dashboard.cpp | 5 +- src/widgets/exportswidget.h | 2 +- src/widgets/flagswidget.cpp | 2 +- src/widgets/flagswidget.h | 2 +- src/widgets/functionswidget.h | 2 +- src/widgets/memorywidget.h | 2 +- src/widgets/notepad.cpp | 4 +- src/widgets/pieview.cpp | 4 +- src/widgets/relocswidget.cpp | 2 +- src/widgets/sectionswidget.cpp | 2 +- src/widgets/stringswidget.cpp | 2 +- src/widgets/symbolswidget.cpp | 2 +- 31 files changed, 147 insertions(+), 146 deletions(-) rename src/{qrcore.h => iaitorcore.h} (95%) rename src/{qrdisasm.h => iaitordisasm.h} (70%) diff --git a/src/analthread.cpp b/src/analthread.cpp index 517e9020..5c008f74 100644 --- a/src/analthread.cpp +++ b/src/analthread.cpp @@ -1,5 +1,5 @@ #include "analthread.h" -#include "qrcore.h" +#include "iaitorcore.h" #include AnalThread::AnalThread(QWidget *parent) : @@ -18,7 +18,7 @@ AnalThread::~AnalThread() } } -void AnalThread::start(QRCore *core, int level) +void AnalThread::start(IaitoRCore *core, int level) { this->core = core; this->level = level; diff --git a/src/analthread.h b/src/analthread.h index 3b5f5e41..e2283f5b 100644 --- a/src/analthread.h +++ b/src/analthread.h @@ -3,7 +3,7 @@ #include -class QRCore; +class IaitoRCore; class AnalThread : public QThread { @@ -12,7 +12,7 @@ public: explicit AnalThread(QWidget *parent = 0); ~AnalThread(); - void start(QRCore *core, int level); + void start(IaitoRCore *core, int level); protected: void run(); @@ -20,7 +20,7 @@ protected: using QThread::start; private: - QRCore *core; + IaitoRCore *core; int level; }; diff --git a/src/dialogs/xrefsdialog.cpp b/src/dialogs/xrefsdialog.cpp index 3d68aa83..11f2c3ec 100644 --- a/src/dialogs/xrefsdialog.cpp +++ b/src/dialogs/xrefsdialog.cpp @@ -80,7 +80,7 @@ void XrefsDialog::fillRefs(QList refs, QList x void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) { - QNOTUSED(column); + IAITONOTUSED(column); XrefDescription xref = item->data(0, Qt::UserRole).value(); RAnalFunction *fcn = this->main->core->functionAt(xref.to); @@ -91,7 +91,7 @@ void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int void XrefsDialog::on_toTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) { - QNOTUSED(column); + IAITONOTUSED(column); XrefDescription xref = item->data(0, Qt::UserRole).value(); RAnalFunction *fcn = this->main->core->functionAt(xref.from); diff --git a/src/dialogs/xrefsdialog.h b/src/dialogs/xrefsdialog.h index cb6b907a..3859d703 100644 --- a/src/dialogs/xrefsdialog.h +++ b/src/dialogs/xrefsdialog.h @@ -2,7 +2,7 @@ #define XREFSDIALOG_H #include "highlighter.h" -#include "qrcore.h" +#include "iaitorcore.h" #include #include diff --git a/src/iaito.pro b/src/iaito.pro index 62646cf1..bf16a0e1 100644 --- a/src/iaito.pro +++ b/src/iaito.pro @@ -73,7 +73,6 @@ HEADERS += \ newfiledialog.h \ optionsdialog.h \ highlighter.h \ - qrcore.h \ createnewdialog.h \ hexascii_highlighter.h \ widgets/pieview.h \ @@ -92,7 +91,6 @@ HEADERS += \ widgets/flagswidget.h \ widgets/memorywidget.h \ widgets/exportswidget.h \ - qrdisasm.h \ widgets/sdbdock.h \ analthread.h \ dialogs/commentsdialog.h \ @@ -106,7 +104,9 @@ HEADERS += \ widgets/dockwidget.h \ widgets/consolewidget.h \ radarewebserver.h \ - settings.h + settings.h \ + iaitorcore.h \ + iaitordisasm.h FORMS += \ mainwindow.ui \ diff --git a/src/qrcore.h b/src/iaitorcore.h similarity index 95% rename from src/qrcore.h rename to src/iaitorcore.h index 93c2e7ef..5eb27fb4 100644 --- a/src/qrcore.h +++ b/src/iaitorcore.h @@ -1,5 +1,5 @@ -#ifndef QRCORE_H -#define QRCORE_H +#ifndef IAITORCORE_H +#define IAITORCORE_H #include #include @@ -22,7 +22,7 @@ #define HAVE_LATEST_LIBR2 false -#define QRListForeach(list, it, type, x) \ +#define IaitoRListForeach(list, it, type, x) \ if (list) for (it = list->head; it && ((x=(type*)it->data)); it = it->n) #define __alert(x) QMessageBox::question (this, "Alert", QString(x), QMessageBox::Ok) @@ -42,7 +42,7 @@ public: RCore *operator->() const; }; -#define QNOTUSED(x) do { (void)(x); } while ( 0 ); +#define IAITONOTUSED(x) do { (void)(x); } while ( 0 ); typedef ut64 RVA; @@ -152,15 +152,15 @@ Q_DECLARE_METATYPE(FlagspaceDescription) Q_DECLARE_METATYPE(FlagDescription) Q_DECLARE_METATYPE(XrefDescription) -class QRCore : public QObject +class IaitoRCore : public QObject { Q_OBJECT public: QString projectPath; - explicit QRCore(QObject *parent = 0); - ~QRCore(); + explicit IaitoRCore(QObject *parent = 0); + ~IaitoRCore(); RVA getOffset() const { return core_->offset; } int getCycloComplex(ut64 addr); @@ -255,4 +255,4 @@ private: RCore *core_; }; -#endif // QRCORE_H +#endif // IAITORCORE_H diff --git a/src/qrdisasm.h b/src/iaitordisasm.h similarity index 70% rename from src/qrdisasm.h rename to src/iaitordisasm.h index 9143e773..5b5bdde8 100644 --- a/src/qrdisasm.h +++ b/src/iaitordisasm.h @@ -1,9 +1,9 @@ -#ifndef QRDISASM_H -#define QRDISASM_H +#ifndef IAITORDISASM_H +#define IAITORDISASM_H -#include +#include -enum QRDisasmDataType +enum IaitoRDisasmDataType { STRING = 'z', STRUCT = 's', @@ -11,7 +11,7 @@ enum QRDisasmDataType }; -enum QRDisasmOption +enum IaitoRDisasmOption { DWARF = 1 << 1, REFS = 1 << 2, @@ -20,10 +20,10 @@ enum QRDisasmOption COMMENT = 1 << 5, }; -class QRDisasmRow +class IaitoRDisasmRow { private: - QRCore *core; + IaitoRCore *core; public: ut64 vaddr; ut64 paddr; @@ -46,7 +46,7 @@ public: QString esil; // if data - QRDisasmDataType datatype; + IaitoRDisasmDataType datatype; QString dataopt; // struct name, aliased name, string, etc // data type // string/struct/hex/word @@ -60,17 +60,17 @@ public: }; -class QRDisasm +class IaitoRDisasm { - QRCore *core; + IaitoRCore *core; Sdb *db; public: - explicit QRDisasm(QRCore *core); - bool disassembleAt(ut64 addr, QRDisasmOption opt, QRDisasmRow &dr); + explicit IaitoRDisasm(IaitoRCore *core); + bool disassembleAt(ut64 addr, IaitoRDisasmOption opt, IaitoRDisasmRow &dr); // high level api for the disasm thing to manage comments, xrefs, etc //next(); //prev(); }; -#endif // QRDISASM_H +#endif // IAITORDISASM_H diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index dee68261..e52b7b4c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -82,7 +82,7 @@ static void registerCustomFonts() MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), - core(new QRCore()), + core(new IaitoRCore()), memoryDock(nullptr), notepadDock(nullptr), asmDock(nullptr), diff --git a/src/mainwindow.h b/src/mainwindow.h index f010759f..1d621857 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -2,12 +2,12 @@ #define MAINWINDOW_H #include "radarewebserver.h" -#include "qrcore.h" // only needed for ut64 +#include "iaitorcore.h" // only needed for ut64 #include #include -class QRCore; +class IaitoRCore; class DockWidget; class Omnibar; class MemoryWidget; @@ -44,7 +44,7 @@ class MainWindow : public QMainWindow Q_OBJECT public: - QRCore *core; + IaitoRCore *core; MemoryWidget *memoryDock; Notepad *notepadDock; diff --git a/src/newfiledialog.cpp b/src/newfiledialog.cpp index fb9757fd..e999399d 100644 --- a/src/newfiledialog.cpp +++ b/src/newfiledialog.cpp @@ -12,7 +12,7 @@ const int NewFileDialog::MaxRecentFiles; static QColor getColorFor(QString str, int pos) { - QNOTUSED(str); + IAITONOTUSED(str); QList Colors; Colors << QColor(29, 188, 156); // Turquoise diff --git a/src/optionsdialog.h b/src/optionsdialog.h index 2371e1ba..0acc2a7a 100644 --- a/src/optionsdialog.h +++ b/src/optionsdialog.h @@ -4,7 +4,7 @@ #include #include -#include "qrcore.h" +#include "iaitorcore.h" #include "analthread.h" class MainWindow; diff --git a/src/qrcore.cpp b/src/qrcore.cpp index 7ed2d7a7..304d2196 100644 --- a/src/qrcore.cpp +++ b/src/qrcore.cpp @@ -1,4 +1,4 @@ -#include "qrcore.h" +#include "iaitorcore.h" #include "sdb.h" #include @@ -33,14 +33,14 @@ RCore *RCoreLocked::operator->() const return core; } -RCoreLocked QRCore::core() const +RCoreLocked IaitoRCore::core() const { return RCoreLocked(this->core_); } #define CORE_LOCK() RCoreLocked core_lock__(this->core_) -QRCore::QRCore(QObject *parent) : +IaitoRCore::IaitoRCore(QObject *parent) : QObject(parent) { r_cons_new(); // initialize console @@ -67,7 +67,7 @@ QRCore::QRCore(QObject *parent) : } -int QRCore::getCycloComplex(ut64 addr) +int IaitoRCore::getCycloComplex(ut64 addr) { CORE_LOCK(); QString ret = ""; @@ -84,7 +84,7 @@ int QRCore::getCycloComplex(ut64 addr) } } -int QRCore::getFcnSize(ut64 addr) +int IaitoRCore::getFcnSize(ut64 addr) { CORE_LOCK(); QString ret = ""; @@ -103,7 +103,7 @@ int QRCore::getFcnSize(ut64 addr) } } -QList QRCore::sdbList(QString path) +QList IaitoRCore::sdbList(QString path) { CORE_LOCK(); QList list = QList(); @@ -121,7 +121,7 @@ QList QRCore::sdbList(QString path) return list; } -QList QRCore::sdbListKeys(QString path) +QList IaitoRCore::sdbListKeys(QString path) { CORE_LOCK(); QList list = QList(); @@ -140,7 +140,7 @@ QList QRCore::sdbListKeys(QString path) return list; } -QString QRCore::sdbGet(QString path, QString key) +QString IaitoRCore::sdbGet(QString path, QString key) { CORE_LOCK(); Sdb *db = sdb_ns_path(core_->sdb, path.toUtf8().constData(), 0); @@ -153,7 +153,7 @@ QString QRCore::sdbGet(QString path, QString key) return QString(""); } -bool QRCore::sdbSet(QString path, QString key, QString val) +bool IaitoRCore::sdbSet(QString path, QString key, QString val) { CORE_LOCK(); Sdb *db = sdb_ns_path(core_->sdb, path.toUtf8().constData(), 1); @@ -161,13 +161,13 @@ bool QRCore::sdbSet(QString path, QString key, QString val) return sdb_set(db, key.toUtf8().constData(), val.toUtf8().constData(), 0); } -QRCore::~QRCore() +IaitoRCore::~IaitoRCore() { r_core_free(this->core_); r_cons_free(); } -QString QRCore::cmd(const QString &str) +QString IaitoRCore::cmd(const QString &str) { CORE_LOCK(); @@ -180,7 +180,7 @@ QString QRCore::cmd(const QString &str) return o; } -QJsonDocument QRCore::cmdj(const QString &str) +QJsonDocument IaitoRCore::cmdj(const QString &str) { CORE_LOCK(); QByteArray cmd = str.toUtf8(); @@ -202,10 +202,10 @@ QJsonDocument QRCore::cmdj(const QString &str) return doc; } -bool QRCore::loadFile(QString path, uint64_t loadaddr, uint64_t mapaddr, bool rw, int va, int idx, bool loadbin) +bool IaitoRCore::loadFile(QString path, uint64_t loadaddr, uint64_t mapaddr, bool rw, int va, int idx, bool loadbin) { - QNOTUSED(loadaddr); - QNOTUSED(idx); + IAITONOTUSED(loadaddr); + IAITONOTUSED(idx); CORE_LOCK(); RCoreFile *f; @@ -286,7 +286,7 @@ bool QRCore::loadFile(QString path, uint64_t loadaddr, uint64_t mapaddr, bool rw return true; } -void QRCore::analyze(int level) +void IaitoRCore::analyze(int level) { CORE_LOCK(); /* @@ -315,32 +315,32 @@ void QRCore::analyze(int level) } } -void QRCore::renameFunction(QString prev_name, QString new_name) +void IaitoRCore::renameFunction(QString prev_name, QString new_name) { cmd("afn " + new_name + " " + prev_name); emit functionRenamed(prev_name, new_name); } -void QRCore::setComment(RVA addr, QString cmt) +void IaitoRCore::setComment(RVA addr, QString cmt) { //r_meta_add (core->anal, 'C', addr, 1, cmt.toUtf8()); cmd("CC " + cmt + " @ " + QString::number(addr)); } -void QRCore::setComment(QString addr, QString cmt) +void IaitoRCore::setComment(QString addr, QString cmt) { //r_meta_add (core->anal, 'C', addr, 1, cmt.toUtf8()); cmd("CC " + cmt + " @ " + addr); } -void QRCore::delComment(ut64 addr) +void IaitoRCore::delComment(ut64 addr) { CORE_LOCK(); r_meta_del(core_->anal, 'C', addr, 1, NULL); //cmd (QString("CC-@")+addr); } -QMap>> QRCore::getNestedComments() +QMap>> IaitoRCore::getNestedComments() { QMap>> ret; QString comments = cmd("CC~CCu"); @@ -360,7 +360,7 @@ QMap>> QRCore::getNestedComments() return ret; } -void QRCore::seek(QString addr) +void IaitoRCore::seek(QString addr) { if (addr.length() > 0) seek(this->math(addr.toUtf8().constData())); @@ -368,13 +368,13 @@ void QRCore::seek(QString addr) -void QRCore::seek(ut64 offset) +void IaitoRCore::seek(ut64 offset) { CORE_LOCK(); r_core_seek(this->core_, offset, true); } -bool QRCore::tryFile(QString path, bool rw) +bool IaitoRCore::tryFile(QString path, bool rw) { CORE_LOCK(); RCoreFile *cf; @@ -400,7 +400,7 @@ bool QRCore::tryFile(QString path, bool rw) -QList QRCore::getList(const QString &type, const QString &subtype) +QList IaitoRCore::getList(const QString &type, const QString &subtype) { CORE_LOCK(); QList ret = QList(); @@ -436,13 +436,13 @@ QList QRCore::getList(const QString &type, const QString &subtype) return ret; } -ut64 QRCore::math(const QString &expr) +ut64 IaitoRCore::math(const QString &expr) { CORE_LOCK(); return r_num_math(this->core_ ? this->core_->num : NULL, expr.toUtf8().constData()); } -int QRCore::fcnCyclomaticComplexity(ut64 addr) +int IaitoRCore::fcnCyclomaticComplexity(ut64 addr) { CORE_LOCK(); RAnalFunction *fcn = r_anal_get_fcn_at(core_->anal, addr, addr); @@ -451,7 +451,7 @@ int QRCore::fcnCyclomaticComplexity(ut64 addr) return 0; } -int QRCore::fcnBasicBlockCount(ut64 addr) +int IaitoRCore::fcnBasicBlockCount(ut64 addr) { CORE_LOCK(); //RAnalFunction *fcn = r_anal_get_fcn_at (core_->anal, addr, addr); @@ -463,7 +463,7 @@ int QRCore::fcnBasicBlockCount(ut64 addr) return 0; } -int QRCore::fcnEndBbs(RVA addr) +int IaitoRCore::fcnEndBbs(RVA addr) { CORE_LOCK(); RAnalFunction *fcn = r_anal_get_fcn_in(core_->anal, addr, 0); @@ -480,12 +480,12 @@ int QRCore::fcnEndBbs(RVA addr) return 0; } -QString QRCore::itoa(ut64 num, int rdx) +QString IaitoRCore::itoa(ut64 num, int rdx) { return QString::number(num, rdx); } -QString QRCore::config(const QString &k, const QString &v) +QString IaitoRCore::config(const QString &k, const QString &v) { CORE_LOCK(); QByteArray key = k.toUtf8(); @@ -497,7 +497,7 @@ QString QRCore::config(const QString &k, const QString &v) return QString(r_config_get(core_->config, key.constData())); } -int QRCore::config(const QString &k, int v) +int IaitoRCore::config(const QString &k, int v) { CORE_LOCK(); QByteArray key = k.toUtf8(); @@ -509,9 +509,9 @@ int QRCore::config(const QString &k, int v) return r_config_get_i(core_->config, key.constData()); } -void QRCore::setOptions(QString key) +void IaitoRCore::setOptions(QString key) { - QNOTUSED(key); + IAITONOTUSED(key); // va // lowercase @@ -522,7 +522,7 @@ void QRCore::setOptions(QString key) // anal plugin } -void QRCore::setCPU(QString arch, QString cpu, int bits, bool temporary) +void IaitoRCore::setCPU(QString arch, QString cpu, int bits, bool temporary) { config("asm.arch", arch); config("asm.cpu", cpu); @@ -535,7 +535,7 @@ void QRCore::setCPU(QString arch, QString cpu, int bits, bool temporary) } } -void QRCore::setDefaultCPU() +void IaitoRCore::setDefaultCPU() { if (!default_arch.isEmpty()) config("asm.arch", default_arch); @@ -545,7 +545,7 @@ void QRCore::setDefaultCPU() config("asm.bits", QString::number(default_bits)); } -QString QRCore::assemble(const QString &code) +QString IaitoRCore::assemble(const QString &code) { CORE_LOCK(); RAsmCode *ac = r_asm_massemble(core_->assembler, code.toUtf8().constData()); @@ -554,7 +554,7 @@ QString QRCore::assemble(const QString &code) return hex; } -QString QRCore::disassemble(const QString &hex) +QString IaitoRCore::disassemble(const QString &hex) { CORE_LOCK(); RAsmCode *ac = r_asm_mdisassemble_hexstr(core_->assembler, hex.toUtf8().constData()); @@ -563,19 +563,19 @@ QString QRCore::disassemble(const QString &hex) return code; } -QString QRCore::disassembleSingleInstruction(RVA addr) +QString IaitoRCore::disassembleSingleInstruction(RVA addr) { return cmd("pi 1@" + QString::number(addr)).simplified(); } -RAnalFunction *QRCore::functionAt(ut64 addr) +RAnalFunction *IaitoRCore::functionAt(ut64 addr) { CORE_LOCK(); //return r_anal_fcn_find (core_->anal, addr, addr); return r_anal_get_fcn_in(core_->anal, addr, 0); } -QString QRCore::cmdFunctionAt(QString addr) +QString IaitoRCore::cmdFunctionAt(QString addr) { QString ret; //afi~name:1[1] @ 0x08048e44 @@ -584,12 +584,12 @@ QString QRCore::cmdFunctionAt(QString addr) return ret.trimmed(); } -QString QRCore::cmdFunctionAt(RVA addr) +QString IaitoRCore::cmdFunctionAt(RVA addr) { return cmdFunctionAt(QString::number(addr)); } -int QRCore::get_size() +int IaitoRCore::get_size() { CORE_LOCK(); RBinObject *obj = r_bin_get_object(core_->bin); @@ -597,14 +597,14 @@ int QRCore::get_size() return obj != nullptr ? obj->obj_size : 0; } -ulong QRCore::get_baddr() +ulong IaitoRCore::get_baddr() { CORE_LOCK(); ulong baddr = r_bin_get_baddr(core_->bin); return baddr; } -QList> QRCore::get_exec_sections() +QList> IaitoRCore::get_exec_sections() { QList> ret; @@ -627,29 +627,29 @@ QList> QRCore::get_exec_sections() return ret; } -QString QRCore::getOffsetInfo(QString addr) +QString IaitoRCore::getOffsetInfo(QString addr) { return cmd("ao @ " + addr); } -QString QRCore::getOffsetJump(QString addr) +QString IaitoRCore::getOffsetJump(QString addr) { QString ret = cmd("ao @" + addr + "~jump[1]"); return ret; } -QString QRCore::getDecompiledCode(QString addr) +QString IaitoRCore::getDecompiledCode(QString addr) { return cmd("pdc @ " + addr); } -QString QRCore::getFileInfo() +QString IaitoRCore::getFileInfo() { QString info = cmd("ij"); return info; } -QStringList QRCore::getStats() +QStringList IaitoRCore::getStats() { QStringList stats; cmd("fs functions"); @@ -672,7 +672,7 @@ QStringList QRCore::getStats() return stats; } -QString QRCore::getSimpleGraph(QString function) +QString IaitoRCore::getSimpleGraph(QString function) { // New styles QString graph = "graph [bgcolor=invis, splines=polyline];"; @@ -694,7 +694,7 @@ QString QRCore::getSimpleGraph(QString function) return dot; } -void QRCore::getOpcodes() +void IaitoRCore::getOpcodes() { QString opcodes = cmd("?O"); this->opcodes = opcodes.split("\n"); @@ -705,7 +705,7 @@ void QRCore::getOpcodes() this->regs.removeLast(); } -void QRCore::setSettings() +void IaitoRCore::setSettings() { config("scr.color", "false"); config("scr.interactive", "false"); @@ -768,7 +768,7 @@ void QRCore::setSettings() -QList QRCore::getSeekHistory() +QList IaitoRCore::getSeekHistory() { CORE_LOCK(); QList ret; @@ -782,14 +782,14 @@ QList QRCore::getSeekHistory() -QStringList QRCore::getAsmPluginNames() +QStringList IaitoRCore::getAsmPluginNames() { CORE_LOCK(); RListIter *it; QStringList ret; RAsmPlugin *ap; - QRListForeach(core_->assembler->plugins, it, RAsmPlugin, ap) + IaitoRListForeach(core_->assembler->plugins, it, RAsmPlugin, ap) { ret << ap->name; } @@ -797,14 +797,14 @@ QStringList QRCore::getAsmPluginNames() return ret; } -QStringList QRCore::getAnalPluginNames() +QStringList IaitoRCore::getAnalPluginNames() { CORE_LOCK(); RListIter *it; QStringList ret; RAnalPlugin *ap; - QRListForeach(core_->anal->plugins, it, RAnalPlugin, ap) + IaitoRListForeach(core_->anal->plugins, it, RAnalPlugin, ap) { ret << ap->name; } @@ -813,7 +813,7 @@ QStringList QRCore::getAnalPluginNames() } -QStringList QRCore::getProjectNames() +QStringList IaitoRCore::getProjectNames() { CORE_LOCK(); QStringList ret; @@ -827,7 +827,7 @@ QStringList QRCore::getProjectNames() -QList QRCore::getAllFunctions() +QList IaitoRCore::getAllFunctions() { CORE_LOCK(); QList ret; @@ -851,7 +851,7 @@ QList QRCore::getAllFunctions() } -QList QRCore::getAllImports() +QList IaitoRCore::getAllImports() { CORE_LOCK(); QList ret; @@ -878,7 +878,7 @@ QList QRCore::getAllImports() -QList QRCore::getAllExports() +QList IaitoRCore::getAllExports() { CORE_LOCK(); QList ret; @@ -905,7 +905,7 @@ QList QRCore::getAllExports() } -QList QRCore::getAllSymbols() +QList IaitoRCore::getAllSymbols() { CORE_LOCK(); RListIter *it; @@ -915,7 +915,7 @@ QList QRCore::getAllSymbols() RBinSymbol *bs; if (core_ && core_->bin && core_->bin->cur && core_->bin->cur->o) { - QRListForeach(core_->bin->cur->o->symbols, it, RBinSymbol, bs) + IaitoRListForeach(core_->bin->cur->o->symbols, it, RBinSymbol, bs) { QString type = QString(bs->bind) + " " + QString(bs->type); SymbolDescription symbol; @@ -929,7 +929,7 @@ QList QRCore::getAllSymbols() /* list entrypoints as symbols too */ int n = 0; RBinAddr *entry; - QRListForeach(core_->bin->cur->o->entries, it, RBinAddr, entry) + IaitoRListForeach(core_->bin->cur->o->entries, it, RBinAddr, entry) { SymbolDescription symbol; symbol.vaddr = entry->vaddr; @@ -944,7 +944,7 @@ QList QRCore::getAllSymbols() } -QList QRCore::getAllComments(const QString &filterType) +QList IaitoRCore::getAllComments(const QString &filterType) { CORE_LOCK(); QList ret; @@ -967,7 +967,7 @@ QList QRCore::getAllComments(const QString &filterType) return ret; } -QList QRCore::getAllRelocs() +QList IaitoRCore::getAllRelocs() { CORE_LOCK(); RListIter *it; @@ -976,7 +976,7 @@ QList QRCore::getAllRelocs() RBinReloc *br; if (core_ && core_->bin && core_->bin->cur && core_->bin->cur->o) { - QRListForeach(core_->bin->cur->o->relocs, it, RBinReloc, br) + IaitoRListForeach(core_->bin->cur->o->relocs, it, RBinReloc, br) { RelocDescription reloc; @@ -996,7 +996,7 @@ QList QRCore::getAllRelocs() return ret; } -QList QRCore::getAllStrings() +QList IaitoRCore::getAllStrings() { CORE_LOCK(); RListIter *it; @@ -1005,7 +1005,7 @@ QList QRCore::getAllStrings() RBinString *bs; if (core_ && core_->bin && core_->bin->cur && core_->bin->cur->o) { - QRListForeach(core_->bin->cur->o->strings, it, RBinString, bs) + IaitoRListForeach(core_->bin->cur->o->strings, it, RBinString, bs) { StringDescription str; str.vaddr = bs->vaddr; @@ -1018,7 +1018,7 @@ QList QRCore::getAllStrings() } -QList QRCore::getAllFlagspaces() +QList IaitoRCore::getAllFlagspaces() { CORE_LOCK(); QList ret; @@ -1037,7 +1037,7 @@ QList QRCore::getAllFlagspaces() } -QList QRCore::getAllFlags(QString flagspace) +QList IaitoRCore::getAllFlags(QString flagspace) { CORE_LOCK(); QList ret; @@ -1063,7 +1063,7 @@ QList QRCore::getAllFlags(QString flagspace) } -QList QRCore::getAllSections() +QList IaitoRCore::getAllSections() { CORE_LOCK(); QList ret; @@ -1090,7 +1090,7 @@ QList QRCore::getAllSections() return ret; } -QList QRCore::getXRefs(RVA addr, bool to, bool whole_function, const QString &filterType) +QList IaitoRCore::getXRefs(RVA addr, bool to, bool whole_function, const QString &filterType) { QList ret = QList(); diff --git a/src/qrdisasm.cpp b/src/qrdisasm.cpp index b3c82bf6..8941df4d 100644 --- a/src/qrdisasm.cpp +++ b/src/qrdisasm.cpp @@ -1,19 +1,19 @@ -#include "qrdisasm.h" +#include "iaitordisasm.h" // This class is not used, created by pancake a long time ago. // Kept here just because -QRDisasm::QRDisasm(QRCore *core) : +IaitoRDisasm::IaitoRDisasm(IaitoRCore *core) : core(core), db(nullptr) { } -bool QRDisasm::disassembleAt(ut64 addr, QRDisasmOption opt, QRDisasmRow &dr) +bool IaitoRDisasm::disassembleAt(ut64 addr, IaitoRDisasmOption opt, IaitoRDisasmRow &dr) { - QNOTUSED(addr); - QNOTUSED(opt); - QNOTUSED(dr); + IAITONOTUSED(addr); + IAITONOTUSED(opt); + IAITONOTUSED(dr); printf("FUCK\n"); return false; diff --git a/src/radarewebserver.cpp b/src/radarewebserver.cpp index 616b0bf8..c4e76fad 100644 --- a/src/radarewebserver.cpp +++ b/src/radarewebserver.cpp @@ -1,11 +1,11 @@ #include "radarewebserver.h" -#include "qrcore.h" +#include "iaitorcore.h" #include #include #include -RadareWebServer::RadareWebServer(QRCore *core) : +RadareWebServer::RadareWebServer(IaitoRCore *core) : core(core), started(false) { diff --git a/src/radarewebserver.h b/src/radarewebserver.h index d03e5c8e..88540d7a 100644 --- a/src/radarewebserver.h +++ b/src/radarewebserver.h @@ -4,13 +4,13 @@ #include #include -class QRCore; +class IaitoRCore; class RadareWebServer { public: - explicit RadareWebServer(QRCore *core); + explicit RadareWebServer(IaitoRCore *core); ~RadareWebServer(); void start(); @@ -19,7 +19,7 @@ public: bool isStarted() const; private: - QRCore *core; + IaitoRCore *core; bool started; }; diff --git a/src/widgets/codegraphic.cpp b/src/widgets/codegraphic.cpp index d848cf35..fc62a204 100644 --- a/src/widgets/codegraphic.cpp +++ b/src/widgets/codegraphic.cpp @@ -14,7 +14,7 @@ GraphicsBar::GraphicsBar(MainWindow *main, QWidget *parent) : QToolBar(main) { - QNOTUSED(parent); + IAITONOTUSED(parent); setObjectName("codeGraphics"); setWindowTitle(tr("Code bar")); @@ -44,7 +44,7 @@ GraphicsBar::GraphicsBar(MainWindow *main, QWidget *parent) : void GraphicsBar::paintEvent(QPaintEvent *event) { - QNOTUSED(event); + IAITONOTUSED(event); QPainter painter(this); this->fillData(); diff --git a/src/widgets/commentswidget.cpp b/src/widgets/commentswidget.cpp index 9b4cfea7..a03f6081 100644 --- a/src/widgets/commentswidget.cpp +++ b/src/widgets/commentswidget.cpp @@ -49,7 +49,7 @@ void CommentsWidget::refresh() void CommentsWidget::on_commentsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) { - QNOTUSED(column); + IAITONOTUSED(column); // Get offset and name of item double clicked CommentDescription comment = item->data(0, Qt::UserRole).value(); diff --git a/src/widgets/consolewidget.cpp b/src/widgets/consolewidget.cpp index 7a08c3b5..b072abcc 100644 --- a/src/widgets/consolewidget.cpp +++ b/src/widgets/consolewidget.cpp @@ -2,7 +2,7 @@ #include "ui_consolewidget.h" #include "helpers.h" -#include "qrcore.h" +#include "iaitorcore.h" #include #include @@ -92,7 +92,7 @@ static bool isForbidden(const QString &input) -ConsoleWidget::ConsoleWidget(QRCore *core, QWidget *parent) : +ConsoleWidget::ConsoleWidget(IaitoRCore *core, QWidget *parent) : QWidget(parent), ui(new Ui::ConsoleWidget), core(core), diff --git a/src/widgets/consolewidget.h b/src/widgets/consolewidget.h index 2da6fa38..0153866a 100644 --- a/src/widgets/consolewidget.h +++ b/src/widgets/consolewidget.h @@ -3,7 +3,7 @@ #include -class QRCore; +class IaitoRCore; class QAction; @@ -18,7 +18,7 @@ class ConsoleWidget : public QWidget Q_OBJECT public: - explicit ConsoleWidget(QRCore *core, QWidget *parent = 0); + explicit ConsoleWidget(IaitoRCore *core, QWidget *parent = 0); ~ConsoleWidget(); void addOutput(const QString &msg); @@ -51,7 +51,7 @@ private: void invalidateHistoryPosition(); Ui::ConsoleWidget *ui; - QRCore *core; + IaitoRCore *core; QList actions; bool debugOutputEnabled; int maxHistoryEntries; diff --git a/src/widgets/dashboard.cpp b/src/widgets/dashboard.cpp index 452942e3..c98096f4 100644 --- a/src/widgets/dashboard.cpp +++ b/src/widgets/dashboard.cpp @@ -72,9 +72,10 @@ void Dashboard::updateContents() this->ui->compiledEdit->setText(item2["compiled"].toString()); this->ui->bitsEdit->setText(QString::number(item2["bits"].toDouble())); - if (!item2["relro"].isUndefined()) { + if (!item2["relro"].isUndefined()) + { QString relro = item2["relro"].toString().split(" ").at(0); - relro[0]=relro[0].toUpper(); + relro[0] = relro[0].toUpper(); this->ui->relroEdit->setText(relro); } diff --git a/src/widgets/exportswidget.h b/src/widgets/exportswidget.h index 4739ca52..293bd275 100644 --- a/src/widgets/exportswidget.h +++ b/src/widgets/exportswidget.h @@ -4,7 +4,7 @@ #include #include -#include "qrcore.h" +#include "iaitorcore.h" #include "dockwidget.h" class MainWindow; diff --git a/src/widgets/flagswidget.cpp b/src/widgets/flagswidget.cpp index 3e294b60..d06ee28e 100644 --- a/src/widgets/flagswidget.cpp +++ b/src/widgets/flagswidget.cpp @@ -167,7 +167,7 @@ void FlagsWidget::on_flagsTreeView_doubleClicked(const QModelIndex &index) void FlagsWidget::on_flagspaceCombo_currentTextChanged(const QString &arg1) { - QNOTUSED(arg1); + IAITONOTUSED(arg1); refreshFlags(); } diff --git a/src/widgets/flagswidget.h b/src/widgets/flagswidget.h index 202b073d..7f5d85ef 100644 --- a/src/widgets/flagswidget.h +++ b/src/widgets/flagswidget.h @@ -1,7 +1,7 @@ #ifndef FLAGSWIDGET_H #define FLAGSWIDGET_H -#include "qrcore.h" +#include "iaitorcore.h" #include "dockwidget.h" #include #include diff --git a/src/widgets/functionswidget.h b/src/widgets/functionswidget.h index ef88cfe0..78d8a225 100644 --- a/src/widgets/functionswidget.h +++ b/src/widgets/functionswidget.h @@ -2,7 +2,7 @@ #define FUNCTIONSWIDGET_H #include "dockwidget.h" -#include "qrcore.h" +#include "iaitorcore.h" #include #include diff --git a/src/widgets/memorywidget.h b/src/widgets/memorywidget.h index 13a8b06c..2ecc6778 100644 --- a/src/widgets/memorywidget.h +++ b/src/widgets/memorywidget.h @@ -1,7 +1,7 @@ #ifndef MEMORYWIDGET_H #define MEMORYWIDGET_H -#include "qrcore.h" +#include "iaitorcore.h" #include "highlighter.h" #include "hexascii_highlighter.h" #include "hexhighlighter.h" diff --git a/src/widgets/notepad.cpp b/src/widgets/notepad.cpp index 573c1941..c8619d29 100644 --- a/src/widgets/notepad.cpp +++ b/src/widgets/notepad.cpp @@ -225,7 +225,7 @@ void Notepad::on_searchEdit_returnPressed() void Notepad::on_searchEdit_textEdited(const QString &arg1) { - QNOTUSED(arg1); + IAITONOTUSED(arg1); QString searchString = ui->searchEdit->text(); QTextDocument *document = ui->notepadTextEdit->document(); @@ -264,7 +264,7 @@ void Notepad::on_searchEdit_textEdited(const QString &arg1) void Notepad::on_searchEdit_textChanged(const QString &arg1) { - QNOTUSED(arg1); + IAITONOTUSED(arg1); QString searchString = ui->searchEdit->text(); QTextDocument *document = ui->notepadTextEdit->document(); diff --git a/src/widgets/pieview.cpp b/src/widgets/pieview.cpp index 74a711eb..3f064618 100644 --- a/src/widgets/pieview.cpp +++ b/src/widgets/pieview.cpp @@ -46,7 +46,7 @@ #define M_PI 3.1415927 #endif -#include "qrcore.h" +#include "iaitorcore.h" #include "pieview.h" PieView::PieView(QWidget *parent) @@ -486,7 +486,7 @@ void PieView::scrollTo(const QModelIndex &index, ScrollHint) void PieView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) { - QNOTUSED(command); + IAITONOTUSED(command); // Use content widget coordinates because we will use the itemRegion() // function to check for intersections. diff --git a/src/widgets/relocswidget.cpp b/src/widgets/relocswidget.cpp index 4e3aae61..6cf450d8 100644 --- a/src/widgets/relocswidget.cpp +++ b/src/widgets/relocswidget.cpp @@ -39,7 +39,7 @@ void RelocsWidget::refresh() void RelocsWidget::on_relocsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) { - QNOTUSED(column); + IAITONOTUSED(column); // Get offset and name of item double clicked RelocDescription reloc = item->data(0, Qt::UserRole).value(); diff --git a/src/widgets/sectionswidget.cpp b/src/widgets/sectionswidget.cpp index f2bdeab5..cd19aed0 100644 --- a/src/widgets/sectionswidget.cpp +++ b/src/widgets/sectionswidget.cpp @@ -11,7 +11,7 @@ SectionsWidget::SectionsWidget(MainWindow *main, QWidget *parent) : QSplitter(main), main(main) { - QNOTUSED(parent); + IAITONOTUSED(parent); setupViews(); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); diff --git a/src/widgets/stringswidget.cpp b/src/widgets/stringswidget.cpp index 761ed8f0..edcfdde7 100644 --- a/src/widgets/stringswidget.cpp +++ b/src/widgets/stringswidget.cpp @@ -38,7 +38,7 @@ void StringsWidget::refresh() void StringsWidget::on_stringsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) { - QNOTUSED(column); + IAITONOTUSED(column); // Get offset and name of item double clicked // TODO: use this info to change disasm contents diff --git a/src/widgets/symbolswidget.cpp b/src/widgets/symbolswidget.cpp index accf2b6d..8a5c738a 100644 --- a/src/widgets/symbolswidget.cpp +++ b/src/widgets/symbolswidget.cpp @@ -36,7 +36,7 @@ void SymbolsWidget::refresh() void SymbolsWidget::on_symbolsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) { - QNOTUSED(column); + IAITONOTUSED(column); // Get offset and name of item double clicked SymbolDescription symbol = item->data(0, Qt::UserRole).value();