带有 Radare2 的 grep -E

逆向工程 雷达2
2021-07-07 07:47:01

使用 Radare2,我喜欢这个iI命令。

我想用 grep 或radare 自己的grep 语法来限制输出。

如何iI | grep -E 'bits | pic | stripped'对我的二进制文件运行 a

[0x100001200]> iI
arch     x86
binsz    38688
bintype  mach0
bits     64
....
..
.

我的目的是在 python 脚本中使用r2pipe.

1个回答

Radare 的 grep 是通过使用~字符来完成的

 ~?<br>
|Usage: [command]~[modifier][word,word][endmodifier][[column]][:line]

因此,要运行您想要的输出:

iI~bits,pic,stripped

[0x100001200]> iI~bits,pic,stripped
bits     64
pic      true
stripped true

您应该在脚本中运行相同的命令。这个 grep 可以做的还有很多。要获得它的帮助,只需运行~?