当前位置:网站首页>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
边栏推荐
- MySQL Téléchargement et installation de la version Linux
- Halo open source project learning (VII): caching mechanism
- Tangle
- ESP32 LVGL8. 1 - BTN button (BTN 15)
- QT excel operation summary
- The corresponding permissions required to automatically open the app in the setting interface through accessibility service
- ESP32 LVGL8. 1 - event (event 17)
- Setting up keil environment of GD single chip microcomputer
- 使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
- Use bitnami / PostgreSQL repmgr image to quickly set up PostgreSQL ha
猜你喜欢

Practice of Druid SQL and security in meituan review

Esp32 drive encoder -- siq-02fvs3 (vscade + IDF)

ESP32 LVGL8. 1. Detailed migration tutorial of m5stack + lvgl + IDF (27)

解决:cnpm : 無法加載文件 ...\cnpm.ps1,因為在此系統上禁止運行脚本

ctfshow-web361(SSTI)

使用晨曦记账本,分析某个时间段每个账户收支结余

ctfshow-web362(SSTI)

昇腾 AI 开发者创享日全国巡回首站在西安成功举行

ESP32 LVGL8. 1 - roller rolling (roller 24)

从技术体系到商业洞察,中小研发团队架构实践之收尾篇
随机推荐
迁移学习进阶
Esp32 drive encoder -- siq-02fvs3 (vscade + IDF)
After CANopen starts PDO timing transmission, the heartbeat frame time is wrong, PDO is delayed, and CANopen time axis is disordered
Machine learning theory (7): kernel function kernels -- a way to help SVM realize nonlinear decision boundary
Nacos集群搭建和mysql持久化配置
ESP32 LVGL8. 1. Detailed migration tutorial of m5stack + lvgl + IDF (27)
Excel intercept text
ESP32 LVGL8. 1 - input devices (input devices 18)
机器学习理论之(7):核函数 Kernels —— 一种帮助 SVM 实现非线性化决策边界的方式
mysql_linux版本的下载及安装详解
listener. log
ctfshow-web362(SSTI)
os_ authent_ Prefix
Esp32 (UART ecoh) - serial port echo worm learning (2)
ctfshow-web361(SSTI)
Golang 语言实现TCP UDP通信
C: generic reflection
CANopen STM32 transplantation
Use stm32cube MX / stm32cube ide to generate FatFs code and operate SPI flash
ESP32 LVGL8. 1 - slider slider (slider 22)