Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # patcher.ps1
- # Script en PowerShell para traducir Indiana Jones Last Crusade versión Steam al español
- $steamlessApp = "${env:UserProfile}\Downloads\Steamless.v3.1.0.5.-.by.atom0s\Steamless.CLI.exe"
- $steamGameFolder = "${env:ProgramFiles(x86)}\Steam\steamapps\common\Indiana Jones and the Last Crusade"
- $steamPathFileName = "${steamGameFolder}\Indiana Jones and the Last Crusade.exe"
- $copiedFileName = "${PWD}\Indiana Jones and the Last Crusade.exe"
- $unpackedFileName = "${PWD}\Indiana Jones and the Last Crusade.exe.unpacked.exe"
- $firstNewLflFileName = "${PWD}\INDY3\00.LFL"
- $secondNewLflFileName = "${PWD}\INDY3\01.LFL"
- $outputFileName = "${PWD}\Last Crusade Spanish.exe"
- $skip = 162056
- $count = 6295
- $offset = 59359
- $messageOffset = 144421
- $messageBytes = [byte[]](0xa8) + [System.Text.Encoding]::ASCII.GetBytes("Seguro que quieres salir? (S/N)S") + [byte[]](0x00,0x00,0x00,0x00)
- try {
- Copy-Item "$steamPathFileName" "$copiedFileName"
- & "${steamlessApp}" "${copiedFileName}"
- $patchedGameData = [System.IO.File]::ReadAllBytes($unpackedFileName)
- $firstNewLflData = [System.IO.File]::ReadAllBytes($firstNewLflFileName)
- $secondNewLflData = [System.IO.File]::ReadAllBytes($secondNewLflFileName)
- $sizeBytes = [BitConverter]::GetBytes($secondNewLflData.Length)
- if ($firstNewLflData.Length -ne $count) {
- Write-Host "Error: " + $firstNewLflFileName + " should be exactly " + $count + " bytes in length."
- exit
- }
- # Sobreescribir dentro el nuevo archivo 00.LFL
- $firstNewLflData.CopyTo($patchedGameData, $skip)
- # Actualizar el checksum que es el size del archivo 01.LFL
- for ($i = 0; $i -lt $sizeBytes.Length; $i++) {
- $patchedGameData[$offset + $i] = $sizeBytes[$i]
- }
- # Traduce mensaje de salir
- [Array]::Copy($messageBytes, 0, $patchedGameData, $messageOffset, $messageBytes.Length)
- # Escribir el resultado
- [System.IO.File]::WriteAllBytes($outputFileName, $patchedGameData)
- # Eliminar archivos intermedios
- Remove-Item "$unpackedFileName"
- Remove-Item "$copiedFileName"
- Write-Host "Listo. Archivo guardado en $outputFileName. No distribuir!"
- }
- catch {
- Write-Host "Error: $($_.Exception.Message)"
- }
Advertisement
Add Comment
Please, Sign In to add comment