宏
Apart from simple sequencing and looping, radare2 allows to write simple macros, using this construction:
This will define a macro called 'qwe' which runs sequentially first 'pd 4' then 'ao'. Calling the macro using syntax .(macro)
is simple:
To list available macroses simply call (*
:
And if want to remove some macro, just add '-' before the name:
Moreover, it's possible to create a macro that takes arguments, which comes in handy in some simple scripting situations. To create a macro that takes arguments you simply add them to macro definition. Be sure, if you're using characters like ';', to quote the whole command for proper parsing.
As you can see, the arguments are named by index, starting from 0: $0, $1, ...
最后更新于
这有帮助吗?