Enhancements for ic

This commit is contained in:
pancake 2015-08-19 02:23:42 +02:00
parent 564fb069be
commit 0868703c9f
2 changed files with 28 additions and 26 deletions

View File

@ -183,7 +183,8 @@ static void copy_sym_name_with_namespace (char *class_name,
class_name,
(len < R_BIN_SIZEOF_STRINGS) ? len : R_BIN_SIZEOF_STRINGS);
tmp = r_str_newf ("%s::%s", class_name, read_name);
//tmp = r_str_newf ("%s::%s", class_name, read_name);
tmp = r_str_newf ("%s", read_name); //class_name, read_name);
len = strlen (tmp);
memcpy (sym->name,
tmp,

View File

@ -327,8 +327,10 @@ static int cmd_info(void *data, const char *input) {
switch (input[1]) {
case '*':
r_list_foreach (cls->methods, iter2, sym) {
r_cons_printf ("f sym.%s @ 0x%"PFMT64x"\n", sym->name, sym->vaddr);
r_cons_printf ("f sym.%s @ 0x%"PFMT64x"\n",
sym->name, sym->vaddr);
}
input++;
break;
case 'l':
r_list_foreach (cls->methods, iter2, sym) {
@ -336,8 +338,10 @@ static int cmd_info(void *data, const char *input) {
r_cons_printf ("%s0x%"PFMT64d, comma, sym->vaddr);
}
r_cons_newline ();
input++;
break;
case 'j':
input++;
r_cons_printf ("\"class\":\"%s\"", cls->name);
r_cons_printf (",\"methods\":[");
r_list_foreach (cls->methods, iter2, sym) {
@ -350,7 +354,8 @@ static int cmd_info(void *data, const char *input) {
default:
r_cons_printf ("class %s\n", cls->name);
r_list_foreach (cls->methods, iter2, sym) {
r_cons_printf ("method %s\n", sym->name);
r_cons_printf ("0x%08"PFMT64x" method %s %s\n",
sym->vaddr, cls->name, sym->name);
}
break;
}
@ -380,13 +385,11 @@ static int cmd_info(void *data, const char *input) {
}
return 0;
case 'a':
{
switch (mode) {
case R_CORE_BIN_RADARE: cmd_info (core, "i*IiesSmz"); break;
case R_CORE_BIN_JSON: cmd_info (core, "ijIiesSmz"); break;
case R_CORE_BIN_SIMPLE: cmd_info (core, "iqIiesSmz"); break;
default: cmd_info (core, "iIiesSmz"); break;
}
case R_CORE_BIN_RADARE: cmd_info (core, "i*IiecsSmz"); break;
case R_CORE_BIN_JSON: cmd_info (core, "ijIiecsSmz"); break;
case R_CORE_BIN_SIMPLE: cmd_info (core, "iqIiecsSmz"); break;
default: cmd_info (core, "iIiecsSmz"); break;
}
break;
case '?': {
@ -401,7 +404,7 @@ static int cmd_info(void *data, const char *input) {
"iA", "", "List archs",
"ia", "", "Show all info (imports, exports, sections..)",
"ib", "", "Reload the current buffer for setting of the bin (use once only)",
"ic", "", "List classes",
"ic", "", "List classes, methods and fields",
"id", "", "Debug information (source lines)",
"iD", " lang sym", "demangle symbolname for given language",
"ie", "", "Entrypoint",
@ -421,7 +424,6 @@ static int cmd_info(void *data, const char *input) {
NULL
};
r_core_cmd_help (core, help_message);
}
goto done;
case '*':
@ -440,11 +442,10 @@ static int cmd_info(void *data, const char *input) {
break;
}
input++;
if (!strcmp (input, "j"))
break;
if (!strcmp (input, "q"))
if ((*input == 'j' || *input == 'q') && !input[1]) {
break;
}
}
done:
if (is_array)
r_cons_printf ("}\n");