Skip to content

Commit c599eb6

Browse files
committed
Update README.md
1 parent 373a8ff commit c599eb6

File tree

4 files changed

+74
-51
lines changed

4 files changed

+74
-51
lines changed

README.md

Lines changed: 20 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# udbserver - Unicorn Emulator Debug Server
22

3-
When you do emulation with [Unicorn Engine](https://www.unicorn-engine.org/), do you want to inspect the inner state during every step?
3+
`udbserver` is a debugging plugin for [Unicorn Engine](https://www.unicorn-engine.org/) that implements the [GDB Remote Serial Protocol](https://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html).
44

5-
`udbserver` is a plugin for Unicorn, provides a debug server which implements [GDB Remote Serial Protocol](https://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html). You can connect it by a `GDB` client and do debugging as what you do on real program.
6-
7-
`udbserver` can be used as a crate by Rust program, but it also provides a C library and bindings for other languages. You can use it inside most Unicorn based projects!
5+
It enables GDB-compatible debugging capabilities for Unicorn-based emulation projects, allowing you to inspect and control the emulation state through a GDB client.
86

97
## Features
108

@@ -15,7 +13,7 @@ When you do emulation with [Unicorn Engine](https://www.unicorn-engine.org/), do
1513
* [x] Watchpoint
1614
* [ ] Ctrl-C interrupt
1715

18-
## Architectures support
16+
## Architectures Support
1917

2018
* i386
2119
* x86\_64
@@ -26,54 +24,32 @@ When you do emulation with [Unicorn Engine](https://www.unicorn-engine.org/), do
2624
* PowerPC
2725
* RISC-V
2826

29-
# Usage
30-
31-
## API
32-
33-
`udbserver` only provides one API:
34-
35-
```c
36-
void udbserver(void* handle, uint16_t port, uint64_t start_addr);
37-
```
38-
39-
The `handle` should be the raw handle of a Unicorn instance, `port` is the port to be listened, `start_addr` is the address which when Unicorn runs at the debug server will start and wait to be connected. if `start_addr` is provided with `0`, the debug server will start instantly.
40-
41-
You can call this API inside a Unicorn hook, so you can integrate `udbserver` inside other Unicorn based project easily.
27+
## Installation & Usage
4228

43-
## Used in Rust
29+
### Python
4430

45-
You can use `udbserver` as a crate in `Rust`.
31+
The easiest way to get started is via pip:
4632

47-
You can check the [example](examples/server.rs) on how to use it.
33+
``
34+
pip install udbserver
35+
``
4836

49-
And you can try it by:
37+
Check out the [Python binding](bindings/python) for examples and documentation.
5038

51-
```sh
52-
$ cargo run --example server
53-
```
39+
### Rust
5440

55-
Then you can connect it with `gdb-multiarch`.
41+
As a native Rust project, you can use `udbserver` directly as a crate. Check out the [example](examples/server.rs):
5642

57-
## Installation
43+
``
44+
cargo run --example server
45+
``
5846

59-
`udbserver` provides a C-compatible set of library, header and pkg-config files, which help you to use it with other languages.
47+
### Other Languages
6048

61-
To build and install it you need to use [cargo-c](https://crates.io/crates/cargo-c):
49+
`udbserver` provides bindings for several languages:
6250

63-
```sh
64-
$ cargo install cargo-c
65-
$ mkdir build
66-
$ cargo cinstall --release --prefix=/usr --destdir build
67-
$ sudo cp -dr build/* /
68-
```
69-
70-
## Language bindings
71-
72-
After install the `udbserver` library, you can use `udbserver` in other languages.
73-
74-
You could check the examples on how to use `udbserver` by different languages:
75-
76-
* [C](bindings/c)
51+
* [C](bindings/c) (also provides C-compatible API for developing new bindings)
7752
* [Go](bindings/go)
7853
* [Java](bindings/java)
79-
* [Python](bindings/python)
54+
55+
Please check the corresponding directories for language-specific installation and usage instructions.

bindings/c/README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,34 @@
1-
# Use udbserver in C
1+
# C bindings for udbserver
22

3-
Check the [example](example.c) on how to use it.
3+
## API
4+
5+
`udbserver` provides a simple API:
6+
7+
```c
8+
void udbserver(void* handle, uint16_t port, uint64_t start_addr);
9+
```
10+
11+
Parameters:
12+
- `handle`: The raw handle of a Unicorn instance
13+
- `port`: The port number to listen on
14+
- `start_addr`: The address at which the debug server will start and wait for connection. If set to `0`, the debug server starts immediately
15+
16+
You can call this API inside a Unicorn hook to integrate `udbserver` within other Unicorn-based projects.
17+
18+
## Installation
19+
20+
`udbserver` provides a C-compatible set of library, header and pkg-config files. To build and install it you need to use [cargo-c](https://crates.io/crates/cargo-c):
21+
22+
```sh
23+
cargo install cargo-c
24+
mkdir build
25+
cargo cinstall --release --prefix=/usr --destdir build
26+
sudo cp -dr build/* /
27+
```
28+
29+
## Usage
30+
31+
Check the [example](example.c) on how to use it:
432

533
```sh
634
$ gcc example.c -lunicorn -ludbserver -o example

bindings/go/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
# Use udbserver in Go
1+
# Go bindings for udbserver
22

3-
Check the [example](example/main.go) on how to use it.
3+
This package provides Go bindings for udbserver, allowing you to inspect and control the emulation state through a GDB client.
4+
5+
## Installation
6+
7+
```sh
8+
$ go get github.com/bet4it/udbserver/bindings/go/udbserver
9+
```
10+
11+
## Usage
12+
13+
Please refer to this [example](example/main.go) to learn how to use this package:
414

515
```sh
616
$ go run ./example

bindings/java/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
# Use udbserver in Java
1+
# Java bindings for udbserver
22

3-
Remember to [install Unicorn java bindings](https://github.com/unicorn-engine/unicorn/tree/master/bindings/java) before use it.
3+
## Installation
44

5-
Check the [example](Example.java) on how to use it.
5+
Remember to [install Unicorn java bindings](https://github.com/unicorn-engine/unicorn/tree/master/bindings/java) before installation.
6+
7+
Then you can install this package with:
68

79
```sh
810
$ sudo make install
11+
```
12+
13+
## Usage
14+
15+
Please refer to this [example](Example.java) to learn how to use this package:
16+
17+
```sh
918
$ make example
1019
```

0 commit comments

Comments
 (0)