https://github.com/joaoviictorti/dbg-rs
Safe Rust bindings for the COM interfaces of the Windows debugging engine
https://github.com/joaoviictorti/dbg-rs
bindings dbgeng rust windows
Last synced: about 2 months ago
JSON representation
Safe Rust bindings for the COM interfaces of the Windows debugging engine
- Host: GitHub
- URL: https://github.com/joaoviictorti/dbg-rs
- Owner: joaoviictorti
- License: mit
- Created: 2025-01-28T20:04:18.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-03-05T23:49:25.000Z (3 months ago)
- Last Synced: 2025-04-14T08:12:50.276Z (about 2 months ago)
- Topics: bindings, dbgeng, rust, windows
- Language: Rust
- Homepage: https://crates.io/crates/dbg-rs
- Size: 13.7 KB
- Stars: 13
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dbg-rs 🦀





Safe Rust bindings for the COM interfaces of the Windows debugging engine.
## Table of Contents
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Logging to the Debugger](#logging-to-the-debugger)
- [Executing Commands](#executing-commands)
- [Reading Virtual Memory](#reading-virtual-memory)
- [Contributing to dbg-rs](#contributing-to-dbg-rs)
- [License](#license)## Features
- ✅ Safe Rust bindings for Windows debugging interfaces.
- ✅ Easy-to-use macros for logging to the debugger.
- ✅ Abstractions for managing symbols, memory, and CPU registers.
- ✅ Works seamlessly with the Windows COM-based debugging system.## Installation
Add `dbg` to your project by updating your `Cargo.toml`:
```bash
cargo add dbg-rs
```Or manually add the dependency:
```toml
[dependencies]
dbg-rs = ""
```## Usage
The `dbg-rs` library provides utilities to interact with the Windows debugging engine, such as executing commands, logging messages, and inspecting debug symbols. Below are some common use cases:
### Logging to the Debugger
Use the `dprintln!` macro to send formatted messages to the debugger output:
```rs
use dbg_rs::dprintln;// Example usage
dprintln!(dbg, "Hello, {}!", "Debugger");
dprintln!(dbg, "Number: {}", 42);
```### Executing Commands
Running commands in the debugger:
```rs
use dbg_rs::Dbg;dbg.exec(".echo Hello, Debugger!")?;
```### Reading Virtual Memory
Access specific regions of the debugged process's memory:
```rs
use dbg_rs::Dbg;let mut buffer = vec![0u8; 128];
dbg.read_vaddr(0x7FFEBEEF0000, &mut buffer)?;
println!("Read memory: {:?}", &buffer[..16]); // Print first 16 bytes
```For more examples, including a WinDbg extension that lists loaded modules, see the [`examples`](./examples) folder in this repository. 📂
## Contributing to dbg-rs
To contribute to **dbg-rs**, follow these steps:
1. Fork this repository.
2. Create a branch: `git checkout -b `.
3. Make your changes and commit them: `git commit -m ''`.
4. Push your changes to your branch: `git push origin `.
5. Create a pull request.Alternatively, consult the [GitHub documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests) on how to create a pull request.
## License
This project is licensed under the MIT License. See the [LICENSE](/LICENSE) file for details.