| Crates.io | coreminer |
| lib.rs | coreminer |
| version | 0.5.2 |
| created_at | 2025-02-26 17:39:12.908163+00 |
| updated_at | 2025-04-11 14:29:54.788341+00 |
| description | A debugger which can be used to debug programs that do not want to be debugged |
| homepage | https://github.com/TalpaLabs/coreminer |
| repository | https://github.com/TalpaLabs/coreminer |
| max_upload_size | |
| id | 1570711 |
| size | 375,964 |
A powerful debugger written in Rust that provides low-level debugging capabilities for programs that may not want to be debugged. Coreminer gives you deep control over program execution with robust DWARF debug information parsing.
To compile, coreminer depends on libunwind-dev. On Debian, it can be installed like
this. Other distributions provide similar packages.
apt install libunwind-dev pkg-config
cargo install coreminer
git clone https://github.com/TalpaLabs/coreminer.git
cd coreminer
cargo build --release
The binary will be available at ./target/release/cm.
You can launch Coreminer with an optional executable path as a default target:
# Launch Coreminer without a target
cm
# Launch Coreminer with a default executable
cm ./target/debug/dummy
Coreminer provides a simple CLI that allows you to interact with the debugger. The interface supports command history for ease of use.
Once in the Coreminer CLI, you can use:
# Run a program with arguments
run ./target/debug/dummy arg1 arg2
# If launched with a default executable, you can run it with:
run
# Set a breakpoint at a specific address (hex)
bp 0x0000563087528176
# Continue execution
c
# Step over instructions
s
step
# View disassembly at some address, 20 bytes
d 0x0000563087528176 20
# View disassembly at some address, 20 bytes, showing the code exactly how it is
# in memory - including the int3 instructions set by breakpoints
d 0x0000563087528176 20 --literal
# Read registers
regs get
# View process memory
rmem 0x7fffffffe000
# Backtrace the call stack
bt
# Read a variable by name (requires debug information)
var my_variable_name
# Inspect a debug symbol (requires debug information)
sym main
sym i
A list of all commands can be gotten with help:
Coreminer Debugger Help:
run PATH:str [ARGS:str ...] - Run program at PATH with optional arguments
c, cont - Continue execution
s, step - Step one instruction
si - Step into function call
su, sov - Step over function call
so - Step out of current function
bp, break ADDR:num - Set breakpoint at address (hex)
dbp, delbreak ADDR:num - Delete breakpoint at address (hex)
d, dis ADDR:num LEN:num [--literal] - Disassemble LEN bytes at ADDR
bt - Show backtrace
stack - Show stack
info - Show debugger info
pm - Show process memory map
regs get - Show register values
regs set REG:str VAL:num - Set register REG to value VAL (hex)
rmem ADDR:num - Read memory at address (hex)
wmem ADDR:num VAL:num - Write value to memory at address (hex)
sym, gsym NAME:str - Look up symbol by name
var NAME:str - Read variable value
vars NAME:str VAL:num - Write value to variable
set stepper N - Set stepper to auto-step N times
q, quit, exit - Exit the debugger
plugin ID:str [STATUS:bool] - Show the status of a plugin or enable/disable it
plugins - Get a list of all loaded plugins
help, h, ? - Show this help
Addresses and values should be in hexadecimal (with or without 0x prefix)
Input Types:
FOO:num is a positive whole number in hexadecimal (optional 0x prefix)
FOO:str is a string
FOO:bool either of 'true', 'false', '1', or '0'
From v0.2.0, Coreminer includes a second binary: cmserve. cmserve provides
all internal functionalities of the Coreminer debugger, but can be
scripted. This enables projects such as hardhat
to build a better user interface for Coreminer.
To see some example inputs (statuses) and outputs (feedbacks), you can use
cmserve --example-statuses --example-feedbacks.
Coreminer is built around several key components:
The examples directory contains a few small programs that serve as debuggees. You can try coreminer on them and see what happens.
They can be compiled in debug or release mode with build-dummy.sh and
build-release.sh.
The examples directory also contains an example plugin.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'feat: Add some amazing feature')git push origin feat/amazing-feature)Note: this project makes use of conventional git commits.
Distributed under the MIT License. See LICENSE for more information.