Files
AC6_recomp/tools/launch_ac6_with_pac_dump.ps1
salh 64f8efbb2b Restore AC6 mode-1 decoder dump hook via midasm at 0x821CCC5C
Recovers the Apr 23 hand-edit (lost in subsequent refactors) and re-wires
it as a TOML midasm hook so codegen regeneration can no longer drop it.
Hook fires immediately after the guest decompressor (bl 0x822CF510)
returns, reads the entry record via r11 (codec at +1, csize at +8,
usize at +12), source offset from *(r31+22888), entry tag from r10, and
calls Ac6DumpPacDecodedEntry with the decoded buffer at r4. With
AC6_DUMP_PAC_DECODED=1, all 800 compressed entries now drop as
FHM-magic'd entry_*_mode1_*.bin in out/ac6_pac_runtime_dump/.

Also adds streamer-worker dispatch probes (AC6_TRACE_PAC_WORK_ITEMS),
PPC stack walking on PAC reads (AC6_TRACE_PAC_STACKS), the AC6 PAC
index parser, the chunk-coalescing dump fallback, and a user-facing
walkthrough at docs/ac6_asset_extraction_walkthrough.txt.
2026-05-01 21:22:14 +03:00

45 lines
1.5 KiB
PowerShell

[CmdletBinding()]
param(
# Enable the PAC stream-worker dispatch probe. When set, every distinct
# work-item virtual that rex_sub_82343E18 dispatches gets logged once
# via `[AC6 PAC WORKER] new dispatch target=...`. Cross-reference these
# against compressed-entry writes to identify the mode-1 decoder.
[switch]$TraceWorkItems,
# Enable per-NtReadFile guest stack traces on PAC reads. Each call into
# NtReadFile / NtReadFileScatter for a PAC path logs `stack=[...]` with
# the full guest back-chain. Used to pin the decoder when it sits above
# the read-issuing function on the reader thread's call chain.
[switch]$TraceStacks
)
$ErrorActionPreference = 'Stop'
$repoRoot = Split-Path -Parent $PSScriptRoot
$exePath = Join-Path $repoRoot 'out\build\win-amd64-relwithdebinfo\ac6recomp.exe'
if (-not (Test-Path -LiteralPath $exePath)) {
throw "ac6recomp.exe not found at $exePath"
}
$env:AC6_DUMP_PAC_DECODED = '1'
Write-Host "AC6_DUMP_PAC_DECODED=1"
if ($TraceWorkItems) {
$env:AC6_TRACE_PAC_WORK_ITEMS = '1'
Write-Host "AC6_TRACE_PAC_WORK_ITEMS=1"
} else {
Remove-Item Env:AC6_TRACE_PAC_WORK_ITEMS -ErrorAction SilentlyContinue
}
if ($TraceStacks) {
$env:AC6_TRACE_PAC_STACKS = '1'
Write-Host "AC6_TRACE_PAC_STACKS=1"
} else {
Remove-Item Env:AC6_TRACE_PAC_STACKS -ErrorAction SilentlyContinue
}
Write-Host "Launching $exePath"
Start-Process -FilePath $exePath -WorkingDirectory (Split-Path -Parent $exePath)