From bc571675342f08d29fd36ed52996816fd1f27202 Mon Sep 17 00:00:00 2001 From: xarkes Date: Fri, 4 Jun 2021 11:05:34 +0200 Subject: [PATCH] Update Rizin version (#2698) --- cmake/BundledRizin.cmake | 2 +- cmake/FindRizin.cmake | 3 ++- dist/CMakeLists.txt | 3 ++- rizin | 2 +- src/core/Cutter.cpp | 33 +++++++++++++++------------------ 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/cmake/BundledRizin.cmake b/cmake/BundledRizin.cmake index 8b21016c..e67e9f14 100644 --- a/cmake/BundledRizin.cmake +++ b/cmake/BundledRizin.cmake @@ -48,7 +48,7 @@ endif() set (RZ_LIBS rz_core rz_config rz_cons rz_io rz_util rz_flag rz_asm rz_debug rz_hash rz_bin rz_lang rz_io rz_analysis rz_parse rz_bp rz_egg rz_reg - rz_search rz_syscall rz_socket rz_magic rz_crypto) + rz_search rz_syscall rz_socket rz_magic rz_crypto rz_type) set (RZ_EXTRA_LIBS rz_main) set (RZ_BIN rz-agent rz-bin rizin rz-diff rz-find rz-gg rz-hash rz-run rz-asm rz-ax) diff --git a/cmake/FindRizin.cmake b/cmake/FindRizin.cmake index 3059c4fd..924e112a 100644 --- a/cmake/FindRizin.cmake +++ b/cmake/FindRizin.cmake @@ -53,7 +53,8 @@ if(WIN32) syscall socket magic - crypto) + crypto + type) set(Rizin_LIBRARIES "") set(Rizin_LIBRARIES_VARS "") diff --git a/dist/CMakeLists.txt b/dist/CMakeLists.txt index 66107fe3..9f2dc288 100644 --- a/dist/CMakeLists.txt +++ b/dist/CMakeLists.txt @@ -109,7 +109,8 @@ if(CUTTER_PACKAGE_RZ_GHIDRA) # installed Cutter. ExternalProject_Add(rz-ghidra GIT_REPOSITORY https://github.com/rizinorg/rz-ghidra - GIT_TAG v0.2.0 + #GIT_TAG v0.2.0 + GIT_TAG dev #GIT_SHALLOW ON # disable this line when using commit hash CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/rizin b/rizin index 91d3bb43..e60f0677 160000 --- a/rizin +++ b/rizin @@ -1 +1 @@ -Subproject commit 91d3bb43fd92fc04e8def76beb22c2d84ae53fb5 +Subproject commit e60f06775ebffc7e91903d0b21ad8fee1c86c1ac diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index 86704804..618457dd 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -659,7 +659,7 @@ bool CutterCore::tryFile(QString path, bool rw) return false; } - rz_core_file_close(core, cf); + rz_core_file_close(cf); return true; } @@ -2873,23 +2873,20 @@ QList CutterCore::getAllRelocs() QList ret; if (core && core->bin && core->bin->cur && core->bin->cur->o) { - auto relocs = core->bin->cur->o->relocs; - RBIter iter; - RzBinReloc *br; - rz_rbtree_foreach(relocs, iter, br, RzBinReloc, vrb) - { - RelocDescription reloc; + auto relocs = rz_bin_object_patch_relocs(core->bin->cur, core->bin->cur->o); + for (size_t i = 0; i < relocs->relocs_count; i++) { + RzBinReloc *reloc = relocs->relocs[i]; + RelocDescription desc; + desc.vaddr = reloc->vaddr; + desc.paddr = reloc->paddr; + desc.type = (reloc->additive ? "ADD_" : "SET_") + QString::number(reloc->type); - reloc.vaddr = br->vaddr; - reloc.paddr = br->paddr; - reloc.type = (br->additive ? "ADD_" : "SET_") + QString::number(br->type); - - if (br->import) - reloc.name = br->import->name; + if (reloc->import) + desc.name = reloc->import->name; else - reloc.name = QString("reloc_%1").arg(QString::number(br->vaddr, 16)); + desc.name = QString("reloc_%1").arg(QString::number(reloc->vaddr, 16)); - ret << reloc; + ret << desc; } } @@ -3481,7 +3478,7 @@ QString CutterCore::addTypes(const char *str) { CORE_LOCK(); char *error_msg = nullptr; - char *parsed = rz_parse_c_string(core->analysis, str, &error_msg); + char *parsed = rz_type_parse_c_string(core->analysis->typedb, str, &error_msg); QString error; if (!parsed) { @@ -3492,7 +3489,7 @@ QString CutterCore::addTypes(const char *str) return error; } - rz_analysis_save_parsed_type(core->analysis, parsed); + rz_type_db_save_parsed_type(core->analysis->typedb, parsed); rz_mem_free(parsed); if (error_msg) { @@ -3922,7 +3919,7 @@ QString CutterCore::getVersionInformation() { "rz_crypto", &rz_crypto_version }, { "rz_bp", &rz_bp_version }, { "rz_debug", &rz_debug_version }, - { "rz_hash", &rz_hash_version }, + { "rz_msg_digest", &rz_msg_digest_version }, { "rz_io", &rz_io_version }, #if !USE_LIB_MAGIC { "rz_magic", &rz_magic_version },