Diagnosed and fixed the crash that killed HAVOC_NOCD.EXE ~1s after launch
(dgVoodoo window appears black, then the process exits). It was not a clean
exit: an ACCESS_VIOLATION (null-pointer read at VA 0x444E6A) during init.
Root cause is a copy-protection check in the WORLDS\ data-file loader
(0x42a480). It opens each file (GRAFIX/LAND/MAP/STUF) from both a local
"WORLDS\<name>" path and a CD-drive path (HAVOC.INI [SETUP] DRIVE=D:\), and
returns a valid stream only when the local open fails and the CD-drive open
succeeds. With files present locally and no D: drive it returned NULL, and the
GRAFIX loader (0x444db0) dereferenced that NULL without checking.
Fix: 14-byte patch at FO 0x29a2b rewrites the return decision to hand back the
successfully-opened local object. The game now boots to the title screen
("HAVOC(tm) by Reality Bytes"), responsive, main loop running.
- docs/PATCHES.md: full patch table (28 patches) + crash write-up
- tools/: RE + patching scripts (r2pipe disasm, minidump parser, ctypes
debugger, PE/IAT/import analysis)
- run_probe.bat / run_and_log.bat: reliable native launch for repro
- .gitignore: exclude CD images, Ghidra install/project, dgVoodoo, *.ini
Diagnosed via WER minidumps (%LOCALAPPDATA%\CrashDumps) parsed in pure Python
(no cdb/windbg available).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TN4Ytn3gdWRonNmHpisWQv
22 lines
844 B
Python
22 lines
844 B
Python
import r2pipe, sys, io
|
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
|
|
|
|
r2 = r2pipe.open("Z:/Development/devl/Havoc/HAVOC_NOCD.EXE",
|
|
["-e", "bin.relocs.apply=true"])
|
|
|
|
print("=== 0x40AC00 (object creator - does it short-circuit?) ===")
|
|
print(r2.cmd("pd 30 @ 0x40ac00"))
|
|
|
|
print("\n=== 0x40ADF0 (second pool alloc, called after 0x429CA0) ===")
|
|
print(r2.cmd("pd 40 @ 0x40adf0"))
|
|
|
|
# Also: read the full 0x429CA0 past the loop to see if there's another crash_stub call
|
|
print("\n=== 0x429CA0 continued (after offset 0x429d57) ===")
|
|
print(r2.cmd("pd 40 @ 0x429d57"))
|
|
|
|
# Run the game and capture the new crash address
|
|
print("\n=== current patch state at crash site FO 0x290A0 area ===")
|
|
# Check if there's anything patched around FO 0x290A0 = VA 0x429CA0
|
|
print(r2.cmd("pd 5 @ 0x429ca0"))
|
|
|
|
r2.quit()
|