Skip to content
Access radare2 via pipe from any programming language!
JavaScript Python C# HTML Swift Perl Other
Branch: master
Clone or download

Latest commit

a1ext Merge pull request #115 from haystack-ia/fix-114
More precise filename parsing in python module. Closes #114.
Latest commit e849126 May 6, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
c Update from r2p_* to r2pipe_* Mar 21, 2019
clojure Change radare->radareorg links (#106) Oct 7, 2019
cxx-qt Add r2pipe-qt naked native API support Nov 24, 2016
dlang Fix #r2pipe #dlang Oct 24, 2015
dotnet Change radare->radareorg links (#106) Oct 7, 2019
erlang Change `r2` to `radare2`, since meson doesn't make r2 (#72) Sep 18, 2018
go Change `r2` to `radare2`, since meson doesn't make r2 (#72) Sep 18, 2018
haskell Remove some fields from r2pipe.cabal Feb 21, 2020
java Add JSON support for r2pipe.java (Uses javax.json) Jan 5, 2019
lisp add r2pipe lisp bindings for radare2. Oct 3, 2015
newlisp Change `r2` to `radare2`, since meson doesn't make r2 (#72) Sep 18, 2018
nim Add JSON support for Nim Oct 19, 2016
nodejs Upgrade r2pipe-promise to use latest r2pipe Dec 4, 2019
ocaml Change `r2` to `radare2`, since meson doesn't make r2 (#72) Sep 18, 2018
perl Fixed json trailing garbage + tcp multiple commands + updated docs Jan 7, 2019
php Change `r2` to `radare2`, since meson doesn't make r2 (#72) Sep 18, 2018
prolog Make r2pipe a Prolog module Mar 30, 2019
python-async Change `r2` to `radare2`, since meson doesn't make r2 (#72) Sep 18, 2018
python More precise filename parsing in python module. Closes #114. May 6, 2020
r2core-js Change radare->radareorg links (#106) Oct 7, 2019
ruby fix all rubocop complaints Nov 11, 2018
rust Sync go, rust and ocaml Jun 12, 2017
shell Use r2p instead of ./r2cmd Jun 17, 2019
swift Almost fully convert r2pipe.swift for Swift4 Jun 26, 2017
v Add v.mod Nov 10, 2019
vala build with performance and debugging symbols May 24, 2016
.gitignore Refactor syntax Mar 5, 2018
Makefile.acr Release 3.1.0 Nov 26, 2018
README.md Update README.md (#75) Oct 20, 2018
autogen.sh Release 3.1.0 Nov 26, 2018
configure Release 4.3.0 Mar 4, 2020
configure.acr Release 4.3.0 Mar 4, 2020
r2pipe.png Update README Oct 7, 2016

README.md

r2pipe

r2pipe logo

The r2pipe APIs are based on a single r2 primitive found behind r_core_cmd_str() which is a function that accepts a string parameter describing the r2 command to run and returns a string with the result.

The decision behind this design comes from a series of benchmarks with different libffi implementations and resulted that using the native API is more complex and slower than just using raw command strings and parsing the output.

As long as the output can be tricky to parse, it's recommended to use the JSON output and deserializing them into native language objects which results much more handy than handling and maintaining internal data structures and pointers.

Also, memory management results into a much simpler thing because you only have to care about freeing the resulting string.

This directory contains different implementations of the r2pipe API for different languages which could handle different communication backends:

  • Grab R2PIPE{_IN|_OUT} environment variables
  • Spawn r2 -q0 and communicate with pipe(2)
  • Plain TCP connection
  • HTTP queries (connecting to a remote webserver)
  • RAP protocol (r2 own's remote protocol)

Most of the language enable asyncronous capabilities in order to handle the result of the operation in a callback, allowing a single program to interact with multiple instances or connections to different r2 sessions at the same time.

  • Syncronous
  • Asyncronous

In addition, r2pipe scripts can be used to write plugins for radare2 or extend current functionalities:

  • Assembler/Disassembler plugin for RAsm
  • RIO plugin to abstract read/write/system operations
  • Syscall handler for the ESIL emulator
  • ...

The most supported languages are:

  • NodeJS
  • Python
  • Swift
  • C/Nim/Vala/C++

But there is r2pipe for:

          pipe spawn async http tcp rap json plug lib buff
C           X     X     -    X    X   X    X    X   X   X
C++/Qt      X     X     -    -    -   -    X    -   X   -
C# / F#     X     X     X    X    -   -    -    -   X   -
D           X     -     -    -    -   -    X    -   -   -
Erlang      X     X     -    -    -   -    -    -   -   -
Go          X     X     -    -    -   -    X    -   -   -
Haskell     X     X     -    X    -   -    X    -   -   -
Java/Groovy -     X     -    X    -   -    -    -   X   -
Lisp        -     X     -    -    -   -    X    -   -   -
NewLisp     X     X     -    X    -   -    X    -   X   -
Nim         -     -     -    X    -   -    X    -   X   -
NodeJS      X     X     X    X    X   -    X    X   -   X
Ocaml       -     X     -    -    -   -    X    -   -   -
Perl        X     X     -    X    X   -    X    -   -   -
PHP         -     X     -    -    -   -    -    -   -   -
Python      X     X     X    X    X   X    X    X   X   -
Ruby        X     X     -    -    -   -    X    -   -   -
Rust        X     X     -    X    X   -    X    -   -   -
Swift       X     X     X    X    -   -    X    -   X   -
Vala        -     X     X    -    -   -    -    -   -   -
Clojure     X     X     -    -    -   -    -    -   -   -

--pancake

You can’t perform that action at this time.