Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Functionality--------------------
  2. Process_Suspend(PID_or_Name){
  3.  
  4.     PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name
  5.  
  6.     h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)
  7.  
  8.     If !h  
  9.  
  10.         Return -1
  11.  
  12.     DllCall("ntdll.dll\NtSuspendProcess", "Int", h)
  13.  
  14.     DllCall("CloseHandle", "Int", h)
  15.  
  16. }
  17.  
  18.  
  19.  
  20. Process_Resume(PID_or_Name){
  21.  
  22.     PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name
  23.  
  24.     h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)
  25.  
  26.     If !h  
  27.  
  28.         Return -1
  29.  
  30.     DllCall("ntdll.dll\NtResumeProcess", "Int", h)
  31.  
  32.     DllCall("CloseHandle", "Int", h)
  33.  
  34. }
  35.  
  36.  
  37.  
  38. ProcExist(PID_or_Name=""){
  39.  
  40.     Process, Exist, % (PID_or_Name="") ? DllCall("GetCurrentProcessID") : PID_or_Name
  41.  
  42.     Return Errorlevel
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement