命令“f?flagname”在radare2 中无法按预期工作

逆向工程 雷达2
2021-06-14 20:22:15
PS C:\_> r2 -v
radare2 4.3.1 6 @ windows-x86-64 git.4.3.1
commit: 54ac837b5503f10f91e2069ac357791f7a3e635a build: Fri 03/06/2020__15:52:24.93
PS C:\_> r2 --
 -- 99 bugs, take one down pass it around. 100 bugs...
[0x00000000]> f myflag
[0x00000000]> f*
fs *
f myflag 1 0x00000000
[0x00000000]> f?myflag ;expect an output here
[0x00000000]> f?~exists
| f?flagname               check if flag exists or not, See ?? and ?!

该命令f?myflag不打印任何输出,就好像该标志不存在一样。为什么会发生?

作为奖励问题:),这See ?? and ?!什么意思?

1个回答

它只是不会在屏幕上打印任何内容,而是设置的内部值。您可以通过查看此处的源代码来验证这一点

它确实告诉您要做的是运行??它实际上正在打印该值,如帮助中所示

| ??                               show value of operation

此外,根据结果,您可以运行或不运行操作。

| ?! [cmd]                         run cmd if $? == 0
| ?? [cmd]                         run cmd if $? != 0

[0x00000000]> f?non-existent-flag
[0x00000000]> ?? ?E exists //<- action is not executed
[0x00000000]> f?myflag
[0x00000000]> ?? ?E exists
 ╭──╮    ╭────────╮
 │ _│    │        │
 │ O O  <  exists │
 │  │╭   │        │
 ││ ││   ╰────────╯
 │└─┘│
 ╰───╯