Load cpu descriptions for multiarch plugins ##asm

This commit is contained in:
pancake 2022-11-02 18:10:11 +01:00 committed by pancake
parent 4a722e6a12
commit c1624396ac
3 changed files with 7 additions and 3 deletions

View File

@ -4,4 +4,5 @@ all: r2.wasm
wapm publish wapm publish
r2.wasm: 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

View File

@ -1,6 +1,6 @@
[package] [package]
name = "pancake/r2" name = "pancake/r2"
version = "5.6.2" version = "5.7.9"
description = "Unix-Like Reverse Engineering Framework" description = "Unix-Like Reverse Engineering Framework"
readme = "README.md" readme = "README.md"
license = "LGPL3" license = "LGPL3"

View File

@ -380,6 +380,7 @@ R_API bool r_asm_use(RAsm *a, const char *name) {
return true; return true;
} }
} else { } else {
// resolve asm plugin by name, support multi-arch assemblers
char *vv = strchr (name, '.'); char *vv = strchr (name, '.');
if (vv) { if (vv) {
if (!strcmp (vv + 1, h->name)) { 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); r_asm_set_cpu (a, arch);
#endif #endif
a->cur = h; a->cur = h;
load_asm_descriptions (a, h);
free (arch); free (arch);
return true; return true;
} }
@ -404,6 +406,7 @@ R_API bool r_asm_use(RAsm *a, const char *name) {
r_asm_set_cpu (a, NULL); r_asm_set_cpu (a, NULL);
#endif #endif
a->cur = h; a->cur = h;
load_asm_descriptions (a, h);
return true; 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)) { if (a->analb.use (a->analb.anal, name)) {
load_asm_descriptions (a, NULL); load_asm_descriptions (a, NULL);
} else { } 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 #if 0