# tools Node tools need `npm install` here once (iced-x86). Paths to sacred.exe are passed explicitly. | Tool | Purpose | |---|---| | `disasm.mjs [n]` | disassemble at an address, ignoring Ghidra's function boundaries | | `find-imm.mjs ` | every instruction using an immediate value (e.g. `1024 768`) | | `find-imm.mjs /regex/` | every instruction whose text matches (e.g. `/96AB0h\]/`) | | `rtti.mjs ` | vtables of an MSVC class via RTTI | | `decompile.ps1 ` | decompile from the persistent Ghidra project `ghidra/` | | `questscript.mjs ` | decode a quest script folder (`bin\TYPE_NPC_`, `bin\Addon\NetScriptCamp`): a quest's labels and where other labels use its NPCs/variables; `--list`, `--facts [ids]` (giver, death labels), `--label `, `--grep ` (matching instructions in all labels) | | `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): ```powershell $env:GHIDRA_HEADLESS_MAXMEM = "8G" & "$env:GHIDRA_INSTALL_DIR\support\analyzeHeadless.bat" ghidra sacred -import "\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 "Spielen" -> a character (`-Save`: row in the character list) -> "Spielen" (its last world), takes screenshots in-game and with the ESC menu open, and stops the game. `-Ini` appends temporary settings to `build\x86-debug\sacredK.ini` (restored afterwards), e.g. ```powershell .\tools\autotest-load.ps1 -Name ws_off -Ini "[widescreen]`r`nEnabled=0" ``` Click positions are for the menu screens (2026-10-25) on 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.