Skip to content

joaoviictorti/dbg-rs

Repository files navigation

dbg-rs 🦀

Rust crate docs License Actions status

Safe Rust bindings for the COM interfaces of the Windows debugging engine.

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.

Getting started

Add dbg to your project by updating your Cargo.toml:

cargo add 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:

use dbg_rs::dprintln;

// Example usage
dprintln!(dbg, "Hello, {}!", "Debugger");
dprintln!(dbg, "Number: {}", 42);

Executing Commands

Running commands in the debugger:

use dbg_rs::Dbg;

dbg.exec(".echo Hello, Debugger!")?;

Reading Virtual Memory

Access specific regions of the debugged process's memory:

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

Additional Resources

For more examples, check the examples folder in the repository.

License

dbg-rs is licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in dbg-rs by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.

About

Safe Rust bindings for the COM interfaces of the Windows debugging engine

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published