Renaming QRCore and QRDisasm to IaitoRCore and IaitoRDisasm (#187)

* Renaming QRCore and QRDisasm to IaitoRCore and IaitoRDisasm

* Included AStyle formatting changes
This commit is contained in:
Hanzō Hattori 2017-07-02 13:11:02 +02:00 committed by Duncan Ogilvie
parent 6d90a98a6f
commit 771eccc125
31 changed files with 147 additions and 146 deletions

View File

@ -1,5 +1,5 @@
#include "analthread.h" #include "analthread.h"
#include "qrcore.h" #include "iaitorcore.h"
#include <QDebug> #include <QDebug>
AnalThread::AnalThread(QWidget *parent) : 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->core = core;
this->level = level; this->level = level;

View File

@ -3,7 +3,7 @@
#include <QThread> #include <QThread>
class QRCore; class IaitoRCore;
class AnalThread : public QThread class AnalThread : public QThread
{ {
@ -12,7 +12,7 @@ public:
explicit AnalThread(QWidget *parent = 0); explicit AnalThread(QWidget *parent = 0);
~AnalThread(); ~AnalThread();
void start(QRCore *core, int level); void start(IaitoRCore *core, int level);
protected: protected:
void run(); void run();
@ -20,7 +20,7 @@ protected:
using QThread::start; using QThread::start;
private: private:
QRCore *core; IaitoRCore *core;
int level; int level;
}; };

View File

@ -80,7 +80,7 @@ void XrefsDialog::fillRefs(QList<XrefDescription> refs, QList<XrefDescription> x
void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
{ {
QNOTUSED(column); IAITONOTUSED(column);
XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>(); XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>();
RAnalFunction *fcn = this->main->core->functionAt(xref.to); 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) void XrefsDialog::on_toTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
{ {
QNOTUSED(column); IAITONOTUSED(column);
XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>(); XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>();
RAnalFunction *fcn = this->main->core->functionAt(xref.from); RAnalFunction *fcn = this->main->core->functionAt(xref.from);

View File

@ -2,7 +2,7 @@
#define XREFSDIALOG_H #define XREFSDIALOG_H
#include "highlighter.h" #include "highlighter.h"
#include "qrcore.h" #include "iaitorcore.h"
#include <QDialog> #include <QDialog>
#include <QTreeWidgetItem> #include <QTreeWidgetItem>

View File

@ -73,7 +73,6 @@ HEADERS += \
newfiledialog.h \ newfiledialog.h \
optionsdialog.h \ optionsdialog.h \
highlighter.h \ highlighter.h \
qrcore.h \
createnewdialog.h \ createnewdialog.h \
hexascii_highlighter.h \ hexascii_highlighter.h \
widgets/pieview.h \ widgets/pieview.h \
@ -92,7 +91,6 @@ HEADERS += \
widgets/flagswidget.h \ widgets/flagswidget.h \
widgets/memorywidget.h \ widgets/memorywidget.h \
widgets/exportswidget.h \ widgets/exportswidget.h \
qrdisasm.h \
widgets/sdbdock.h \ widgets/sdbdock.h \
analthread.h \ analthread.h \
dialogs/commentsdialog.h \ dialogs/commentsdialog.h \
@ -106,7 +104,9 @@ HEADERS += \
widgets/dockwidget.h \ widgets/dockwidget.h \
widgets/consolewidget.h \ widgets/consolewidget.h \
radarewebserver.h \ radarewebserver.h \
settings.h settings.h \
iaitorcore.h \
iaitordisasm.h
FORMS += \ FORMS += \
mainwindow.ui \ mainwindow.ui \

View File

@ -1,5 +1,5 @@
#ifndef QRCORE_H #ifndef IAITORCORE_H
#define QRCORE_H #define IAITORCORE_H
#include <QMap> #include <QMap>
#include <QDebug> #include <QDebug>
@ -22,7 +22,7 @@
#define HAVE_LATEST_LIBR2 false #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) 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) #define __alert(x) QMessageBox::question (this, "Alert", QString(x), QMessageBox::Ok)
@ -42,7 +42,7 @@ public:
RCore *operator->() const; RCore *operator->() const;
}; };
#define QNOTUSED(x) do { (void)(x); } while ( 0 ); #define IAITONOTUSED(x) do { (void)(x); } while ( 0 );
typedef ut64 RVA; typedef ut64 RVA;
@ -152,15 +152,15 @@ Q_DECLARE_METATYPE(FlagspaceDescription)
Q_DECLARE_METATYPE(FlagDescription) Q_DECLARE_METATYPE(FlagDescription)
Q_DECLARE_METATYPE(XrefDescription) Q_DECLARE_METATYPE(XrefDescription)
class QRCore : public QObject class IaitoRCore : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
QString projectPath; QString projectPath;
explicit QRCore(QObject *parent = 0); explicit IaitoRCore(QObject *parent = 0);
~QRCore(); ~IaitoRCore();
RVA getOffset() const { return core_->offset; } RVA getOffset() const { return core_->offset; }
int getCycloComplex(ut64 addr); int getCycloComplex(ut64 addr);
@ -255,4 +255,4 @@ private:
RCore *core_; RCore *core_;
}; };
#endif // QRCORE_H #endif // IAITORCORE_H

View File

@ -1,9 +1,9 @@
#ifndef QRDISASM_H #ifndef IAITORDISASM_H
#define QRDISASM_H #define IAITORDISASM_H
#include <qrcore.h> #include <iaitorcore.h>
enum QRDisasmDataType enum IaitoRDisasmDataType
{ {
STRING = 'z', STRING = 'z',
STRUCT = 's', STRUCT = 's',
@ -11,7 +11,7 @@ enum QRDisasmDataType
}; };
enum QRDisasmOption enum IaitoRDisasmOption
{ {
DWARF = 1 << 1, DWARF = 1 << 1,
REFS = 1 << 2, REFS = 1 << 2,
@ -20,10 +20,10 @@ enum QRDisasmOption
COMMENT = 1 << 5, COMMENT = 1 << 5,
}; };
class QRDisasmRow class IaitoRDisasmRow
{ {
private: private:
QRCore *core; IaitoRCore *core;
public: public:
ut64 vaddr; ut64 vaddr;
ut64 paddr; ut64 paddr;
@ -46,7 +46,7 @@ public:
QString esil; QString esil;
// if data // if data
QRDisasmDataType datatype; IaitoRDisasmDataType datatype;
QString dataopt; // struct name, aliased name, string, etc QString dataopt; // struct name, aliased name, string, etc
// data type // data type
// string/struct/hex/word // string/struct/hex/word
@ -60,17 +60,17 @@ public:
}; };
class QRDisasm class IaitoRDisasm
{ {
QRCore *core; IaitoRCore *core;
Sdb *db; Sdb *db;
public: public:
explicit QRDisasm(QRCore *core); explicit IaitoRDisasm(IaitoRCore *core);
bool disassembleAt(ut64 addr, QRDisasmOption opt, QRDisasmRow &dr); bool disassembleAt(ut64 addr, IaitoRDisasmOption opt, IaitoRDisasmRow &dr);
// high level api for the disasm thing to manage comments, xrefs, etc // high level api for the disasm thing to manage comments, xrefs, etc
//next(); //next();
//prev(); //prev();
}; };
#endif // QRDISASM_H #endif // IAITORDISASM_H

View File

@ -82,7 +82,7 @@ static void registerCustomFonts()
MainWindow::MainWindow(QWidget *parent) : MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),
core(new QRCore()), core(new IaitoRCore()),
memoryDock(nullptr), memoryDock(nullptr),
notepadDock(nullptr), notepadDock(nullptr),
asmDock(nullptr), asmDock(nullptr),

View File

@ -2,12 +2,12 @@
#define MAINWINDOW_H #define MAINWINDOW_H
#include "radarewebserver.h" #include "radarewebserver.h"
#include "qrcore.h" // only needed for ut64 #include "iaitorcore.h" // only needed for ut64
#include <QMainWindow> #include <QMainWindow>
#include <QList> #include <QList>
class QRCore; class IaitoRCore;
class DockWidget; class DockWidget;
class Omnibar; class Omnibar;
class MemoryWidget; class MemoryWidget;
@ -44,7 +44,7 @@ class MainWindow : public QMainWindow
Q_OBJECT Q_OBJECT
public: public:
QRCore *core; IaitoRCore *core;
MemoryWidget *memoryDock; MemoryWidget *memoryDock;
Notepad *notepadDock; Notepad *notepadDock;

View File

@ -12,7 +12,7 @@ const int NewFileDialog::MaxRecentFiles;
static QColor getColorFor(QString str, int pos) static QColor getColorFor(QString str, int pos)
{ {
QNOTUSED(str); IAITONOTUSED(str);
QList<QColor> Colors; QList<QColor> Colors;
Colors << QColor(29, 188, 156); // Turquoise Colors << QColor(29, 188, 156); // Turquoise

View File

@ -4,7 +4,7 @@
#include <QDialog> #include <QDialog>
#include <QStringList> #include <QStringList>
#include "qrcore.h" #include "iaitorcore.h"
#include "analthread.h" #include "analthread.h"
class MainWindow; class MainWindow;

View File

@ -1,4 +1,4 @@
#include "qrcore.h" #include "iaitorcore.h"
#include "sdb.h" #include "sdb.h"
#include <QJsonArray> #include <QJsonArray>
@ -33,14 +33,14 @@ RCore *RCoreLocked::operator->() const
return core; return core;
} }
RCoreLocked QRCore::core() const RCoreLocked IaitoRCore::core() const
{ {
return RCoreLocked(this->core_); return RCoreLocked(this->core_);
} }
#define CORE_LOCK() RCoreLocked core_lock__(this->core_) #define CORE_LOCK() RCoreLocked core_lock__(this->core_)
QRCore::QRCore(QObject *parent) : IaitoRCore::IaitoRCore(QObject *parent) :
QObject(parent) QObject(parent)
{ {
r_cons_new(); // initialize console 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(); CORE_LOCK();
QString ret = ""; QString ret = "";
@ -84,7 +84,7 @@ int QRCore::getCycloComplex(ut64 addr)
} }
} }
int QRCore::getFcnSize(ut64 addr) int IaitoRCore::getFcnSize(ut64 addr)
{ {
CORE_LOCK(); CORE_LOCK();
QString ret = ""; QString ret = "";
@ -103,7 +103,7 @@ int QRCore::getFcnSize(ut64 addr)
} }
} }
QList<QString> QRCore::sdbList(QString path) QList<QString> IaitoRCore::sdbList(QString path)
{ {
CORE_LOCK(); CORE_LOCK();
QList<QString> list = QList<QString>(); QList<QString> list = QList<QString>();
@ -121,7 +121,7 @@ QList<QString> QRCore::sdbList(QString path)
return list; return list;
} }
QList<QString> QRCore::sdbListKeys(QString path) QList<QString> IaitoRCore::sdbListKeys(QString path)
{ {
CORE_LOCK(); CORE_LOCK();
QList<QString> list = QList<QString>(); QList<QString> list = QList<QString>();
@ -140,7 +140,7 @@ QList<QString> QRCore::sdbListKeys(QString path)
return list; return list;
} }
QString QRCore::sdbGet(QString path, QString key) QString IaitoRCore::sdbGet(QString path, QString key)
{ {
CORE_LOCK(); CORE_LOCK();
Sdb *db = sdb_ns_path(core_->sdb, path.toUtf8().constData(), 0); Sdb *db = sdb_ns_path(core_->sdb, path.toUtf8().constData(), 0);
@ -153,7 +153,7 @@ QString QRCore::sdbGet(QString path, QString key)
return QString(""); return QString("");
} }
bool QRCore::sdbSet(QString path, QString key, QString val) bool IaitoRCore::sdbSet(QString path, QString key, QString val)
{ {
CORE_LOCK(); CORE_LOCK();
Sdb *db = sdb_ns_path(core_->sdb, path.toUtf8().constData(), 1); 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); return sdb_set(db, key.toUtf8().constData(), val.toUtf8().constData(), 0);
} }
QRCore::~QRCore() IaitoRCore::~IaitoRCore()
{ {
r_core_free(this->core_); r_core_free(this->core_);
r_cons_free(); r_cons_free();
} }
QString QRCore::cmd(const QString &str) QString IaitoRCore::cmd(const QString &str)
{ {
CORE_LOCK(); CORE_LOCK();
@ -180,7 +180,7 @@ QString QRCore::cmd(const QString &str)
return o; return o;
} }
QJsonDocument QRCore::cmdj(const QString &str) QJsonDocument IaitoRCore::cmdj(const QString &str)
{ {
CORE_LOCK(); CORE_LOCK();
QByteArray cmd = str.toUtf8(); QByteArray cmd = str.toUtf8();
@ -202,10 +202,10 @@ QJsonDocument QRCore::cmdj(const QString &str)
return doc; 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); IAITONOTUSED(loadaddr);
QNOTUSED(idx); IAITONOTUSED(idx);
CORE_LOCK(); CORE_LOCK();
RCoreFile *f; RCoreFile *f;
@ -286,7 +286,7 @@ bool QRCore::loadFile(QString path, uint64_t loadaddr, uint64_t mapaddr, bool rw
return true; return true;
} }
void QRCore::analyze(int level) void IaitoRCore::analyze(int level)
{ {
CORE_LOCK(); 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); cmd("afn " + new_name + " " + prev_name);
emit functionRenamed(prev_name, new_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()); //r_meta_add (core->anal, 'C', addr, 1, cmt.toUtf8());
cmd("CC " + cmt + " @ " + QString::number(addr)); 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()); //r_meta_add (core->anal, 'C', addr, 1, cmt.toUtf8());
cmd("CC " + cmt + " @ " + addr); cmd("CC " + cmt + " @ " + addr);
} }
void QRCore::delComment(ut64 addr) void IaitoRCore::delComment(ut64 addr)
{ {
CORE_LOCK(); CORE_LOCK();
r_meta_del(core_->anal, 'C', addr, 1, NULL); r_meta_del(core_->anal, 'C', addr, 1, NULL);
//cmd (QString("CC-@")+addr); //cmd (QString("CC-@")+addr);
} }
QMap<QString, QList<QList<QString>>> QRCore::getNestedComments() QMap<QString, QList<QList<QString>>> IaitoRCore::getNestedComments()
{ {
QMap<QString, QList<QList<QString>>> ret; QMap<QString, QList<QList<QString>>> ret;
QString comments = cmd("CC~CCu"); QString comments = cmd("CC~CCu");
@ -360,7 +360,7 @@ QMap<QString, QList<QList<QString>>> QRCore::getNestedComments()
return ret; return ret;
} }
void QRCore::seek(QString addr) void IaitoRCore::seek(QString addr)
{ {
if (addr.length() > 0) if (addr.length() > 0)
seek(this->math(addr.toUtf8().constData())); 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(); CORE_LOCK();
r_core_seek(this->core_, offset, true); r_core_seek(this->core_, offset, true);
} }
bool QRCore::tryFile(QString path, bool rw) bool IaitoRCore::tryFile(QString path, bool rw)
{ {
CORE_LOCK(); CORE_LOCK();
RCoreFile *cf; RCoreFile *cf;
@ -400,7 +400,7 @@ bool QRCore::tryFile(QString path, bool rw)
QList<QString> QRCore::getList(const QString &type, const QString &subtype) QList<QString> IaitoRCore::getList(const QString &type, const QString &subtype)
{ {
CORE_LOCK(); CORE_LOCK();
QList<QString> ret = QList<QString>(); QList<QString> ret = QList<QString>();
@ -436,13 +436,13 @@ QList<QString> QRCore::getList(const QString &type, const QString &subtype)
return ret; return ret;
} }
ut64 QRCore::math(const QString &expr) ut64 IaitoRCore::math(const QString &expr)
{ {
CORE_LOCK(); CORE_LOCK();
return r_num_math(this->core_ ? this->core_->num : NULL, expr.toUtf8().constData()); 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(); CORE_LOCK();
RAnalFunction *fcn = r_anal_get_fcn_at(core_->anal, addr, addr); RAnalFunction *fcn = r_anal_get_fcn_at(core_->anal, addr, addr);
@ -451,7 +451,7 @@ int QRCore::fcnCyclomaticComplexity(ut64 addr)
return 0; return 0;
} }
int QRCore::fcnBasicBlockCount(ut64 addr) int IaitoRCore::fcnBasicBlockCount(ut64 addr)
{ {
CORE_LOCK(); CORE_LOCK();
//RAnalFunction *fcn = r_anal_get_fcn_at (core_->anal, addr, addr); //RAnalFunction *fcn = r_anal_get_fcn_at (core_->anal, addr, addr);
@ -463,7 +463,7 @@ int QRCore::fcnBasicBlockCount(ut64 addr)
return 0; return 0;
} }
int QRCore::fcnEndBbs(RVA addr) int IaitoRCore::fcnEndBbs(RVA addr)
{ {
CORE_LOCK(); CORE_LOCK();
RAnalFunction *fcn = r_anal_get_fcn_in(core_->anal, addr, 0); RAnalFunction *fcn = r_anal_get_fcn_in(core_->anal, addr, 0);
@ -480,12 +480,12 @@ int QRCore::fcnEndBbs(RVA addr)
return 0; return 0;
} }
QString QRCore::itoa(ut64 num, int rdx) QString IaitoRCore::itoa(ut64 num, int rdx)
{ {
return QString::number(num, 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(); CORE_LOCK();
QByteArray key = k.toUtf8(); 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())); 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(); CORE_LOCK();
QByteArray key = k.toUtf8(); 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()); return r_config_get_i(core_->config, key.constData());
} }
void QRCore::setOptions(QString key) void IaitoRCore::setOptions(QString key)
{ {
QNOTUSED(key); IAITONOTUSED(key);
// va // va
// lowercase // lowercase
@ -522,7 +522,7 @@ void QRCore::setOptions(QString key)
// anal plugin // 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.arch", arch);
config("asm.cpu", cpu); 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()) if (!default_arch.isEmpty())
config("asm.arch", default_arch); config("asm.arch", default_arch);
@ -545,7 +545,7 @@ void QRCore::setDefaultCPU()
config("asm.bits", QString::number(default_bits)); config("asm.bits", QString::number(default_bits));
} }
QString QRCore::assemble(const QString &code) QString IaitoRCore::assemble(const QString &code)
{ {
CORE_LOCK(); CORE_LOCK();
RAsmCode *ac = r_asm_massemble(core_->assembler, code.toUtf8().constData()); RAsmCode *ac = r_asm_massemble(core_->assembler, code.toUtf8().constData());
@ -554,7 +554,7 @@ QString QRCore::assemble(const QString &code)
return hex; return hex;
} }
QString QRCore::disassemble(const QString &hex) QString IaitoRCore::disassemble(const QString &hex)
{ {
CORE_LOCK(); CORE_LOCK();
RAsmCode *ac = r_asm_mdisassemble_hexstr(core_->assembler, hex.toUtf8().constData()); RAsmCode *ac = r_asm_mdisassemble_hexstr(core_->assembler, hex.toUtf8().constData());
@ -563,19 +563,19 @@ QString QRCore::disassemble(const QString &hex)
return code; return code;
} }
QString QRCore::disassembleSingleInstruction(RVA addr) QString IaitoRCore::disassembleSingleInstruction(RVA addr)
{ {
return cmd("pi 1@" + QString::number(addr)).simplified(); return cmd("pi 1@" + QString::number(addr)).simplified();
} }
RAnalFunction *QRCore::functionAt(ut64 addr) RAnalFunction *IaitoRCore::functionAt(ut64 addr)
{ {
CORE_LOCK(); CORE_LOCK();
//return r_anal_fcn_find (core_->anal, addr, addr); //return r_anal_fcn_find (core_->anal, addr, addr);
return r_anal_get_fcn_in(core_->anal, addr, 0); return r_anal_get_fcn_in(core_->anal, addr, 0);
} }
QString QRCore::cmdFunctionAt(QString addr) QString IaitoRCore::cmdFunctionAt(QString addr)
{ {
QString ret; QString ret;
//afi~name:1[1] @ 0x08048e44 //afi~name:1[1] @ 0x08048e44
@ -584,12 +584,12 @@ QString QRCore::cmdFunctionAt(QString addr)
return ret.trimmed(); return ret.trimmed();
} }
QString QRCore::cmdFunctionAt(RVA addr) QString IaitoRCore::cmdFunctionAt(RVA addr)
{ {
return cmdFunctionAt(QString::number(addr)); return cmdFunctionAt(QString::number(addr));
} }
int QRCore::get_size() int IaitoRCore::get_size()
{ {
CORE_LOCK(); CORE_LOCK();
RBinObject *obj = r_bin_get_object(core_->bin); RBinObject *obj = r_bin_get_object(core_->bin);
@ -597,14 +597,14 @@ int QRCore::get_size()
return obj != nullptr ? obj->obj_size : 0; return obj != nullptr ? obj->obj_size : 0;
} }
ulong QRCore::get_baddr() ulong IaitoRCore::get_baddr()
{ {
CORE_LOCK(); CORE_LOCK();
ulong baddr = r_bin_get_baddr(core_->bin); ulong baddr = r_bin_get_baddr(core_->bin);
return baddr; return baddr;
} }
QList<QList<QString>> QRCore::get_exec_sections() QList<QList<QString>> IaitoRCore::get_exec_sections()
{ {
QList<QList<QString>> ret; QList<QList<QString>> ret;
@ -627,29 +627,29 @@ QList<QList<QString>> QRCore::get_exec_sections()
return ret; return ret;
} }
QString QRCore::getOffsetInfo(QString addr) QString IaitoRCore::getOffsetInfo(QString addr)
{ {
return cmd("ao @ " + addr); return cmd("ao @ " + addr);
} }
QString QRCore::getOffsetJump(QString addr) QString IaitoRCore::getOffsetJump(QString addr)
{ {
QString ret = cmd("ao @" + addr + "~jump[1]"); QString ret = cmd("ao @" + addr + "~jump[1]");
return ret; return ret;
} }
QString QRCore::getDecompiledCode(QString addr) QString IaitoRCore::getDecompiledCode(QString addr)
{ {
return cmd("pdc @ " + addr); return cmd("pdc @ " + addr);
} }
QString QRCore::getFileInfo() QString IaitoRCore::getFileInfo()
{ {
QString info = cmd("ij"); QString info = cmd("ij");
return info; return info;
} }
QStringList QRCore::getStats() QStringList IaitoRCore::getStats()
{ {
QStringList stats; QStringList stats;
cmd("fs functions"); cmd("fs functions");
@ -672,7 +672,7 @@ QStringList QRCore::getStats()
return stats; return stats;
} }
QString QRCore::getSimpleGraph(QString function) QString IaitoRCore::getSimpleGraph(QString function)
{ {
// New styles // New styles
QString graph = "graph [bgcolor=invis, splines=polyline];"; QString graph = "graph [bgcolor=invis, splines=polyline];";
@ -694,7 +694,7 @@ QString QRCore::getSimpleGraph(QString function)
return dot; return dot;
} }
void QRCore::getOpcodes() void IaitoRCore::getOpcodes()
{ {
QString opcodes = cmd("?O"); QString opcodes = cmd("?O");
this->opcodes = opcodes.split("\n"); this->opcodes = opcodes.split("\n");
@ -705,7 +705,7 @@ void QRCore::getOpcodes()
this->regs.removeLast(); this->regs.removeLast();
} }
void QRCore::setSettings() void IaitoRCore::setSettings()
{ {
config("scr.color", "false"); config("scr.color", "false");
config("scr.interactive", "false"); config("scr.interactive", "false");
@ -768,7 +768,7 @@ void QRCore::setSettings()
QList<RVA> QRCore::getSeekHistory() QList<RVA> IaitoRCore::getSeekHistory()
{ {
CORE_LOCK(); CORE_LOCK();
QList<RVA> ret; QList<RVA> ret;
@ -782,14 +782,14 @@ QList<RVA> QRCore::getSeekHistory()
QStringList QRCore::getAsmPluginNames() QStringList IaitoRCore::getAsmPluginNames()
{ {
CORE_LOCK(); CORE_LOCK();
RListIter *it; RListIter *it;
QStringList ret; QStringList ret;
RAsmPlugin *ap; RAsmPlugin *ap;
QRListForeach(core_->assembler->plugins, it, RAsmPlugin, ap) IaitoRListForeach(core_->assembler->plugins, it, RAsmPlugin, ap)
{ {
ret << ap->name; ret << ap->name;
} }
@ -797,14 +797,14 @@ QStringList QRCore::getAsmPluginNames()
return ret; return ret;
} }
QStringList QRCore::getAnalPluginNames() QStringList IaitoRCore::getAnalPluginNames()
{ {
CORE_LOCK(); CORE_LOCK();
RListIter *it; RListIter *it;
QStringList ret; QStringList ret;
RAnalPlugin *ap; RAnalPlugin *ap;
QRListForeach(core_->anal->plugins, it, RAnalPlugin, ap) IaitoRListForeach(core_->anal->plugins, it, RAnalPlugin, ap)
{ {
ret << ap->name; ret << ap->name;
} }
@ -813,7 +813,7 @@ QStringList QRCore::getAnalPluginNames()
} }
QStringList QRCore::getProjectNames() QStringList IaitoRCore::getProjectNames()
{ {
CORE_LOCK(); CORE_LOCK();
QStringList ret; QStringList ret;
@ -827,7 +827,7 @@ QStringList QRCore::getProjectNames()
QList<FunctionDescription> QRCore::getAllFunctions() QList<FunctionDescription> IaitoRCore::getAllFunctions()
{ {
CORE_LOCK(); CORE_LOCK();
QList<FunctionDescription> ret; QList<FunctionDescription> ret;
@ -851,7 +851,7 @@ QList<FunctionDescription> QRCore::getAllFunctions()
} }
QList<ImportDescription> QRCore::getAllImports() QList<ImportDescription> IaitoRCore::getAllImports()
{ {
CORE_LOCK(); CORE_LOCK();
QList<ImportDescription> ret; QList<ImportDescription> ret;
@ -878,7 +878,7 @@ QList<ImportDescription> QRCore::getAllImports()
QList<ExportDescription> QRCore::getAllExports() QList<ExportDescription> IaitoRCore::getAllExports()
{ {
CORE_LOCK(); CORE_LOCK();
QList<ExportDescription> ret; QList<ExportDescription> ret;
@ -905,7 +905,7 @@ QList<ExportDescription> QRCore::getAllExports()
} }
QList<SymbolDescription> QRCore::getAllSymbols() QList<SymbolDescription> IaitoRCore::getAllSymbols()
{ {
CORE_LOCK(); CORE_LOCK();
RListIter *it; RListIter *it;
@ -915,7 +915,7 @@ QList<SymbolDescription> QRCore::getAllSymbols()
RBinSymbol *bs; RBinSymbol *bs;
if (core_ && core_->bin && core_->bin->cur && core_->bin->cur->o) 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); QString type = QString(bs->bind) + " " + QString(bs->type);
SymbolDescription symbol; SymbolDescription symbol;
@ -929,7 +929,7 @@ QList<SymbolDescription> QRCore::getAllSymbols()
/* list entrypoints as symbols too */ /* list entrypoints as symbols too */
int n = 0; int n = 0;
RBinAddr *entry; RBinAddr *entry;
QRListForeach(core_->bin->cur->o->entries, it, RBinAddr, entry) IaitoRListForeach(core_->bin->cur->o->entries, it, RBinAddr, entry)
{ {
SymbolDescription symbol; SymbolDescription symbol;
symbol.vaddr = entry->vaddr; symbol.vaddr = entry->vaddr;
@ -944,7 +944,7 @@ QList<SymbolDescription> QRCore::getAllSymbols()
} }
QList<CommentDescription> QRCore::getAllComments(const QString &filterType) QList<CommentDescription> IaitoRCore::getAllComments(const QString &filterType)
{ {
CORE_LOCK(); CORE_LOCK();
QList<CommentDescription> ret; QList<CommentDescription> ret;
@ -967,7 +967,7 @@ QList<CommentDescription> QRCore::getAllComments(const QString &filterType)
return ret; return ret;
} }
QList<RelocDescription> QRCore::getAllRelocs() QList<RelocDescription> IaitoRCore::getAllRelocs()
{ {
CORE_LOCK(); CORE_LOCK();
RListIter *it; RListIter *it;
@ -976,7 +976,7 @@ QList<RelocDescription> QRCore::getAllRelocs()
RBinReloc *br; RBinReloc *br;
if (core_ && core_->bin && core_->bin->cur && core_->bin->cur->o) 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; RelocDescription reloc;
@ -996,7 +996,7 @@ QList<RelocDescription> QRCore::getAllRelocs()
return ret; return ret;
} }
QList<StringDescription> QRCore::getAllStrings() QList<StringDescription> IaitoRCore::getAllStrings()
{ {
CORE_LOCK(); CORE_LOCK();
RListIter *it; RListIter *it;
@ -1005,7 +1005,7 @@ QList<StringDescription> QRCore::getAllStrings()
RBinString *bs; RBinString *bs;
if (core_ && core_->bin && core_->bin->cur && core_->bin->cur->o) 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; StringDescription str;
str.vaddr = bs->vaddr; str.vaddr = bs->vaddr;
@ -1018,7 +1018,7 @@ QList<StringDescription> QRCore::getAllStrings()
} }
QList<FlagspaceDescription> QRCore::getAllFlagspaces() QList<FlagspaceDescription> IaitoRCore::getAllFlagspaces()
{ {
CORE_LOCK(); CORE_LOCK();
QList<FlagspaceDescription> ret; QList<FlagspaceDescription> ret;
@ -1037,7 +1037,7 @@ QList<FlagspaceDescription> QRCore::getAllFlagspaces()
} }
QList<FlagDescription> QRCore::getAllFlags(QString flagspace) QList<FlagDescription> IaitoRCore::getAllFlags(QString flagspace)
{ {
CORE_LOCK(); CORE_LOCK();
QList<FlagDescription> ret; QList<FlagDescription> ret;
@ -1063,7 +1063,7 @@ QList<FlagDescription> QRCore::getAllFlags(QString flagspace)
} }
QList<SectionDescription> QRCore::getAllSections() QList<SectionDescription> IaitoRCore::getAllSections()
{ {
CORE_LOCK(); CORE_LOCK();
QList<SectionDescription> ret; QList<SectionDescription> ret;
@ -1090,7 +1090,7 @@ QList<SectionDescription> QRCore::getAllSections()
return ret; return ret;
} }
QList<XrefDescription> QRCore::getXRefs(RVA addr, bool to, bool whole_function, const QString &filterType) QList<XrefDescription> IaitoRCore::getXRefs(RVA addr, bool to, bool whole_function, const QString &filterType)
{ {
QList<XrefDescription> ret = QList<XrefDescription>(); QList<XrefDescription> ret = QList<XrefDescription>();

View File

@ -1,19 +1,19 @@
#include "qrdisasm.h" #include "iaitordisasm.h"
// This class is not used, created by pancake a long time ago. // This class is not used, created by pancake a long time ago.
// Kept here just because // Kept here just because
QRDisasm::QRDisasm(QRCore *core) : IaitoRDisasm::IaitoRDisasm(IaitoRCore *core) :
core(core), core(core),
db(nullptr) db(nullptr)
{ {
} }
bool QRDisasm::disassembleAt(ut64 addr, QRDisasmOption opt, QRDisasmRow &dr) bool IaitoRDisasm::disassembleAt(ut64 addr, IaitoRDisasmOption opt, IaitoRDisasmRow &dr)
{ {
QNOTUSED(addr); IAITONOTUSED(addr);
QNOTUSED(opt); IAITONOTUSED(opt);
QNOTUSED(dr); IAITONOTUSED(dr);
printf("FUCK\n"); printf("FUCK\n");
return false; return false;

View File

@ -1,11 +1,11 @@
#include "radarewebserver.h" #include "radarewebserver.h"
#include "qrcore.h" #include "iaitorcore.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QProcessEnvironment> #include <QProcessEnvironment>
#include <cassert> #include <cassert>
RadareWebServer::RadareWebServer(QRCore *core) : RadareWebServer::RadareWebServer(IaitoRCore *core) :
core(core), core(core),
started(false) started(false)
{ {

View File

@ -4,13 +4,13 @@
#include <QThread> #include <QThread>
#include <QMutex> #include <QMutex>
class QRCore; class IaitoRCore;
class RadareWebServer class RadareWebServer
{ {
public: public:
explicit RadareWebServer(QRCore *core); explicit RadareWebServer(IaitoRCore *core);
~RadareWebServer(); ~RadareWebServer();
void start(); void start();
@ -19,7 +19,7 @@ public:
bool isStarted() const; bool isStarted() const;
private: private:
QRCore *core; IaitoRCore *core;
bool started; bool started;
}; };

View File

@ -14,7 +14,7 @@
GraphicsBar::GraphicsBar(MainWindow *main, QWidget *parent) : GraphicsBar::GraphicsBar(MainWindow *main, QWidget *parent) :
QToolBar(main) QToolBar(main)
{ {
QNOTUSED(parent); IAITONOTUSED(parent);
setObjectName("codeGraphics"); setObjectName("codeGraphics");
setWindowTitle(tr("Code bar")); setWindowTitle(tr("Code bar"));
@ -44,7 +44,7 @@ GraphicsBar::GraphicsBar(MainWindow *main, QWidget *parent) :
void GraphicsBar::paintEvent(QPaintEvent *event) void GraphicsBar::paintEvent(QPaintEvent *event)
{ {
QNOTUSED(event); IAITONOTUSED(event);
QPainter painter(this); QPainter painter(this);
this->fillData(); this->fillData();

View File

@ -49,7 +49,7 @@ void CommentsWidget::refresh()
void CommentsWidget::on_commentsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) void CommentsWidget::on_commentsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
{ {
QNOTUSED(column); IAITONOTUSED(column);
// Get offset and name of item double clicked // Get offset and name of item double clicked
CommentDescription comment = item->data(0, Qt::UserRole).value<CommentDescription>(); CommentDescription comment = item->data(0, Qt::UserRole).value<CommentDescription>();

View File

@ -2,7 +2,7 @@
#include "ui_consolewidget.h" #include "ui_consolewidget.h"
#include "helpers.h" #include "helpers.h"
#include "qrcore.h" #include "iaitorcore.h"
#include <QScrollBar> #include <QScrollBar>
#include <QMenu> #include <QMenu>
@ -92,7 +92,7 @@ static bool isForbidden(const QString &input)
ConsoleWidget::ConsoleWidget(QRCore *core, QWidget *parent) : ConsoleWidget::ConsoleWidget(IaitoRCore *core, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::ConsoleWidget), ui(new Ui::ConsoleWidget),
core(core), core(core),

View File

@ -3,7 +3,7 @@
#include <QWidget> #include <QWidget>
class QRCore; class IaitoRCore;
class QAction; class QAction;
@ -18,7 +18,7 @@ class ConsoleWidget : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit ConsoleWidget(QRCore *core, QWidget *parent = 0); explicit ConsoleWidget(IaitoRCore *core, QWidget *parent = 0);
~ConsoleWidget(); ~ConsoleWidget();
void addOutput(const QString &msg); void addOutput(const QString &msg);
@ -51,7 +51,7 @@ private:
void invalidateHistoryPosition(); void invalidateHistoryPosition();
Ui::ConsoleWidget *ui; Ui::ConsoleWidget *ui;
QRCore *core; IaitoRCore *core;
QList<QAction *> actions; QList<QAction *> actions;
bool debugOutputEnabled; bool debugOutputEnabled;
int maxHistoryEntries; int maxHistoryEntries;

View File

@ -72,9 +72,10 @@ void Dashboard::updateContents()
this->ui->compiledEdit->setText(item2["compiled"].toString()); this->ui->compiledEdit->setText(item2["compiled"].toString());
this->ui->bitsEdit->setText(QString::number(item2["bits"].toDouble())); 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); QString relro = item2["relro"].toString().split(" ").at(0);
relro[0]=relro[0].toUpper(); relro[0] = relro[0].toUpper();
this->ui->relroEdit->setText(relro); this->ui->relroEdit->setText(relro);
} }

View File

@ -4,7 +4,7 @@
#include <QAbstractListModel> #include <QAbstractListModel>
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include "qrcore.h" #include "iaitorcore.h"
#include "dockwidget.h" #include "dockwidget.h"
class MainWindow; class MainWindow;

View File

@ -167,7 +167,7 @@ void FlagsWidget::on_flagsTreeView_doubleClicked(const QModelIndex &index)
void FlagsWidget::on_flagspaceCombo_currentTextChanged(const QString &arg1) void FlagsWidget::on_flagspaceCombo_currentTextChanged(const QString &arg1)
{ {
QNOTUSED(arg1); IAITONOTUSED(arg1);
refreshFlags(); refreshFlags();
} }

View File

@ -1,7 +1,7 @@
#ifndef FLAGSWIDGET_H #ifndef FLAGSWIDGET_H
#define FLAGSWIDGET_H #define FLAGSWIDGET_H
#include "qrcore.h" #include "iaitorcore.h"
#include "dockwidget.h" #include "dockwidget.h"
#include <QAbstractItemModel> #include <QAbstractItemModel>
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>

View File

@ -2,7 +2,7 @@
#define FUNCTIONSWIDGET_H #define FUNCTIONSWIDGET_H
#include "dockwidget.h" #include "dockwidget.h"
#include "qrcore.h" #include "iaitorcore.h"
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include <QTreeView> #include <QTreeView>

View File

@ -1,7 +1,7 @@
#ifndef MEMORYWIDGET_H #ifndef MEMORYWIDGET_H
#define MEMORYWIDGET_H #define MEMORYWIDGET_H
#include "qrcore.h" #include "iaitorcore.h"
#include "highlighter.h" #include "highlighter.h"
#include "hexascii_highlighter.h" #include "hexascii_highlighter.h"
#include "hexhighlighter.h" #include "hexhighlighter.h"

View File

@ -225,7 +225,7 @@ void Notepad::on_searchEdit_returnPressed()
void Notepad::on_searchEdit_textEdited(const QString &arg1) void Notepad::on_searchEdit_textEdited(const QString &arg1)
{ {
QNOTUSED(arg1); IAITONOTUSED(arg1);
QString searchString = ui->searchEdit->text(); QString searchString = ui->searchEdit->text();
QTextDocument *document = ui->notepadTextEdit->document(); 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) void Notepad::on_searchEdit_textChanged(const QString &arg1)
{ {
QNOTUSED(arg1); IAITONOTUSED(arg1);
QString searchString = ui->searchEdit->text(); QString searchString = ui->searchEdit->text();
QTextDocument *document = ui->notepadTextEdit->document(); QTextDocument *document = ui->notepadTextEdit->document();

View File

@ -46,7 +46,7 @@
#define M_PI 3.1415927 #define M_PI 3.1415927
#endif #endif
#include "qrcore.h" #include "iaitorcore.h"
#include "pieview.h" #include "pieview.h"
PieView::PieView(QWidget *parent) PieView::PieView(QWidget *parent)
@ -486,7 +486,7 @@ void PieView::scrollTo(const QModelIndex &index, ScrollHint)
void PieView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) void PieView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)
{ {
QNOTUSED(command); IAITONOTUSED(command);
// Use content widget coordinates because we will use the itemRegion() // Use content widget coordinates because we will use the itemRegion()
// function to check for intersections. // function to check for intersections.

View File

@ -39,7 +39,7 @@ void RelocsWidget::refresh()
void RelocsWidget::on_relocsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) void RelocsWidget::on_relocsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
{ {
QNOTUSED(column); IAITONOTUSED(column);
// Get offset and name of item double clicked // Get offset and name of item double clicked
RelocDescription reloc = item->data(0, Qt::UserRole).value<RelocDescription>(); RelocDescription reloc = item->data(0, Qt::UserRole).value<RelocDescription>();

View File

@ -11,7 +11,7 @@ SectionsWidget::SectionsWidget(MainWindow *main, QWidget *parent) :
QSplitter(main), QSplitter(main),
main(main) main(main)
{ {
QNOTUSED(parent); IAITONOTUSED(parent);
setupViews(); setupViews();
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);

View File

@ -38,7 +38,7 @@ void StringsWidget::refresh()
void StringsWidget::on_stringsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) void StringsWidget::on_stringsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
{ {
QNOTUSED(column); IAITONOTUSED(column);
// Get offset and name of item double clicked // Get offset and name of item double clicked
// TODO: use this info to change disasm contents // TODO: use this info to change disasm contents

View File

@ -36,7 +36,7 @@ void SymbolsWidget::refresh()
void SymbolsWidget::on_symbolsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) void SymbolsWidget::on_symbolsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
{ {
QNOTUSED(column); IAITONOTUSED(column);
// Get offset and name of item double clicked // Get offset and name of item double clicked
SymbolDescription symbol = item->data(0, Qt::UserRole).value<SymbolDescription>(); SymbolDescription symbol = item->data(0, Qt::UserRole).value<SymbolDescription>();