Crate coreminer

Crate coreminer 

Source
Expand description

§Coreminer

A debugger library and executable for Rust that provides low-level debugging capabilities, particularly useful for debugging programs that may be resistant to standard debugging approaches.

§Core Features

  • Memory Access: Read and write process memory
  • Register Control: Access and modify CPU registers
  • Breakpoint Management: Set, enable, disable, and remove breakpoints
  • Execution Control: Step by step execution, continue execution, step in/out/over functions
  • Symbol Resolution: Parse and use DWARF debug information for symbol lookup
  • Variable Inspection: Access application variables through debug information
  • Stack Analysis: Generate and inspect backtraces and stack frames
  • Disassembly: Disassemble machine code to human readable assembly

§Architecture

Coreminer is built around several core components:

  • Debuggee: Represents the debugged process, managed through ptrace
  • Debugger: Coordinates the debugging session and UI communication
  • DWARF Parser: Extracts debug information for symbol and variable resolution
  • Breakpoint Management: Handles instruction replacement for breakpoints
  • UI Interface: Accepts commands and provides feedback

§Example Usage

#[cfg(feature = "cli")]
use coreminer::debugger::Debugger;
use coreminer::ui::cli::CliUi;

fn main() -> Result<(), coreminer::errors::DebuggerError> {
    let ui = CliUi::build(None)?;
    let mut debugger = Debugger::build(ui)?;
    debugger.run_debugger()?;
    debugger.cleanup()?;
    Ok(())
}

Modules§

addr
Address Module
breakpoint
Breakpoint Module
consts
Constants Module
dbginfo
Debug Information Module
debuggee
Debuggee Module
debugger
Debugger Module
disassemble
Disassembly Module
dwarf_parse
DWARF Debug Information Parser
errors
Error Types
feedback
Feedback Module
memorymap
Memory Map Module
plugins
Plugin System
stack
Stack Module
ui
User Interface Module
unwind
Stack Unwinding Module
variable
Variable Access Module

Macros§

for_hooks
Executes code for each enabled hook implementing a specific extension point

Enums§

Register
CPU register names for x86_64 architecture

Constants§

WORD_BYTES
Number of bytes in a Word (8 bytes on a 64-bit system)

Functions§

get_reg
Gets the value of a specified register for the target process
set_reg
Sets the value of a specified register for the target process

Type Aliases§

Word
Type alias for machine word-sized integers, used for register values and memory contents