forked from thyaguster/NoRecoilApex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ahkhider.ahk
78 lines (63 loc) · 2 KB
/
ahkhider.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
hyde.dll hides a process from the Task-Manager on Windows2k/Windows7 (x86/x64 bit)!
Your process can inject it into other processes however you like. The example uses
SetWindowsHookEx with a CBT hook (the dll exports a CBTProc) to inject it into all
running processes.
Press Esc to exit the script.
Note: if you do not compile the script, AutoHotKey.exe gets hidden. Otherwise the
the name of the .exe gets hidden.
Important: This does only work if you are using a x64 bit OS and the 64 bit version
of AutoHotkey or if you're using a x86 bit OS and the 32 bit version of AutoHotkey.
This does not work if you have a x64 bit OS but use 32 bit AHK (and vice versa) !!!
*/
#NoEnv
SetWorkingDir %A_ScriptDir%
OnExit, ExitSub
RunAsAdmin()
if ((A_Is64bitOS=1) && (A_PtrSize!=4))
hMod := DllCall("LoadLibrary", Str, "hyde64.dll", Ptr)
else if ((A_Is32bitOS=1) && (A_PtrSize=4))
hMod := DllCall("LoadLibrary", Str, "hyde.dll", Ptr)
Else
{
MsgBox, Mixed Versions detected!`nOS Version and AHK Version need to be the same (x86 & AHK32 or x64 & AHK64).`n`nScript will now terminate!
ExitApp
}
if (hMod)
{
hHook := DllCall("SetWindowsHookEx", Int, 5, Ptr, DllCall("GetProcAddress", Ptr, hMod, AStr, "CBProc", ptr), Ptr, hMod, Ptr, 0, Ptr)
if (!hHook)
{
MsgBox, SetWindowsHookEx failed!`nScript will now terminate!
ExitApp
}
}
else
{
MsgBox, LoadLibrary failed!`nScript will now terminate!
ExitApp
}
MsgBox, % "Process ('" . A_ScriptName . "') hidden!"
Return
=::ExitApp
RunAsAdmin()
{
Global 0
IfEqual, A_IsAdmin, 1, Return 0
Loop, %0%
params .= A_Space . %A_Index%
DllCall("shell32\ShellExecute" (A_IsUnicode ? "":"A"),uint,0,str,"RunAs",str,(A_IsCompiled ? A_ScriptFullPath : A_AhkPath),str,(A_IsCompiled ? "": """" . A_ScriptFullPath . """" . A_Space) params,str,A_WorkingDir,int,1)
ExitApp
}
ExitSub:
if (hHook)
{
DllCall("UnhookWindowsHookEx", Ptr, hHook)
MsgBox, % "Process unhooked!"
}
if (hMod)
{
DllCall("FreeLibrary", Ptr, hMod)
MsgBox, % "Library unloaded"
}
ExitApp