Skip to content

Commit

Permalink
Renaming QRCore and QRDisasm to IaitoRCore and IaitoRDisasm (hteso#187)
Browse files Browse the repository at this point in the history
* Renaming QRCore and QRDisasm to IaitoRCore and IaitoRDisasm

* Included AStyle formatting changes
  • Loading branch information
d0vine authored and mrexodia committed Jul 2, 2017
1 parent 6d90a98 commit 771eccc
Show file tree
Hide file tree
Showing 31 changed files with 147 additions and 146 deletions.
4 changes: 2 additions & 2 deletions src/analthread.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "analthread.h"
#include "qrcore.h"
#include "iaitorcore.h"
#include <QDebug>

AnalThread::AnalThread(QWidget *parent) :
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/analthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <QThread>

class QRCore;
class IaitoRCore;

class AnalThread : public QThread
{
Expand All @@ -12,15 +12,15 @@ class AnalThread : public QThread
explicit AnalThread(QWidget *parent = 0);
~AnalThread();

void start(QRCore *core, int level);
void start(IaitoRCore *core, int level);

protected:
void run();

using QThread::start;

private:
QRCore *core;
IaitoRCore *core;
int level;
};

Expand Down
4 changes: 2 additions & 2 deletions src/dialogs/xrefsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void XrefsDialog::fillRefs(QList<XrefDescription> refs, QList<XrefDescription> x

void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
{
QNOTUSED(column);
IAITONOTUSED(column);

XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>();
RAnalFunction *fcn = this->main->core->functionAt(xref.to);
Expand All @@ -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<XrefDescription>();
RAnalFunction *fcn = this->main->core->functionAt(xref.from);
Expand Down
2 changes: 1 addition & 1 deletion src/dialogs/xrefsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define XREFSDIALOG_H

#include "highlighter.h"
#include "qrcore.h"
#include "iaitorcore.h"

#include <QDialog>
#include <QTreeWidgetItem>
Expand Down
6 changes: 3 additions & 3 deletions src/iaito.pro
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ HEADERS += \
newfiledialog.h \
optionsdialog.h \
highlighter.h \
qrcore.h \
createnewdialog.h \
hexascii_highlighter.h \
widgets/pieview.h \
Expand All @@ -92,7 +91,6 @@ HEADERS += \
widgets/flagswidget.h \
widgets/memorywidget.h \
widgets/exportswidget.h \
qrdisasm.h \
widgets/sdbdock.h \
analthread.h \
dialogs/commentsdialog.h \
Expand All @@ -106,7 +104,9 @@ HEADERS += \
widgets/dockwidget.h \
widgets/consolewidget.h \
radarewebserver.h \
settings.h
settings.h \
iaitorcore.h \
iaitordisasm.h

FORMS += \
mainwindow.ui \
Expand Down
16 changes: 8 additions & 8 deletions src/qrcore.h → src/iaitorcore.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef QRCORE_H
#define QRCORE_H
#ifndef IAITORCORE_H
#define IAITORCORE_H

#include <QMap>
#include <QDebug>
Expand All @@ -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)
Expand All @@ -42,7 +42,7 @@ class RCoreLocked
RCore *operator->() const;
};

#define QNOTUSED(x) do { (void)(x); } while ( 0 );
#define IAITONOTUSED(x) do { (void)(x); } while ( 0 );

typedef ut64 RVA;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -255,4 +255,4 @@ public slots:
RCore *core_;
};

#endif // QRCORE_H
#endif // IAITORCORE_H
26 changes: 13 additions & 13 deletions src/qrdisasm.h → src/iaitordisasm.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#ifndef QRDISASM_H
#define QRDISASM_H
#ifndef IAITORDISASM_H
#define IAITORDISASM_H

#include <qrcore.h>
#include <iaitorcore.h>

enum QRDisasmDataType
enum IaitoRDisasmDataType
{
STRING = 'z',
STRUCT = 's',
DATA = 'd',

};

enum QRDisasmOption
enum IaitoRDisasmOption
{
DWARF = 1 << 1,
REFS = 1 << 2,
Expand All @@ -20,10 +20,10 @@ enum QRDisasmOption
COMMENT = 1 << 5,
};

class QRDisasmRow
class IaitoRDisasmRow
{
private:
QRCore *core;
IaitoRCore *core;
public:
ut64 vaddr;
ut64 paddr;
Expand All @@ -46,7 +46,7 @@ class QRDisasmRow
QString esil;

// if data
QRDisasmDataType datatype;
IaitoRDisasmDataType datatype;
QString dataopt; // struct name, aliased name, string, etc
// data type
// string/struct/hex/word
Expand All @@ -60,17 +60,17 @@ class QRDisasmRow
};


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
2 changes: 1 addition & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <QMainWindow>
#include <QList>

class QRCore;
class IaitoRCore;
class DockWidget;
class Omnibar;
class MemoryWidget;
Expand Down Expand Up @@ -44,7 +44,7 @@ class MainWindow : public QMainWindow
Q_OBJECT

public:
QRCore *core;
IaitoRCore *core;
MemoryWidget *memoryDock;
Notepad *notepadDock;

Expand Down
2 changes: 1 addition & 1 deletion src/newfiledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const int NewFileDialog::MaxRecentFiles;

static QColor getColorFor(QString str, int pos)
{
QNOTUSED(str);
IAITONOTUSED(str);

QList<QColor> Colors;
Colors << QColor(29, 188, 156); // Turquoise
Expand Down
2 changes: 1 addition & 1 deletion src/optionsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <QDialog>
#include <QStringList>

#include "qrcore.h"
#include "iaitorcore.h"
#include "analthread.h"

class MainWindow;
Expand Down
Loading

0 comments on commit 771eccc

Please sign in to comment.