tools: function names for the Ghidra project, Hold-Key test helper

- tools/names.txt lists identified sacred.exe functions ("0xADDR
  Class::Method"); rename.ps1 / Rename.java apply them to the persistent
  Ghidra project, so decompiles read with real names.
- decompile.ps1: parameters other than the addresses are named-only (the
  first address was taken as -Out).
- game-input.ps1: Hold-Key for polled keys such as movement.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-14 09:08:52 +02:00
1 parent 09f7dcc0f4
commit 52db0f79f9
6 files changed
+182 -1

No files matched your search

+9
View File
@@ -4,6 +4,7 @@
# Start-Sacred # launcher, returns the sacred.exe process
# Click-At 1720 779 # screen pixels (left click)
# Press-Key 0x1B # virtual key (ESC)
# Hold-Key 0x27 -Ms 1500 # hold a key (right arrow)
# Save-Screen screenshots\x.png # primary monitor area of the game
# Stop-Sacred $game # only the given process
#
@@ -85,3 +86,11 @@ function Move-To([int]$X, [int]$Y, [int]$AfterMs = 800) {
}
Start-Sleep -Milliseconds $AfterMs
}
# Holds a key down for a while (polled keys such as movement need this).
function Hold-Key([byte]$VirtualKey, [int]$Ms = 1500, [int]$AfterMs = 500) {
[SacredRe.Input]::keybd_event($VirtualKey, 0, 0, [UIntPtr]::Zero)
Start-Sleep -Milliseconds $Ms
[SacredRe.Input]::keybd_event($VirtualKey, 0, 2, [UIntPtr]::Zero)
Start-Sleep -Milliseconds $AfterMs
}