Created
June 16, 2016 00:53
-
-
Save SmugZombie/9ea99c475a37684eb290b2a1f0319309 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Process_Suspend(PID_or_Name){ | |
PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name | |
h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid) | |
If !h | |
Return -1 | |
DllCall("ntdll.dll\NtSuspendProcess", "Int", h) | |
DllCall("CloseHandle", "Int", h) | |
} | |
Process_Resume(PID_or_Name){ | |
PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name | |
h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid) | |
If !h | |
Return -1 | |
DllCall("ntdll.dll\NtResumeProcess", "Int", h) | |
DllCall("CloseHandle", "Int", h) | |
} | |
ProcExist(PID_or_Name=""){ | |
Process, Exist, % (PID_or_Name="") ? DllCall("GetCurrentProcessID") : PID_or_Name | |
Return Errorlevel | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment