当前位置:网站首页>Disable Ctrl + Alt + Del
Disable Ctrl + Alt + Del
2022-04-23 18:52:00 【Brick Porter】
BOOL DisableCTRL_ALT_DEL(bool bDisable)
{
if (bDisable==suspend)
return FALSE;
//bDisable ? Suspend(_WinLoginPid) : Resume(_WinLoginPid);
typedef DWORD(WINAPI* NtProcessAPI)(HANDLE ProcessHandle);
HMODULE h_module = LoadLibrary(L"ntdll.dll");
if (!h_module)
return FALSE;
NtProcessAPI _NtResumeProcess = (NtProcessAPI)GetProcAddress(h_module, bDisable ? "NtSuspendProcess" : "NtResumeProcess");
if (_NtResumeProcess)
{
HANDLE ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, _WinLoginPid);
if (ProcessHandle)
{
_NtResumeProcess(ProcessHandle);
CloseHandle(ProcessHandle);
}
}
suspend = bDisable;
FreeLibrary(h_module);
return TRUE;
}
explain :bDisable Record whether you are disabled for a member variable .
_WinLoginPid Return values for the following functions .
DWORD GetWinLoginPID()
{
PROCESSENTRY32 pe32;
pe32.dwSize = sizeof(pe32);
HANDLE hProcessSnap = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
DWORD PID = 0;
BOOL bNext = ::Process32First(hProcessSnap, &pe32);
while (bNext)
{
if (wcscmp(pe32.szExeFile, L"winlogon.exe") == 0)
{
PID = pe32.th32ProcessID;
break;
}
bNext = ::Process32Next(hProcessSnap, &pe32);
}
::CloseHandle(hProcessSnap);
return PID;
}
This method has defects :
1、 Because it hung up winlogon, This is the key process of the system , It will affect the system function , So when you exit the program, you must restore it .
2、 After exiting the program, the key combination will still be processed .
Another way is to inject winlogon Take over message processing by yourself , The risk will be greater , Easy to use, system problems . If you have a lot of testing machines, you can try .
版权声明
本文为[Brick Porter]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210603257648.html
边栏推荐
- [mathematical modeling] - analytic hierarchy process (AHP)
- WebView opens H5 video and displays gray background or black triangle button. Problem solved
- 解决:cnpm : 無法加載文件 ...\cnpm.ps1,因為在此系統上禁止運行脚本
- Nacos as service registry
- c#:泛型反射
- After opening the original normal project, the dependency package displays red and does not exist.
- The first leg of the national tour of shengteng AI developer creation and enjoyment day was successfully held in Xi'an
- Tencent map and high logo removal method
- 昇腾 AI 开发者创享日全国巡回首站在西安成功举行
- Introduction to ROS learning notes (II)
猜你喜欢
C: generic reflection
Machine learning theory (7): kernel function kernels -- a way to help SVM realize nonlinear decision boundary
七、DOM(下) - 章节课后练习题及答案
玻璃体中的硫酸软骨素
Machine learning practice - naive Bayes
ESP32 LVGL8. 1 - label (style 14)
Introduction to ROS learning notes (II)
Use bitnami / PostgreSQL repmgr image to quickly set up PostgreSQL ha
Use bitnami / PostgreSQL repmgr image to quickly set up PostgreSQL ha
Resolution: cnpm: unable to load file \cnpm. PS1, because running scripts is prohibited on this system
随机推荐
Practice of Druid SQL and security in meituan review
[popular science] CRC verification (I) what is CRC verification?
电路在线模拟
Simplified path (force buckle 71)
ESP32 LVGL8. 1 - checkbox (checkbox 23)
Go language GUI framework Fyne Chinese garbled or not displayed
Druid SQL和Security在美团点评的实践
c#:泛型反射
ctfshow-web361(SSTI)
Loop path
解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
12 examples to consolidate promise Foundation
Introduction to ROS learning notes (II)
: app: transformclasseswithrobustfordevrease meituan hot repair compilation error record
Simple use of viewbinding
QT error: no matching member function for call to ‘connect‘
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
Database computer experiment 4 (data integrity and stored procedure)
ESP32 LVGL8. 1 - event (event 17)
ESP32 LVGL8. 1 - label (style 14)