• Stars
    star
    370
  • Rank 115,405 (Top 3 %)
  • Language
    JavaScript
  • Created about 8 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Access radare2 via pipe from any programming language!

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     X    -    -   -    -    -   -   -
V           X     X     -    -    -   -    -    X   -   -
Clojure     X     X     -    -    -   -    -    -   -   -

--pancake

More Repositories

1

radare2

UNIX-like reverse engineering framework and command-line toolset
C
20,356
star
2

iaito

Official QT frontend of radare2
C++
1,047
star
3

radare2-book

The Official Radare2 Book
C
787
star
4

awesome-radare2

A curated list of awesome projects, articles and the other materials powered by Radare2
696
star
5

radeco

radare2-based decompiler and symbol executor
Rust
372
star
6

r2ghidra

Native Ghidra Decompiler for r2
C++
334
star
7

radare2-extras

Source graveyard and random candy for radare2
C
239
star
8

sdb

Simple and fast string based key-value database with support for arrays and json
C
216
star
9

r2con

Radare Congress Stuff
202
star
10

esilsolve

A python symbolic execution framework using radare2's ESIL (Evaluable String Intermediate Language)
Python
159
star
11

r2con2019

r2con2019 - slides and materials
Python
135
star
12

radare2-pm

Package Manager for Radare2
Shell
131
star
13

radare2-bindings

Bindings of the r2 api for Valabind and friends
Python
130
star
14

r2retdec

RetDec plugin for Radare2
C++
123
star
15

r2con2017

r2con 2017 September 6-9
Python
97
star
16

radare2-webui

webui repository for radare2
JavaScript
93
star
17

r2con2018

HTML
92
star
18

r2ai

local language model for radare2
Python
78
star
19

r2wars

Corewars but within r2
C#
56
star
20

r2pipe.rs

Rust crate for r2pipe
Rust
44
star
21

ghidra-r2web

Ghidra plugin to start an r2 webserver to let r2 interact with it
Java
43
star
22

libdemangle

A simple library focusing on demangling symbols for different programing languages
C
39
star
23

r2con2020

Python
35
star
24

radare

advanced unix-like hexadecimal editor and debugger
C
35
star
25

r2jp

Japanese Community of radare2
34
star
26

r2pm

Radare2 cross platform package manager
Go
33
star
27

radare2-r2papi

High Level API on top of the R2Pipe interface
TypeScript
33
star
28

acr

autoconf replacement
Shell
33
star
29

r2pipe-go

Go API to interact with radare2
Go
31
star
30

ghidra-native

C++
29
star
31

r2con2021

28
star
32

r2env

Install multiple versions of r2 and its plugins via Pip on any system!
Python
25
star
33

r2yara

yara and radare2, better together
C
17
star
34

radare2-rlang

Writing Radare2 plugins in various languages
C
15
star
35

radare2-testbins

Rebol
15
star
36

radare2-rust

Playground for Rust and Radare2
Rust
14
star
37

radare.org

http://www.radare.org/
CSS
14
star
38

r2hexagon

Hexagon disassembler code generator from the official instruction manual.
C
11
star
39

r2con2016

r2con2016 repository
C
10
star
40

esil-rs

Radare2's ESIL in Rust
Rust
10
star
41

r2diaphora

Binary Diffing tool ported to radare2
Python
9
star
42

radare2-gsoc-windows

Various Brainstorming/scripts/ideas/etc. for the GSOC-Windows Task
C
9
star
43

ragui

Vala
8
star
44

radare2-release

Releasing is hard
Shell
7
star
45

r2app

Electron Desktop App for Radare2
JavaScript
6
star
46

blog

The radare2 blog, available on radare.today
Shell
6
star
47

r2pipe-codeshare

A place to share your radare2 scripts
Python
6
star
48

radare2-win-installer

Windows installer scripts for radare2
Inno Setup
5
star
49

r2r-go

Go
5
star
50

radareorg

New amazing website for radare.org
Python
4
star
51

radare2-cheatsheets

TeX
4
star
52

radare2-fuzz

Python
4
star
53

ideas

4
star
54

radare2-skel

Sample radare2 project templates
Python
4
star
55

node-r2r

radare2 regressions testsuite in nodejs
JavaScript
3
star
56

iaito-translations

Makefile
3
star
57

.github

Radare Organization Templates
3
star
58

r2shell

C
2
star
59

infrastructure

Terraform, Nomad, Consul and Vault configuration of radare infrastructure
Dockerfile
2
star
60

r2pm-db

Radare2 package manager database
2
star
61

radare2-snap

Radare2 snap and docker repository
Makefile
2
star
62

radare2-fuzztargets

Makefile
1
star
63

r2r-v

R2 regressions testsuite written in V
V
1
star
64

radeco-regressions

Regresion tests for radeco
Rust
1
star
65

radare2-sigs

Zignature masm32 repository
Python
1
star
66

r2sarif

Load, manage and create SARIF documents with radare2
TypeScript
1
star