Preservation + Godot remaster of Havoc (Reality Bytes, 1995): .FF asset extraction, format docs, and reverse-engineering toolkit.
Find a file
pyr0ball 7d39ccddf0 fix: harden debug agent for reliable WOW64 watchpoints and multi-run stability
Key fixes applied during Task 6 end-to-end MCP integration testing:

- CONTEXT_ALL (CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS) for Wow64Get/SetThreadContext
  so DR0-DR7 are read and written alongside general-purpose registers
- Native x64 SetThreadContext path in _apply_watchpoints_to_thread: Wow64SetThreadContext
  updates the WOW64 context save area but does not propagate to hardware DR registers;
  the native path is required for hardware watchpoints to actually fire on WOW64 threads
- _REGISTER_NAMES extended to include Dr0-Dr3, Dr6, Dr7 so get_registers returns them
- launch() now terminates and drains the previously attached process before starting a
  new one, preventing stale debug events from a hung game from corrupting a new session
- continue_execution filters events by process ID so late-arriving exit events from a
  previously terminated game do not trigger a false "exited" status for the new process
- AV exception routing restored: EXCEPTION_ACCESS_VIOLATION stops and reports; callers
  skip boot-time AVs in a loop rather than silently continuing them in the agent
- launch_with_breakpoints atomic op in agent server and MCP server
- _DebugWorker dedicated thread: Windows debug API requires all WaitForDebugEvent,
  ContinueDebugEvent, and CreateProcessA calls to originate from the same OS thread;
  ThreadingTCPServer violated this -- replaced with single worker thread + queue
- Gameplay screenshot captured at watchpoint stop (272 KB real frame)

Acceptance checklist results:
- Item 1 PASS: bp@0x40C8E0, eip/eax confirmed
- Item 2 PASS: conditional breakpoint false-skip and true-fire verified
- Item 3 PASS: watchpoint@slot0 fired at 0x40E998 (MOV [DAT_0047c488], EAX in
  player_cooldown_timers_tick -- the DAT write is in the caller, not inside
  compute_frame_delta_ticks_60hz_min1_clamp as the spec assumed)
- Item 4 PASS: screenshot PNG captured (gameplay frame 272 KB)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TN4Ytn3gdWRonNmHpisWQv
2026-07-04 14:05:24 -07:00
docs docs: add briefing for the Caspian-side agent implementing Tasks 2-4/6 2026-07-04 06:01:55 -07:00
tests fix: close timing-attack and empty-secret auth bypass in MCP server 2026-07-04 07:22:55 -07:00
tools fix: harden debug agent for reliable WOW64 watchpoints and multi-run stability 2026-07-04 14:05:24 -07:00
.gitignore feat: set up Linux Ghidra pipeline, find and patch FPS-coupling and pause-hang bugs 2026-07-03 22:32:28 -07:00
README.md feat: crack GRAFIX0N.DAT texture format + extractor 2026-07-03 09:36:41 -07:00
requirements.txt feat: wire MCP tool definitions and bearer-token auth into server 2026-07-04 07:13:36 -07:00
run_and_log.bat feat: NOCD patch boots Havoc on modern Windows (defeats CD copy protection) 2026-07-03 09:29:59 -07:00
run_probe.bat feat: NOCD patch boots Havoc on modern Windows (defeats CD copy protection) 2026-07-03 09:29:59 -07:00

Havoc — Preservation & Godot Remaster

Reverse-engineering, asset-extraction, and Godot remaster of Havoc (Reality Bytes, Inc., 1995) — a first-person vehicular-combat shooter for Windows 95/98.

Havoc renders a software-rasterized 3D world (textured terrain, low-poly enemy/pickup models, drivable and flyable vehicles, dithered 8-bit color) into a DirectDraw framebuffer, framed by an elaborate 2D cockpit HUD (mirrors, radar, gauges, weapon icons). Biomes include desert, snow/ice, lava, and ocean.

The original 32-bit executable (DirectDraw + DirectSound, no Direct3D — the 3D is all software) no longer runs reliably on modern Windows (legacy DirectDraw + a 16-bit installer/DirectX setup path). Rather than only emulate it, this project extracts the original data into open formats and rebuilds the game in Godot as a quality-of-life remaster.

Legal: Havoc is 30-year-old abandonware. This repository contains only original reverse-engineering code and documentation. It does not redistribute the game's executables, DLLs, or data files (see .gitignore). You must supply your own copy of the game data to run the tools.

Status

  • Identified binaries: HAVOC.EXE/LAUNCHER.EXE/SETUP.EXE are 32-bit PE (i386), DirectDraw + DirectSound, not 16-bit/DOS.
  • Cracked the .FF ("FlashFile") archive format — see docs/FORMATS.md.
  • Extracted MUSIC.FF: 97 WAV segments + 17 playlist-sequenced songs (verified correct).
  • FL Studio pack: per-song MIDI + sample mapping (tools/ff_extract.py --fl).
  • ogg/mp3 conversion (--convert, needs ffmpeg).
  • Boot HAVOC.EXE on Windows 11 (dgVoodoo2) — NOCD + copy-protection fix, see docs/PATCHES.md.
  • [~] Crack graphics formats: GRAFIX*.DAT done (docs/FORMATS.md); LAND*.DAT, MAP*.MAP, STUF*.DAT next.
  • Decompile HAVOC.EXE (Ghidra) to recover game logic.
  • Godot remaster project (widescreen, higher-res, rebindable input).

Tools

tools/ff_extract.py — extract any .FF archive.

python tools/ff_extract.py MUSIC.FF -o out_music --songs          # raw entries + assembled songs
python tools/ff_extract.py MUSIC.FF -o out_music --songs --convert ogg
python tools/ff_extract.py MUSIC.FF -o Havoc_MUSIC_FLStudio --fl  # FL Studio samples + MIDI

Layout

tools/        reverse-engineering & extraction scripts (tracked)
docs/         format documentation (tracked)
godot/        Godot remaster project (tracked, WIP)
<game files>  original data — supplied by you, gitignored