From c1624396acc10f1f66b604008a7398d3f89594e5 Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 2 Nov 2022 18:10:11 +0100 Subject: [PATCH] Load cpu descriptions for multiarch plugins ##asm --- dist/wapm/r2/Makefile | 3 ++- dist/wapm/r2/wapm.toml | 2 +- libr/asm/asm.c | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/wapm/r2/Makefile b/dist/wapm/r2/Makefile index 50d7858ad0..8f4b12b163 100644 --- a/dist/wapm/r2/Makefile +++ b/dist/wapm/r2/Makefile @@ -4,4 +4,5 @@ all: r2.wasm wapm publish r2.wasm: - cp -f ../../../radare2-*-wasi/radare2.wasm.o3.wasm r2.wasm + cp -f ../../../radare2-*-wasi/radare2.wasm r2.wasm +#cp -f ../../../radare2-*-wasi/radare2.wasm.o3.wasm r2.wasm diff --git a/dist/wapm/r2/wapm.toml b/dist/wapm/r2/wapm.toml index 61c2c02a62..2c2fca256a 100644 --- a/dist/wapm/r2/wapm.toml +++ b/dist/wapm/r2/wapm.toml @@ -1,6 +1,6 @@ [package] name = "pancake/r2" -version = "5.6.2" +version = "5.7.9" description = "Unix-Like Reverse Engineering Framework" readme = "README.md" license = "LGPL3" diff --git a/libr/asm/asm.c b/libr/asm/asm.c index 3bff27c03b..e66913bf96 100644 --- a/libr/asm/asm.c +++ b/libr/asm/asm.c @@ -380,6 +380,7 @@ R_API bool r_asm_use(RAsm *a, const char *name) { return true; } } else { + // resolve asm plugin by name, support multi-arch assemblers char *vv = strchr (name, '.'); if (vv) { if (!strcmp (vv + 1, h->name)) { @@ -392,6 +393,7 @@ R_API bool r_asm_use(RAsm *a, const char *name) { r_asm_set_cpu (a, arch); #endif a->cur = h; + load_asm_descriptions (a, h); free (arch); return true; } @@ -404,6 +406,7 @@ R_API bool r_asm_use(RAsm *a, const char *name) { r_asm_set_cpu (a, NULL); #endif a->cur = h; + load_asm_descriptions (a, h); return true; } } @@ -413,7 +416,7 @@ R_API bool r_asm_use(RAsm *a, const char *name) { if (a->analb.use (a->analb.anal, name)) { load_asm_descriptions (a, NULL); } else { - R_LOG_ERROR ("Cannot find arch plugin with this name. See rasm2 -L and rasm2 -LL"); + R_LOG_ERROR ("Cannot find '%s' asm/arch/anal plugin. See rasm2 -L and rasm2 -LL", name); } } #if 0