Handle 'ph?'

This commit is contained in:
Sergi Àlvarez i Capilla 2022-01-07 03:42:23 +01:00
parent ab1e0de94c
commit 8909464c45
2 changed files with 13 additions and 2 deletions

View File

@ -264,6 +264,13 @@ static const char *help_msg_pdp[] = {
NULL
};
static const char *help_msg_ph[] = {
"Usage:", "ph", " [algorithm] ([size])",
"ph", " md5", "compute md5 hash of current block",
"ph.", " sha1 32 @ 0x1000", "calculate sha1 of 32 bytes starting at 0x1000",
NULL
};
static const char *help_msg_pdr[] = {
"Usage:", "pdr", "Disassemble N instructions following execution flow from current PC",
"pdr", "", "recursive disassemble across the function graph",
@ -2906,7 +2913,11 @@ static bool cmd_print_ph(RCore *core, const char *input) {
const char *ptr;
int pos = 0, handled_cmd = false;
if (!*input || *input == '?') {
if (*input == '?') {
r_core_cmd_help (core, help_msg_ph);
return true;
}
if (!*input) {
algolist (1);
return true;
}

View File

@ -2119,7 +2119,7 @@ static void cmd_search_aF(RCore *core, const char *input) {
}
r_str_trim (s);
if (strstr (s, input)) {
eprintf ("0x%08"PFMT64x" %s: %s\n", addr, fcn->name, s);
r_cons_printf ("0x%08"PFMT64x" %s: %s\n", addr, fcn->name, s);
}
free (s);
}