Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://www.autohotkey.com/download/ahk-install.exe
- ##SingleInstance force ;
- #^+o::
- #EnvGet, SystemRoot, SystemRoot
- #Run %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy unrestricted -Command "C:\Temp\pauseGTA\pause.ps1",, hide
- $job = Start-Job -ScriptBlock {
- $Process = Get-Process -Name "gta5"
- Add-Type -TypeDefinition @"
- using System;
- using System.Diagnostics;
- using System.Security.Principal;
- using System.Runtime.InteropServices;
- public static class Kernel32
- {
- [DllImport("kernel32.dll")]
- public static extern bool CheckRemoteDebuggerPresent(IntPtr hProcess, out bool pbDebuggerPresent);
- [DllImport("kernel32.dll")]
- public static extern int DebugActiveProcess(int PID);
- [DllImport("kernel32.dll")]
- public static extern int DebugActiveProcessStop(int PID);
- }
- "@
- If ([Kernel32]::CheckRemoteDebuggerPresent($Process.Handle,[ref][IntPtr]::Zero) -And $(whoami /priv) -match "SeDebugPrivilege") {
- [Kernel32]::DebugActiveProcess($Process.id)
- Start-Sleep -Seconds 10
- [Kernel32]::DebugActiveProcessStop($Process.id)
- }
- }
- Wait-Job $job | Out-Null
- Receive-Job $job
Add Comment
Please, Sign In to add comment