Skip to content

Instantly share code, notes, and snippets.

@ph1048
Created December 17, 2020 14:07
Show Gist options
  • Save ph1048/3c6e6b18abe85cb11ddd01beef173f5a to your computer and use it in GitHub Desktop.
Save ph1048/3c6e6b18abe85cb11ddd01beef173f5a to your computer and use it in GitHub Desktop.
RDR2 + steam
job := DllCall("CreateJobObject", "Ptr", 0, "Ptr", 0)
jobinfo := BufferAlloc(144, 0)
NumPut("UInt", 0x2000, jobinfo, 16)
setinfo := DllCall("SetInformationJobObject", "Ptr", job, "UInt", 9, "Ptr", jobinfo, "UInt", 144)
assigned := DllCall("AssignProcessToJobObject", "Ptr", job, "Ptr", DllCall("GetCurrentProcess"))
ProcessClose("Launcher.exe")
ProcessClose("SocialClubHelper.exe")
ProcessClose("LauncherPatcher.exe")
ProcessWaitClose("Launcher.exe", 30)
ProcessWaitClose("SocialClubHelper.exe", 30)
ProcessWaitClose("LauncherPatcher.exe", 30)
RunWait("RDR2.exe", "D:\Games\Red Dead Redemption 2\")
Sleep(1000)
rdrpid := ProcessWait("RDR2.exe", 600)
rdrHandle := DllCall("OpenProcess", "UInt", 0x101, "UInt", 0, "UInt", rdrpid)
DllCall("AssignProcessToJobObject", "Ptr", job, "Ptr", rdrHandle)
DllCall("CloseHandle", "Ptr", rdrHandle)
ProcessWaitClose(rdrpid)
WinWait("Rockstar Games Launcher", , 20)
WinClose("Rockstar Games Launcher")
Exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment