radare2/doc/macros

39 lines
733 B
Plaintext
Raw Normal View History

Examples of Macros
--------------------
NOTE: in radare2, do not add a space between the "," and the next
command otherwise you are in for pain...
1.) Hello, world
(hello,?e Hello World)
.(hello)
2.) Looping inside a macro
(loop_macro,f cnt=3,loop:,?e hello `?vi cnt`,f cnt=`?vi cnt-1`,?= cnt,?!(),.loop:)
.(loop_macro)
2012-06-12 00:52:39 +00:00
Backtrace implementation for x86-64:
------------------------------------
2012-06-12 00:52:39 +00:00
(backtrace,
aa
f prev @ rsp
f base@ rbp
loop:
f next @ `pq 1 @base~[1]`,
f cont @ `pq 1 @base+8~[1]`,
?= next
??()
?= next-0xffffffffffffffff
??()
?= cont-0xffffffffffffffff
??()
?e StackFrame at `?v next` with size `?vi base-prev`
x base-prev@base+16
?e Code: `?v cont`
pdf @ cont
f prev@base
f base@next
.loop:
)
.(backtrace)