Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Const adTypeBinary = 1
- Const adSaveCreateOverWrite = 2
- fileToModify = "Humans Must Answer.exe"
- Set fso = CreateObject("Scripting.FileSystemObject")
- If Not (fso.FileExists(fileToModify)) Then
- MsgBox "Unable to find " & Chr(34) & fileToModify & Chr(34) & ". This script must be placed in the game directory.", vbCritical
- Wscript.Quit
- End If
- If Not (fso.FileExists(fileToModify & ".bak")) Then
- fso.CopyFile fileToModify, fileToModify & ".bak"
- If Not (fso.FileExists(fileToModify & ".bak")) Then
- result = MsgBox ("Unable to create backup " & Chr(34) & fileToModify & ".bak" & Chr(34) & ". Would you like to patch " & Chr(34) & fileToModify & Chr(34) & " anyway?", vbYesNo+vbExclamation)
- If result = 7 Then
- Wscript.Quit
- End If
- End If
- End If
- Set stream = CreateObject("ADODB.Stream")
- stream.Open
- stream.Type = adTypeBinary
- stream.LoadFromFile fileToModify
- stream.Position = &H0014F479
- stream.Write BytesToBinaryArray(ChrB(&H16))
- stream.SaveToFile fileToModify, adSaveCreateOverWrite
- stream.Close()
- Function BytesToBinaryArray(Bytes)
- Set patch = CreateObject("ADODB.Stream")
- patch.Open
- patch.WriteText Bytes
- patch.Position = 0
- patch.Type = adTypeBinary
- patch.Position = 2 ' Skip the BOM bytes
- BytesToBinaryArray = patch.Read(LenB(Bytes))
- patch.Close()
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement