Contributing¶
The full guide
This page is a summary. The complete guide, with the commit conventions and how to add a simulator feature, is CONTRIBUTING.md on GitHub. Ask questions in Discussions, report vulnerabilities privately as described in SECURITY.md, and follow the Code of Conduct.
Bug reports, fixes and new device support are welcome. Please open an issue first for larger changes, so we can agree on the approach before you spend time on it.
Reports from real hardware are especially useful: uart, openocd, spiflash and tools
are still experimental because they have only been tested against simulated devices and
recorded tool output. If you ran them on a board, tell us what worked and what did not (the
board, adapter, U-Boot or OpenOCD version, and the console output with secrets removed).
Development setup¶
git clone https://github.com/reflex-hs/hwntools.git
cd hwntools
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
Checks¶
CI runs these on Linux, macOS and Windows with Python 3.10 to 3.13. Run them before you open a pull request:
pytest --cov # pty-based tests are skipped on Windows
ruff check src tests examples && ruff format --check src tests examples && mypy
python -m build && twine check dist/*
Optional integration tests: set HWNTOOLS_TEST_BIN_DIRS to the directories that hold the Rust
binaries (fwsift, bootlint, baudhound, mcpwarden), and HWNTOOLS_TEST_DOCKER=1 to run the
unblob Docker tests (needs the unblob Docker image and mksquashfs).
Tests must not need hardware. Use the simulator (hwntools.sim), the fake OpenOCD server in
tests/fake_openocd.py, the fake external tools in tests/fake_tools.py and the synthetic
firmware images in tests/fwimages.py.
Documentation¶
This site is built with MkDocs Material and
mkdocstrings. The pages are in docs/, the API reference is
generated from the docstrings, and the CLI reference from the real hwn argument parser.
pip install -e ".[docs]"
mkdocs serve # live preview on http://127.0.0.1:8000
mkdocs build --strict # what CI runs on every pull request
Docstrings use Google style (Args:, Returns:, Raises:) with Markdown. Keep code examples
runnable; if one needs hardware, show the simulator version too.
Pull requests¶
- Keep each pull request focused on one change and add tests for it.
- Destructive operations (anything that writes flash or persistent settings) must require
force=Trueand raiseSafetyErrorotherwise. - Do not add third-party dependencies to the core. Optional features go behind an extra or an external program that is detected at runtime.
- Add a line to
CHANGELOG.mdunder an "Unreleased" heading.
License¶
By contributing you agree that your contributions are licensed under the project's
MIT license. The illustrations in
docs/art/ come from Reflex Design and are
licensed separately under CC BY 4.0.