📄 isdebuggerpresent.cpp
字号:
/*--------------------------------------------------------------
IsDebuggerPresent.cpp -- 检测用户模式调试器(如OllyDbg)
(c) www.pediy.com code by 段钢, 2003.11
--------------------------------------------------------------*/
#include <windows.h>
BOOL IsInDebugger();
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,PSTR szCmdLine, int iCmdShow)
{
if( IsInDebugger() )
MessageBox(NULL,TEXT ("u are debugging me !"),TEXT ("OK"),MB_ICONEXCLAMATION);
else
MessageBox(NULL,TEXT ("not debugged!"),TEXT ("OK"),MB_ICONEXCLAMATION);
return 0;
}
//////////////////////////////////////////////////////////////////////
BOOL IsInDebugger()
{
HINSTANCE hInst = LoadLibrary("kernel32.dll");
if (hInst != NULL)
{
FARPROC pIsDebuggerPresent = GetProcAddress(hInst, "IsDebuggerPresent");
if (pIsDebuggerPresent != NULL)
return pIsDebuggerPresent();
}
return FALSE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -