-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update README.md #56
Open
Semnodime
wants to merge
1
commit into
rizinorg:master
Choose a base branch
from
Semnodime:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update README.md #56
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,39 @@ | ||
rz-pipe | ||
====== | ||
# rz-pipe | ||
The `rz-pipe` provides access to `rz_core_cmd_str()`. | ||
|
||
The rz-pipe APIs are based on a single rizin primitive found behind `rz_core_cmd_str()` | ||
which is a function that accepts a string parameter describing the rizin 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. | ||
## Usage | ||
This function **takes a string parameter describing the rizin command** to execute and **returns a string** with the result. | ||
|
||
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. | ||
```json | ||
"fij" | ||
``` | ||
-> | ||
```json | ||
[{"name":"entry0","size":1,"offset":27296},{"name":"entry.fini0","size":1,"offset":27456},{"name":"entry.init0","size":1,"offset":27520}] | ||
``` | ||
|
||
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 rz-pipe API for different | ||
languages which could handle different communication backends: | ||
## Design Choice | ||
After benchmarking various `libffi` implementations, it was found that using the native API is both more complex and slower compared to utilizing raw command strings and parsing their output. | ||
Parsing the output can be challenging, so it's advisable to use JSON output and deserialize it into native language objects. | ||
This approach proves to be much more convenient than dealing with and maintaining internal data structures and pointers. | ||
|
||
* Grab RZPIPE{_IN|_OUT} environment variables | ||
* Spawn `rizin -q0` and communicate with pipe(2) | ||
* Plain TCP connection | ||
* HTTP queries (connecting to a remote webserver) | ||
* RAP protocol (rizin own's remote protocol) | ||
Moreover, memory management becomes simpler since you only need to focus on freeing the resulting string. | ||
|
||
The current supported languages are: | ||
## Backends | ||
In this directory, you'll find different implementations of the `rz-pipe` API for various languages, each capable of handling different communication backends: | ||
|
||
* Python | ||
* Go | ||
* Haskell | ||
* OCaml | ||
* Rust | ||
* Ruby | ||
- Retrieving RZPIPE{_IN|_OUT} environment variables | ||
- Spawning `rizin -q0` and communicating with pipe(2) | ||
- Plain TCP connection | ||
- HTTP queries (connecting to a remote webserver) | ||
- RAP protocol (rizin's custom remote protocol) | ||
|
||
## Supported Languages | ||
- Python | ||
- Go | ||
- Haskell | ||
- OCaml | ||
- Rust | ||
- Ruby |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably it would make sense to have: