class CutterCore

Public Types

enum MemoryWidgetType


enum HexdumpFormats



Public Functions

CutterCore(QObject *parent)
void initialize()
AsyncTaskManager *getAsyncTaskManager()
RVA getOffset() const
QString cmd(const char *str)

CutterCore::cmd send a command to radare2.

command output
  • str -

    the command you want to execute Note that if you want to seek to an address, you should use CutterCore::seek

QString cmd(const QString &str)
QString cmdRaw(const QString &str)
QJsonDocument cmdj(const char *str)
QJsonDocument cmdj(const QString &str)
QStringList cmdList(const char *str)
QStringList cmdList(const QString &str)
QString cmdTask(const QString &str)
QJsonDocument cmdjTask(const QString &str)
void cmdEsil(const char *command)
void cmdEsil(const QString &command)
QString getVersionInformation()
QJsonDocument parseJson(const char *res, const char *cmd)
QJsonDocument parseJson(const char *res, const QString &cmd)
QStringList autocomplete(const QString &cmd, RLinePromptType promptType, size_t limit)
void renameFunction(const QString &oldName, const QString &newName)
void delFunction(RVA addr)
void renameFlag(QString old_name, QString new_name)
RAnalFunction *functionAt(ut64 addr)
QString cmdFunctionAt(QString addr)
QString cmdFunctionAt(RVA addr)
QString createFunctionAt(RVA addr, QString name)
QStringList getDisassemblyPreview(RVA address, int num_of_lines)

get a compact disassembly preview for tooltips

  • address -

    - the address from which to print the disassembly

  • num_of_lines -

    - number of instructions to print

void delFlag(RVA addr)
void delFlag(const QString &name)
void addFlag(RVA offset, QString name, RVA size)
void triggerFlagsChanged()
QString getInstructionBytes(RVA addr)
QString getInstructionOpcode(RVA addr)
void editInstruction(RVA addr, const QString &inst)
void nopInstruction(RVA addr)
void jmpReverse(RVA addr)
void editBytes(RVA addr, const QString &inst)
void editBytesEndian(RVA addr, const QString &bytes)
void setToCode(RVA addr)
void setAsString(RVA addr)
void setToData(RVA addr, int size, int repeat)
int sizeofDataMeta(RVA addr)
void setComment(RVA addr, const QString &cmt)
void delComment(RVA addr)
void setImmediateBase(const QString &r2BaseName, RVA offset)
void setCurrentBits(int bits, RVA offset)
void applyStructureOffset(const QString &structureOffset, RVA offset)

Changes immediate displacement to structure offset This function makes use of the “ta” command of r2 to apply structure offset to the immediate displacement used in the given instruction.

  • structureOffset -

    The name of struct which will be applied

  • offset -

    The address of the instruction where the struct will be applied

QList<QString> getAllAnalClasses(bool sorted)
QList<AnalMethodDescription> getAnalClassMethods(const QString &cls)
QList<AnalBaseClassDescription> getAnalClassBaseClasses(const QString &cls)
QList<AnalVTableDescription> getAnalClassVTables(const QString &cls)
void createNewClass(const QString &cls)
void renameClass(const QString &oldName, const QString &newName)
void deleteClass(const QString &cls)
bool getAnalMethod(const QString &cls, const QString &meth, AnalMethodDescription *desc)
void renameAnalMethod(const QString &className, const QString &oldMethodName, const QString &newMethodName)
void setAnalMethod(const QString &cls, const AnalMethodDescription &meth)
bool loadFile(QString path, ut64 baddr, ut64 mapaddr, int perms, int va, bool loadbin, const QString &forceBinPlugin)

CutterCore::loadFile Load initial file. TODO Maybe use the “o” commands?

  • path -

    File path

  • baddr -

    Base (RBin) address

  • mapaddr -

    Map address

  • perms -

  • va -

  • loadbin -

    Load RBin information

  • forceBinPlugin -

bool tryFile(QString path, bool rw)
bool openFile(QString path, RVA mapaddr)

Opens a file using r2 API.

  • path -

    Path to file

  • mapaddr -

    Map Address

void loadScript(const QString &scriptname)
QJsonArray getOpenedFiles()
void seek(QString thing)
void seek(ut64 offset)
void seekPrev()
void seekNext()
void updateSeek()
RVA getOffset()
RVA prevOpAddr(RVA startAddr, int count)
RVA nextOpAddr(RVA startAddr, int count)
MemoryWidgetType getMemoryWidgetPriority() const
void setMemoryWidgetPriority(MemoryWidgetType type)
void triggerRaisePrioritizedMemoryWidget()
ut64 math(const QString &expr)
ut64 num(const QString &expr)
QString itoa(ut64 num, int rdx)
void setConfig(const char *k, const QString &v)
void setConfig(const QString &k, const QString &v)
void setConfig(const char *k, int v)
void setConfig(const QString &k, int v)
void setConfig(const char *k, bool v)
void setConfig(const QString &k, bool v)
void setConfig(const char *k, const QVariant &v)
void setConfig(const QString &k, const QVariant &v)
int getConfigi(const char *k)
int getConfigi(const QString &k)
ut64 getConfigut64(const char *k)
ut64 getConfigut64(const QString &k)
bool getConfigb(const char *k)
bool getConfigb(const QString &k)
QString getConfig(const char *k)
QString getConfig(const QString &k)
QList<QString> getColorThemes()
QByteArray assemble(const QString &code)
QString disassemble(const QByteArray &data)
QString disassembleSingleInstruction(RVA addr)
QList<DisassemblyLine> disassembleLines(RVA offset, int lines)
QString hexdump(RVA offset, int size, HexdumpFormats format)

return hexdump of <size> from an <offset> by a given formats

  • address -

    - the address from which to print the hexdump

  • size -

    - number of bytes to print

  • format -

    - the type of hexdump (qwords, words. decimal, etc)

QString getHexdumpPreview(RVA offset, int size)

get a compact hexdump preview for tooltips

  • address -

    - the address from which to print the hexdump

  • size -

    - number of bytes to print

void setCPU(QString arch, QString cpu, int bits)
void setEndianness(bool big)
QList<QString> sdbList(QString path)
QList<QString> sdbListKeys(QString path)
QString sdbGet(QString path, QString key)
bool sdbSet(QString path, QString key, QString val)
QJsonDocument getRegistersInfo()
QJsonDocument getRegisterValues()
QString getRegisterName(QString registerRole)
RVA getProgramCounterValue()
void setRegister(QString regName, QString regValue)
QJsonDocument getStack(int size)
QJsonDocument getBacktrace()
void startDebug()
void startEmulation()
void attachDebug(int pid)
void stopDebug()
void continueDebug()
void continueUntilCall()
void continueUntilSyscall()
void continueUntilDebug(QString offset)
void stepDebug()
void stepOverDebug()
void stepOutDebug()
void toggleBreakpoint(RVA addr)
void toggleBreakpoint(QString addr)
void delBreakpoint(RVA addr)
void delAllBreakpoints()
void enableBreakpoint(RVA addr)
void disableBreakpoint(RVA addr)
bool isBreakpoint(const QList<RVA> &breakpoints, RVA addr)
QList<RVA> getBreakpointsAddresses()
QString getActiveDebugPlugin()
QStringList getDebugPlugins()
void setDebugPlugin(QString plugin)
QString getDecompiledCodePDC(RVA addr)
bool getR2DecAvailable()
QString getDecompiledCodeR2Dec(RVA addr)
RVA getOffsetJump(RVA addr)
QJsonDocument getFileInfo()
QJsonDocument getSignatureInfo()
QJsonDocument getFileVersionInfo()
QStringList getStats()
void setGraphEmpty(bool empty)
bool isGraphEmpty()
void getOpcodes()
void setSettings()
void loadPDB(const QString &file)
QByteArray ioRead(RVA addr, int len)
QList<RVA> getSeekHistory()
QStringList getAsmPluginNames()
QStringList getAnalPluginNames()
QStringList getProjectNames()
void openProject(const QString &name)
void saveProject(const QString &name)
void deleteProject(const QString &name)
QList<RBinPluginDescription> getRBinPluginDescriptions(const QString &type)
QList<RIOPluginDescription> getRIOPluginDescriptions()
QList<RCorePluginDescription> getRCorePluginDescriptions()
QList<RAsmPluginDescription> getRAsmPluginDescriptions()
QList<FunctionDescription> getAllFunctions()
QList<ImportDescription> getAllImports()
QList<ExportDescription> getAllExports()
QList<SymbolDescription> getAllSymbols()
QList<HeaderDescription> getAllHeaders()
QList<ZignatureDescription> getAllZignatures()
QList<CommentDescription> getAllComments(const QString &filterType)
QList<RelocDescription> getAllRelocs()
QList<StringDescription> getAllStrings()
QList<FlagspaceDescription> getAllFlagspaces()
QList<FlagDescription> getAllFlags(QString flagspace)
QList<SectionDescription> getAllSections()
QList<SegmentDescription> getAllSegments()
QList<EntrypointDescription> getAllEntrypoint()
QList<BinClassDescription> getAllClassesFromBin()
QList<BinClassDescription> getAllClassesFromFlags()
QList<ResourcesDescription> getAllResources()
QList<VTableDescription> getAllVTables()
QList<TypeDescription> getAllTypes()

all loaded types

QList<TypeDescription> getAllPrimitiveTypes()

all loaded primitive types

QList<TypeDescription> getAllUnions()

all loaded unions

QList<TypeDescription> getAllStructs()

all loaded structs

QList<TypeDescription> getAllEnums()

all loaded enums

QList<TypeDescription> getAllTypedefs()

all loaded typedefs

QString addTypes(const char *str)

Adds new types It first uses the r_parse_c_string() function from radare2 API to parse the supplied C file (in the form of a string). If there were errors, they are displayed. If there were no errors, it uses sdb_query_lines() function from radare2 API to save the parsed types returned by r_parse_c_string()

returns an empty QString if there was no error, else returns the error
  • str -

    Contains the definition of the data types

QString addTypes(const QString &str)
bool isAddressMapped(RVA addr)

Checks if the given address is mapped to a region.

true if addr is mapped, false otherwise
  • addr -

    The address to be checked

QList<MemoryMapDescription> getMemoryMap()
QList<SearchDescription> getAllSearch(QString search_for, QString space)
BlockStatistics getBlockStatistics(unsigned int blocksCount)
QList<BreakpointDescription> getBreakpoints()
QList<ProcessDescription> getAllProcesses()
QList<RegisterRefDescription> getRegisterRefs()
QJsonObject getRegisterJson()
QList<VariableDescription> getVariables(RVA at)
QList<XrefDescription> getXRefs(RVA addr, bool to, bool whole_function, const QString &filterType)
QList<StringDescription> parseStringsJson(const QJsonDocument &doc)
void handleREvent(int type, void *data)
void triggerVarsChanged()
void triggerFunctionRenamed(const QString &prevName, const QString &newName)
void triggerRefreshAll()
void triggerAsmOptionsChanged()
void triggerGraphOptionsChanged()
void message(const QString &msg, bool debug)
QStringList getSectionList()
RCoreLocked core() const
BasicBlockHighlighter *getBBHighlighter()

Public Members

bool currentlyDebugging
bool currentlyEmulating
int currentlyAttachedToPID
QString currentlyOpenFile
QList<QString> opcodes
QList<QString> regs


signal CutterCore::refreshAll
signal CutterCore::functionRenamed
signal CutterCore::varsChanged
signal CutterCore::functionsChanged
signal CutterCore::flagsChanged
signal CutterCore::commentsChanged
signal CutterCore::registersChanged
signal CutterCore::instructionChanged
signal CutterCore::breakpointsChanged
signal CutterCore::refreshCodeViews
signal CutterCore::stackChanged
signal CutterCore::classNew
signal CutterCore::classDeleted
signal CutterCore::classRenamed
signal CutterCore::classAttrsChanged
signal CutterCore::projectSaved
signal CutterCore::asmOptionsChanged

emitted when config regarding disassembly display changes

signal CutterCore::graphOptionsChanged

emitted when config regarding graph display changes

signal CutterCore::seekChanged

seekChanged is emitted each time radare2 seek value is modified

  • offset -

signal CutterCore::raisePrioritizedMemoryWidget
signal CutterCore::changeDefinedView
signal CutterCore::changeDebugView
signal CutterCore::newMessage
signal CutterCore::newDebugMessage

Public Static Functions

CutterCore *instance()
QString sanitizeStringForCommand(QString s)
QByteArray hexStringToBytes(const QString &hex)
QString bytesToHexString(const QByteArray &bytes)
bool isProjectNameValid(const QString &name)
QString ansiEscapeToHtml(const QString &text)