mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-04 11:43:39 +00:00
add optional "asm.armimm" to display # for immediates in arm disassembly
This commit is contained in:
parent
637102385d
commit
239dd49e30
@ -14,6 +14,7 @@ static csh cd = 0;
|
||||
static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
|
||||
static int omode = -1;
|
||||
static int obits = 32;
|
||||
bool disp_hash = a->immdisp;
|
||||
cs_insn* insn = NULL;
|
||||
cs_mode mode = 0;
|
||||
int ret, n = 0;
|
||||
@ -91,7 +92,9 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
|
||||
insn->mnemonic,
|
||||
insn->op_str[0]?" ":"",
|
||||
insn->op_str);
|
||||
r_str_rmch (op->buf_asm, '#');
|
||||
if (!disp_hash) {
|
||||
r_str_rmch (op->buf_asm, '#');
|
||||
}
|
||||
}
|
||||
cs_free (insn, n);
|
||||
beach:
|
||||
|
@ -639,6 +639,13 @@ static int cb_emuskip(void *user, void *data) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static int cb_asm_armimm(void *user, void *data) {
|
||||
RCore *core = (RCore *) user;
|
||||
RConfigNode *node = (RConfigNode *) data;
|
||||
core->assembler->immdisp = node->i_value ? true : false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static int cb_asm_addrbytes(void *user, void *data) {
|
||||
RCore *core = (RCore *) user;
|
||||
RConfigNode *node = (RConfigNode *) data;
|
||||
@ -2056,6 +2063,7 @@ R_API int r_core_config_init(RCore *core) {
|
||||
/* asm */
|
||||
//asm.os needs to be first, since other asm.* depend on it
|
||||
SETICB ("asm.addrbytes", 1, &cb_asm_addrbytes, "Number of bytes one vaddr unit uses");
|
||||
SETICB ("asm.armimm", false, &cb_asm_armimm, "Display # for immediates in ARM");
|
||||
n = NODECB ("asm.os", R_SYS_OS, &cb_asmos);
|
||||
SETDESC (n, "Select operating system (kernel)");
|
||||
SETOPTIONS (n, "ios", "dos", "darwin", "linux", "freebsd", "openbsd", "netbsd", "windows", NULL);
|
||||
|
@ -115,6 +115,7 @@ typedef struct r_asm_t {
|
||||
int pcalign;
|
||||
int dataalign;
|
||||
int bitshift;
|
||||
bool immdisp; // Display immediates with # symbol (for arm stuff).
|
||||
SdbHash *flags;
|
||||
} RAsm;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user