mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-28 15:41:38 +00:00
bin.strpurge: added support to prevent string purge by prev entries (addr range) (#9225)
This commit is contained in:
parent
bf1fb2d31f
commit
38a6cc2ff7
@ -215,6 +215,10 @@ R_API bool r_core_bin_strpurge(RCore *core, const char *str, ut64 refaddr) {
|
||||
purge = true;
|
||||
continue;
|
||||
}
|
||||
if (*ptr == '!') {
|
||||
bang = true;
|
||||
ptr++;
|
||||
}
|
||||
range_sep = strchr (ptr, '-');
|
||||
if (range_sep) {
|
||||
*range_sep = 0;
|
||||
@ -222,14 +226,10 @@ R_API bool r_core_bin_strpurge(RCore *core, const char *str, ut64 refaddr) {
|
||||
ptr = range_sep + 1;
|
||||
to = r_num_get (NULL, ptr);
|
||||
if (refaddr >= from && refaddr <= to) {
|
||||
purge = true;
|
||||
purge = bang ? false : true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (*ptr == '!') {
|
||||
bang = true;
|
||||
ptr++;
|
||||
}
|
||||
addr = r_num_get (NULL, ptr);
|
||||
if (addr != 0 || *ptr == '0') {
|
||||
if (refaddr == addr) {
|
||||
|
@ -2391,10 +2391,11 @@ R_API int r_core_config_init(RCore *core) {
|
||||
SETOPTIONS (n, "latin1", "utf8", "utf16le", "utf32le", "guess", NULL);
|
||||
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, "Try to purge false positive strings (true: use the "
|
||||
"false_positive() classifier in cbin.c, [,addr]*: specific string addrs to purge, "
|
||||
"[,addr1-addr2]*: purge all strings in the range addr1-addr2 inclusive, [,!addr]*: prevent "
|
||||
"purge of string at addr by prev entries)");
|
||||
SETCB ("bin.strpurge", "", &cb_strpurge, "Purge strings (true: use the false_positive() "
|
||||
"classifier in cbin.c, [,addr]*: specific string addrs to purge, [,addr1-addr2]*: purge "
|
||||
"all strings in the range addr1-addr2 inclusive, [,!addr]*: prevent purge of string at "
|
||||
"addr by prev entries, [,!addr1-addr2]*: prevent purge of strings in range addr1-addr2 "
|
||||
"inclusive by prev entries). Neither !true nor !false is supported.");
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user