2019-02-22 16:50:45 +00:00
|
|
|
/** \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
|
|
|
|
|
2019-03-08 23:01:24 +00:00
|
|
|
#include <QString>
|
|
|
|
#include <QList>
|
|
|
|
#include <QStringList>
|
|
|
|
#include <QMetaType>
|
2020-01-30 17:40:27 +00:00
|
|
|
#include <QColor>
|
2019-04-09 07:44:44 +00:00
|
|
|
#include "core/CutterCommon.h"
|
2019-03-08 23:01:24 +00:00
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct FunctionDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA offset;
|
2020-01-15 19:19:24 +00:00
|
|
|
RVA linearSize;
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA nargs;
|
|
|
|
RVA nbbs;
|
|
|
|
RVA nlocals;
|
|
|
|
QString calltype;
|
|
|
|
QString name;
|
|
|
|
RVA edges;
|
|
|
|
RVA stackframe;
|
|
|
|
|
|
|
|
bool contains(RVA addr) const
|
|
|
|
{
|
2020-01-15 19:19:24 +00:00
|
|
|
// TODO: this is not exactly correct in edge cases.
|
2020-12-07 07:57:11 +00:00
|
|
|
// rz_analysis_function_contains() does it right.
|
2020-01-15 19:19:24 +00:00
|
|
|
return addr >= offset && addr < offset + linearSize;
|
2019-02-22 16:50:45 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct ImportDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA plt;
|
|
|
|
int ordinal;
|
|
|
|
QString bind;
|
|
|
|
QString type;
|
|
|
|
QString name;
|
2020-01-25 07:18:53 +00:00
|
|
|
QString libname;
|
2019-02-22 16:50:45 +00:00
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct ExportDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct TypeDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString type;
|
|
|
|
int size;
|
|
|
|
QString format;
|
|
|
|
QString category;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct SearchDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA offset;
|
|
|
|
int size;
|
|
|
|
QString code;
|
|
|
|
QString data;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct SymbolDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA vaddr;
|
|
|
|
QString bind;
|
|
|
|
QString type;
|
|
|
|
QString name;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct CommentDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA offset;
|
|
|
|
QString name;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct RelocDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA vaddr;
|
|
|
|
RVA paddr;
|
|
|
|
QString type;
|
|
|
|
QString name;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct StringDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA vaddr;
|
|
|
|
QString string;
|
|
|
|
QString type;
|
|
|
|
QString section;
|
|
|
|
ut32 length;
|
|
|
|
ut32 size;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct FlagspaceDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString name;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct FlagDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA offset;
|
|
|
|
RVA size;
|
|
|
|
QString name;
|
2020-01-25 07:18:53 +00:00
|
|
|
QString realname;
|
2019-02-22 16:50:45 +00:00
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct SectionDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA vaddr;
|
|
|
|
RVA paddr;
|
|
|
|
RVA size;
|
|
|
|
RVA vsize;
|
|
|
|
QString name;
|
2019-05-16 10:48:14 +00:00
|
|
|
QString perm;
|
2019-02-22 16:50:45 +00:00
|
|
|
QString entropy;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct SegmentDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA vaddr;
|
|
|
|
RVA paddr;
|
|
|
|
RVA size;
|
|
|
|
RVA vsize;
|
|
|
|
QString name;
|
|
|
|
QString perm;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct EntrypointDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA vaddr;
|
|
|
|
RVA paddr;
|
|
|
|
RVA baddr;
|
|
|
|
RVA laddr;
|
|
|
|
RVA haddr;
|
|
|
|
QString type;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct XrefDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA from;
|
|
|
|
QString from_str;
|
|
|
|
RVA to;
|
|
|
|
QString to_str;
|
|
|
|
QString type;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct RzBinPluginDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString name;
|
|
|
|
QString description;
|
|
|
|
QString license;
|
|
|
|
QString type;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct RzIOPluginDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString name;
|
|
|
|
QString description;
|
|
|
|
QString license;
|
|
|
|
QString permissions;
|
2019-05-17 07:09:10 +00:00
|
|
|
QList<QString> uris;
|
2019-02-22 16:50:45 +00:00
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct RzCorePluginDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString name;
|
|
|
|
QString description;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct RzAsmPluginDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString name;
|
|
|
|
QString architecture;
|
|
|
|
QString author;
|
|
|
|
QString version;
|
|
|
|
QString cpus;
|
|
|
|
QString description;
|
|
|
|
QString license;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct DisassemblyLine
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA offset;
|
|
|
|
QString text;
|
2019-06-26 07:12:39 +00:00
|
|
|
RVA arrow;
|
2019-02-22 16:50:45 +00:00
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct BinClassBaseClassDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString name;
|
|
|
|
RVA offset;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct BinClassMethodDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString name;
|
|
|
|
RVA addr = RVA_INVALID;
|
|
|
|
st64 vtableOffset = -1;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct BinClassFieldDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString name;
|
|
|
|
RVA addr = RVA_INVALID;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct BinClassDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString name;
|
|
|
|
RVA addr = RVA_INVALID;
|
|
|
|
RVA vtableAddr = RVA_INVALID;
|
|
|
|
ut64 index = 0;
|
|
|
|
QList<BinClassBaseClassDescription> baseClasses;
|
|
|
|
QList<BinClassMethodDescription> methods;
|
|
|
|
QList<BinClassFieldDescription> fields;
|
|
|
|
};
|
|
|
|
|
2021-09-15 18:48:02 +00:00
|
|
|
struct AnalysisMethodDescription
|
2021-01-24 14:50:13 +00:00
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString name;
|
|
|
|
RVA addr;
|
|
|
|
st64 vtableOffset;
|
|
|
|
};
|
|
|
|
|
2021-09-15 18:48:02 +00:00
|
|
|
struct AnalysisBaseClassDescription
|
2021-01-24 14:50:13 +00:00
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString id;
|
|
|
|
RVA offset;
|
|
|
|
QString className;
|
|
|
|
};
|
|
|
|
|
2021-09-15 18:48:02 +00:00
|
|
|
struct AnalysisVTableDescription
|
2021-01-24 14:50:13 +00:00
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString id;
|
|
|
|
ut64 offset;
|
|
|
|
ut64 addr;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct ResourcesDescription
|
|
|
|
{
|
2020-04-15 16:20:57 +00:00
|
|
|
QString name;
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA vaddr;
|
|
|
|
ut64 index;
|
|
|
|
QString type;
|
|
|
|
ut64 size;
|
|
|
|
QString lang;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct VTableDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA addr;
|
|
|
|
QList<BinClassMethodDescription> methods;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct BlockDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA addr;
|
|
|
|
RVA size;
|
|
|
|
int flags;
|
|
|
|
int functions;
|
|
|
|
int inFunctions;
|
|
|
|
int comments;
|
|
|
|
int symbols;
|
|
|
|
int strings;
|
|
|
|
ut8 rwx;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct BlockStatistics
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA from;
|
|
|
|
RVA to;
|
|
|
|
RVA blocksize;
|
|
|
|
QList<BlockDescription> blocks;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct MemoryMapDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
RVA addrStart;
|
|
|
|
RVA addrEnd;
|
|
|
|
QString name;
|
|
|
|
QString fileName;
|
|
|
|
QString type;
|
|
|
|
QString permission;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct BreakpointDescription
|
|
|
|
{
|
2020-01-04 18:05:49 +00:00
|
|
|
enum PositionType {
|
|
|
|
Address,
|
|
|
|
Named,
|
|
|
|
Module,
|
|
|
|
};
|
|
|
|
|
|
|
|
RVA addr = 0;
|
|
|
|
int64_t moduleDelta = 0;
|
|
|
|
int index = -1;
|
|
|
|
PositionType type = Address;
|
|
|
|
int size = 0;
|
|
|
|
int permission = 0;
|
|
|
|
QString positionExpression;
|
|
|
|
QString name;
|
|
|
|
QString command;
|
|
|
|
QString condition;
|
|
|
|
bool hw = false;
|
|
|
|
bool trace = false;
|
|
|
|
bool enabled = true;
|
2019-02-22 16:50:45 +00:00
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct ProcessDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
int pid;
|
|
|
|
int uid;
|
|
|
|
QString status;
|
|
|
|
QString path;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct RefDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
QString ref;
|
2020-01-30 17:40:27 +00:00
|
|
|
QColor refColor;
|
2019-02-22 16:50:45 +00:00
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct VariableDescription
|
|
|
|
{
|
2019-02-22 16:50:45 +00:00
|
|
|
enum class RefType { SP, BP, Reg };
|
|
|
|
RefType refType;
|
|
|
|
QString name;
|
|
|
|
QString type;
|
|
|
|
};
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct RegisterRefValueDescription
|
|
|
|
{
|
2020-04-17 13:01:05 +00:00
|
|
|
QString name;
|
|
|
|
QString value;
|
|
|
|
QString ref;
|
|
|
|
};
|
|
|
|
|
2021-06-27 20:21:06 +00:00
|
|
|
struct Chunk
|
|
|
|
{
|
|
|
|
RVA offset;
|
|
|
|
QString status;
|
|
|
|
int size;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Arena
|
|
|
|
{
|
|
|
|
RVA offset;
|
|
|
|
QString type;
|
2021-07-16 13:48:10 +00:00
|
|
|
ut64 top;
|
|
|
|
ut64 last_remainder;
|
|
|
|
ut64 next;
|
|
|
|
ut64 next_free;
|
|
|
|
ut64 system_mem;
|
|
|
|
ut64 max_system_mem;
|
2021-06-27 20:21:06 +00:00
|
|
|
};
|
|
|
|
|
2019-02-22 16:50:45 +00:00
|
|
|
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)
|
2020-10-28 12:28:04 +00:00
|
|
|
Q_DECLARE_METATYPE(RzBinPluginDescription)
|
|
|
|
Q_DECLARE_METATYPE(RzIOPluginDescription)
|
|
|
|
Q_DECLARE_METATYPE(RzCorePluginDescription)
|
|
|
|
Q_DECLARE_METATYPE(RzAsmPluginDescription)
|
2019-02-22 16:50:45 +00:00
|
|
|
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 *)
|
2021-09-15 18:48:02 +00:00
|
|
|
Q_DECLARE_METATYPE(AnalysisBaseClassDescription)
|
|
|
|
Q_DECLARE_METATYPE(AnalysisMethodDescription)
|
|
|
|
Q_DECLARE_METATYPE(AnalysisVTableDescription)
|
2019-02-22 16:50:45 +00:00
|
|
|
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)
|
2020-01-04 18:05:49 +00:00
|
|
|
Q_DECLARE_METATYPE(BreakpointDescription::PositionType)
|
2019-02-22 16:50:45 +00:00
|
|
|
Q_DECLARE_METATYPE(ProcessDescription)
|
2020-01-30 17:40:27 +00:00
|
|
|
Q_DECLARE_METATYPE(RefDescription)
|
2019-02-22 16:50:45 +00:00
|
|
|
Q_DECLARE_METATYPE(VariableDescription)
|
|
|
|
|
|
|
|
#endif // DESCRIPTIONS_H
|