- 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>
17 lines
902 B
PowerShell
17 lines
902 B
PowerShell
# Apply tools/names.txt to the persistent Ghidra project (ghidra/sacred.gpr).
|
|
# .\tools\rename.ps1
|
|
$ErrorActionPreference = "Stop"
|
|
$root = Split-Path $PSScriptRoot
|
|
$ghidra = if ($env:GHIDRA_INSTALL_DIR) { $env:GHIDRA_INSTALL_DIR } else { "E:\Coding\Ghidra\ghidra_12.1.4_PUBLIC" }
|
|
if (-not $env:JAVA_HOME) { $env:JAVA_HOME = "C:\Program Files\Java\jdk-21" }
|
|
|
|
$arguments = @(
|
|
(Join-Path $root "ghidra"), "sacred",
|
|
"-process", "sacred.exe", "-noanalysis",
|
|
"-scriptPath", (Join-Path $PSScriptRoot "ghidra"),
|
|
"-postScript", "Rename.java", (Join-Path $PSScriptRoot "names.txt")
|
|
)
|
|
& (Join-Path $ghidra "support\analyzeHeadless.bat") @arguments *> (Join-Path $root "ghidra\rename.out")
|
|
if ($LASTEXITCODE -ne 0) { Get-Content (Join-Path $root "ghidra\rename.out") -Tail 30; exit $LASTEXITCODE }
|
|
Select-String -Path (Join-Path $root "ghidra\rename.out") -Pattern "renamed|bad line|no function"
|