简单的 NtGlobalFlag 反调试程序:
#include "stdafx.h"
#include <windows.h>
#define NAKED __declspec(naked)
NAKED BOOL Detect32()
{
__asm
{
push ebp;
mov ebp, esp;
pushad;
mov eax, fs:[30h];
mov al, [eax + 68h];
and al, 70h;
cmp al, 70h;
je being_debugged;
popad;
mov eax, 0;
jmp being_debugged + 6
being_debugged:
popad;
mov eax, 1;
leave;
retn;
}
}