diff --git a/libr/core/agraph.c b/libr/core/agraph.c index e1d7d5ea6c..dc3d4bd16c 100644 --- a/libr/core/agraph.c +++ b/libr/core/agraph.c @@ -3374,19 +3374,18 @@ static bool check_changes(RAGraph *g, int is_interactive, RCore *core, RAnalFunc } if (core) { ut64 off = r_anal_get_bbaddr (core->anal, core->offset); - if (off == UT64_MAX) { - return false; - } - char *title = get_title (off); - RANode *cur_anode = get_anode (g->curnode); - if (fcn && ((is_interactive && !cur_anode) || (cur_anode && strcmp (cur_anode->title, title)))) { - g->update_seek_on = r_agraph_get_node (g, title); - if (g->update_seek_on) { - r_agraph_set_curnode (g, g->update_seek_on); - g->force_update_seek = true; + if (off != UT64_MAX) { + char *title = get_title (off); + RANode *cur_anode = get_anode (g->curnode); + if (fcn && ((is_interactive && !cur_anode) || (cur_anode && strcmp (cur_anode->title, title)))) { + g->update_seek_on = r_agraph_get_node (g, title); + if (g->update_seek_on) { + r_agraph_set_curnode (g, g->update_seek_on); + g->force_update_seek = true; + } } + free (title); } - free (title); g->can->color = r_config_get_i (core->config, "scr.color"); g->hints = r_config_get_i (core->config, "graph.hints"); } @@ -4200,6 +4199,13 @@ R_API int r_core_visual_graph(RCore *core, RAGraph *g, RAnalFunction *_fcn, int agraph_update_seek (g, get_anode (g->curnode), true); // update scroll (with minor shift) break; + // Those hardcoded keys are useful only for aegi, should add subcommand of ag to set key actions + case '1': + r_core_cmd0 (core, "so;.aeg*"); + break; + case '2': + r_core_cmd0 (core, "so-1;.aeg*"); + break; case '=': { // TODO: edit showcursor (core, true); diff --git a/libr/core/cmd_anal.c b/libr/core/cmd_anal.c index 1db612fde7..114c67f994 100644 --- a/libr/core/cmd_anal.c +++ b/libr/core/cmd_anal.c @@ -5951,17 +5951,21 @@ static void cmd_anal_esil(RCore *core, const char *input) { r_anal_esil_interrupt_free (esil, interrupt); } break; - - // TODO: display help? } } break; case 'g': // "aeg" - if (input[1] == 'v') { - r_core_cmd0 (core, ".aeg;agg"); + if (input[1] == 'i' || input[1] == 'v') { + char *oprompt = strdup (r_config_get (core->config, "cmd.gprompt")); + r_config_set (core->config, "cmd.gprompt", "pi 1"); + r_core_cmd0 (core, ".aeg*;aggv"); + r_config_set (core->config, "cmd.gprompt", oprompt); + free (oprompt); + } else if (!input[1]) { + r_core_cmd0 (core, ".aeg*;agg"); } else if (input[1] == ' ') { r_core_anal_esil_graph (core, input + 2); - } else { // "*" + } else if (input[1] == '*') { RAnalOp *aop = r_core_anal_op (core, core->offset, R_ANAL_OP_MASK_ESIL); if (aop) { const char *esilstr = r_strbuf_get (&aop->esil); @@ -5969,6 +5973,11 @@ static void cmd_anal_esil(RCore *core, const char *input) { r_core_anal_esil_graph (core, esilstr); } } + } else { + r_cons_printf ("Usage: aeg[iv*]\n"); + r_cons_printf (" aeg analyze current instruction as an esil graph\n"); + r_cons_printf (" aeg* analyze current instruction as an esil graph\n"); + r_cons_printf (" aegv and launch the visual interactive mode (.aeg*;aggv == aegv)\n"); } break; case 'b': // "aeb" @@ -9200,7 +9209,9 @@ static int cmd_anal_all(RCore *core, const char *input) { cmd_anal_objc (core, input + 1, false); break; case 'e': // "aae" - if (input[1]) { + if (input[1] == 'f') { // "aaef + r_core_cmd0 (core, "aef@@@F"); + } else if (input[1] == ' ') { const char *len = (char *)input + 1; char *addr = strchr (input + 2, ' '); if (addr) {