A multi-threaded extension of Blacksmith for Rowhammer research.
ThreadHammer extends the Blacksmith Rowhammer fuzzer with multi-threading and channel mapping. It keeps full compatibility with Blacksmith’s patterns and JSON outputs, making it easy to reuse existing results and workflows.
- 🧵 Multi-threaded sweeping with disjoint memory regions
- 🔍 Channel mapping through timing-based measurement
- ⚡ Thread-local configurations to prevent interference
- 🧾 JSON output for each thread
- 📊 Python tools for result analysis and plotting
- Linux (tested on Ubuntu and Arch)
- Root privileges
- Hugepages enabled
- C++17 or newer
- Libraries:
pthread,asmjit,nlohmann-json,cmake,make - Python 3 (for analysis)
- Correct DRAM addressing function mapping, hardcoded into the source code of both
/Blacksmithand/Blacksmith-Original(The mappings should be same for both)
git clone https://github.com/nima-sayadi/ThreadHammer.git
cd ThreadHammerOpen conf.cfg and change values according to your requirements:
DEFAULT_RUNTIMEis in seconds and is used only for fuzzing run of Blacksmith to obtain patternsN_THREADSis used to set maximum threads for your system. Read the description inconf.cfg. Open/Blacksmith/include/GlobalDefines.hppand setMAX_SWEEP_SIZEbased on your requirements (For Sweeping).
To obtain patterns outputted as /fuzz-summary.json, you need a fuzzing run simply by:
sudo bash run.shAfter this, you can split patterns you need for multi-threading with the help of Python tools in /scripts or your own tools.
To start single-threaded or multi-threaded sweeping:
sudo bash run.sh [-j pattern.json | -p pattern_dir -m] [-r repetition]-j: Path to a single pattern JSON file (single-thread mode)-p: Path to a folder with pattern files (required for multi-thread mode)-m: Enable multi-threading (must be used with-p)-r: Number of repetitions (default: 1) Note: You can adjust theMAX_SWEEP_SIZEin/Blacksmith/include/GlobalDefines.hppbefore starting your sweeping phase.
To measure DRAM channel mappings to banks and store the results in results/:
sudo bash measure-channel.sh -o channel-to-bank -r 3-o: Output file name (required)-r: Number of repetitions (default: 1)
Example output files:
results/channel-to-bank-1.json
results/channel-to-bank-2.json
results/channel-to-bank-3.json
- Do not remove/un-mount Hugepages during your experiment phases, otherwise your bank to channel mappings and obtained patterns become invalid and you will need to start over from the fuzzing in step 1.
- Do NOT run
remove-hugepage.shunless you know what you are doing. - Always run these scripts with root privileges.
- Do not interrupt a run to avoid partial data.
- If you have your bank functions in a form of Hex values (e.g.,
[0x2040, 0x24000, 0x48000, 0x90000]), you can usemat_gen.pyto create mapping matrix and inject the output to both Blacksmith source codes.
Nima Sayadi
Master of Applied Research in Computer Science, Hof University of Applied Sciences
Supervisors: Prof. Dr. Florian Adamsky & Martin Heckel, M.Sc.
(System & Network Security)
If you use this tool in your research, please cite:
N. Sayadi, ThreadHammer: A Multi-Thread Modification of Blacksmith,
Master’s Thesis, Hof University of Applied Sciences, 2025.
MIT License — see LICENSE for details.