Fix rasm2 -w in termux (honor R_SYS_ARCH) ##asm (#18722)

This commit is contained in:
pancake 2021-05-20 11:50:33 +02:00 committed by GitHub
parent dbf72103da
commit 1198b77cb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -522,7 +522,7 @@ static int print_assembly_output(RAsmState *as, const char *buf, ut64 offset, ut
int bin, bool use_spp, bool rad, bool hexwords, const char *arch) {
if (rad) {
printf ("e asm.arch=%s\n", arch? arch: R_SYS_ARCH);
printf ("e asm.bits=%d\n", bits);
printf ("e asm.bits=%d\n", bits? bits: R_SYS_BITS);
if (offset) {
printf ("s 0x%"PFMT64x"\n", offset);
}
@ -574,7 +574,7 @@ static void __load_plugins(RAsmState *as) {
R_API int r_main_rasm2(int argc, const char *argv[]) {
const char *env_arch = r_sys_getenv ("RASM2_ARCH");
const char *env_bits = r_sys_getenv ("RASM2_BITS");
const char *arch = NULL;
const char *arch = R_SYS_ARCH;
const char *cpu = NULL;
const char *kernel = NULL;
const char *filters = NULL;
@ -740,7 +740,7 @@ R_API int r_main_rasm2(int argc, const char *argv[]) {
ret = 0;
goto beach;
}
} else if (!r_asm_use (as->a, "x86")) {
} else if (!r_asm_use (as->a, R_SYS_ARCH)) {
eprintf ("rasm2: Cannot find asm.x86 plugin\n");
ret = 0;
goto beach;