From 207879027838dc480a39de90b13ea15218ace22e Mon Sep 17 00:00:00 2001 From: NIRMAL MANOJ C Date: Sat, 16 May 2020 22:58:34 +0530 Subject: [PATCH] Update r2 and fix API changes (#2199) --- radare2 | 2 +- src/core/Cutter.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/radare2 b/radare2 index 0b231619..04baa004 160000 --- a/radare2 +++ b/radare2 @@ -1 +1 @@ -Subproject commit 0b231619abedfec08f3bfb86fea259536877ab9a +Subproject commit 04baa004cc20df00a7c05056928de75951dadf27 diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index 81432c78..b485cc38 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -1054,7 +1054,7 @@ void CutterCore::setEndianness(bool big) QByteArray CutterCore::assemble(const QString &code) { CORE_LOCK(); - RAsmCode *ac = r_asm_massemble(core->assembler, code.toUtf8().constData()); + RAsmCode *ac = r_asm_massemble(core->rasm, code.toUtf8().constData()); QByteArray res; if (ac && ac->bytes) { res = QByteArray(reinterpret_cast(ac->bytes), ac->len); @@ -1066,7 +1066,7 @@ QByteArray CutterCore::assemble(const QString &code) QString CutterCore::disassemble(const QByteArray &data) { CORE_LOCK(); - RAsmCode *ac = r_asm_mdisassemble(core->assembler, reinterpret_cast(data.constData()), data.length()); + RAsmCode *ac = r_asm_mdisassemble(core->rasm, reinterpret_cast(data.constData()), data.length()); QString code; if (ac && ac->assembly) { code = QString::fromUtf8(ac->assembly); @@ -1345,7 +1345,7 @@ QJsonObject CutterCore::getAddrRefs(RVA addr, int depth) { } CORE_LOCK(); - int bits = core->assembler->bits; + int bits = core->rasm->bits; QByteArray buf = QByteArray(); ut64 type = r_core_anal_address(core, addr); @@ -1409,8 +1409,8 @@ QJsonObject CutterCore::getAddrRefs(RVA addr, int depth) { perms += "x"; // Instruction disassembly r_io_read_at(core->io, addr, (unsigned char*)buf.data(), buf.size()); - r_asm_set_pc(core->assembler, addr); - r_asm_disassemble(core->assembler, &op, (unsigned char*)buf.data(), buf.size()); + r_asm_set_pc(core->rasm, addr); + r_asm_disassemble(core->rasm, &op, (unsigned char*)buf.data(), buf.size()); json["asm"] = r_asm_op_get_asm(&op); } @@ -2365,7 +2365,7 @@ QStringList CutterCore::getAsmPluginNames() QStringList ret; RAsmPlugin *ap; - CutterRListForeach(core->assembler->plugins, it, RAsmPlugin, ap) { + CutterRListForeach(core->rasm->plugins, it, RAsmPlugin, ap) { ret << ap->name; } @@ -2476,7 +2476,7 @@ QList CutterCore::getRAsmPluginDescriptions() QList ret; RAsmPlugin *ap; - CutterRListForeach(core->assembler->plugins, it, RAsmPlugin, ap) { + CutterRListForeach(core->rasm->plugins, it, RAsmPlugin, ap) { RAsmPluginDescription plugin; plugin.name = ap->name;