Splitted Cutter.h and moved everything in core (#1201)

Sometimes it is not necessary to include the whole Cutter.h file
Hence, it's been splitted so you can include only what you require
E.g. #include "core/CutterCommon.h" to have access to the common types
This commit is contained in:
xarkes 2019-02-22 17:50:45 +01:00 committed by Florian Märkl
parent 2d2b9c8a28
commit ab27e09b91
126 changed files with 553 additions and 524 deletions

View File

@ -42,6 +42,11 @@ project(Cutter VERSION "${CUTTER_VERSION_FULL}")
set(CMAKE_CXX_STANDARD 11)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/core")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/widgets")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/common")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/plugins")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
@ -136,9 +141,6 @@ if(CUTTER_ENABLE_PYTHON_BINDINGS)
set_property(SOURCE ${BINDINGS_SOURCE} PROPERTY SKIP_AUTOGEN ON)
include_directories("${BINDINGS_BUILD_DIR}/CutterBindings")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/widgets")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/common")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/plugins")
add_custom_command(OUTPUT ${BINDINGS_SOURCE}
COMMAND "${SHIBOKEN_BINARY}" --project-file="${BINDINGS_BUILD_DIR}/bindings.txt"

View File

@ -90,7 +90,7 @@ CUTTER_ENABLE_QTWEBENGINE {
message("QtWebEngine support disabled. (requires CUTTER_ENABLE_JUPYTER=true)")
}
INCLUDEPATH *= . widgets dialogs common plugins
INCLUDEPATH *= . core widgets dialogs common plugins
win32 {
# Generate debug symbols in release mode
@ -194,7 +194,7 @@ QMAKE_SUBSTITUTES += CutterConfig.h.in
SOURCES += \
Main.cpp \
Cutter.cpp \
core/Cutter.cpp \
widgets/DisassemblerGraphView.cpp \
widgets/OverviewView.cpp \
common/RichTextPainter.cpp \
@ -205,7 +205,7 @@ SOURCES += \
dialogs/FlagDialog.cpp \
dialogs/RenameDialog.cpp \
dialogs/XrefsDialog.cpp \
MainWindow.cpp \
core/MainWindow.cpp \
common/Helpers.cpp \
common/HexAsciiHighlighter.cpp \
common/HexHighlighter.cpp \
@ -213,7 +213,7 @@ SOURCES += \
common/MdHighlighter.cpp \
dialogs/preferences/AsmOptionsWidget.cpp \
dialogs/NewFileDialog.cpp \
AnalTask.cpp \
common/AnalTask.cpp \
widgets/CommentsWidget.cpp \
widgets/ConsoleWidget.cpp \
widgets/Dashboard.cpp \
@ -293,7 +293,7 @@ SOURCES += \
common/CutterSeekable.cpp \
common/RefreshDeferrer.cpp \
dialogs/WelcomeDialog.cpp \
RunScriptTask.cpp \
common/RunScriptTask.cpp \
dialogs/EditMethodDialog.cpp \
dialogs/LoadNewTypesDialog.cpp \
widgets/SdbWidget.cpp \
@ -302,7 +302,9 @@ SOURCES += \
common/BasicBlockHighlighter.cpp
HEADERS += \
Cutter.h \
core/Cutter.h \
core/CutterCommon.h \
core/CutterDescriptions.h \
widgets/DisassemblerGraphView.h \
widgets/OverviewView.h \
common/RichTextPainter.h \
@ -317,12 +319,12 @@ HEADERS += \
common/Helpers.h \
common/HexAsciiHighlighter.h \
common/HexHighlighter.h \
MainWindow.h \
core/MainWindow.h \
common/Highlighter.h \
common/MdHighlighter.h \
dialogs/InitialOptionsDialog.h \
dialogs/NewFileDialog.h \
AnalTask.h \
common/AnalTask.h \
widgets/CommentsWidget.h \
widgets/ConsoleWidget.h \
widgets/Dashboard.h \
@ -406,7 +408,7 @@ HEADERS += \
common/CutterSeekable.h \
common/RefreshDeferrer.h \
dialogs/WelcomeDialog.h \
RunScriptTask.h \
common/RunScriptTask.h \
common/Json.h \
dialogs/EditMethodDialog.h \
dialogs/LoadNewTypesDialog.h \
@ -426,7 +428,7 @@ FORMS += \
dialogs/NewfileDialog.ui \
dialogs/InitialOptionsDialog.ui \
dialogs/EditFunctionDialog.ui \
MainWindow.ui \
core/MainWindow.ui \
widgets/CommentsWidget.ui \
widgets/ConsoleWidget.ui \
widgets/Dashboard.ui \

View File

@ -6,7 +6,7 @@
#include <QList>
#include <QProxyStyle>
#include "MainWindow.h"
#include "core/MainWindow.h"
class CutterApplication : public QApplication

View File

@ -1,6 +1,6 @@
#include "CutterApplication.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
/*!
* \brief Migrate Settings used before Cutter 1.8

View File

@ -2,9 +2,9 @@
#ifndef CUTTER_BINDINGS_H
#define CUTTER_BINDINGS_H
#include "../Cutter.h"
#include "../core/Cutter.h"
#include "../common/Configuration.h"
#include "../MainWindow.h"
#include "../core/MainWindow.h"
#include "../widgets/CutterDockWidget.h"
#include "../plugins/CutterPlugin.h"

View File

@ -1,6 +1,6 @@
#include "Cutter.h"
#include "AnalTask.h"
#include "MainWindow.h"
#include "core/Cutter.h"
#include "common/AnalTask.h"
#include "core/MainWindow.h"
#include "dialogs/InitialOptionsDialog.h"
#include <QJsonArray>
#include <QDebug>

View File

@ -2,7 +2,7 @@
#define ANALTHREAD_H
#include "common/AsyncTask.h"
#include "Cutter.h"
#include "core/Cutter.h"
#include "common/InitialOptions.h"
class CutterCore;

View File

@ -1,7 +1,7 @@
#ifndef COLORS_H
#define COLORS_H
#include "Cutter.h"
#include "core/Cutter.h"
#include "common/RichTextPainter.h"
#include <r_anal.h>

View File

@ -3,7 +3,7 @@
#define COMMANDTASK_H
#include "common/AsyncTask.h"
#include "Cutter.h"
#include "core/Cutter.h"
class CommandTask : public AsyncTask
{

View File

@ -3,7 +3,7 @@
#include <QSettings>
#include <QFont>
#include <Cutter.h>
#include <core/Cutter.h>
#define Config() (Configuration::instance())
#define ConfigColor(x) Config()->getColor(x)

View File

@ -1,4 +1,4 @@
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "CutterSeekable.h"
#include <QPlainTextEdit>

View File

@ -1,6 +1,6 @@
#pragma once
#include "Cutter.h"
#include "core/Cutter.h"
class MainWindow;

View File

@ -3,7 +3,7 @@
#define FUNCTIONSTASK_H
#include "common/AsyncTask.h"
#include "Cutter.h"
#include "core/Cutter.h"
class FunctionsTask : public AsyncTask
{

View File

@ -1,5 +1,5 @@
#include "Highlighter.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include <QtGui>

View File

@ -1,7 +1,7 @@
#ifndef HIGHLIGHTER_H
#define HIGHLIGHTER_H
#include "Cutter.h"
#include "core/Cutter.h"
#include <QSyntaxHighlighter>
#include <QHash>

View File

@ -2,7 +2,7 @@
#ifndef CUTTER_INITIALOPTIONS_H
#define CUTTER_INITIALOPTIONS_H
#include "Cutter.h"
#include "core/Cutter.h"
struct InitialOptions
{

View File

@ -2,7 +2,7 @@
#ifndef CUTTER_JSON_H
#define CUTTER_JSON_H
#include "Cutter.h"
#include "core/Cutter.h"
#include <QJsonValue>

View File

@ -4,7 +4,7 @@
#include <Python.h>
#include <csignal>
#include "Cutter.h"
#include "core/Cutter.h"
#include "NestedIPyKernel.h"
#include "QtResImporter.h"

View File

@ -2,7 +2,7 @@
#ifdef CUTTER_ENABLE_PYTHON
#include "PythonAPI.h"
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterConfig.h"

View File

@ -2,7 +2,7 @@
#ifndef R2TASK_H
#define R2TASK_H
#include "Cutter.h"
#include "core/Cutter.h"
class R2Task: public QObject
{

View File

@ -1,6 +1,6 @@
#include "Cutter.h"
#include "RunScriptTask.h"
#include "MainWindow.h"
#include "core/Cutter.h"
#include "common/RunScriptTask.h"
#include "core/MainWindow.h"
RunScriptTask::RunScriptTask() :
AsyncTask()

View File

@ -2,7 +2,7 @@
#define RUNSCRIPTTHREAD_H
#include "common/AsyncTask.h"
#include "Cutter.h"
#include "core/Cutter.h"
class RunScriptTask : public AsyncTask
{

View File

@ -3,7 +3,7 @@
#define STRINGSASYNCTASK_H
#include "common/AsyncTask.h"
#include "Cutter.h"
#include "core/Cutter.h"
class StringsTask : public AsyncTask
{

View File

@ -1,7 +1,7 @@
#include <cassert>
#include "Cutter.h"
#include "core/Cutter.h"
#include "TempConfig.h"
TempConfig::~TempConfig()

View File

@ -9,7 +9,7 @@
#include "common/AsyncTask.h"
#include "common/R2Task.h"
#include "common/Json.h"
#include "Cutter.h"
#include "core/Cutter.h"
#include "sdb.h"
Q_GLOBAL_STATIC(CutterCore, uniqueInstance)

View File

@ -1,13 +1,8 @@
#ifndef CUTTER_H
#define CUTTER_H
#include "r_core.h"
// Workaround for compile errors on Windows
#ifdef _WIN32
#undef min
#undef max
#endif //_WIN32
#include "core/CutterCommon.h"
#include "core/CutterDescriptions.h"
#include <QMap>
#include <QDebug>
@ -17,37 +12,13 @@
#include <QJsonDocument>
#include <QErrorMessage>
#define CutterRListForeach(list, it, type, x) \
if (list) for (it = list->head; it && ((x=static_cast<type*>(it->data))); it = it->n)
#define CutterRVectorForeach(vec, it, type) \
if ((vec) && (vec)->a) \
for (it = (type *)(vec)->a; (char *)it != (char *)(vec)->a + ((vec)->len * (vec)->elem_size); it = (type *)((char *)it + (vec)->elem_size))
#define APPNAME "Cutter"
#define Core() (CutterCore::instance())
/*!
* \brief Type to be used for all kinds of addresses/offsets in r2 address space.
*/
typedef ut64 RVA;
/*!
* \brief Maximum value of RVA. Do NOT use this for specifying invalid values, use RVA_INVALID instead.
*/
#define RVA_MAX UT64_MAX
/*!
* \brief Value for specifying an invalid RVA.
*/
#define RVA_INVALID RVA_MAX
class AsyncTaskManager;
class CutterCore;
#include "plugins/CutterPlugin.h"
#include "common/BasicBlockHighlighter.h"
#define Core() (CutterCore::instance())
class RCoreLocked
{
RCore *core;
@ -62,352 +33,6 @@ public:
RCore *operator->() const;
};
inline QString RAddressString(RVA addr)
{
return QString::asprintf("%#010llx", addr);
}
inline QString RSizeString(RVA size)
{
return QString::asprintf("%lld", size);
}
inline QString RHexString(RVA size)
{
return QString::asprintf("%#llx", size);
}
struct FunctionDescription {
RVA offset;
RVA size;
RVA nargs;
RVA nbbs;
RVA nlocals;
RVA cc;
QString calltype;
QString name;
RVA edges;
RVA cost;
RVA calls;
RVA stackframe;
bool contains(RVA addr) const
{
return addr >= offset && addr < offset + size;
}
};
struct ImportDescription {
RVA plt;
int ordinal;
QString bind;
QString type;
QString name;
};
struct ExportDescription {
RVA vaddr;
RVA paddr;
RVA size;
QString type;
QString name;
QString flag_name;
};
struct HeaderDescription
{
RVA vaddr;
RVA paddr;
QString value;
QString name;
};
struct ZignatureDescription
{
QString name;
QString bytes;
RVA cc;
RVA nbbs;
RVA edges;
RVA ebbs;
RVA offset;
QStringList refs;
};
struct TypeDescription {
QString type;
int size;
QString format;
QString category;
};
struct SearchDescription {
RVA offset;
int size;
QString code;
QString data;
};
struct SymbolDescription {
RVA vaddr;
QString bind;
QString type;
QString name;
};
struct CommentDescription {
RVA offset;
QString name;
};
struct RelocDescription {
RVA vaddr;
RVA paddr;
QString type;
QString name;
};
struct StringDescription {
RVA vaddr;
QString string;
QString type;
QString section;
ut32 length;
ut32 size;
};
struct FlagspaceDescription {
QString name;
};
struct FlagDescription {
RVA offset;
RVA size;
QString name;
};
struct SectionDescription {
RVA vaddr;
RVA paddr;
RVA size;
RVA vsize;
QString name;
QString flags;
QString entropy;
};
struct SegmentDescription {
RVA vaddr;
RVA paddr;
RVA size;
RVA vsize;
QString name;
QString perm;
};
struct EntrypointDescription {
RVA vaddr;
RVA paddr;
RVA baddr;
RVA laddr;
RVA haddr;
QString type;
};
struct XrefDescription {
RVA from;
QString from_str;
RVA to;
QString to_str;
QString type;
};
struct RBinPluginDescription {
QString name;
QString description;
QString license;
QString type;
};
struct RIOPluginDescription {
QString name;
QString description;
QString license;
QString permissions;
};
struct RCorePluginDescription {
QString name;
QString description;
};
struct RAsmPluginDescription {
QString name;
QString architecture;
QString author;
QString version;
QString cpus;
QString description;
QString license;
};
struct DisassemblyLine {
RVA offset;
QString text;
};
struct BinClassBaseClassDescription {
QString name;
RVA offset;
};
struct BinClassMethodDescription {
QString name;
RVA addr = RVA_INVALID;
st64 vtableOffset = -1;
};
struct BinClassFieldDescription {
QString name;
RVA addr = RVA_INVALID;
};
struct BinClassDescription {
QString name;
RVA addr = RVA_INVALID;
RVA vtableAddr = RVA_INVALID;
ut64 index = 0;
QList<BinClassBaseClassDescription> baseClasses;
QList<BinClassMethodDescription> methods;
QList<BinClassFieldDescription> fields;
};
struct AnalMethodDescription {
QString name;
RVA addr;
st64 vtableOffset;
};
struct AnalBaseClassDescription {
QString id;
RVA offset;
QString className;
};
struct AnalVTableDescription {
QString id;
ut64 offset;
ut64 addr;
};
struct ResourcesDescription {
int name;
RVA vaddr;
ut64 index;
QString type;
ut64 size;
QString lang;
};
struct VTableDescription {
RVA addr;
QList<BinClassMethodDescription> methods;
};
struct BlockDescription {
RVA addr;
RVA size;
int flags;
int functions;
int inFunctions;
int comments;
int symbols;
int strings;
ut8 rwx;
};
struct BlockStatistics {
RVA from;
RVA to;
RVA blocksize;
QList<BlockDescription> blocks;
};
struct MemoryMapDescription {
RVA addrStart;
RVA addrEnd;
QString name;
QString fileName;
QString type;
QString permission;
};
struct BreakpointDescription {
RVA addr;
int size;
QString permission;
bool hw;
bool trace;
bool enabled;
};
struct ProcessDescription {
int pid;
int uid;
QString status;
QString path;
};
struct RegisterRefDescription {
QString reg;
QString value;
QString ref;
};
struct VariableDescription {
enum class RefType { SP, BP, Reg };
RefType refType;
QString name;
QString type;
};
Q_DECLARE_METATYPE(FunctionDescription)
Q_DECLARE_METATYPE(ImportDescription)
Q_DECLARE_METATYPE(ExportDescription)
Q_DECLARE_METATYPE(SymbolDescription)
Q_DECLARE_METATYPE(CommentDescription)
Q_DECLARE_METATYPE(RelocDescription)
Q_DECLARE_METATYPE(StringDescription)
Q_DECLARE_METATYPE(FlagspaceDescription)
Q_DECLARE_METATYPE(FlagDescription)
Q_DECLARE_METATYPE(XrefDescription)
Q_DECLARE_METATYPE(EntrypointDescription)
Q_DECLARE_METATYPE(RBinPluginDescription)
Q_DECLARE_METATYPE(RIOPluginDescription)
Q_DECLARE_METATYPE(RCorePluginDescription)
Q_DECLARE_METATYPE(RAsmPluginDescription)
Q_DECLARE_METATYPE(BinClassMethodDescription)
Q_DECLARE_METATYPE(BinClassFieldDescription)
Q_DECLARE_METATYPE(BinClassDescription)
Q_DECLARE_METATYPE(const BinClassDescription *)
Q_DECLARE_METATYPE(const BinClassMethodDescription *)
Q_DECLARE_METATYPE(const BinClassFieldDescription *)
Q_DECLARE_METATYPE(AnalBaseClassDescription)
Q_DECLARE_METATYPE(AnalMethodDescription)
Q_DECLARE_METATYPE(AnalVTableDescription)
Q_DECLARE_METATYPE(ResourcesDescription)
Q_DECLARE_METATYPE(VTableDescription)
Q_DECLARE_METATYPE(TypeDescription)
Q_DECLARE_METATYPE(HeaderDescription)
Q_DECLARE_METATYPE(ZignatureDescription)
Q_DECLARE_METATYPE(SearchDescription)
Q_DECLARE_METATYPE(SectionDescription)
Q_DECLARE_METATYPE(SegmentDescription)
Q_DECLARE_METATYPE(MemoryMapDescription)
Q_DECLARE_METATYPE(BreakpointDescription)
Q_DECLARE_METATYPE(ProcessDescription)
Q_DECLARE_METATYPE(RegisterRefDescription)
Q_DECLARE_METATYPE(VariableDescription)
class CutterCore: public QObject
{
@ -787,7 +412,6 @@ private:
bool emptyGraph = false;
BasicBlockHighlighter *bbHighlighter;
};
#endif // CUTTER_H

59
src/core/CutterCommon.h Normal file
View File

@ -0,0 +1,59 @@
/** \file CutterCommon.h
* This file contains any definition that is useful in the whole project.
* For example, it may contain custom types (RVA, ut64), list iterators, etc.
*/
#ifndef CUTTERCORE_H
#define CUTTERCORE_H
#include "r_core.h"
#include <QtCore/QtCore>
// Workaround for compile errors on Windows
#ifdef _WIN32
#undef min
#undef max
#endif //_WIN32
// radare2 list iteration macros
#define CutterRListForeach(list, it, type, x) \
if (list) for (it = list->head; it && ((x=static_cast<type*>(it->data))); it = it->n)
#define CutterRVectorForeach(vec, it, type) \
if ((vec) && (vec)->a) \
for (it = (type *)(vec)->a; (char *)it != (char *)(vec)->a + ((vec)->len * (vec)->elem_size); it = (type *)((char *)it + (vec)->elem_size))
// Global information for Cutter
#define APPNAME "Cutter"
/*!
* \brief Type to be used for all kinds of addresses/offsets in r2 address space.
*/
typedef ut64 RVA;
/*!
* \brief Maximum value of RVA. Do NOT use this for specifying invalid values, use RVA_INVALID instead.
*/
#define RVA_MAX UT64_MAX
/*!
* \brief Value for specifying an invalid RVA.
*/
#define RVA_INVALID RVA_MAX
inline QString RAddressString(RVA addr)
{
return QString::asprintf("%#010llx", addr);
}
inline QString RSizeString(RVA size)
{
return QString::asprintf("%lld", size);
}
inline QString RHexString(RVA size)
{
return QString::asprintf("%#llx", size);
}
#endif // CUTTERCORE_H

View File

@ -0,0 +1,340 @@
/** \file CutterDescriptions.h
* This file contains every structure description that are used in widgets.
* The descriptions are used for the Qt metatypes.
*/
#ifndef DESCRIPTIONS_H
#define DESCRIPTIONS_H
struct FunctionDescription {
RVA offset;
RVA size;
RVA nargs;
RVA nbbs;
RVA nlocals;
RVA cc;
QString calltype;
QString name;
RVA edges;
RVA cost;
RVA calls;
RVA stackframe;
bool contains(RVA addr) const
{
return addr >= offset && addr < offset + size;
}
};
struct ImportDescription {
RVA plt;
int ordinal;
QString bind;
QString type;
QString name;
};
struct ExportDescription {
RVA vaddr;
RVA paddr;
RVA size;
QString type;
QString name;
QString flag_name;
};
struct HeaderDescription
{
RVA vaddr;
RVA paddr;
QString value;
QString name;
};
struct ZignatureDescription
{
QString name;
QString bytes;
RVA cc;
RVA nbbs;
RVA edges;
RVA ebbs;
RVA offset;
QStringList refs;
};
struct TypeDescription {
QString type;
int size;
QString format;
QString category;
};
struct SearchDescription {
RVA offset;
int size;
QString code;
QString data;
};
struct SymbolDescription {
RVA vaddr;
QString bind;
QString type;
QString name;
};
struct CommentDescription {
RVA offset;
QString name;
};
struct RelocDescription {
RVA vaddr;
RVA paddr;
QString type;
QString name;
};
struct StringDescription {
RVA vaddr;
QString string;
QString type;
QString section;
ut32 length;
ut32 size;
};
struct FlagspaceDescription {
QString name;
};
struct FlagDescription {
RVA offset;
RVA size;
QString name;
};
struct SectionDescription {
RVA vaddr;
RVA paddr;
RVA size;
RVA vsize;
QString name;
QString flags;
QString entropy;
};
struct SegmentDescription {
RVA vaddr;
RVA paddr;
RVA size;
RVA vsize;
QString name;
QString perm;
};
struct EntrypointDescription {
RVA vaddr;
RVA paddr;
RVA baddr;
RVA laddr;
RVA haddr;
QString type;
};
struct XrefDescription {
RVA from;
QString from_str;
RVA to;
QString to_str;
QString type;
};
struct RBinPluginDescription {
QString name;
QString description;
QString license;
QString type;
};
struct RIOPluginDescription {
QString name;
QString description;
QString license;
QString permissions;
};
struct RCorePluginDescription {
QString name;
QString description;
};
struct RAsmPluginDescription {
QString name;
QString architecture;
QString author;
QString version;
QString cpus;
QString description;
QString license;
};
struct DisassemblyLine {
RVA offset;
QString text;
};
struct BinClassBaseClassDescription {
QString name;
RVA offset;
};
struct BinClassMethodDescription {
QString name;
RVA addr = RVA_INVALID;
st64 vtableOffset = -1;
};
struct BinClassFieldDescription {
QString name;
RVA addr = RVA_INVALID;
};
struct BinClassDescription {
QString name;
RVA addr = RVA_INVALID;
RVA vtableAddr = RVA_INVALID;
ut64 index = 0;
QList<BinClassBaseClassDescription> baseClasses;
QList<BinClassMethodDescription> methods;
QList<BinClassFieldDescription> fields;
};
struct AnalMethodDescription {
QString name;
RVA addr;
st64 vtableOffset;
};
struct AnalBaseClassDescription {
QString id;
RVA offset;
QString className;
};
struct AnalVTableDescription {
QString id;
ut64 offset;
ut64 addr;
};
struct ResourcesDescription {
int name;
RVA vaddr;
ut64 index;
QString type;
ut64 size;
QString lang;
};
struct VTableDescription {
RVA addr;
QList<BinClassMethodDescription> methods;
};
struct BlockDescription {
RVA addr;
RVA size;
int flags;
int functions;
int inFunctions;
int comments;
int symbols;
int strings;
ut8 rwx;
};
struct BlockStatistics {
RVA from;
RVA to;
RVA blocksize;
QList<BlockDescription> blocks;
};
struct MemoryMapDescription {
RVA addrStart;
RVA addrEnd;
QString name;
QString fileName;
QString type;
QString permission;
};
struct BreakpointDescription {
RVA addr;
int size;
QString permission;
bool hw;
bool trace;
bool enabled;
};
struct ProcessDescription {
int pid;
int uid;
QString status;
QString path;
};
struct RegisterRefDescription {
QString reg;
QString value;
QString ref;
};
struct VariableDescription {
enum class RefType { SP, BP, Reg };
RefType refType;
QString name;
QString type;
};
Q_DECLARE_METATYPE(FunctionDescription)
Q_DECLARE_METATYPE(ImportDescription)
Q_DECLARE_METATYPE(ExportDescription)
Q_DECLARE_METATYPE(SymbolDescription)
Q_DECLARE_METATYPE(CommentDescription)
Q_DECLARE_METATYPE(RelocDescription)
Q_DECLARE_METATYPE(StringDescription)
Q_DECLARE_METATYPE(FlagspaceDescription)
Q_DECLARE_METATYPE(FlagDescription)
Q_DECLARE_METATYPE(XrefDescription)
Q_DECLARE_METATYPE(EntrypointDescription)
Q_DECLARE_METATYPE(RBinPluginDescription)
Q_DECLARE_METATYPE(RIOPluginDescription)
Q_DECLARE_METATYPE(RCorePluginDescription)
Q_DECLARE_METATYPE(RAsmPluginDescription)
Q_DECLARE_METATYPE(BinClassMethodDescription)
Q_DECLARE_METATYPE(BinClassFieldDescription)
Q_DECLARE_METATYPE(BinClassDescription)
Q_DECLARE_METATYPE(const BinClassDescription *)
Q_DECLARE_METATYPE(const BinClassMethodDescription *)
Q_DECLARE_METATYPE(const BinClassFieldDescription *)
Q_DECLARE_METATYPE(AnalBaseClassDescription)
Q_DECLARE_METATYPE(AnalMethodDescription)
Q_DECLARE_METATYPE(AnalVTableDescription)
Q_DECLARE_METATYPE(ResourcesDescription)
Q_DECLARE_METATYPE(VTableDescription)
Q_DECLARE_METATYPE(TypeDescription)
Q_DECLARE_METATYPE(HeaderDescription)
Q_DECLARE_METATYPE(ZignatureDescription)
Q_DECLARE_METATYPE(SearchDescription)
Q_DECLARE_METATYPE(SectionDescription)
Q_DECLARE_METATYPE(SegmentDescription)
Q_DECLARE_METATYPE(MemoryMapDescription)
Q_DECLARE_METATYPE(BreakpointDescription)
Q_DECLARE_METATYPE(ProcessDescription)
Q_DECLARE_METATYPE(RegisterRefDescription)
Q_DECLARE_METATYPE(VariableDescription)
#endif // DESCRIPTIONS_H

View File

@ -1,5 +1,5 @@
#include "common/PythonManager.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "ui_MainWindow.h"
#include "common/Helpers.h"
#include "CutterConfig.h"
@ -94,7 +94,7 @@
#include "widgets/BreakpointWidget.h"
#include "widgets/RegisterRefsWidget.h"
#include "RunScriptTask.h"
#include "common/RunScriptTask.h"
// Graphics
#include <QGraphicsEllipseItem>

View File

@ -3,7 +3,7 @@
#include <memory>
#include "Cutter.h" // only needed for ut64
#include "core/Cutter.h" // only needed for ut64
#include "widgets/DisassemblyWidget.h"
#include "widgets/GraphWidget.h"
#include "widgets/OverviewWidget.h"

View File

@ -1,8 +1,9 @@
#include <Cutter.h>
#include "r_version.h"
#include "core/Cutter.h"
#include "AboutDialog.h"
#include "ui_AboutDialog.h"
#include "R2PluginsDialog.h"
#include "r_version.h"
#include "common/Configuration.h"
#include <QUrl>

View File

@ -1,5 +1,5 @@
#include "MainWindow.h"
#include "Cutter.h"
#include "core/MainWindow.h"
#include "core/Cutter.h"
#include "AttachProcDialog.h"
#include "ui_AttachProcDialog.h"

View File

@ -1,6 +1,6 @@
#pragma once
#include "Cutter.h"
#include "core/Cutter.h"
#include <QDialog>
#include <memory>
#include <QAbstractListModel>

View File

@ -1,6 +1,6 @@
#include "EditInstructionDialog.h"
#include "ui_EditInstructionDialog.h"
#include "Cutter.h"
#include "core/Cutter.h"
EditInstructionDialog::EditInstructionDialog(QWidget *parent, InstructionEditMode editMode) :
QDialog(parent),

View File

@ -6,7 +6,7 @@
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
namespace Ui {
class EditMethodDialog;

View File

@ -1,7 +1,7 @@
#ifndef EDITVARIABLESDIALOG_H
#define EDITVARIABLESDIALOG_H
#include "Cutter.h"
#include "core/Cutter.h"
#include <QDialog>
namespace Ui {

View File

@ -4,7 +4,7 @@
#include <QDialog>
#include <QIntValidator>
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
namespace Ui {
class FlagDialog;

View File

@ -1,7 +1,7 @@
#ifndef HEXDUMPRANGEDIALOG_H
#define HEXDUMPRANGEDIALOG_H
#include "Cutter.h"
#include "core/Cutter.h"
#include <QDialog>
#include <QRegExpValidator>

View File

@ -3,7 +3,7 @@
#include "InitialOptionsDialog.h"
#include "ui_InitialOptionsDialog.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "dialogs/NewFileDialog.h"
#include "dialogs/AsyncTaskDialog.h"
#include "common/Helpers.h"

View File

@ -6,8 +6,8 @@
#include <QTimer>
#include <QElapsedTimer>
#include <memory>
#include "Cutter.h"
#include "AnalTask.h"
#include "core/Cutter.h"
#include "common/AnalTask.h"
#include "common/InitialOptions.h"
namespace Ui {

View File

@ -1,7 +1,7 @@
#include "dialogs/LoadNewTypesDialog.h"
#include "ui_LoadNewTypesDialog.h"
#include "Cutter.h"
#include "core/Cutter.h"
#include "common/Configuration.h"
#include "common/SyntaxHighlighter.h"
#include "widgets/TypesWidget.h"

View File

@ -1,5 +1,5 @@
#include "InitialOptionsDialog.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "dialogs/NewFileDialog.h"
#include "dialogs/AboutDialog.h"
#include "ui_NewfileDialog.h"

View File

@ -3,7 +3,7 @@
#include <QDialog>
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
namespace Ui {
class OpenFileDialog;

View File

@ -1,7 +1,7 @@
#include "R2PluginsDialog.h"
#include "ui_R2PluginsDialog.h"
#include "Cutter.h"
#include "core/Cutter.h"
#include "common/Helpers.h"
#include "plugins/PluginManager.h"

View File

@ -4,7 +4,7 @@
#include <QDialog>
#include <QAbstractTableModel>
#include "Cutter.h"
#include "core/Cutter.h"
namespace Ui {
class R2PluginsDialog;

View File

@ -1,7 +1,7 @@
#include <QFileDialog>
#include <Cutter.h>
#include "core/Cutter.h"
#include "SaveProjectDialog.h"
#include "ui_SaveProjectDialog.h"
#include "common/TempConfig.h"

View File

@ -2,7 +2,7 @@
#define SETTODATADIALOG_H
#include <QDialog>
#include "Cutter.h"
#include "core/Cutter.h"
namespace Ui {
class SetToDataDialog;

View File

@ -4,7 +4,7 @@
#include <QDialog>
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
namespace Ui {
class VersionInfoDialog;

View File

@ -1,4 +1,4 @@
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "CutterConfig.h"
#include "common/Helpers.h"

View File

@ -4,7 +4,7 @@
#include "common/TempConfig.h"
#include "common/Helpers.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include <QJsonArray>

View File

@ -5,7 +5,7 @@
#include <QTreeWidgetItem>
#include <memory>
#include "common/Highlighter.h"
#include "Cutter.h"
#include "core/Cutter.h"
class MainWindow;

View File

@ -6,7 +6,7 @@
#include <QPushButton>
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
class PreferencesDialog;

View File

@ -6,7 +6,7 @@
#include <QPushButton>
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
class PreferencesDialog;

View File

@ -3,7 +3,7 @@
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
class PreferencesDialog;

View File

@ -6,7 +6,7 @@
#include <QPushButton>
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
class PreferencesDialog;

View File

@ -7,7 +7,7 @@
#include <QTreeWidget>
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
namespace Ui {
class PreferencesDialog;

View File

@ -1,7 +1,7 @@
#ifndef DISASSEMBLYCONTEXTMENU_H
#define DISASSEMBLYCONTEXTMENU_H
#include "Cutter.h"
#include "core/Cutter.h"
#include <QMenu>
#include <QKeySequence>

View File

@ -83,6 +83,7 @@ if get_option('enable_python')
shiboken_exe = shiboken_dep.get_pkgconfig_variable('generator_location')
qt5core_dep = dependency('Qt5Core', method: 'pkg-config')
bindings_generate_inc = [meson.current_source_dir(),
join_paths(meson.current_source_dir(), 'core'),
join_paths(meson.current_source_dir(), 'common'),
join_paths(meson.current_source_dir(), 'widgets'),
join_paths(meson.current_source_dir(), 'plugins'),
@ -127,6 +128,6 @@ cutter_exe = executable(
moc_files,
gui_app: true,
sources: sources,
include_directories: [include_directories('common', 'widgets', 'plugins'), platform_inc, conf_inc],
include_directories: [include_directories('core', 'common', 'widgets', 'plugins'), platform_inc, conf_inc],
dependencies: deps,
)

View File

@ -4,7 +4,7 @@
class CutterPlugin;
class MainWindow;
#include "Cutter.h"
#include "core/Cutter.h"
#include "widgets/CutterDockWidget.h"
class CutterPlugin

View File

@ -2,7 +2,7 @@
#include "ui_BacktraceWidget.h"
#include "common/JsonModel.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
BacktraceWidget::BacktraceWidget(MainWindow *main, QAction *action) :
CutterDockWidget(main, action),

View File

@ -5,7 +5,7 @@
#include <QStandardItem>
#include <QTableView>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
class MainWindow;

View File

@ -1,7 +1,7 @@
#include "BreakpointWidget.h"
#include "ui_BreakpointWidget.h"
#include "dialogs/BreakpointsDialog.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "common/Helpers.h"
#include <QMenu>

View File

@ -2,7 +2,7 @@
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include <QAbstractListModel>

View File

@ -2,7 +2,7 @@
#include <QList>
#include "ClassesWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "ui_ClassesWidget.h"
#include "common/Helpers.h"
#include "dialogs/EditMethodDialog.h"

View File

@ -3,7 +3,7 @@
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include <QAbstractListModel>

View File

@ -3,7 +3,7 @@
#include "CommentsWidget.h"
#include "ui_CommentsWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "common/Helpers.h"
CommentsModel::CommentsModel(QList<CommentDescription> *comments,

View File

@ -5,7 +5,7 @@
#include <QAbstractItemModel>
#include <QSortFilterProxyModel>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include "CutterTreeWidget.h"

View File

@ -6,7 +6,7 @@
#include <QStringListModel>
#include <QTimer>
#include <iostream>
#include "Cutter.h"
#include "core/Cutter.h"
#include "ConsoleWidget.h"
#include "ui_ConsoleWidget.h"
#include "common/Helpers.h"

View File

@ -2,7 +2,7 @@
#define CONSOLEWIDGET_H
#include <memory>
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "CutterDockWidget.h"
#include "common/CommandTask.h"

View File

@ -1,5 +1,5 @@
#include "CutterDockWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
CutterDockWidget::CutterDockWidget(MainWindow *main, QAction *action) :

View File

@ -1,5 +1,5 @@
#include "CutterTreeWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
CutterTreeWidget::CutterTreeWidget(QObject *parent) :
QObject(parent),

View File

@ -6,7 +6,7 @@
#include "common/TempConfig.h"
#include "dialogs/VersionInfoDialog.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "CutterTreeView.h"
#include <QDebug>

View File

@ -1,5 +1,5 @@
#include "DebugActions.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "dialogs/AttachProcDialog.h"
#include <QAction>

View File

@ -1,6 +1,6 @@
#pragma once
#include "Cutter.h"
#include "core/Cutter.h"
class MainWindow;
class QToolBar;

View File

@ -17,7 +17,7 @@
#include <QClipboard>
#include <QApplication>
#include "Cutter.h"
#include "core/Cutter.h"
#include "common/Colors.h"
#include "common/Configuration.h"
#include "common/CachedFontMetrics.h"

View File

@ -1,7 +1,7 @@
#ifndef DISASSEMBLYWIDGET_H
#define DISASSEMBLYWIDGET_H
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include "common/CutterSeekable.h"
#include "common/RefreshDeferrer.h"

View File

@ -1,7 +1,7 @@
#include "EntrypointWidget.h"
#include "ui_EntrypointWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "common/Helpers.h"
#include <QTreeWidget>

View File

@ -1,6 +1,6 @@
#include "ExportsWidget.h"
#include "ui_ExportsWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "common/Helpers.h"
#include "WidgetShortcuts.h"

View File

@ -3,7 +3,7 @@
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include "CutterTreeWidget.h"

View File

@ -4,7 +4,7 @@
#include "FlagsWidget.h"
#include "ui_FlagsWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "dialogs/RenameDialog.h"
#include "common/Helpers.h"

View File

@ -6,7 +6,7 @@
#include <QAbstractItemModel>
#include <QSortFilterProxyModel>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include "CutterTreeWidget.h"

View File

@ -1,7 +1,7 @@
#include "FunctionsWidget.h"
#include "ui_FunctionsWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "common/Helpers.h"
#include "dialogs/CommentsDialog.h"
#include "dialogs/RenameDialog.h"

View File

@ -5,7 +5,7 @@
#include <QSortFilterProxyModel>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include "CutterTreeWidget.h"
#include "CutterTreeView.h"

View File

@ -13,7 +13,7 @@
#include <unordered_set>
#include <queue>
#include "Cutter.h"
#include "core/Cutter.h"
class GraphView : public QAbstractScrollArea
{

View File

@ -1,4 +1,4 @@
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "GraphWidget.h"
#include "DisassemblerGraphView.h"
#include "WidgetShortcuts.h"

View File

@ -1,6 +1,6 @@
#include "HeadersWidget.h"
#include "ui_HeadersWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "common/Helpers.h"
HeadersModel::HeadersModel(QList<HeaderDescription> *headers, QObject *parent)

View File

@ -3,7 +3,7 @@
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include <QAbstractListModel>

View File

@ -9,7 +9,7 @@
#include <array>
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include "common/CutterSeekable.h"
#include "dialogs/HexdumpRangeDialog.h"

View File

@ -1,7 +1,7 @@
#include "ImportsWidget.h"
#include "ui_ImportsWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "common/Helpers.h"
#include "WidgetShortcuts.h"

View File

@ -10,7 +10,7 @@
#include <QTreeWidgetItem>
#include "CutterDockWidget.h"
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterTreeWidget.h"
class MainWindow;

View File

@ -1,6 +1,6 @@
#include "MemoryMapWidget.h"
#include "ui_MemoryMapWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "common/Helpers.h"
MemoryMapModel::MemoryMapModel(QList<MemoryMapDescription> *memoryMaps, QObject *parent)

View File

@ -2,7 +2,7 @@
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include <QAbstractListModel>

View File

@ -1,5 +1,5 @@
#include "Omnibar.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include <QStringListModel>
#include <QCompleter>

View File

@ -2,7 +2,7 @@
#include <QPainter>
#include <QMouseEvent>
#include "Cutter.h"
#include "core/Cutter.h"
#include "common/Colors.h"
#include "common/Configuration.h"
#include "common/TempConfig.h"

View File

@ -1,4 +1,4 @@
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "OverviewWidget.h"
#include "OverviewView.h"

View File

@ -3,7 +3,7 @@
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
namespace Ui {

View File

@ -1,6 +1,6 @@
#include "RegisterRefsWidget.h"
#include "ui_RegisterRefsWidget.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include "common/Helpers.h"
#include <QMenu>
#include <QClipboard>

View File

@ -2,7 +2,7 @@
#include <memory>
#include "Cutter.h"
#include "core/Cutter.h"
#include "CutterDockWidget.h"
#include "CutterTreeWidget.h"

View File

@ -2,7 +2,7 @@
#include "ui_RegistersWidget.h"
#include "common/JsonModel.h"
#include "MainWindow.h"
#include "core/MainWindow.h"
#include <QLabel>
#include <QLineEdit>

Some files were not shown because too many files have changed in this diff Show More