1

In gdb I can easily do the following:

(gdb) call function(arg) 

what is the equivalent in r2?

There is no call function in debug session so this doesn't work:

[0x08048795] call sym.func

Inject opcode also didn't work as I tried this:

[0x08048795] dx call syn.func

1 Answer 1

2

radare2 is not a source code debugger so you might see some things that are missing in comparison to what you got in GDB.

This feature is not implemented in radare2 and I'm not sure will be. Anyway, you can point eip to the function you want to execute by using dr eip=0x... but you'll have a hard time with passing arguments through the stack (although it is possible).

You can also check dx? to see examples of how dx should be executed. Check gs as well to execute syscalls.

Also, you can use radare2 with gdbserver/gdb so you better check this out as well.

Here is a good place to read about migrating from GDB to radare2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.