Implement @@@strings iterator ##core

This commit is contained in:
pancake 2019-05-05 11:28:03 +02:00
parent 9e9eac5171
commit b176a9fb1b
2 changed files with 16 additions and 1 deletions

View File

@ -3401,7 +3401,21 @@ R_API int r_core_cmd_foreach3(RCore *core, const char *cmd, char *each) { // "@@
#endif
break;
case 's':
{
if (each[1] == 't') { // strings
list = r_bin_get_strings (core->bin);
RBinString *s;
if (list) {
ut64 offorig = core->offset;
ut64 obs = core->blocksize;
r_list_foreach (list, iter, s) {
r_core_block_size (core, s->size);
r_core_seek (core, s->vaddr, 1);
r_core_cmd0 (core, cmd);
}
r_core_block_size (core, obs);
r_core_seek (core, offorig, 1);
}
} else {
// symbols
RBinSymbol *sym;
ut64 offorig = core->offset;

View File

@ -160,6 +160,7 @@ static const char *help_msg_at_at_at[] = {
"x", " @@@i", "imports",
"x", " @@@r", "registers",
"x", " @@@s", "symbols",
"x", " @@@st", "strings",
"x", " @@@S", "sections",
"x", " @@@m", "io.maps",
"x", " @@@M", "dbg.maps (See ?$?~size)",