Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' --------------------------------------------------
- ' ij3spa.vbs
- ' Indiana Jones and the Last Crusade (Steam)
- ' Script en VBScript para traducir la versión Steam al español
- ' --------------------------------------------------
- Option Explicit
- Dim shell
- Set shell = CreateObject("WScript.Shell")
- ' --------------------------------------------------
- ' DOCUMENTACIÓN
- ' --------------------------------------------------
- ' Este script está diseñado para traducir la versión Steam del juego
- ' "Indiana Jones and the Last Crusade". En lugar de modificar el archivo EXE original,
- ' se crea una copia del EXE y se aplican los cambios sobre esta copia.
- ' El EXE original permanece intacto, mientras que la versión modificada se guarda como "Last Crusade Spanish.exe".
- '
- ' El script realiza los siguientes cambios en la copia del EXE:
- ' - Inserta el archivo 00.LFL en una posición específica dentro del EXE.
- ' - Actualiza el tamaño del archivo 01.LFL dentro del EXE.
- ' - Traduce el mensaje de salida que aparece cuando el jugador intenta salir.
- '
- ' Requisitos:
- ' - El archivo Steamless.CLI.exe debe estar ubicado en la ruta especificada en el script.
- ' Si la ruta de Steamless es diferente en tu sistema, deberás modificarla.
- ' - El EXE original del juego debe estar en la carpeta estándar de Steam.
- ' - Los archivos LFL traducidos deben estar disponibles en la carpeta "INDY3".
- '
- ' Pasos del script:
- ' 1. El EXE original es copiado a la carpeta actual.
- ' 2. El archivo es desempaquetado utilizando Steamless.CLI.exe.
- ' 3. Se aplican los parches correspondientes (inserta 00.LFL, actualiza tamaño 01.LFL, modifica mensaje de salida).
- ' 4. El EXE parchado es guardado como "Last Crusade Spanish.exe".
- ' 5. Se eliminan archivos temporales generados durante el proceso.
- ' --------------------------------------------------
- ' RUTA DE STEAMLESS.CLI.EXE
- ' --------------------------------------------------
- ' Modificar ruta
- Dim steamlessExe
- ' steamlessExe = C:\Users\[tu_usuario]\Downloads\Steamless.v3.1.0.5.-.by.atom0s\Steamless.CLI.exe
- steamlessExe = shell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Downloads\Steamless.v3.1.0.5.-.by.atom0s\Steamless.CLI.exe"
- ' --------------------------------------------------
- ' INICIO
- ' --------------------------------------------------
- Dim fso
- Set fso = CreateObject("Scripting.FileSystemObject")
- ' Obtener rutas de archivos y configuraciones
- Dim userProfile, programFilesX86, baseDir
- userProfile = shell.ExpandEnvironmentStrings("%USERPROFILE%")
- programFilesX86 = shell.ExpandEnvironmentStrings("%ProgramFiles(x86)%")
- baseDir = fso.GetParentFolderName(WScript.ScriptFullName)
- ' Rutas de archivos del juego y temporales
- Dim steamGameDir, steamExe, copiedExe, unpackedExe, lfl00, lfl01, outputExe
- steamGameDir = programFilesX86 & "\Steam\steamapps\common\Indiana Jones and the Last Crusade"
- steamExe = steamGameDir & "\Indiana Jones and the Last Crusade.exe"
- copiedExe = baseDir & "\Indiana Jones and the Last Crusade.exe"
- unpackedExe = baseDir & "\Indiana Jones and the Last Crusade.exe.unpacked.exe"
- lfl00 = baseDir & "\INDY3\00.LFL"
- lfl01 = baseDir & "\INDY3\01.LFL"
- outputExe = baseDir & "\Last Crusade Spanish.exe"
- ' Constantes de desplazamientos y tamaños
- Const OFFSET_LFL00 = 162056
- Const LFL00_EXPECTED_LEN = 6295
- Const OFFSET_LFL01_SIZE = 59359
- Const OFFSET_EXIT_MSG = 144421
- ' --------------------------------------------------
- ' MENSAJE DE SALIDA
- ' El mensaje de salida está en formato:
- ' 0xA8 + texto ASCII + 4 bytes nulos (0x00)
- ' --------------------------------------------------
- Dim exitMsg
- exitMsg = Chr(&HA8) & "Seguro que quieres salir? (S/N)S" & String(4, Chr(0))
- ' --------------------------------------------------
- ' PROCESO DE PARCHEO
- ' --------------------------------------------------
- ' 0. Validar que el archivo 00.LFL tenga el tamaño correcto.
- If fso.GetFile(lfl00).Size <> LFL00_EXPECTED_LEN Then
- WScript.Echo "Error: El archivo 00.LFL debe tener exactamente " & LFL00_EXPECTED_LEN & " bytes."
- WScript.Quit 1
- End If
- ' 1. Copiar el EXE original a la carpeta actual.
- fso.CopyFile steamExe, copiedExe, True
- ' 2. Ejecutar Steamless para desencriptar el EXE copiado.
- shell.Run """" & steamlessExe & """ """ & copiedExe & """", 1, True
- ' 3. Abrir el EXE desencriptado para aplicar los parches.
- Dim exeStream
- Set exeStream = CreateObject("ADODB.Stream")
- exeStream.Type = 1 ' binario
- exeStream.Open
- exeStream.LoadFromFile unpackedExe
- ' 5. Insertar el archivo 00.LFL en el EXE.
- WriteFileIntoStream exeStream, OFFSET_LFL00, lfl00
- ' 6. Actualizar el tamaño de 01.LFL en el EXE.
- Dim sizeBytes
- sizeBytes = Int32ToLE(fso.GetFile(lfl01).Size)
- WriteBytesAtOffset exeStream, OFFSET_LFL01_SIZE, sizeBytes
- ' 7. Modificar el mensaje de salida.
- WriteBytesAtOffset exeStream, OFFSET_EXIT_MSG, StringToBytes(exitMsg)
- ' 8. Guardar el EXE modificado como "Last Crusade Spanish.exe".
- exeStream.SaveToFile outputExe, 2
- exeStream.Close
- ' 9. Eliminar archivos temporales generados durante el proceso.
- fso.DeleteFile unpackedExe, True
- fso.DeleteFile copiedExe, True
- ' --------------------------------------------------
- ' MENSAJE DE FINALIZACIÓN
- ' --------------------------------------------------
- WScript.Echo "Listo. El archivo de salida es:" & vbCrLf & outputExe & vbCrLf & "¡No distribuir!"
- ' ==================================================
- ' FUNCIONES
- ' ==================================================
- ' Escribir el contenido de un archivo en un flujo binario en un offset específico
- Sub WriteFileIntoStream(stream, offset, filePath)
- Dim src
- Set src = CreateObject("ADODB.Stream")
- src.Type = 1 ' binario
- src.Open
- src.LoadFromFile filePath
- stream.Position = offset
- stream.Write src.Read
- src.Close
- End Sub
- ' Convertir un número entero a 4 bytes en formato little-endian
- ' Equivalente a BitConverter.GetBytes en PowerShell
- Function Int32ToLE(value)
- Int32ToLE = StringToBytes( _
- Chr(value And &HFF) & _
- Chr((value \ 256) And &HFF) & _
- Chr((value \ 65536) And &HFF) & _
- Chr((value \ 16777216) And &HFF) _
- )
- End Function
- ' Escribir bytes en un flujo binario en un offset específico
- Sub WriteBytesAtOffset(stream, offset, bytes)
- stream.Position = offset
- stream.Write bytes
- End Sub
- ' Convertir una cadena de texto a bytes binarios (usado para ASCII o bytes extendidos)
- Function StringToBytes(s)
- Dim stm
- Set stm = CreateObject("ADODB.Stream")
- stm.Type = 2 ' texto
- stm.Charset = "windows-1252"
- stm.Open
- stm.WriteText s
- stm.Position = 0
- stm.Type = 1 ' binario
- StringToBytes = stm.Read
- stm.Close
- End Function
Advertisement
Add Comment
Please, Sign In to add comment