Files
sacred2_k/tools/rename.ps1
T
khallaandClaude Opus 5.5 8a7bdfd99f Framework for Sacred 2 Gold, game log mirror, borderless fullscreen
Ported from sacredK with module-relative addresses, hooks by exported
name and a SHA-256 check of the six game modules (Community Patch
2.65.1). Borderless windowed at monitor size replaces exclusive
fullscreen, whose focus loss during loading made the game quit and
crash on exit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 01:39:44 +01:00

18 lines
937 B
PowerShell

# Apply tools/names.txt to every program of the persistent Ghidra project
# (ghidra/sacred2.gpr); each line names its module.
# .\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"), "sacred2",
"-process", "-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"