radareorg/radare2

Reverse cmd in rap

Closed this issue · 12 comments

We need a way for rap servers to run commands in r2 host. something like this:

r2 <----> rap://target
> CMD(x)
< CMD(y)
> CMD|REPLY(res-y)
< CMD|REPLY(res-x)

This will be useful when writing debug backends using rap://, so the io plugin can run r2 commands to change register values and stuff like that. we should slowly redesign this to support remote debuggers in a better way

I am interested in solving this? This is my idea right now, Basically When the host is Listening for Incoming Connections, I Should use (select() or new thread) for reading from stdin and pass that to existing functions right?? (tell me if this is the right path?)

@jarusified radare2 already has it's own API to talk via the network - see libr/include/r_socket.h for API and libr/socket/*.c for implementation.

@XVilka will use that. But is the overall understanding of the issue correct?

@jarusified there yes, just add the answering part.

you can test this by doing:

$ r2 rap://:9999

and then:

$ r2 rap://localhost:9999//bin/ls

the idea behind this issue is to review/cleanup/document the rap protocol
and add support for the server side to issue commands in the host one. This
will be easier to test/implement if done in python or nodejs, there are
already implementations of that protocol for them.

This is important because it will allow non-r2 rap servers to tell r2 which
commands to run to set flags, change register state, emulate step, etc.
Only the command packet makes sense to be bidirectional imho.

On 16 March 2016 at 16:00, Anton Kochkov notifications@github.com wrote:

@jarusified https://github.com/jarusified there yes, just add the
answering part.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#4173 (comment)

--pancake

It's good to have this fix in python, but the proper fix should be in core, are you planning to do it too?

yes, i am planning to do the same.

cool!

On 22 Mar 2016, at 20:24, suraj jarus notifications@github.com wrote:

yes, i am planning to the same.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub #4173 (comment)

Done in master