mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-05 04:56:10 +00:00
Fix segfault in RAsm.fini and disable iter api for arm.cs
This commit is contained in:
parent
2ab0dce285
commit
4bb8a10390
@ -170,12 +170,15 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len
|
||||
}
|
||||
|
||||
static int analop(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len) {
|
||||
csh handle;
|
||||
cs_insn *insn;
|
||||
csh handle = 0;
|
||||
cs_insn *insn = NULL;
|
||||
int mode = (a->bits==16)? CS_MODE_THUMB: CS_MODE_ARM;
|
||||
int i, n, ret = (a->bits==64)?
|
||||
cs_open (CS_ARCH_ARM64, mode, &handle):
|
||||
cs_open (CS_ARCH_ARM, mode, &handle);
|
||||
int i, n, ret;
|
||||
mode |= (a->big_endian)? CS_MODE_BIG_ENDIAN: CS_MODE_LITTLE_ENDIAN;
|
||||
|
||||
ret = (a->bits==64)?
|
||||
cs_open (CS_ARCH_ARM64, mode, &handle):
|
||||
cs_open (CS_ARCH_ARM, mode, &handle);
|
||||
cs_option (handle, CS_OPT_DETAIL, CS_OPT_ON);
|
||||
op->type = R_ANAL_OP_TYPE_NULL;
|
||||
op->size = (a->bits==16)? 2: 4;
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <capstone.h>
|
||||
#include <x86.h>
|
||||
|
||||
#define USE_ITER_API 1
|
||||
#define USE_ITER_API 0
|
||||
|
||||
#if CS_API_MAJOR < 2
|
||||
#error Old Capstone not supported
|
||||
|
@ -182,7 +182,7 @@ R_API int r_asm_filter_output(RAsm *a, const char *f) {
|
||||
|
||||
R_API RAsm *r_asm_free(RAsm *a) {
|
||||
if (a) {
|
||||
if (a->cur) {
|
||||
if (a->cur && a->cur->fini) {
|
||||
a->cur->fini (a->cur->user);
|
||||
}
|
||||
if (a->plugins) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <r_lib.h>
|
||||
#include <capstone.h>
|
||||
|
||||
#define USE_ITER_API 1
|
||||
#define USE_ITER_API 0
|
||||
|
||||
static csh cd = 0;
|
||||
static int n = 0;
|
||||
|
@ -17,10 +17,10 @@ R_API int r_core_plugin_deinit(RCmd *cmd) {
|
||||
if (plugin && plugin->deinit) {
|
||||
plugin->deinit (cmd, NULL);
|
||||
}
|
||||
r_list_pop(cmd->plist);
|
||||
r_list_pop (cmd->plist);
|
||||
}
|
||||
if (!r_list_empty(cmd->plist))
|
||||
r_list_pop(cmd->plist);
|
||||
if (!r_list_empty (cmd->plist))
|
||||
r_list_pop (cmd->plist);
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user