Fix aaa is the old aa, current aa is the old aa0. (Do not run afna)

That should fix #1849 and missing entry0 issue
This commit is contained in:
pancake 2014-12-17 12:09:33 +01:00
parent ced3041acf
commit b0fcb5cbe4
3 changed files with 12 additions and 12 deletions

View File

@ -1511,34 +1511,34 @@ R_API int r_core_anal_ref_list(RCore *core, int rad) {
R_API int r_core_anal_all(RCore *core) {
RList *list;
RListIter *iter;
RFlagItem *item;
RAnalFunction *fcni;
RBinAddr *binmain;
RBinAddr *entry;
RBinSymbol *symbol;
ut64 baddr;
ut64 offset;
int depth =r_config_get_i (core->config, "anal.depth");
int depth = r_config_get_i (core->config, "anal.depth");
int va = core->io->va || core->io->debug;
baddr = r_bin_get_baddr (core->bin);
offset = r_bin_get_offset (core->bin);
/* Analyze Functions */
/* Entries */
{
RFlagItem *item = r_flag_get (core->flags, "entry0");
item = r_flag_get (core->flags, "entry0");
if (item) {
r_core_anal_fcn (core, item->offset, -1, R_ANAL_REF_TYPE_NULL, depth);
r_core_cmdf (core, "afn entry0 0x%08"PFMT64x, item->offset);
} else {
r_core_cmd0 (core, "af");
}
}
/* Main */
if ((binmain = r_bin_get_sym (core->bin, R_BIN_SYM_MAIN)) != NULL) {
ut64 addr = va? binmain->vaddr: binmain->paddr; // offset + va?baddr+binmain->vaddr:binmain->paddr;
r_core_anal_fcn (core, addr, -1, R_ANAL_REF_TYPE_NULL, depth);
/* rename function */
r_core_cmdf (core, "afn main 0x%08"PFMT64x, addr);
if (!item || item->offset != addr)
r_core_cmdf (core, "afn main 0x%08"PFMT64x, addr);
}
if ((list = r_bin_get_entries (core->bin)) != NULL)
r_list_foreach (list, iter, entry)
@ -1558,7 +1558,7 @@ R_API int r_core_anal_all(RCore *core) {
r_list_foreach (core->anal->fcns, iter, fcni) {
if (core->cons->breaked)
break;
if (!memcmp (fcni->name, "sym.", 4) || !memcmp (fcni->name, "main", 4))
if (!strncmp (fcni->name, "sym.", 4) || !strncmp (fcni->name, "main", 4))
fcni->type = R_ANAL_FCN_TYPE_SYM;
}
return R_TRUE;

View File

@ -2131,15 +2131,15 @@ static int cmd_anal(void *data, const char *input) {
r_cons_break_end();
if (input[1] == '?') {
const char* help_msg[] = {
"Usage:", "aa[0*?]", " # see also 'af' and 'afna'",
"aa", " ", "alias for 'af@@ sym.*;af@entry0;.afna @@ fcn.*'",
"aa0", "", "do not autoname functions after aa (see afna)",
"Usage:", "aa[0*?]", " # see also 'af', 'ac' and 'afna'",
"aa", " ", "alias for 'af@@ sym.*;af@entry0'", //;.afna @@ fcn.*'",
"aaa", "", "autoname functions after aa (see afna)",
"aa*", "", "print the commands that 'aa' will run",
NULL};
r_core_cmd_help (core, help_msg);
} else if (input[1] == '*') {
r_cons_printf ("af @@ sym.* ; af @ entry0 ; .afna @@ fcn.*\n");
} else if (input[1] != '0') {
r_cons_printf ("af @@ sym.* ; af @ entry0\n");// ; .afna @@ fcn.*\n");
} else if (input[1] != 'a') {
r_core_cmd0 (core, ".afna @@ fcn.*");
}
break;

View File

@ -165,7 +165,7 @@ static void print_format_help(RCore *core) {
static void cmd_print_format (RCore *core, const char *_input, int len) {
char *input;
int i, flag = -1;
int flag = -1;
switch (_input[1]) {
case '*':
_input++;