Files
neoLegacy/tools/msscmp_list.ps1
T
Tranqlmao ff562d1644 TU46 Test content and patches
TU46 Test content, added missing commits by amending commit and cherry-picking to new branch, ready for iggy guis and tu46 bug fixes
2026-10-22 13:55:39 -04:00

28 lines
983 B
PowerShell

param([string]$Bank, [string]$Filter = '', [string]$OutDir = '')
$data = [System.IO.File]::ReadAllBytes($Bank)
$text = [System.Text.Encoding]::GetEncoding(28591).GetString($data)
$pattern = 'Minecraft/([A-Za-z0-9_/]+)\x00\*(\d+)\*(\d+)\.binka'
$seen = @{}
foreach ($m in [regex]::Matches($text, $pattern)) {
$name = $m.Groups[1].Value
if ($Filter -and $name -notlike "*$Filter*") { continue }
if ($seen.ContainsKey($name)) { continue }
$seen[$name] = 1
$size = [int64]$m.Groups[2].Value
$off = [int64]$m.Groups[3].Value
if ($off + $size -gt $data.Length) { Write-Warning "$name is outside the bank"; continue }
if ($OutDir) {
$path = Join-Path $OutDir ($name + '.binka')
New-Item -ItemType Directory -Force (Split-Path $path) | Out-Null
$buf = New-Object byte[] $size
[Array]::Copy($data, $off, $buf, 0, $size)
[System.IO.File]::WriteAllBytes($path, $buf)
}
else {
"$name $size $off"
}
}