The keys rewrite the hero's path every cCreature::Update: one segment along the held direction, the facing set to it, sliding along blocked cells. Starting from idle runs the game's own Think steps at once (StartPendingWalk, WalkAction) instead of waiting up to 110 ms, so weapon switches no longer stop the walk. Stops wait 50 ms after the keys are released, and a stop in progress is taken back when keys are held again. Names for movement, stats and text-key functions. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
tools
Node tools need npm install here once (iced-x86). Paths to sacred.exe are
passed explicitly.
| Tool | Purpose |
|---|---|
disasm.mjs <exe> <va> [n] |
disassemble at an address, ignoring Ghidra's function boundaries |
find-imm.mjs <exe> <value...> |
every instruction using an immediate value (e.g. 1024 768) |
find-imm.mjs <exe> /regex/ |
every instruction whose text matches (e.g. /96AB0h\]/) |
rtti.mjs <exe> <Class> |
vtables of an MSVC class via RTTI |
decompile.ps1 <addr...> |
decompile from the persistent Ghidra project ghidra/ |
rename.ps1 |
apply the function names in names.txt to the Ghidra project (add names there as functions are identified) |
Persistent Ghidra project (ghidra/, not in git)
Created once (about 7 minutes):
$env:GHIDRA_HEADLESS_MAXMEM = "8G"
& "$env:GHIDRA_INSTALL_DIR\support\analyzeHeadless.bat" ghidra sacred -import "<Sacred Gold>\sacred.exe"
& "$env:GHIDRA_INSTALL_DIR\support\analyzeHeadless.bat" ghidra sacred -process sacred.exe -scriptPath tools\ghidra -postScript ApplyRtti.java
ApplyRtti.java recovers the MSVC 6 RTTI that Ghidra's own script misses:
410 vtables, ~1200 extra functions, methods named Class::vfNN.
Automated in-game test
autotest-load.ps1 starts the game through the launcher, clicks
"Spiel laden" -> "Laden" -> "Ok" (first save game), takes screenshots in-game
and with the ESC menu open, and stops the game. -Ini appends temporary
settings to build\x86-debug\sacred_re.ini (restored afterwards), e.g.
.\tools\autotest-load.ps1 -Name ws_off -Ini "[widescreen]`r`nEnabled=0"
Click positions assume the classic menu layout scaled onto a 3440x1440
monitor. game-input.ps1 has the building blocks (start, click, key, hold key,
screenshot). Don't touch mouse/keyboard while a test runs.