8.5 CheckRemoteDebuggerPresent
CheckRemoteDebuggerPresent 也是一个微软提供的反调试函数,该函数可以在本地或者远程进程中使用。函数接收两个参数进程句柄和一个指向布尔值的指针。如果指定的进程正在被调试,则函数会把指向布尔值的指针设为 TRUE,否则设为FALSE。
#include <stdio.h>
#include <windows.h>
// 定义指针
typedef BOOL(WINAPI *CHECK_REMOTE_DEBUG_PROCESS)(HANDLE, PBOOL);
BOOL CheckDebugger()
{
    BOOL bDebug = FALSE;
    CHECK_REMOTE_DEBUG_PROCESS CheckRemoteDebuggerPresent;
    HINSTANCE hModule = GetModuleHandle("kernel32");
    CheckRemoteDebuggerPresent = (CHECK_REMOTE_DEBUG_PROCESS)GetProcAddress(hModule, "CheckRemoteDebuggerPresent");
    HANDLE hProcess = GetCurrentProcess();
    CheckRemoteDebuggerPresent(hProcess, &bDebug);
    return bDebug;
}
int main(int argc, char *argv[])
{
    if (CheckDebugger())
    {
        printf("[-] 进程正在被调试 \n");
    }
    system("pause");
    return 0;
}
    文章出处:https://www.cnblogs.com/LyShark/p/17731834.html
本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号