Skip to content

TalpaLabs/hardhat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

icon

HardHat

🔩 HardHat 👷

A textual user interface for Coreminer


Python Requires Coreminer License Release

HardHat

HardHat is a powerful Textual User Interface (TUI) for the Coreminer debugger. It provides an intuitive, terminal-based interface that enhances the debugging experience with Coreminer while maintaining the flexibility and power of the command-line.

Features

  • Customizable multi-pane interface: Arrange different views to suit your debugging workflow
  • Richer command input: Command history navigation
  • Multiple data views:
    • Disassembly view: Code disassembly with breakpoint indicators
    • Register view: CPU register values
    • Stack view: Current stack contents
    • Output view: Program and debugger output
    • Backtrace view: Current backtrace
    • Raw responses: Full JSON data for debugging the debugger itself
  • Plugin management: Enable/disable Coreminer plugins directly from the UI
  • Keyboard navigation: Efficient workflow with keyboard shortcuts

Requirements

  • Python 3.13+
  • Coreminer debugger with the cmserve binary, at least v0.4.0
  • Textual library

Installation

Install Coreminer

HardHat requires the Coreminer debugger to be installed. Follow the Coreminer installation instructions from its README.

Ensure that cmserve is in your PATH after installing Coreminer.

Install HardHat

# Clone the repository
git clone https://github.com/TalpaLabs/hardhat.git
cd hardhat

# Install dependencies
pip install -e .

# For development
pip install -e ".[dev]"

Usage

Launch HardHat

python src/app.py

Basic Interface

HardHat provides four customizable window panes that can display different widgets:

  • Main window (large)
  • Two small windows
  • Medium window
  • Command input at the bottom

Click the [+] tab in any window to add a widget:

  • Output: Program and debugger output
  • Disassembly: Disassembled code view
  • Registers: CPU register values
  • Stack: Current stack values
  • RawResponses: Raw JSON responses from Coreminer

Commands

HardHat supports all Coreminer commands with a similar syntax. Here are some examples:

# Run a program
run /path/to/executable arg1 arg2

# Set a breakpoint at an address
bp 0x4000000

# Delete a breakpoint
dbp 0x4000000

# Continue execution
c

# Step instructions
s                  # Single step
si                 # Step into function
so                 # Step out of function
sov                # Step over function

# View memory and registers
d 0x4000000 20     # Disassemble 20 bytes at address
regs get           # View registers
stack              # View stack
bt                 # View backtrace
pm                 # View process memory map

# Memory operations
rmem 0x7fffffffe000  # Read word at address
wmem 0x7fffffffe000 0x1234  # Write word to address

# View symbols and variables
sym main           # Look up symbol 'main'
var count          # View variable value
vars count 42      # Set variable value

# Plugin management
plugins            # List all plugins
plugin sigtrap_guard true  # Enable a plugin

Press CTRL + P to open the command palette and click "Help Menu" to see all available commands.

Architecture

HardHat uses a MVC-inspired architecture:

  • Data Store: Central repository for application state
  • Feedback Parser: Processes JSON responses from Coreminer
  • Command Parser: Converts user commands to Coreminer JSON requests
  • Coreminer Interface: Manages communication with the Coreminer process
  • UI Components: Textual widgets for displaying different views

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: Add some amazing feature')
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

Note: this project makes use of conventional git commits.

License

Distributed under the MIT License. See the LICENSE file for more information.

Acknowledgements

  • Coreminer - The debugger powering HardHat
  • Textual - The TUI framework used to build HardHat

About

python user interface for coreminer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages