Renamed ?d into aod(#10263)

This commit is contained in:
Vivek Bhatt 2018-06-08 19:04:44 +05:30 committed by radare
parent afe3792d0f
commit 93c9696938
2 changed files with 26 additions and 26 deletions

View File

@ -476,6 +476,7 @@ static const char *help_msg_ao[] = {
"aoe", " N", "display esil form for N opcodes",
"aor", " N", "display reil form for N opcodes",
"aos", " N", "display size of N opcodes",
"aod[*.]", " opcode", "describe opcode for asm.arch (aod* list them all)",
"ao", " 5", "display opcode analysis of 5 opcodes",
"ao*", "", "display opcode in r commands",
NULL
@ -604,6 +605,11 @@ static void cmd_anal_init(RCore *core) {
DEFINE_CMD_DESCRIPTOR (core, ax);
}
static int listOpDescriptions(void *_core, const char *k, const char *v) {
r_cons_printf ("%s=%s\n", k, v);
return 1;
}
/* better aac for windows-x86-32 */
#define JAYRO_03 0
@ -4530,6 +4536,26 @@ static void cmd_anal_opcode(RCore *core, const char *input) {
}
}
break;
case 'd': // "aod"
if (input[1]=='*') {
// list sdb database
sdb_foreach (core->assembler->pair, listOpDescriptions, core);
} else if (input[1]=='.') {
int cur = R_MAX (core->print->cur, 0);
// XXX: we need cmd_xxx.h (cmd_anal.h)
core_anal_bytes (core, core->block + cur, core->blocksize, 1, 'd');
} else if (input[1] == ' ') {
char *d = r_asm_describe (core->assembler, input+2);
if (d && *d) {
r_cons_println (d);
free (d);
} else {
eprintf ("Unknown opcode\n");
}
} else {
eprintf ("Use: aod[.*] [opcode] to get the description of the opcode\n");
}
break;
case '*':
r_core_anal_hint_list (core->anal, input[0]);
break;

View File

@ -82,7 +82,6 @@ static const char *help_msg_question[] = {
"?b64[-]", " [str]", "encode/decode in base64",
"?btw", " num|expr num|expr num|expr", "returns boolean value of a <= b <= c",
"?B", " [elem]", "show range boundaries like 'e?search.in",
"?d[*.]", " opcode", "describe opcode for asm.arch (?d* list them all)",
"?e[nbgc]", " string", "echo string (nonl, gotoxy, column, bars)",
"?f", " [num] [str]", "map each bit of the number as flag string index",
"?F", "", "flush cons output",
@ -278,11 +277,6 @@ R_API void r_core_clippy(const char *msg) {
free (s);
}
static int listOpDescriptions(void *_core, const char *k, const char *v) {
r_cons_printf ("%s=%s\n", k, v);
return 1;
}
static int cmd_help(void *data, const char *input) {
RCore *core = (RCore *)data;
RIOMap *map;
@ -363,26 +357,6 @@ static int cmd_help(void *data, const char *input) {
}
r_list_free (tmp);
break;
case 'd': // "?d"
if (input[1]=='*') {
// list sdb database
sdb_foreach (core->assembler->pair, listOpDescriptions, core);
} else if (input[1]=='.') {
int cur = R_MAX (core->print->cur, 0);
// XXX: we need cmd_xxx.h (cmd_anal.h)
core_anal_bytes (core, core->block + cur, core->blocksize, 1, 'd');
} else if (input[1] == ' ') {
char *d = r_asm_describe (core->assembler, input+2);
if (d && *d) {
r_cons_println (d);
free (d);
} else {
eprintf ("Unknown opcode\n");
}
} else {
eprintf ("Use: ?d[?.*] [opcode] to get the description of the opcode\n");
}
break;
case 'h': // "?h"
if (input[1] == ' ') {
r_cons_printf ("0x%08x\n", (ut32)r_str_hash (input + 2));