mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-26 22:50:48 +00:00
Enforce valid value for asm.offset.relto ##config
This commit is contained in:
parent
23223ee6f2
commit
2fba90530f
@ -1612,10 +1612,18 @@ static bool cb_color_getter(void *user, RConfigNode *node) {
|
||||
}
|
||||
|
||||
static bool cb_reloff(void *user, void *data) {
|
||||
// RCore *core = (RCore *) user;
|
||||
const char options[] = "func\nflag\nmaps\ndmap\nfmap\nsect\nsymb\nlibs\nfile\n";
|
||||
RConfigNode *node = (RConfigNode *) data;
|
||||
if (strchr (node->value, '?')) {
|
||||
r_cons_printf ("func\nflag\nmaps\ndmap\nfmap\nsect\nsymb\nlibs\nfile\n");
|
||||
if (*node->value) {
|
||||
char *pos = strstr (options, node->value);
|
||||
if (pos && pos[strlen (node->value)] == '\n') {
|
||||
return true;
|
||||
}
|
||||
if (strchr (node->value, '?')) {
|
||||
r_cons_printf (options);
|
||||
} else {
|
||||
R_LOG_ERROR ("Invalid value, try `-e asm.offset.relto=?`");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -34,7 +34,7 @@ NAME=pd+reloff+colors
|
||||
FILE=bins/elf/analysis/ls-alxchk
|
||||
CMDS=<<EOF
|
||||
af
|
||||
e asm.offset.relto=fun
|
||||
e asm.offset.relto=func
|
||||
pd 10
|
||||
e scr.color=1
|
||||
pd 10
|
||||
|
Loading…
Reference in New Issue
Block a user