当前位置:网站首页>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
边栏推荐
- 机器学习理论基础篇--关于机器学习的一些术语
- ESP32 LVGL8. 1 - input devices (input devices 18)
- Introduction to ROS learning notes (I)
- Excel intercept text
- 特征选择feature_selection--SelectKBest
- Machine learning practice - naive Bayes
- Ctfshow - web362 (ssti)
- Eight bit binary multiplier VHDL
- After opening the original normal project, the dependency package displays red and does not exist.
- 数据库上机实验四(数据完整性与存储过程)
猜你喜欢
12个例子夯实promise基础
12 examples to consolidate promise Foundation
Practice of Druid SQL and security in meituan review
Use stm32cube MX / stm32cube ide to generate FatFs code and operate SPI flash
实战业务优化方案总结---主目录---持续更新
Use Chenxi bookkeeping book to analyze the balance of revenue and expenditure of each account in a certain period of time
解决:cnpm : 無法加載文件 ...\cnpm.ps1,因為在此系統上禁止運行脚本
Resolution: cnpm: unable to load file \cnpm. PS1, because running scripts is prohibited on this system
微搭低代码零基础入门课(第三课)
根据快递单号查询物流查询更新量
随机推荐
Sentinel服务熔断实战(sentinel整合ribbon+openFeign+fallback)
Keil RVMDK compiled data type
【数学建模】—— 层次分析法(AHP)
STM32: LCD display
Introduction to ROS learning notes (II)
Machine learning theory (8): model integration ensemble learning
The type initializer for ‘Gdip‘ threw an exception
教你用简单几个步骤快速重命名文件夹名
ESP32 LVGL8. 1 - BTN button (BTN 15)
Esp32 (UART receiving and sending) - receiving and sending communication of serial port (4)
Deeply understand what new and make in golang are and what are the differences?
Machine learning practice - naive Bayes
Use Chenxi bookkeeping book to analyze the balance of revenue and expenditure of each account in a certain period of time
【历史上的今天】4 月 23 日:YouTube 上传第一个视频;网易云音乐正式上线;数字音频播放器的发明者出生
配置iptables
迁移学习进阶
Query the logistics update quantity according to the express order number
Simple use of viewbinding
Daily network security certification test questions (April 18, 2022)
With the use of qchart, the final UI interface can be realized. The control of qweight can be added and promoted to a user-defined class. Only the class needs to be promoted to realize the coordinate