I want to use pwntools with Radare2, since this is my debugger of choice.
However, I can only find GDB-related library calls in pwntools' documentation (pwnlib.gdb).
Anyone with experience in integration Radare2 with pwntools?
Reverse Engineering Stack Exchange is a question and answer site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation. It only takes a minute to sign up.Sign up to join this community
There is no integrated way to debug using radare2, but there is 2 workarounds :
You can use
util.proc.wait_for_debugger start the process when a debugger is connected.
Exploit script :
io = process('my_binary') pid = util.proc.pidof(io) print("The pid is " + str(pid)) util.proc.wait_for_debugger(pid)
r2 -A -d pid
See here for an example : https://ret2libc.com/article/19/pwntools-radare2-debugger
Radare2 can be called from
pwndbg. It's possible to use the gdb integration in pwntools, and the use the command
r2 to switch to radare.