Skip to content

Commit

Permalink
Add axl command for consistency with afl for 'axlc' ##analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
trufae authored and pull[bot] committed Oct 14, 2022
1 parent 43b2af4 commit 7927661
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions libr/core/cmd_anal.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ static const char *help_msg_ax[] = {
"axF", " [flg-glob]", "find data/code references of flags",
"axm", " addr [at]", "copy data/code references pointing to addr to also point to curseek (or at)",
"axt", "[?] [addr]", "find data/code references to this address",
"axl", "[cq]", "list xrefs (axlc = count, axlq = quiet)",
"axf", "[?] [addr]", "find data/code references from this address",
"axv", "[?] [addr]", "list local variables read-write-exec references",
"ax.", " [addr]", "find data/code references from and to this address",
Expand All @@ -874,6 +875,14 @@ static const char *help_msg_ax[] = {
NULL
};

static const char *help_msg_axl[]= {
"Usage:", "axl[cq]", "show global xrefs",
"axl", "", "list all xrefs",
"axlc", "", "count how many xrefs are registered",
"axlq", "", "list xrefs in quiet mode (axq)",
NULL
};

static const char *help_msg_axv[]= {
"Usage:", "axv[?j]", "show xrefs to local variables in current function",
"axv", " ([addr])", "optionally you can specify address instead of current seek",
Expand Down Expand Up @@ -8357,6 +8366,25 @@ static bool cmd_anal_refs(RCore *core, const char *input) {
cmd_afvx (core, NULL, input[1] == 'j');
}
break;
case 'l': // "axl"
switch (input[1]) {
case '?':
r_core_cmd_help (core, help_msg_axl);
break;
case 'c':
{
ut64 count = r_anal_xrefs_count (core->anal);
r_cons_printf ("%"PFMT64d"\n", count);
}
break;
case 'q':
r_core_cmd0 (core, "axq");
break;
default:
r_core_cmd0 (core, "ax");
break;
}
break;
case 't': { // "axt"
if (input[1] == '?') { // "axt?"
r_core_cmd_help (core, help_msg_axt);
Expand Down

0 comments on commit 7927661

Please # to comment.