mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-27 15:10:53 +00:00
Fix arch.riscv.vs plugin (decoding always failed) ##arch
This commit is contained in:
parent
cfccd3d92d
commit
db299d28cc
@ -76,14 +76,18 @@ static bool r_arch_cs_init(RArchSession *as, csh *cs_handle) {
|
||||
}
|
||||
#else
|
||||
if (*cs_handle) {
|
||||
if (as->config->syntax == R_ARCH_SYNTAX_ATT) {
|
||||
switch (as->config->syntax) {
|
||||
case R_ARCH_SYNTAX_ATT:
|
||||
cs_option (*cs_handle, CS_OPT_SYNTAX, CS_OPT_SYNTAX_ATT);
|
||||
break;
|
||||
#if CS_API_MAJOR >= 4
|
||||
} else if (as->config->syntax == R_ARCH_SYNTAX_MASM) {
|
||||
case R_ARCH_SYNTAX_MASM:
|
||||
cs_option (*cs_handle, CS_OPT_SYNTAX, CS_OPT_SYNTAX_MASM);
|
||||
break;
|
||||
#endif
|
||||
} else {
|
||||
default:
|
||||
cs_option (*cs_handle, CS_OPT_SYNTAX, CS_OPT_SYNTAX_INTEL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -119,7 +119,6 @@ static bool decode(RArchSession *as, RAnalOp *op, RArchDecodeMask mask) {
|
||||
|
||||
// WORDs must be aligned at even byte boundaries in the address space
|
||||
static int archinfo(RArchSession *as, ut32 q) {
|
||||
// R2_590
|
||||
switch (q) {
|
||||
case R_ANAL_ARCHINFO_ALIGN:
|
||||
return 1;
|
||||
|
@ -259,7 +259,7 @@ static void set_opdir(RAnalOp *op) {
|
||||
}
|
||||
|
||||
#define CSINC RISCV
|
||||
#define CSINC_MODE (as->config->bits == 64)? CS_MODE_RISCV64: CS_MODE_RISCV32
|
||||
#define CSINC_MODE (CS_MODE_RISCVC | ((as->config->bits == 64)? CS_MODE_RISCV64: CS_MODE_RISCV32))
|
||||
#include "../capstone.inc.c"
|
||||
|
||||
static bool riscv_decode(RArchSession *a, RAnalOp *op, RArchDecodeMask mask) {
|
||||
|
Loading…
Reference in New Issue
Block a user