Skip to content

Commit

Permalink
bin.str{purge,filter} -> bin.str.{purge,filter} ##core
Browse files Browse the repository at this point in the history
  • Loading branch information
kazarmy authored and radare committed Mar 19, 2019
1 parent e04f31a commit a478cdf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions libr/core/cconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,10 +867,10 @@ static int cb_strpurge(void *user, void *data) {
"Neither !true nor !false is supported.\n"
"\n"
"Examples:\n"
" e bin.strpurge=true,0-0xff,!0x1a\n"
" e bin.str.purge=true,0-0xff,!0x1a\n"
" -- purge strings using the false_positive() classifier in cbin.c and also strings \n"
" with addresses in the range 0-0xff, but not the string at 0x1a.\n"
" e bin.strpurge=all,!0x1000-0x1fff\n"
" e bin.str.purge=all,!0x1000-0x1fff\n"
" -- purge all strings except the strings with addresses in the range 0x1000-0x1fff.\n");
return false;
}
Expand All @@ -894,7 +894,7 @@ static int cb_strfilter(void *user, void *data) {
RConfigNode *node = (RConfigNode*) data;
if (node->value[0] == '?') {
if (strlen (node->value) > 1 && node->value[1] == '?') {
r_cons_printf ("Valid values for bin.strfilter:\n"
r_cons_printf ("Valid values for bin.str.filter:\n"
"a only alphanumeric printable\n"
"8 only strings with utf8 chars\n"
"p file/directory paths\n"
Expand Down Expand Up @@ -2861,10 +2861,10 @@ R_API int r_core_config_init(RCore *core) {
SETPREF ("bin.hashlimit", "10M", "Only compute hash when opening a file if smaller than this size");
SETCB ("bin.usextr", "true", &cb_usextr, "Use extract plugins when loading files");
SETCB ("bin.useldr", "true", &cb_useldr, "Use loader plugins when loading files");
SETCB ("bin.strpurge", "", &cb_strpurge, "Purge strings (e bin.strpurge=? provides more detail)");
SETCB ("bin.str.purge", "", &cb_strpurge, "Purge strings (e bin.str.purge=? provides more detail)");
SETPREF ("bin.b64str", "false", "Try to debase64 the strings");
SETPREF ("bin.libs", "false", "Try to load libraries after loading main binary");
n = NODECB ("bin.strfilter", "", &cb_strfilter);
n = NODECB ("bin.str.filter", "", &cb_strfilter);
SETDESC (n, "Filter strings");
SETOPTIONS (n, "a", "8", "p", "e", "u", "i", "U", "f", NULL);
SETCB ("bin.filter", "true", &cb_binfilter, "Filter symbol names to fix dupped names");
Expand Down
2 changes: 1 addition & 1 deletion libr/core/cfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ R_API bool r_core_bin_load(RCore *r, const char *filenameuri, ut64 baddr) {
char msg[2];
msg[0] = r->bin->cur->curplugin->strfilter;
msg[1] = 0;
r_config_set (r->config, "bin.strfilter", msg);
r_config_set (r->config, "bin.str.filter", msg);
}
//r_core_bin_set_env (r, binfile);
plugin = r_bin_file_cur_plugin (binfile);
Expand Down
4 changes: 2 additions & 2 deletions libr/core/cmd_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static const char *help_msg_i[] = {
"iz|izj", "", "Strings in data sections (in JSON/Base64)",
"izz", "", "Search for Strings in the whole binary",
"izzz", "", "Dump Strings from whole binary to r2 shell (for huge files)",
"iz-", " [addr]", "Purge string via bin.strpurge",
"iz-", " [addr]", "Purge string via bin.str.purge",
"iZ", "", "Guess size of binary program",
NULL
};
Expand Down Expand Up @@ -756,7 +756,7 @@ static int cmd_info(void *data, const char *input) {
}
}
core->tmpseek = false;
r_core_cmdf (core, "e bin.strpurge=%s%s0x%" PFMT64x,
r_core_cmdf (core, "e bin.str.purge=%s%s0x%" PFMT64x,
strpurge ? strpurge : "",
strpurge && *strpurge ? "," : "",
addr);
Expand Down
8 changes: 4 additions & 4 deletions libr/main/rabin2.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ static int rabin_show_help(int v) {
" RABIN2_NOPLUGINS: # do not load shared plugins (speedup loading)\n"
" RABIN2_DEMANGLE=0:e bin.demangle # do not demangle symbols\n"
" RABIN2_MAXSTRBUF: e bin.maxstrbuf # specify maximum buffer size\n"
" RABIN2_STRFILTER: e bin.strfilter # r2 -qe bin.strfilter=? -c '' --\n"
" RABIN2_STRPURGE: e bin.strpurge # try to purge false positives\n"
" RABIN2_STRFILTER: e bin.str.filter # r2 -qe bin.str.filter=? -c '' --\n"
" RABIN2_STRPURGE: e bin.str.purge # try to purge false positives\n"
" RABIN2_DEBASE64: e bin.debase64 # try to debase64 all strings\n"
" RABIN2_DMNGLRCMD: e bin.demanglercmd # try to purge false positives\n"
" RABIN2_PDBSERVER: e pdb.server # use alternative PDB server\n"
Expand Down Expand Up @@ -607,11 +607,11 @@ R_API int r_main_rabin2(int argc, char **argv) {
free (tmp);
}
if ((tmp = r_sys_getenv ("RABIN2_STRFILTER"))) {
r_config_set (core.config, "bin.strfilter", tmp);
r_config_set (core.config, "bin.str.filter", tmp);
free (tmp);
}
if ((tmp = r_sys_getenv ("RABIN2_STRPURGE"))) {
r_config_set (core.config, "bin.strpurge", tmp);
r_config_set (core.config, "bin.str.purge", tmp);
free (tmp);
}
if ((tmp = r_sys_getenv ("RABIN2_DEBASE64"))) {
Expand Down
4 changes: 2 additions & 2 deletions man/rabin2.1
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ RABIN2_MAXSTRBUF same as r2 -e bin.maxstrbuf for rabin2
.Pp
RABIN2_DEBASE64 try to decode all strings as base64 if possible
.Pp
RABIN2_STRFILTER same as r2 -e bin.strfilter for rabin2
RABIN2_STRFILTER same as r2 -e bin.str.filter for rabin2
.Pp
RABIN2_STRPURGE same as r2 -e bin.strpurge for rabin2
RABIN2_STRPURGE same as r2 -e bin.str.purge for rabin2
.Sh EXAMPLES
.Pp
List symbols of a program
Expand Down

0 comments on commit a478cdf

Please sign in to comment.