mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-04 19:47:31 +00:00
39 lines
733 B
Plaintext
39 lines
733 B
Plaintext
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)
|
|
|
|
Backtrace implementation for x86-64:
|
|
------------------------------------
|
|
|
|
(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)
|