Guest User

ij3spa.vbs

a guest
Jan 16th, 2026
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' --------------------------------------------------
  2. ' ij3spa.vbs
  3. ' Indiana Jones and the Last Crusade (Steam)
  4. ' Script en VBScript para traducir la versión Steam al español
  5. ' --------------------------------------------------
  6.  
  7. Option Explicit
  8. Dim shell
  9. Set shell = CreateObject("WScript.Shell")
  10.  
  11. ' --------------------------------------------------
  12. ' DOCUMENTACIÓN
  13. ' --------------------------------------------------
  14. ' Este script está diseñado para traducir la versión Steam del juego
  15. ' "Indiana Jones and the Last Crusade". En lugar de modificar el archivo EXE original,
  16. ' se crea una copia del EXE y se aplican los cambios sobre esta copia.
  17. ' El EXE original permanece intacto, mientras que la versión modificada se guarda como "Last Crusade Spanish.exe".
  18. '
  19. ' El script realiza los siguientes cambios en la copia del EXE:
  20. ' - Inserta el archivo 00.LFL en una posición específica dentro del EXE.
  21. ' - Actualiza el tamaño del archivo 01.LFL dentro del EXE.
  22. ' - Traduce el mensaje de salida que aparece cuando el jugador intenta salir.
  23. '
  24. ' Requisitos:
  25. ' - El archivo Steamless.CLI.exe debe estar ubicado en la ruta especificada en el script.
  26. '   Si la ruta de Steamless es diferente en tu sistema, deberás modificarla.
  27. ' - El EXE original del juego debe estar en la carpeta estándar de Steam.
  28. ' - Los archivos LFL traducidos deben estar disponibles en la carpeta "INDY3".
  29. '
  30. ' Pasos del script:
  31. ' 1. El EXE original es copiado a la carpeta actual.
  32. ' 2. El archivo es desempaquetado utilizando Steamless.CLI.exe.
  33. ' 3. Se aplican los parches correspondientes (inserta 00.LFL, actualiza tamaño 01.LFL, modifica mensaje de salida).
  34. ' 4. El EXE parchado es guardado como "Last Crusade Spanish.exe".
  35. ' 5. Se eliminan archivos temporales generados durante el proceso.
  36.  
  37. ' --------------------------------------------------
  38. ' RUTA DE STEAMLESS.CLI.EXE
  39. ' --------------------------------------------------
  40. ' Modificar ruta
  41. Dim steamlessExe
  42. ' steamlessExe =  C:\Users\[tu_usuario]\Downloads\Steamless.v3.1.0.5.-.by.atom0s\Steamless.CLI.exe
  43. steamlessExe = shell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Downloads\Steamless.v3.1.0.5.-.by.atom0s\Steamless.CLI.exe"
  44.  
  45. ' --------------------------------------------------
  46. ' INICIO
  47. ' --------------------------------------------------
  48. Dim fso
  49. Set fso = CreateObject("Scripting.FileSystemObject")
  50.  
  51. ' Obtener rutas de archivos y configuraciones
  52. Dim userProfile, programFilesX86, baseDir
  53. userProfile      = shell.ExpandEnvironmentStrings("%USERPROFILE%")
  54. programFilesX86  = shell.ExpandEnvironmentStrings("%ProgramFiles(x86)%")
  55. baseDir          = fso.GetParentFolderName(WScript.ScriptFullName)
  56.  
  57. ' Rutas de archivos del juego y temporales
  58. Dim steamGameDir, steamExe, copiedExe, unpackedExe, lfl00, lfl01, outputExe
  59. steamGameDir = programFilesX86 & "\Steam\steamapps\common\Indiana Jones and the Last Crusade"
  60. steamExe    = steamGameDir & "\Indiana Jones and the Last Crusade.exe"
  61. copiedExe   = baseDir & "\Indiana Jones and the Last Crusade.exe"
  62. unpackedExe = baseDir & "\Indiana Jones and the Last Crusade.exe.unpacked.exe"
  63. lfl00       = baseDir & "\INDY3\00.LFL"
  64. lfl01       = baseDir & "\INDY3\01.LFL"
  65. outputExe   = baseDir & "\Last Crusade Spanish.exe"
  66.  
  67. ' Constantes de desplazamientos y tamaños
  68. Const OFFSET_LFL00       = 162056
  69. Const LFL00_EXPECTED_LEN = 6295
  70. Const OFFSET_LFL01_SIZE  = 59359
  71. Const OFFSET_EXIT_MSG    = 144421
  72.  
  73. ' --------------------------------------------------
  74. ' MENSAJE DE SALIDA
  75. ' El mensaje de salida está en formato:
  76. ' 0xA8 + texto ASCII + 4 bytes nulos (0x00)
  77. ' --------------------------------------------------
  78. Dim exitMsg
  79. exitMsg = Chr(&HA8) & "Seguro que quieres salir? (S/N)S" & String(4, Chr(0))
  80.  
  81. ' --------------------------------------------------
  82. ' PROCESO DE PARCHEO
  83. ' --------------------------------------------------
  84.  
  85. ' 0. Validar que el archivo 00.LFL tenga el tamaño correcto.
  86. If fso.GetFile(lfl00).Size <> LFL00_EXPECTED_LEN Then
  87.     WScript.Echo "Error: El archivo 00.LFL debe tener exactamente " & LFL00_EXPECTED_LEN & " bytes."
  88.     WScript.Quit 1
  89. End If
  90.  
  91. ' 1. Copiar el EXE original a la carpeta actual.
  92. fso.CopyFile steamExe, copiedExe, True
  93.  
  94. ' 2. Ejecutar Steamless para desencriptar el EXE copiado.
  95. shell.Run """" & steamlessExe & """ """ & copiedExe & """", 1, True
  96.  
  97. ' 3. Abrir el EXE desencriptado para aplicar los parches.
  98. Dim exeStream
  99. Set exeStream = CreateObject("ADODB.Stream")
  100. exeStream.Type = 1 ' binario
  101. exeStream.Open
  102. exeStream.LoadFromFile unpackedExe
  103.  
  104. ' 5. Insertar el archivo 00.LFL en el EXE.
  105. WriteFileIntoStream exeStream, OFFSET_LFL00, lfl00
  106.  
  107. ' 6. Actualizar el tamaño de 01.LFL en el EXE.
  108. Dim sizeBytes
  109. sizeBytes = Int32ToLE(fso.GetFile(lfl01).Size)
  110. WriteBytesAtOffset exeStream, OFFSET_LFL01_SIZE, sizeBytes
  111.  
  112. ' 7. Modificar el mensaje de salida.
  113. WriteBytesAtOffset exeStream, OFFSET_EXIT_MSG, StringToBytes(exitMsg)
  114.  
  115. ' 8. Guardar el EXE modificado como "Last Crusade Spanish.exe".
  116. exeStream.SaveToFile outputExe, 2
  117. exeStream.Close
  118.  
  119. ' 9. Eliminar archivos temporales generados durante el proceso.
  120. fso.DeleteFile unpackedExe, True
  121. fso.DeleteFile copiedExe, True
  122.  
  123. ' --------------------------------------------------
  124. ' MENSAJE DE FINALIZACIÓN
  125. ' --------------------------------------------------
  126. WScript.Echo "Listo. El archivo de salida es:" & vbCrLf & outputExe & vbCrLf & "¡No distribuir!"
  127.  
  128. ' ==================================================
  129. ' FUNCIONES
  130. ' ==================================================
  131.  
  132. ' Escribir el contenido de un archivo en un flujo binario en un offset específico
  133. Sub WriteFileIntoStream(stream, offset, filePath)
  134.     Dim src
  135.     Set src = CreateObject("ADODB.Stream")
  136.     src.Type = 1 ' binario
  137.    src.Open
  138.     src.LoadFromFile filePath
  139.  
  140.     stream.Position = offset
  141.     stream.Write src.Read
  142.  
  143.     src.Close
  144. End Sub
  145.  
  146. ' Convertir un número entero a 4 bytes en formato little-endian
  147. ' Equivalente a BitConverter.GetBytes en PowerShell
  148. Function Int32ToLE(value)
  149.     Int32ToLE = StringToBytes( _
  150.         Chr(value And &HFF) & _
  151.         Chr((value \ 256) And &HFF) & _
  152.         Chr((value \ 65536) And &HFF) & _
  153.         Chr((value \ 16777216) And &HFF) _
  154.     )
  155. End Function
  156.  
  157. ' Escribir bytes en un flujo binario en un offset específico
  158. Sub WriteBytesAtOffset(stream, offset, bytes)
  159.     stream.Position = offset
  160.     stream.Write bytes
  161. End Sub
  162.  
  163. ' Convertir una cadena de texto a bytes binarios (usado para ASCII o bytes extendidos)
  164. Function StringToBytes(s)
  165.     Dim stm
  166.     Set stm = CreateObject("ADODB.Stream")
  167.     stm.Type = 2 ' texto
  168.    stm.Charset = "windows-1252"
  169.     stm.Open
  170.     stm.WriteText s
  171.     stm.Position = 0
  172.     stm.Type = 1 ' binario
  173.    StringToBytes = stm.Read
  174.     stm.Close
  175. End Function
  176.  
Advertisement
Add Comment
Please, Sign In to add comment