enhance 'im' command

This commit is contained in:
condret 2015-03-19 00:53:46 +01:00
parent b9c59d39d0
commit a854a6ab03
2 changed files with 4 additions and 3 deletions

View File

@ -1476,7 +1476,7 @@ static void bin_mem_print (RList *mems, int perms, int depth) {
if (mem) {
for (i=0; i < depth; i++)
r_cons_printf (" ");
r_cons_printf ("%8s 0x%08"PFMT64x" %d\t[%s]\n", mem->name, mem->addr, mem->size, r_str_rwx_i (mem->perms & perms));
r_cons_printf ("%8s addr=0x%016"PFMT64x" size=%6d perms=[%s]\n", mem->name, mem->addr, mem->size, r_str_rwx_i (mem->perms & perms));
if (mem->mirrors)
bin_mem_print (mem->mirrors, (mem->perms & perms), (depth + 1)); //sorry, but anything else would be inefficient
}
@ -1486,6 +1486,8 @@ static void bin_mem_print (RList *mems, int perms, int depth) {
static int bin_mem (RCore *r, int mode) {
RList *mem = NULL;
if (!r) return R_FALSE;
if (!((mode & R_CORE_BIN_RADARE) || (mode & R_CORE_BIN_SET)))
r_cons_printf ("[Memory]\n\n");
if (!(mem = r_bin_get_mem (r->bin)))
return R_FALSE;
if (mode & R_CORE_BIN_JSON) {
@ -1493,7 +1495,6 @@ static int bin_mem (RCore *r, int mode) {
return R_FALSE;
}
if (!((mode & R_CORE_BIN_RADARE) || (mode & R_CORE_BIN_SET))) {
r_cons_printf ("[Memory]\n");
bin_mem_print (mem, 7, 0);
}
return R_TRUE;

View File

@ -295,7 +295,7 @@ static int cmd_info(void *data, const char *input) {
case R_CORE_BIN_RADARE: cmd_info (core, "i*IiesSz"); break;
case R_CORE_BIN_JSON: cmd_info (core, "iIiesSzj"); break;
default:
case R_CORE_BIN_SIMPLE: cmd_info (core, "iIiesSz"); break;
case R_CORE_BIN_SIMPLE: cmd_info (core, "iIiesSmz"); break;
}
}
break;