mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
Renamed Iaito to Cutter
This commit is contained in:
parent
e9f9add9b0
commit
821602eabd
22
README.md
22
README.md
@ -1,23 +1,17 @@
|
|||||||
# Iaitō [![Build Status](https://travis-ci.org/hteso/iaito.svg?branch=master)](https://travis-ci.org/hteso/iaito)
|
# Cutter [![Build Status](https://travis-ci.org/radareorg/cutter.svg?branch=master)](https://travis-ci.org/radareorg/cutter)
|
||||||
|
|
||||||
> The GUI that ~~radare2~~ humans deserve
|
A Qt and C++ GUI for radare2 reverse engineering framework (originally Iaito)
|
||||||
|
|
||||||
A Qt and C++ GUI for radare2 reverse engineering framework
|
|
||||||
|
|
||||||
## Screenshot
|
## Screenshot
|
||||||
|
|
||||||
![Screenshot](https://raw.githubusercontent.com/hteso/iaito/master/Screenshots/Screenshot.png)
|
![Screenshot](https://raw.githubusercontent.com/radareorg/cutter/master/Screenshots/Screenshot.png)
|
||||||
|
|
||||||
## Disclaimer
|
## Disclaimer
|
||||||
|
|
||||||
Iaitō is not aimed at existing radare2 users, it is focused on those whose are not yet radare2 users because of the learning curve, they don't like CLI applications or the difficulty/instability of radare2.
|
Cutter is not aimed at existing radare2 users, it is focused on those whose are not yet radare2 users because of the learning curve, they don't like CLI applications or the difficulty/instability of radare2.
|
||||||
|
|
||||||
**IMPORTANT:** the current status is **highly unstable**, it is an alpha version aimed for developers. Users please wait for the first stable release with installers.
|
**IMPORTANT:** the current status is **highly unstable**, it is an alpha version aimed for developers. Users please wait for the first stable release with installers.
|
||||||
|
|
||||||
## The code sucks
|
|
||||||
|
|
||||||
Yes, the code sucks. Hopefully we will be able to remove this statement from the README one day, but I had never coded Qt nor C++ until I started Iaitō, so obviously the code is ugly and not well designed.
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- **Radare2**: Make sure that, when cloning the project, you use `git clone --recurse-submodules` or run `git submodule update --init` to clone the correct radare2 version. Then execute the following command in the radare2 folder:
|
- **Radare2**: Make sure that, when cloning the project, you use `git clone --recurse-submodules` or run `git submodule update --init` to clone the correct radare2 version. Then execute the following command in the radare2 folder:
|
||||||
@ -25,22 +19,22 @@ Yes, the code sucks. Hopefully we will be able to remove this statement from the
|
|||||||
sys/install.sh
|
sys/install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
- QtCreator and Qt: Right now Iaitō uses Qt 5.9.1, you will need the latest QtCreator and Qt added during the installation:
|
- QtCreator and Qt: Right now *cutter* uses Qt 5.9.1, you will need the latest QtCreator and Qt added during the installation:
|
||||||
- Download: https://www.qt.io/ide/
|
- Download: https://www.qt.io/ide/
|
||||||
- Add Qt 5.9.1: http://doc.qt.io/qtcreator/creator-project-qmake.html
|
- Add Qt 5.9.1: http://doc.qt.io/qtcreator/creator-project-qmake.html
|
||||||
|
|
||||||
## Platforms
|
## Platforms
|
||||||
|
|
||||||
Iaitō is developed and tested in OS X, Linux and [Windows](https://github.com/hteso/iaito/wiki/Compiling-on-Windows). The first release for users will include installers for all three platforms.
|
Cutter is developed on OS X, Linux and Windows. The first release for users will include installers for all three platforms.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Proper documentation and website will be created before the first release.
|
Proper documentation and website will be created before the first release.
|
||||||
|
|
||||||
Roadmap information for developers can be found [here](https://github.com/hteso/iaito/wiki/Roadmap).
|
Roadmap information for developers can be found [here](https://github.com/radareorg/cutter/wiki/Roadmap).
|
||||||
|
|
||||||
## Help
|
## Help
|
||||||
|
|
||||||
Right now the best place to obtain help from Iaitō developers and community is joining this telegram group:
|
Right now the best place to obtain help from *cutter* developers and community is joining this telegram group:
|
||||||
|
|
||||||
- https://t.me/iaito
|
- https://t.me/iaito
|
||||||
|
@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1)
|
|||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
include(DisallowInSource)
|
include(DisallowInSource)
|
||||||
|
|
||||||
project(Iaito VERSION 1.0.0)
|
project(cutter VERSION 1.0.0)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui WebEngine WebEngineWidgets
|
|||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# use radare2 libraries from submodule on windows
|
# use radare2 libraries from submodule on windows
|
||||||
set(IAITO_WIN32_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../iaito_win32")
|
set(IAITO_WIN32_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../cutter_win32")
|
||||||
list(APPEND CMAKE_PREFIX_PATH "${IAITO_WIN32_DIR}")
|
list(APPEND CMAKE_PREFIX_PATH "${IAITO_WIN32_DIR}")
|
||||||
|
|
||||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64 bit
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64 bit
|
||||||
@ -41,30 +41,30 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Parse iaito.pro to get filenames
|
# Parse cutter.pro to get filenames
|
||||||
include(QMakeProParse)
|
include(QMakeProParse)
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/iaito.pro"
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cutter.pro"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/iaito.pro"
|
"${CMAKE_CURRENT_BINARY_DIR}/cutter.pro"
|
||||||
COPYONLY) # trigger reconfigure if iaito.pro changes
|
COPYONLY) # trigger reconfigure if cutter.pro changes
|
||||||
parse_qmake_pro("${CMAKE_CURRENT_BINARY_DIR}/iaito.pro" IAITO_PRO)
|
parse_qmake_pro("${CMAKE_CURRENT_BINARY_DIR}/cutter.pro" IAITO_PRO)
|
||||||
set(SOURCE_FILES ${IAITO_PRO_SOURCES})
|
set(SOURCE_FILES ${IAITO_PRO_SOURCES})
|
||||||
set(HEADER_FILES ${IAITO_PRO_HEADERS})
|
set(HEADER_FILES ${IAITO_PRO_HEADERS})
|
||||||
set(UI_FILES ${IAITO_PRO_FORMS})
|
set(UI_FILES ${IAITO_PRO_FORMS})
|
||||||
set(QRC_FILES ${IAITO_PRO_RESOURCES})
|
set(QRC_FILES ${IAITO_PRO_RESOURCES})
|
||||||
|
|
||||||
message(STATUS "sources from iaito.pro: ${SOURCE_FILES}")
|
message(STATUS "sources from cutter.pro: ${SOURCE_FILES}")
|
||||||
message(STATUS "headers from iaito.pro: ${HEADER_FILES}")
|
message(STATUS "headers from cutter.pro: ${HEADER_FILES}")
|
||||||
message(STATUS "forms from iaito.pro: ${UI_FILES}")
|
message(STATUS "forms from cutter.pro: ${UI_FILES}")
|
||||||
message(STATUS "resources from iaito.pro: ${QRC_FILES}")
|
message(STATUS "resources from cutter.pro: ${QRC_FILES}")
|
||||||
|
|
||||||
|
|
||||||
set(IAITO_VERSION_SUFFIX "-dev")
|
set(IAITO_VERSION_SUFFIX "-dev")
|
||||||
set(IAITO_VERSION_FULL "${PROJECT_VERSION}${IAITO_VERSION_SUFFIX}")
|
set(IAITO_VERSION_FULL "${PROJECT_VERSION}${IAITO_VERSION_SUFFIX}")
|
||||||
message(STATUS "Building Iaito version ${IAITO_VERSION_FULL}")
|
message(STATUS "Building Cutter version ${IAITO_VERSION_FULL}")
|
||||||
add_definitions("-DAPP_VERSION=\"${IAITO_VERSION_FULL}\"")
|
add_definitions("-DAPP_VERSION=\"${IAITO_VERSION_FULL}\"")
|
||||||
|
|
||||||
|
|
||||||
add_executable(iaito ${UI_FILES} ${QRC_FILES} ${SOURCE_FILES} ${HEADER_FILES})
|
add_executable(cutter ${UI_FILES} ${QRC_FILES} ${SOURCE_FILES} ${HEADER_FILES})
|
||||||
qt5_use_modules(iaito Core Widgets Gui WebEngine WebEngineWidgets)
|
qt5_use_modules(cutter Core Widgets Gui WebEngine WebEngineWidgets)
|
||||||
target_link_libraries(iaito ${RADARE2_LIBRARIES})
|
target_link_libraries(cutter ${RADARE2_LIBRARIES})
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "analthread.h"
|
|
||||||
#include "iaitorcore.h"
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include "cutter.h"
|
||||||
|
#include "analthread.h"
|
||||||
|
|
||||||
AnalThread::AnalThread(QWidget *parent) :
|
AnalThread::AnalThread(QWidget *parent) :
|
||||||
QThread(parent),
|
QThread(parent),
|
||||||
@ -18,7 +18,7 @@ AnalThread::~AnalThread()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalThread::start(IaitoRCore *core, int level, QList<QString> advanced)
|
void AnalThread::start(CutterCore *core, int level, QList<QString> advanced)
|
||||||
{
|
{
|
||||||
this->core = core;
|
this->core = core;
|
||||||
this->level = level;
|
this->level = level;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
class IaitoRCore;
|
class CutterCore;
|
||||||
|
|
||||||
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(IaitoRCore *core, int level, QList<QString> advanced);
|
void start(CutterCore *core, int level, QList<QString> advanced);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void run();
|
void run();
|
||||||
@ -20,7 +20,7 @@ protected:
|
|||||||
using QThread::start;
|
using QThread::start;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IaitoRCore *core;
|
CutterCore *core;
|
||||||
int level;
|
int level;
|
||||||
QList<QString> advanced;
|
QList<QString> advanced;
|
||||||
};
|
};
|
||||||
|
BIN
src/cutter
Executable file
BIN
src/cutter
Executable file
Binary file not shown.
@ -1,8 +1,8 @@
|
|||||||
#include "iaitorcore.h"
|
|
||||||
#include "sdb.h"
|
|
||||||
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
#include "cutter.h"
|
||||||
|
#include "sdb.h"
|
||||||
|
|
||||||
|
|
||||||
#define DB this->db
|
#define DB this->db
|
||||||
|
|
||||||
@ -33,14 +33,14 @@ RCore *RCoreLocked::operator->() const
|
|||||||
return core;
|
return core;
|
||||||
}
|
}
|
||||||
|
|
||||||
RCoreLocked IaitoRCore::core() const
|
RCoreLocked CutterCore::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_)
|
||||||
|
|
||||||
IaitoRCore::IaitoRCore(QObject *parent) :
|
CutterCore::CutterCore(QObject *parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
r_cons_new(); // initialize console
|
r_cons_new(); // initialize console
|
||||||
@ -67,7 +67,7 @@ IaitoRCore::IaitoRCore(QObject *parent) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int IaitoRCore::getCycloComplex(ut64 addr)
|
int CutterCore::getCycloComplex(ut64 addr)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QString ret = "";
|
QString ret = "";
|
||||||
@ -84,7 +84,7 @@ int IaitoRCore::getCycloComplex(ut64 addr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int IaitoRCore::getFcnSize(ut64 addr)
|
int CutterCore::getFcnSize(ut64 addr)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QString ret = "";
|
QString ret = "";
|
||||||
@ -103,7 +103,7 @@ int IaitoRCore::getFcnSize(ut64 addr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QString> IaitoRCore::sdbList(QString path)
|
QList<QString> CutterCore::sdbList(QString path)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<QString> list = QList<QString>();
|
QList<QString> list = QList<QString>();
|
||||||
@ -121,7 +121,7 @@ QList<QString> IaitoRCore::sdbList(QString path)
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QString> IaitoRCore::sdbListKeys(QString path)
|
QList<QString> CutterCore::sdbListKeys(QString path)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<QString> list = QList<QString>();
|
QList<QString> list = QList<QString>();
|
||||||
@ -140,7 +140,7 @@ QList<QString> IaitoRCore::sdbListKeys(QString path)
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::sdbGet(QString path, QString key)
|
QString CutterCore::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 IaitoRCore::sdbGet(QString path, QString key)
|
|||||||
return QString("");
|
return QString("");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IaitoRCore::sdbSet(QString path, QString key, QString val)
|
bool CutterCore::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,19 +161,19 @@ bool IaitoRCore::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);
|
||||||
}
|
}
|
||||||
|
|
||||||
IaitoRCore::~IaitoRCore()
|
CutterCore::~CutterCore()
|
||||||
{
|
{
|
||||||
r_core_free(this->core_);
|
r_core_free(this->core_);
|
||||||
r_cons_free();
|
r_cons_free();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::sanitizeStringForCommand(QString s)
|
QString CutterCore::sanitizeStringForCommand(QString s)
|
||||||
{
|
{
|
||||||
static const QRegExp regexp(";|@");
|
static const QRegExp regexp(";|@");
|
||||||
return s.replace(regexp, "_");
|
return s.replace(regexp, "_");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::cmd(const QString &str)
|
QString CutterCore::cmd(const QString &str)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ QString IaitoRCore::cmd(const QString &str)
|
|||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonDocument IaitoRCore::cmdj(const QString &str)
|
QJsonDocument CutterCore::cmdj(const QString &str)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QByteArray cmd = str.toUtf8();
|
QByteArray cmd = str.toUtf8();
|
||||||
@ -208,10 +208,10 @@ QJsonDocument IaitoRCore::cmdj(const QString &str)
|
|||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IaitoRCore::loadFile(QString path, uint64_t loadaddr, uint64_t mapaddr, bool rw, int va, int idx, bool loadbin)
|
bool CutterCore::loadFile(QString path, uint64_t loadaddr, uint64_t mapaddr, bool rw, int va, int idx, bool loadbin)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(loadaddr);
|
CUTTERNOTUSED(loadaddr);
|
||||||
IAITONOTUSED(idx);
|
CUTTERNOTUSED(idx);
|
||||||
|
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
RCoreFile *f;
|
RCoreFile *f;
|
||||||
@ -292,7 +292,7 @@ bool IaitoRCore::loadFile(QString path, uint64_t loadaddr, uint64_t mapaddr, boo
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IaitoRCore::analyze(int level, QList<QString> advanced)
|
void CutterCore::analyze(int level, QList<QString> advanced)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
/*
|
/*
|
||||||
@ -317,13 +317,13 @@ void IaitoRCore::analyze(int level, QList<QString> advanced)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IaitoRCore::renameFunction(QString prev_name, QString new_name)
|
void CutterCore::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 IaitoRCore::setComment(RVA addr, QString cmt)
|
void CutterCore::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));
|
||||||
@ -331,14 +331,14 @@ void IaitoRCore::setComment(RVA addr, QString cmt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IaitoRCore::delComment(ut64 addr)
|
void CutterCore::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>>> IaitoRCore::getNestedComments()
|
QMap<QString, QList<QList<QString>>> CutterCore::getNestedComments()
|
||||||
{
|
{
|
||||||
QMap<QString, QList<QList<QString>>> ret;
|
QMap<QString, QList<QList<QString>>> ret;
|
||||||
QString comments = cmd("CC~CCu");
|
QString comments = cmd("CC~CCu");
|
||||||
@ -358,7 +358,7 @@ QMap<QString, QList<QList<QString>>> IaitoRCore::getNestedComments()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IaitoRCore::seek(QString addr)
|
void CutterCore::seek(QString addr)
|
||||||
{
|
{
|
||||||
if (addr.length() > 0)
|
if (addr.length() > 0)
|
||||||
seek(this->math(addr.toUtf8().constData()));
|
seek(this->math(addr.toUtf8().constData()));
|
||||||
@ -366,13 +366,13 @@ void IaitoRCore::seek(QString addr)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void IaitoRCore::seek(ut64 offset)
|
void CutterCore::seek(ut64 offset)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
r_core_seek(this->core_, offset, true);
|
r_core_seek(this->core_, offset, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IaitoRCore::tryFile(QString path, bool rw)
|
bool CutterCore::tryFile(QString path, bool rw)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
RCoreFile *cf;
|
RCoreFile *cf;
|
||||||
@ -401,7 +401,7 @@ bool IaitoRCore::tryFile(QString path, bool rw)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
QList<QString> IaitoRCore::getList(const QString &type, const QString &subtype)
|
QList<QString> CutterCore::getList(const QString &type, const QString &subtype)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<QString> ret = QList<QString>();
|
QList<QString> ret = QList<QString>();
|
||||||
@ -437,13 +437,13 @@ QList<QString> IaitoRCore::getList(const QString &type, const QString &subtype)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ut64 IaitoRCore::math(const QString &expr)
|
ut64 CutterCore::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 IaitoRCore::fcnCyclomaticComplexity(ut64 addr)
|
int CutterCore::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);
|
||||||
@ -452,7 +452,7 @@ int IaitoRCore::fcnCyclomaticComplexity(ut64 addr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IaitoRCore::fcnBasicBlockCount(ut64 addr)
|
int CutterCore::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);
|
||||||
@ -464,7 +464,7 @@ int IaitoRCore::fcnBasicBlockCount(ut64 addr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IaitoRCore::fcnEndBbs(RVA addr)
|
int CutterCore::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);
|
||||||
@ -481,12 +481,12 @@ int IaitoRCore::fcnEndBbs(RVA addr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::itoa(ut64 num, int rdx)
|
QString CutterCore::itoa(ut64 num, int rdx)
|
||||||
{
|
{
|
||||||
return QString::number(num, rdx);
|
return QString::number(num, rdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::config(const QString &k, const QString &v)
|
QString CutterCore::config(const QString &k, const QString &v)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QByteArray key = k.toUtf8();
|
QByteArray key = k.toUtf8();
|
||||||
@ -498,7 +498,7 @@ QString IaitoRCore::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 IaitoRCore::config(const QString &k, int v)
|
int CutterCore::config(const QString &k, int v)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QByteArray key = k.toUtf8();
|
QByteArray key = k.toUtf8();
|
||||||
@ -510,23 +510,23 @@ int IaitoRCore::config(const QString &k, int v)
|
|||||||
return r_config_get_i(core_->config, key.constData());
|
return r_config_get_i(core_->config, key.constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
int IaitoRCore::getConfigi(const QString &k)
|
int CutterCore::getConfigi(const QString &k)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QByteArray key = k.toUtf8();
|
QByteArray key = k.toUtf8();
|
||||||
return r_config_get_i(core_->config, key.constData());
|
return r_config_get_i(core_->config, key.constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::getConfig(const QString &k)
|
QString CutterCore::getConfig(const QString &k)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QByteArray key = k.toUtf8();
|
QByteArray key = k.toUtf8();
|
||||||
return QString(r_config_get(core_->config, key.constData()));
|
return QString(r_config_get(core_->config, key.constData()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IaitoRCore::setOptions(QString key)
|
void CutterCore::setOptions(QString key)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(key);
|
CUTTERNOTUSED(key);
|
||||||
|
|
||||||
// va
|
// va
|
||||||
// lowercase
|
// lowercase
|
||||||
@ -537,7 +537,7 @@ void IaitoRCore::setOptions(QString key)
|
|||||||
// anal plugin
|
// anal plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
void IaitoRCore::setCPU(QString arch, QString cpu, int bits, bool temporary)
|
void CutterCore::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);
|
||||||
@ -550,7 +550,7 @@ void IaitoRCore::setCPU(QString arch, QString cpu, int bits, bool temporary)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IaitoRCore::setDefaultCPU()
|
void CutterCore::setDefaultCPU()
|
||||||
{
|
{
|
||||||
if (!default_arch.isEmpty())
|
if (!default_arch.isEmpty())
|
||||||
config("asm.arch", default_arch);
|
config("asm.arch", default_arch);
|
||||||
@ -560,7 +560,7 @@ void IaitoRCore::setDefaultCPU()
|
|||||||
config("asm.bits", QString::number(default_bits));
|
config("asm.bits", QString::number(default_bits));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::assemble(const QString &code)
|
QString CutterCore::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());
|
||||||
@ -569,7 +569,7 @@ QString IaitoRCore::assemble(const QString &code)
|
|||||||
return hex;
|
return hex;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::disassemble(const QString &hex)
|
QString CutterCore::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());
|
||||||
@ -578,19 +578,19 @@ QString IaitoRCore::disassemble(const QString &hex)
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::disassembleSingleInstruction(RVA addr)
|
QString CutterCore::disassembleSingleInstruction(RVA addr)
|
||||||
{
|
{
|
||||||
return cmd("pi 1@" + QString::number(addr)).simplified();
|
return cmd("pi 1@" + QString::number(addr)).simplified();
|
||||||
}
|
}
|
||||||
|
|
||||||
RAnalFunction *IaitoRCore::functionAt(ut64 addr)
|
RAnalFunction *CutterCore::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 IaitoRCore::cmdFunctionAt(QString addr)
|
QString CutterCore::cmdFunctionAt(QString addr)
|
||||||
{
|
{
|
||||||
QString ret;
|
QString ret;
|
||||||
//afi~name:1[1] @ 0x08048e44
|
//afi~name:1[1] @ 0x08048e44
|
||||||
@ -599,12 +599,12 @@ QString IaitoRCore::cmdFunctionAt(QString addr)
|
|||||||
return ret.trimmed();
|
return ret.trimmed();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::cmdFunctionAt(RVA addr)
|
QString CutterCore::cmdFunctionAt(RVA addr)
|
||||||
{
|
{
|
||||||
return cmdFunctionAt(QString::number(addr));
|
return cmdFunctionAt(QString::number(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
int IaitoRCore::get_size()
|
int CutterCore::get_size()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
RBinObject *obj = r_bin_get_object(core_->bin);
|
RBinObject *obj = r_bin_get_object(core_->bin);
|
||||||
@ -612,14 +612,14 @@ int IaitoRCore::get_size()
|
|||||||
return obj != nullptr ? obj->obj_size : 0;
|
return obj != nullptr ? obj->obj_size : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ulong IaitoRCore::get_baddr()
|
ulong CutterCore::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>> IaitoRCore::get_exec_sections()
|
QList<QList<QString>> CutterCore::get_exec_sections()
|
||||||
{
|
{
|
||||||
QList<QList<QString>> ret;
|
QList<QList<QString>> ret;
|
||||||
|
|
||||||
@ -642,29 +642,29 @@ QList<QList<QString>> IaitoRCore::get_exec_sections()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::getOffsetInfo(QString addr)
|
QString CutterCore::getOffsetInfo(QString addr)
|
||||||
{
|
{
|
||||||
return cmd("ao @ " + addr);
|
return cmd("ao @ " + addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::getOffsetJump(QString addr)
|
QString CutterCore::getOffsetJump(QString addr)
|
||||||
{
|
{
|
||||||
QString ret = cmd("ao @" + addr + "~jump[1]");
|
QString ret = cmd("ao @" + addr + "~jump[1]");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::getDecompiledCode(QString addr)
|
QString CutterCore::getDecompiledCode(QString addr)
|
||||||
{
|
{
|
||||||
return cmd("pdc @ " + addr);
|
return cmd("pdc @ " + addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::getFileInfo()
|
QString CutterCore::getFileInfo()
|
||||||
{
|
{
|
||||||
QString info = cmd("ij");
|
QString info = cmd("ij");
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList IaitoRCore::getStats()
|
QStringList CutterCore::getStats()
|
||||||
{
|
{
|
||||||
QStringList stats;
|
QStringList stats;
|
||||||
cmd("fs functions");
|
cmd("fs functions");
|
||||||
@ -687,7 +687,7 @@ QStringList IaitoRCore::getStats()
|
|||||||
return stats;
|
return stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IaitoRCore::getSimpleGraph(QString function)
|
QString CutterCore::getSimpleGraph(QString function)
|
||||||
{
|
{
|
||||||
// New styles
|
// New styles
|
||||||
QString graph = "graph [bgcolor=invis, splines=polyline];";
|
QString graph = "graph [bgcolor=invis, splines=polyline];";
|
||||||
@ -709,7 +709,7 @@ QString IaitoRCore::getSimpleGraph(QString function)
|
|||||||
return dot;
|
return dot;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IaitoRCore::getOpcodes()
|
void CutterCore::getOpcodes()
|
||||||
{
|
{
|
||||||
QString opcodes = cmd("?O");
|
QString opcodes = cmd("?O");
|
||||||
this->opcodes = opcodes.split("\n");
|
this->opcodes = opcodes.split("\n");
|
||||||
@ -720,7 +720,7 @@ void IaitoRCore::getOpcodes()
|
|||||||
this->regs.removeLast();
|
this->regs.removeLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IaitoRCore::setSettings()
|
void CutterCore::setSettings()
|
||||||
{
|
{
|
||||||
config("scr.color", "false");
|
config("scr.color", "false");
|
||||||
config("scr.interactive", "false");
|
config("scr.interactive", "false");
|
||||||
@ -787,7 +787,7 @@ void IaitoRCore::setSettings()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
QList<RVA> IaitoRCore::getSeekHistory()
|
QList<RVA> CutterCore::getSeekHistory()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<RVA> ret;
|
QList<RVA> ret;
|
||||||
@ -801,7 +801,7 @@ QList<RVA> IaitoRCore::getSeekHistory()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
QStringList IaitoRCore::getAsmPluginNames()
|
QStringList CutterCore::getAsmPluginNames()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
RListIter *it;
|
RListIter *it;
|
||||||
@ -816,7 +816,7 @@ QStringList IaitoRCore::getAsmPluginNames()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList IaitoRCore::getAnalPluginNames()
|
QStringList CutterCore::getAnalPluginNames()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
RListIter *it;
|
RListIter *it;
|
||||||
@ -832,7 +832,7 @@ QStringList IaitoRCore::getAnalPluginNames()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QStringList IaitoRCore::getProjectNames()
|
QStringList CutterCore::getProjectNames()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QStringList ret;
|
QStringList ret;
|
||||||
@ -846,7 +846,7 @@ QStringList IaitoRCore::getProjectNames()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
QList<FunctionDescription> IaitoRCore::getAllFunctions()
|
QList<FunctionDescription> CutterCore::getAllFunctions()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<FunctionDescription> ret;
|
QList<FunctionDescription> ret;
|
||||||
@ -870,7 +870,7 @@ QList<FunctionDescription> IaitoRCore::getAllFunctions()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QList<ImportDescription> IaitoRCore::getAllImports()
|
QList<ImportDescription> CutterCore::getAllImports()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<ImportDescription> ret;
|
QList<ImportDescription> ret;
|
||||||
@ -897,7 +897,7 @@ QList<ImportDescription> IaitoRCore::getAllImports()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
QList<ExportDescription> IaitoRCore::getAllExports()
|
QList<ExportDescription> CutterCore::getAllExports()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<ExportDescription> ret;
|
QList<ExportDescription> ret;
|
||||||
@ -924,7 +924,7 @@ QList<ExportDescription> IaitoRCore::getAllExports()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QList<SymbolDescription> IaitoRCore::getAllSymbols()
|
QList<SymbolDescription> CutterCore::getAllSymbols()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
RListIter *it;
|
RListIter *it;
|
||||||
@ -963,7 +963,7 @@ QList<SymbolDescription> IaitoRCore::getAllSymbols()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QList<CommentDescription> IaitoRCore::getAllComments(const QString &filterType)
|
QList<CommentDescription> CutterCore::getAllComments(const QString &filterType)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<CommentDescription> ret;
|
QList<CommentDescription> ret;
|
||||||
@ -986,7 +986,7 @@ QList<CommentDescription> IaitoRCore::getAllComments(const QString &filterType)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<RelocDescription> IaitoRCore::getAllRelocs()
|
QList<RelocDescription> CutterCore::getAllRelocs()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
RListIter *it;
|
RListIter *it;
|
||||||
@ -1015,7 +1015,7 @@ QList<RelocDescription> IaitoRCore::getAllRelocs()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<StringDescription> IaitoRCore::getAllStrings()
|
QList<StringDescription> CutterCore::getAllStrings()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
RListIter *it;
|
RListIter *it;
|
||||||
@ -1037,7 +1037,7 @@ QList<StringDescription> IaitoRCore::getAllStrings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QList<FlagspaceDescription> IaitoRCore::getAllFlagspaces()
|
QList<FlagspaceDescription> CutterCore::getAllFlagspaces()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<FlagspaceDescription> ret;
|
QList<FlagspaceDescription> ret;
|
||||||
@ -1056,7 +1056,7 @@ QList<FlagspaceDescription> IaitoRCore::getAllFlagspaces()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QList<FlagDescription> IaitoRCore::getAllFlags(QString flagspace)
|
QList<FlagDescription> CutterCore::getAllFlags(QString flagspace)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<FlagDescription> ret;
|
QList<FlagDescription> ret;
|
||||||
@ -1082,7 +1082,7 @@ QList<FlagDescription> IaitoRCore::getAllFlags(QString flagspace)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QList<SectionDescription> IaitoRCore::getAllSections()
|
QList<SectionDescription> CutterCore::getAllSections()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<SectionDescription> ret;
|
QList<SectionDescription> ret;
|
||||||
@ -1110,7 +1110,7 @@ QList<SectionDescription> IaitoRCore::getAllSections()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QList<EntrypointDescription> IaitoRCore::getAllEntrypoint()
|
QList<EntrypointDescription> CutterCore::getAllEntrypoint()
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
QList<EntrypointDescription> ret;
|
QList<EntrypointDescription> ret;
|
||||||
@ -1133,7 +1133,7 @@ QList<EntrypointDescription> IaitoRCore::getAllEntrypoint()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<XrefDescription> IaitoRCore::getXRefs(RVA addr, bool to, bool whole_function, const QString &filterType)
|
QList<XrefDescription> CutterCore::getXRefs(RVA addr, bool to, bool whole_function, const QString &filterType)
|
||||||
{
|
{
|
||||||
QList<XrefDescription> ret = QList<XrefDescription>();
|
QList<XrefDescription> ret = QList<XrefDescription>();
|
||||||
|
|
||||||
@ -1170,7 +1170,7 @@ QList<XrefDescription> IaitoRCore::getXRefs(RVA addr, bool to, bool whole_functi
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IaitoRCore::addFlag(RVA offset, QString name, RVA size)
|
void CutterCore::addFlag(RVA offset, QString name, RVA size)
|
||||||
{
|
{
|
||||||
name = sanitizeStringForCommand(name);
|
name = sanitizeStringForCommand(name);
|
||||||
cmd(QString("f %1 %2 @ %3").arg(name).arg(size).arg(offset));
|
cmd(QString("f %1 %2 @ %3").arg(name).arg(size).arg(offset));
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef IAITORCORE_H
|
#ifndef CUTTER_H
|
||||||
#define IAITORCORE_H
|
#define CUTTER_H
|
||||||
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@ -28,6 +28,8 @@
|
|||||||
#define __alert(x) QMessageBox::question (this, "Alert", QString(x), QMessageBox::Ok)
|
#define __alert(x) QMessageBox::question (this, "Alert", QString(x), QMessageBox::Ok)
|
||||||
#define __question(x) (QMessageBox::Yes==QMessageBox::question (this, "Alert", QString(x), QMessageBox::Yes| QMessageBox::No))
|
#define __question(x) (QMessageBox::Yes==QMessageBox::question (this, "Alert", QString(x), QMessageBox::Yes| QMessageBox::No))
|
||||||
|
|
||||||
|
#define APPNAME "Cutter"
|
||||||
|
|
||||||
class RCoreLocked
|
class RCoreLocked
|
||||||
{
|
{
|
||||||
RCore *core;
|
RCore *core;
|
||||||
@ -42,7 +44,7 @@ public:
|
|||||||
RCore *operator->() const;
|
RCore *operator->() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define IAITONOTUSED(x) do { (void)(x); } while ( 0 );
|
#define CUTTERNOTUSED(x) do { (void)(x); } while ( 0 );
|
||||||
|
|
||||||
typedef ut64 RVA;
|
typedef ut64 RVA;
|
||||||
|
|
||||||
@ -165,17 +167,17 @@ Q_DECLARE_METATYPE(FlagDescription)
|
|||||||
Q_DECLARE_METATYPE(XrefDescription)
|
Q_DECLARE_METATYPE(XrefDescription)
|
||||||
Q_DECLARE_METATYPE(EntrypointDescription)
|
Q_DECLARE_METATYPE(EntrypointDescription)
|
||||||
|
|
||||||
class IaitoRCore : public QObject
|
class CutterCore: public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QString projectPath;
|
QString projectPath;
|
||||||
|
|
||||||
explicit IaitoRCore(QObject *parent = 0);
|
explicit CutterCore(QObject *parent = 0);
|
||||||
~IaitoRCore();
|
~CutterCore();
|
||||||
|
|
||||||
RVA getOffset() const { return core_->offset; }
|
RVA getOffset() const { return core_->offset; }
|
||||||
static QString sanitizeStringForCommand(QString s);
|
static QString sanitizeStringForCommand(QString s);
|
||||||
int getCycloComplex(ut64 addr);
|
int getCycloComplex(ut64 addr);
|
||||||
int getFcnSize(ut64 addr);
|
int getFcnSize(ut64 addr);
|
||||||
@ -276,4 +278,4 @@ private:
|
|||||||
RCore *core_;
|
RCore *core_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // IAITORCORE_H
|
#endif // CUTTER_H
|
@ -1,6 +1,6 @@
|
|||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
|
||||||
TARGET = iaito
|
TARGET = cutter
|
||||||
|
|
||||||
# The application version
|
# The application version
|
||||||
win32 {
|
win32 {
|
||||||
@ -39,7 +39,7 @@ SOURCES += \
|
|||||||
newfiledialog.cpp \
|
newfiledialog.cpp \
|
||||||
optionsdialog.cpp \
|
optionsdialog.cpp \
|
||||||
highlighter.cpp \
|
highlighter.cpp \
|
||||||
qrcore.cpp \
|
cutter.cpp \
|
||||||
createnewdialog.cpp \
|
createnewdialog.cpp \
|
||||||
hexascii_highlighter.cpp \
|
hexascii_highlighter.cpp \
|
||||||
widgets/pieview.cpp \
|
widgets/pieview.cpp \
|
||||||
@ -58,7 +58,6 @@ SOURCES += \
|
|||||||
widgets/flagswidget.cpp \
|
widgets/flagswidget.cpp \
|
||||||
widgets/memorywidget.cpp \
|
widgets/memorywidget.cpp \
|
||||||
widgets/exportswidget.cpp \
|
widgets/exportswidget.cpp \
|
||||||
qrdisasm.cpp \
|
|
||||||
widgets/sdbdock.cpp \
|
widgets/sdbdock.cpp \
|
||||||
analthread.cpp \
|
analthread.cpp \
|
||||||
dialogs/commentsdialog.cpp \
|
dialogs/commentsdialog.cpp \
|
||||||
@ -112,8 +111,7 @@ HEADERS += \
|
|||||||
radarewebserver.h \
|
radarewebserver.h \
|
||||||
settings.h \
|
settings.h \
|
||||||
widgets/entrypointwidget.h \
|
widgets/entrypointwidget.h \
|
||||||
iaitorcore.h \
|
cutter.h \
|
||||||
iaitordisasm.h \
|
|
||||||
dialogs/flagdialog.h
|
dialogs/flagdialog.h
|
||||||
FORMS += \
|
FORMS += \
|
||||||
mainwindow.ui \
|
mainwindow.ui \
|
||||||
@ -145,7 +143,7 @@ FORMS += \
|
|||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
resources.qrc
|
resources.qrc
|
||||||
|
|
||||||
DISTFILES += iaito.astylerc
|
DISTFILES += cutter.astylerc
|
||||||
|
|
||||||
|
|
||||||
include(lib_radare2.pri)
|
include(lib_radare2.pri)
|
@ -8,7 +8,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
||||||
ui->label->setText(tr("<h1>Iaito</h1>"
|
ui->label->setText(tr("<h1>Cutter</h1>"
|
||||||
"Version 1.0 alpha<br />"
|
"Version 1.0 alpha<br />"
|
||||||
"Using r2-" R2_GITTAP
|
"Using r2-" R2_GITTAP
|
||||||
"<h2>License</h2>"
|
"<h2>License</h2>"
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
|
|
||||||
#include "ui_flagdialog.h"
|
#include "ui_flagdialog.h"
|
||||||
#include "flagdialog.h"
|
#include "flagdialog.h"
|
||||||
|
|
||||||
FlagDialog::FlagDialog(IaitoRCore *core, RVA offset, QWidget *parent) :
|
FlagDialog::FlagDialog(CutterCore *core, RVA offset, QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::FlagDialog)
|
ui(new Ui::FlagDialog)
|
||||||
{
|
{
|
||||||
@ -32,4 +31,4 @@ void FlagDialog::on_buttonBox_accepted()
|
|||||||
void FlagDialog::on_buttonBox_rejected()
|
void FlagDialog::on_buttonBox_rejected()
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define FLAGDIALOG_H
|
#define FLAGDIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <iaitorcore.h>
|
#include "cutter.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
@ -14,7 +14,7 @@ class FlagDialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FlagDialog(IaitoRCore *core, RVA offset, QWidget *parent = 0);
|
explicit FlagDialog(CutterCore *core, RVA offset, QWidget *parent = 0);
|
||||||
~FlagDialog();
|
~FlagDialog();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -24,7 +24,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
Ui::FlagDialog *ui;
|
Ui::FlagDialog *ui;
|
||||||
|
|
||||||
IaitoRCore *core;
|
CutterCore *core;
|
||||||
RVA offset;
|
RVA offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(column);
|
CUTTERNOTUSED(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)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(column);
|
CUTTERNOTUSED(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);
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
#ifndef XREFSDIALOG_H
|
#ifndef XREFSDIALOG_H
|
||||||
#define XREFSDIALOG_H
|
#define XREFSDIALOG_H
|
||||||
|
|
||||||
#include "highlighter.h"
|
|
||||||
#include "iaitorcore.h"
|
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QTreeWidgetItem>
|
#include <QTreeWidgetItem>
|
||||||
|
#include "highlighter.h"
|
||||||
|
#include "cutter.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
|
||||||
|
@ -1,76 +0,0 @@
|
|||||||
#ifndef IAITORDISASM_H
|
|
||||||
#define IAITORDISASM_H
|
|
||||||
|
|
||||||
#include <iaitorcore.h>
|
|
||||||
|
|
||||||
enum IaitoRDisasmDataType
|
|
||||||
{
|
|
||||||
STRING = 'z',
|
|
||||||
STRUCT = 's',
|
|
||||||
DATA = 'd',
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
enum IaitoRDisasmOption
|
|
||||||
{
|
|
||||||
DWARF = 1 << 1,
|
|
||||||
REFS = 1 << 2,
|
|
||||||
ESIL = 1 << 3,
|
|
||||||
HEXPAIRS = 1 << 4,
|
|
||||||
COMMENT = 1 << 5,
|
|
||||||
};
|
|
||||||
|
|
||||||
class IaitoRDisasmRow
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
IaitoRCore *core;
|
|
||||||
public:
|
|
||||||
ut64 vaddr;
|
|
||||||
ut64 paddr;
|
|
||||||
int size;
|
|
||||||
QString hex;
|
|
||||||
|
|
||||||
// Context
|
|
||||||
// list of flags
|
|
||||||
// closer function
|
|
||||||
RFlagItem *flag;
|
|
||||||
RAnalFunction *fcn;
|
|
||||||
|
|
||||||
// Contents
|
|
||||||
|
|
||||||
// if instruction
|
|
||||||
int optype; // jmp, cjmp, ... // aka RAnalOp
|
|
||||||
QString mnemonic;
|
|
||||||
QString arg[3]; // each argument splitted here
|
|
||||||
QString disasm;
|
|
||||||
QString esil;
|
|
||||||
|
|
||||||
// if data
|
|
||||||
IaitoRDisasmDataType datatype;
|
|
||||||
QString dataopt; // struct name, aliased name, string, etc
|
|
||||||
// data type
|
|
||||||
// string/struct/hex/word
|
|
||||||
|
|
||||||
// Comment
|
|
||||||
QString comment;
|
|
||||||
QString description;
|
|
||||||
// References
|
|
||||||
// refs
|
|
||||||
// xrefs
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class IaitoRDisasm
|
|
||||||
{
|
|
||||||
IaitoRCore *core;
|
|
||||||
Sdb *db;
|
|
||||||
public:
|
|
||||||
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 // IAITORDISASM_H
|
|
15
src/main.cpp
15
src/main.cpp
@ -1,18 +1,17 @@
|
|||||||
|
|
||||||
#include "mainwindow.h"
|
|
||||||
#include "newfiledialog.h"
|
|
||||||
#include "optionsdialog.h"
|
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "newfiledialog.h"
|
||||||
|
#include "optionsdialog.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
a.setOrganizationName("iaito");
|
a.setOrganizationName("cutter");
|
||||||
a.setApplicationName("iaito");
|
a.setApplicationName("cutter");
|
||||||
a.setApplicationVersion(APP_VERSION);
|
a.setApplicationVersion(APP_VERSION);
|
||||||
|
|
||||||
// Set QString codec to UTF-8
|
// Set QString codec to UTF-8
|
||||||
@ -48,7 +47,7 @@ int main(int argc, char *argv[])
|
|||||||
msg.setWindowIcon(QIcon(":/img/logo-small.png"));
|
msg.setWindowIcon(QIcon(":/img/logo-small.png"));
|
||||||
msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||||
msg.setWindowTitle(QObject::tr("Version mismatch!"));
|
msg.setWindowTitle(QObject::tr("Version mismatch!"));
|
||||||
msg.setText(QString(QObject::tr("The version used to compile iaito (%1) does not match the binary version of radare2 (%2). This could result in unexpected behaviour. Are you sure you want to continue?")).arg(localVersion, r2version));
|
msg.setText(QString(QObject::tr("The version used to compile cutter (%1) does not match the binary version of radare2 (%2). This could result in unexpected behaviour. Are you sure you want to continue?")).arg(localVersion, r2version));
|
||||||
if (msg.exec() == QMessageBox::No)
|
if (msg.exec() == QMessageBox::No)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
#include <QTreeWidgetItem>
|
#include <QTreeWidgetItem>
|
||||||
|
|
||||||
|
|
||||||
#include "highlighter.h"
|
#include "highlighter.h"
|
||||||
#include "hexascii_highlighter.h"
|
#include "hexascii_highlighter.h"
|
||||||
#include "newfiledialog.h"
|
#include "newfiledialog.h"
|
||||||
@ -83,7 +82,7 @@ static void registerCustomFonts()
|
|||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent) :
|
MainWindow::MainWindow(QWidget *parent) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
core(new IaitoRCore()),
|
core(new CutterCore()),
|
||||||
memoryDock(nullptr),
|
memoryDock(nullptr),
|
||||||
notepadDock(nullptr),
|
notepadDock(nullptr),
|
||||||
asmDock(nullptr),
|
asmDock(nullptr),
|
||||||
@ -495,12 +494,12 @@ void MainWindow::setFilename(const QString &fn)
|
|||||||
{
|
{
|
||||||
// Add file name to window title
|
// Add file name to window title
|
||||||
this->filename = fn;
|
this->filename = fn;
|
||||||
this->setWindowTitle("Iaito - " + fn);
|
this->setWindowTitle(APPNAME" - " + fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent *event)
|
void MainWindow::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
QMessageBox::StandardButton ret = QMessageBox::question(this, "Iaito",
|
QMessageBox::StandardButton ret = QMessageBox::question(this, APPNAME,
|
||||||
tr("Do you really want to exit?\nSave your project before closing!"),
|
tr("Do you really want to exit?\nSave your project before closing!"),
|
||||||
(QMessageBox::StandardButtons)(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel));
|
(QMessageBox::StandardButtons)(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel));
|
||||||
//qDebug() << ret;
|
//qDebug() << ret;
|
||||||
@ -1046,7 +1045,7 @@ void MainWindow::on_actionTabs_on_Top_triggered()
|
|||||||
void MainWindow::on_actionReset_settings_triggered()
|
void MainWindow::on_actionReset_settings_triggered()
|
||||||
{
|
{
|
||||||
QMessageBox::StandardButton ret =
|
QMessageBox::StandardButton ret =
|
||||||
(QMessageBox::StandardButton)QMessageBox::question(this, "Iaito",
|
(QMessageBox::StandardButton)QMessageBox::question(this, APPNAME,
|
||||||
tr("Do you really want to clear all settings?"),
|
tr("Do you really want to clear all settings?"),
|
||||||
QMessageBox::Ok | QMessageBox::Cancel);
|
QMessageBox::Ok | QMessageBox::Cancel);
|
||||||
if (ret == QMessageBox::Ok)
|
if (ret == QMessageBox::Ok)
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#ifndef MAINWINDOW_H
|
#ifndef MAINWINDOW_H
|
||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include "radarewebserver.h"
|
|
||||||
#include "iaitorcore.h" // only needed for ut64
|
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include "radarewebserver.h"
|
||||||
|
#include "cutter.h" // only needed for ut64
|
||||||
|
|
||||||
class IaitoRCore;
|
class CutterCore;
|
||||||
class DockWidget;
|
class DockWidget;
|
||||||
class Omnibar;
|
class Omnibar;
|
||||||
class MemoryWidget;
|
class MemoryWidget;
|
||||||
@ -45,7 +44,7 @@ class MainWindow : public QMainWindow
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IaitoRCore *core;
|
CutterCore *core;
|
||||||
MemoryWidget *memoryDock;
|
MemoryWidget *memoryDock;
|
||||||
Notepad *notepadDock;
|
Notepad *notepadDock;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string notr="true">Iaito</string>
|
<string notr="true">Cutter</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="resources.qrc">
|
||||||
|
@ -12,7 +12,7 @@ const int NewFileDialog::MaxRecentFiles;
|
|||||||
|
|
||||||
static QColor getColorFor(QString str, int pos)
|
static QColor getColorFor(QString str, int pos)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(str);
|
CUTTERNOTUSED(str);
|
||||||
|
|
||||||
QList<QColor> Colors;
|
QList<QColor> Colors;
|
||||||
Colors << QColor(29, 188, 156); // Turquoise
|
Colors << QColor(29, 188, 156); // Turquoise
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include "cutter.h"
|
||||||
#include "iaitorcore.h"
|
|
||||||
#include "analthread.h"
|
#include "analthread.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
#include "iaitordisasm.h"
|
|
||||||
|
|
||||||
// This class is not used, created by pancake a long time ago.
|
|
||||||
// Kept here just because
|
|
||||||
|
|
||||||
IaitoRDisasm::IaitoRDisasm(IaitoRCore *core) :
|
|
||||||
core(core),
|
|
||||||
db(nullptr)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IaitoRDisasm::disassembleAt(ut64 addr, IaitoRDisasmOption opt, IaitoRDisasmRow &dr)
|
|
||||||
{
|
|
||||||
IAITONOTUSED(addr);
|
|
||||||
IAITONOTUSED(opt);
|
|
||||||
IAITONOTUSED(dr);
|
|
||||||
|
|
||||||
printf("FUCK\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
@ -1,11 +1,10 @@
|
|||||||
#include "radarewebserver.h"
|
|
||||||
#include "iaitorcore.h"
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QProcessEnvironment>
|
#include <QProcessEnvironment>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include "cutter.h"
|
||||||
|
#include "radarewebserver.h"
|
||||||
|
|
||||||
|
RadareWebServer::RadareWebServer(CutterCore *core) :
|
||||||
RadareWebServer::RadareWebServer(IaitoRCore *core) :
|
|
||||||
core(core),
|
core(core),
|
||||||
started(false)
|
started(false)
|
||||||
{
|
{
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
|
|
||||||
class IaitoRCore;
|
class CutterCore;
|
||||||
|
|
||||||
class RadareWebServer
|
class RadareWebServer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit RadareWebServer(IaitoRCore *core);
|
explicit RadareWebServer(CutterCore *core);
|
||||||
~RadareWebServer();
|
~RadareWebServer();
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
@ -19,7 +19,7 @@ public:
|
|||||||
bool isStarted() const;
|
bool isStarted() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IaitoRCore *core;
|
CutterCore *core;
|
||||||
bool started;
|
bool started;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
GraphicsBar::GraphicsBar(MainWindow *main, QWidget *parent) :
|
GraphicsBar::GraphicsBar(MainWindow *main, QWidget *parent) :
|
||||||
QToolBar(main)
|
QToolBar(main)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(parent);
|
CUTTERNOTUSED(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)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(event);
|
CUTTERNOTUSED(event);
|
||||||
|
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
this->fillData();
|
this->fillData();
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
#include "commentswidget.h"
|
|
||||||
#include "ui_commentswidget.h"
|
|
||||||
|
|
||||||
#include "mainwindow.h"
|
|
||||||
#include "helpers.h"
|
|
||||||
|
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
|
|
||||||
|
#include "commentswidget.h"
|
||||||
|
#include "ui_commentswidget.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
|
||||||
CommentsWidget::CommentsWidget(MainWindow *main, QWidget *parent) :
|
CommentsWidget::CommentsWidget(MainWindow *main, QWidget *parent) :
|
||||||
DockWidget(parent),
|
DockWidget(parent),
|
||||||
@ -51,7 +49,7 @@ void CommentsWidget::refresh()
|
|||||||
|
|
||||||
void CommentsWidget::on_commentsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void CommentsWidget::on_commentsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(column);
|
CUTTERNOTUSED(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>();
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
#include "consolewidget.h"
|
|
||||||
#include "ui_consolewidget.h"
|
|
||||||
|
|
||||||
#include "helpers.h"
|
|
||||||
#include "iaitorcore.h"
|
|
||||||
|
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QCompleter>
|
#include <QCompleter>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QStringListModel>
|
#include <QStringListModel>
|
||||||
|
#include "cutter.h"
|
||||||
|
#include "consolewidget.h"
|
||||||
|
#include "ui_consolewidget.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
|
||||||
|
|
||||||
// TODO: Find a way to get to this without copying it here
|
// TODO: Find a way to get to this without copying it here
|
||||||
@ -92,7 +90,7 @@ static bool isForbidden(const QString &input)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
ConsoleWidget::ConsoleWidget(IaitoRCore *core, QWidget *parent) :
|
ConsoleWidget::ConsoleWidget(CutterCore *core, QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::ConsoleWidget),
|
ui(new Ui::ConsoleWidget),
|
||||||
core(core),
|
core(core),
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class IaitoRCore;
|
class CutterCore;
|
||||||
|
|
||||||
class QAction;
|
class QAction;
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ class ConsoleWidget : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ConsoleWidget(IaitoRCore *core, QWidget *parent = 0);
|
explicit ConsoleWidget(CutterCore *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;
|
||||||
IaitoRCore *core;
|
CutterCore *core;
|
||||||
QList<QAction *> actions;
|
QList<QAction *> actions;
|
||||||
bool debugOutputEnabled;
|
bool debugOutputEnabled;
|
||||||
int maxHistoryEntries;
|
int maxHistoryEntries;
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
#include "exportswidget.h"
|
#include "exportswidget.h"
|
||||||
#include "ui_exportswidget.h"
|
#include "ui_exportswidget.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ExportsModel::ExportsModel(QList<ExportDescription> *exports, QObject *parent)
|
ExportsModel::ExportsModel(QList<ExportDescription> *exports, QObject *parent)
|
||||||
: QAbstractListModel(parent),
|
: QAbstractListModel(parent),
|
||||||
exports(exports)
|
exports(exports)
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
#include "cutter.h"
|
||||||
#include "iaitorcore.h"
|
|
||||||
#include "dockwidget.h"
|
#include "dockwidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
#include "flagswidget.h"
|
|
||||||
#include "ui_flagswidget.h"
|
|
||||||
|
|
||||||
#include "mainwindow.h"
|
|
||||||
#include "helpers.h"
|
|
||||||
|
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
|
#include "flagswidget.h"
|
||||||
|
#include "ui_flagswidget.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
|
||||||
FlagsModel::FlagsModel(QList<FlagDescription> *flags, QObject *parent)
|
FlagsModel::FlagsModel(QList<FlagDescription> *flags, QObject *parent)
|
||||||
: QAbstractListModel(parent),
|
: QAbstractListModel(parent),
|
||||||
@ -169,7 +165,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)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(arg1);
|
CUTTERNOTUSED(arg1);
|
||||||
|
|
||||||
refreshFlags();
|
refreshFlags();
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
#ifndef FLAGSWIDGET_H
|
#ifndef FLAGSWIDGET_H
|
||||||
#define FLAGSWIDGET_H
|
#define FLAGSWIDGET_H
|
||||||
|
|
||||||
#include "iaitorcore.h"
|
|
||||||
#include "dockwidget.h"
|
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
#include "cutter.h"
|
||||||
|
#include "dockwidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
#ifndef FUNCTIONSWIDGET_H
|
#ifndef FUNCTIONSWIDGET_H
|
||||||
#define FUNCTIONSWIDGET_H
|
#define FUNCTIONSWIDGET_H
|
||||||
|
|
||||||
#include "dockwidget.h"
|
|
||||||
#include "iaitorcore.h"
|
|
||||||
|
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
|
#include "cutter.h"
|
||||||
|
#include "dockwidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
#ifndef MEMORYWIDGET_H
|
#ifndef MEMORYWIDGET_H
|
||||||
#define MEMORYWIDGET_H
|
#define MEMORYWIDGET_H
|
||||||
|
|
||||||
#include "iaitorcore.h"
|
|
||||||
#include "highlighter.h"
|
|
||||||
#include "hexascii_highlighter.h"
|
|
||||||
#include "hexhighlighter.h"
|
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
@ -15,7 +10,10 @@
|
|||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
#include "cutter.h"
|
||||||
|
#include "highlighter.h"
|
||||||
|
#include "hexascii_highlighter.h"
|
||||||
|
#include "hexhighlighter.h"
|
||||||
#include "dashboard.h"
|
#include "dashboard.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(arg1);
|
CUTTERNOTUSED(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)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(arg1);
|
CUTTERNOTUSED(arg1);
|
||||||
|
|
||||||
QString searchString = ui->searchEdit->text();
|
QString searchString = ui->searchEdit->text();
|
||||||
QTextDocument *document = ui->notepadTextEdit->document();
|
QTextDocument *document = ui->notepadTextEdit->document();
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#define M_PI 3.1415927
|
#define M_PI 3.1415927
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "iaitorcore.h"
|
#include "cutter.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)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(command);
|
CUTTERNOTUSED(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.
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
|
#include <QTreeWidget>
|
||||||
#include "relocswidget.h"
|
#include "relocswidget.h"
|
||||||
#include "ui_relocswidget.h"
|
#include "ui_relocswidget.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
#include <QTreeWidget>
|
|
||||||
|
|
||||||
|
|
||||||
RelocsWidget::RelocsWidget(MainWindow *main, QWidget *parent) :
|
RelocsWidget::RelocsWidget(MainWindow *main, QWidget *parent) :
|
||||||
DockWidget(parent),
|
DockWidget(parent),
|
||||||
ui(new Ui::RelocsWidget),
|
ui(new Ui::RelocsWidget),
|
||||||
@ -39,7 +36,7 @@ void RelocsWidget::refresh()
|
|||||||
|
|
||||||
void RelocsWidget::on_relocsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void RelocsWidget::on_relocsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(column);
|
CUTTERNOTUSED(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>();
|
||||||
|
@ -11,7 +11,7 @@ SectionsWidget::SectionsWidget(MainWindow *main, QWidget *parent) :
|
|||||||
QSplitter(main),
|
QSplitter(main),
|
||||||
main(main)
|
main(main)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(parent);
|
CUTTERNOTUSED(parent);
|
||||||
|
|
||||||
setupViews();
|
setupViews();
|
||||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
|
#include <QTreeWidget>
|
||||||
|
#include <QAbstractItemView>
|
||||||
#include "stringswidget.h"
|
#include "stringswidget.h"
|
||||||
#include "ui_stringswidget.h"
|
#include "ui_stringswidget.h"
|
||||||
|
|
||||||
//#include "dialogs/xrefsdialog.h"
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
#include <QTreeWidget>
|
|
||||||
#include <QAbstractItemView>
|
|
||||||
|
|
||||||
|
|
||||||
StringsWidget::StringsWidget(MainWindow *main, QWidget *parent) :
|
StringsWidget::StringsWidget(MainWindow *main, QWidget *parent) :
|
||||||
DockWidget(parent),
|
DockWidget(parent),
|
||||||
@ -38,7 +36,7 @@ void StringsWidget::refresh()
|
|||||||
|
|
||||||
void StringsWidget::on_stringsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
void StringsWidget::on_stringsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(column);
|
CUTTERNOTUSED(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
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
IAITONOTUSED(column);
|
CUTTERNOTUSED(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>();
|
||||||
|
Loading…
Reference in New Issue
Block a user