Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bindings introduction #227

Open
radare opened this issue Oct 19, 2019 · 1 comment
Open

Bindings introduction #227

radare opened this issue Oct 19, 2019 · 1 comment

Comments

@radare
Copy link
Collaborator

radare commented Oct 19, 2019

There are three kinds of bindings for r2.

  • r2pipe (r2pipe-api)
  • rlang
  • api bindings

The easiest one is r2pipe, see the radare2-r2pipe repository, but basically provides a way to talk to the current r2 session using two pipes exposed via R2PIPE_IN/OUT env vars.

R2 pipe can also spawn an r2 and run commands on it.

But additionatlly it can also provide other ways of talking to r2 like using http or dlopen the core lib and use the rcorenew , rcorecmdstr and rcorefree functions, additionally theres also http support by making get requests to the given url +/cmd/$cmd

Rlang basically provides a way to keep a running vm of the given language like python, lua or whatver this way you can have a repl for the given language or run scripts by using the api directly which is faster and keeps the state

And finally the api bindings are the harder to maintain and are a bit outdated. Take a look at the radare2-bindings repository which containd a vapidir with all the definitions of the public apis of r2. Using valabind those files are converted into swig or py/go/.. files that expose an api to use the native apis directly from the given language

To finalyze theres also an r2pipe-api project that exposes a high level api on top of r2pipe, being manually maintained and providing a more idiomatic way to use r2

@XVilka
Copy link
Contributor

XVilka commented Mar 11, 2020

rlang and r2pipe are already part of the "Scripting" and "Plugins" sections:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants