# restoHack: Bringing 1985 Hack Back from the Dead **restoHack** is a full-blooded resurrection of *Hack* 1.0.3 (1985), the version of Hack that spawned *NetHack*. Not a remake. Not a reboot. This is *software preservation with a blowtorch and a scalpel*. The goal: make the original code compile, run, and dungeon-crawl exactly as it did when floppies were king. Think resto-mod: the soul stays vintage, the internals get a precision rebuild. **Philosophy**: "Fix what breaks, preserve what works" - authentic 1985 gameplay with modern build system and safety improvements. **[Read the Complete History of Hack](docs/HISTORY_OF_HACK.md)** *From Rogue (1980) to NetHack's rise, through decades of digital decay, to restoHack's 2025 resurrection* ---

Screenshots

Luck and death, in that order.

Full moon event Tombstone

--- ## Features * **Modern Build System** – CMake replaces Makefiles. Clean builds on Linux, FreeBSD, and other Unix systems. * **Authentic Systems** – Over a dozen original systems restored from source, untouched in design. * **Complete K\&R Modernization** – Entire codebase converted to ANSI C (\~250 functions updated). * **Unix/Linux Fixes** – No more hardcoded BSD paths or FS quirks. * **Cross-Platform Verified** – Linux (glibc/musl) and macOS are CI-tested on GitHub Actions; FreeBSD was CI-tested on Cirrus CI until that service shut down in June 2026. > **Tested on:** Arch, Alpine, FreeBSD 14.3, WSL, and aarch64. > macOS support verified via runner. Arch users can install via the AUR. --- **Recognition:** RestoHack was recognized by **GitHub** as a *For the Love of Code* category winner (2025). Featured in the official GitHub Blog: [From Karaoke Terminals to AI Resumes — The Winners of GitHub’s For the Love of Code Challenge](https://github.blog/open-source/from-karaoke-terminals-to-ai-resumes-the-winners-of-githubs-for-the-love-of-code-challenge/) --- ## Play Online (Hardfought) restoHack is now available on [Hardfought](https://www.hardfought.org/) — no installation required. ```bash ssh nethack@us.hardfought.org ``` 1. Login or register (`l` / `r`) 2. Select `5) Miscellaneous games` 3. Select `$) Hack 1.0.3` Hardfought also lets you watch games in progress (`w` from the main menu). --- ## Installation ### Arch Linux (AUR) ```bash yay -S restohack ``` ### Download Pre-built Binary (Linux) Download the static binary from [Releases](https://github.com/Critlist/restoHack/releases): ```bash mkdir -p ~/Games/restohack cd ~/Games/restohack tar -xzf restoHack-*-linux-x86_64-static.tar.gz ./run-hack.sh ``` *Note: As of v1.1.1, we provide separate binary and source tarballs instead of hybrid packages.* *(static binary, no dependencies required)* Also available on [itch.io](https://critlist.itch.io/restohack) — no compiling required. ### Build from Source **Requirements:** `git`, `cmake`, a C compiler, `ncurses` ```bash git clone https://github.com/Critlist/restoHack.git cd restoHack cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build cd build && ./hack ``` **Alternative** (if your system supports CMake presets): ```bash cmake --preset=release && cmake --build build ``` **For BSD systems, development builds, IDE integration, and troubleshooting:** see [**Build Instructions**](docs/BUILD.md) ### Windows (Work in Progress) A `windows-port` branch exists targeting **MSVC** and **MinGW64** using **PDCurses**. The MinGW build currently compiles but is **not yet playable**. Build system details and testing are still in progress. The long-term goal is a simple Windows build so people curious about early roguelike and Hack history can experience the game without needing a Unix terminal. A free Steam release is planned once the Windows build is stable. --- ## Current Status v1.1.7 — Stable Release Security and stability fixes from a code review: format-string bugs, a missing `setuid` privilege drop, a crash when `HOME` is unset, and file-descriptor leaks. See [CHANGELOG](docs/CHANGELOG.md). --- ## Recent Fixes * **aarch64 Crash** – Fixed segfault after character selection on aarch64 Ubuntu (reported by [@Filipsys](https://github.com/Filipsys)) * **Save System Safety** – Version 2 save format with pointer serialization * **Ubuntu Fix** – Resolved PATH resolution bug preventing game launch on Ubuntu 22.04/24.04 * **Hardening** – Made 151 char-typed array subscripts safe, fixed a format-string bug and privilege-drop handling, and added bounds checks * **Terminal Resize** – Added SIGWINCH handler to prevent display corruption on window resize * **Overflow Guards** – Defensive caps on strength arithmetic (spinach/potions); the original math already stays within range in normal play --- ## Preservation Philosophy Fix what breaks, preserve what works. --- ## Source Code Built from Andries Brouwer's Hack 1.0.3 (1985) preserved in FreeBSD's games collection. Original source in [`docs/historical/original-source/`](docs/historical/original-source/) See [CODING_STANDARDS.md](docs/CODING_STANDARDS.md) for how changes are documented. Full history: [HISTORY_OF_HACK.md](docs/HISTORY_OF_HACK.md) --- ## Historical Research **[protoHack](https://github.com/Critlist/protoHack)** restores Jay Fenlason's original 1981-82 source code (preserved by Brian Harvey and published by Dan Stormont as [fenlason-hack](https://github.com/Sustainable-Games/fenlason-hack)) and conducts primary-source research into Hack's origins. **restoHack** is the stabilized restoration of Brouwer's Hack 1.0.3 with curated history. The [`docs/research/`](docs/research/) directory is the shared evidence base maintained across both projects. --- ## Gameplay You’re the `@`, diving into the Mazes of Menace to steal the Amulet of Yendor. Expect monsters, magic, cursed loot, and permadeath. Controls are Vi-style (`hjkl`). Survival is… unlikely. --- ## Contributing Bug fixes, portability patches, packaging help—welcome. Want to port to Plan 9? Go for it. Just document changes and respect the code. --- ## Acknowledgments Thanks to **K2** for hosting restoHack on [Hardfought](https://www.hardfought.org/) and keeping the roguelike public server tradition alive. --- ## License 3-Clause BSD. Do what you want, just don’t sue me. See `LICENSE`.