怎么在静态链接的dll进行反调试(保护调用它的程序)

如何在静态链接的dll进行反调试(保护调用它的程序)
1.首先要检查调用它的程序是否被调试(IsDebuggerPresent()好像不行);
2.然后对调用它的程序进行内存保护(改成只读),防止调试器写入int 3中断,这里调用VirtualProtect()也实现不了


------解决思路----------------------
BOOL sDebugger()
{
#if _MSC_VER < 1600
_asm
{
mov eax, fs:[30h]
movzx eax, byte ptr [eax + 2h]
or al, al
jz _Fine
}
//_Debugged:
//AfxMessageBox("Found a debugger tried to read from and\n write to a virtual address for which it does not\nhave the appropriate access!",MB_OK
------解决思路----------------------
MB_ICONWARNING);
 // exit(0);
return TRUE;
_Fine:
return FALSE;
#endif // #if _MSC_VER < 1600
return FALSE;
}
------解决思路----------------------
引用:
1.首先要检查调用它的程序是否被调试(IsDebuggerPresent()好像不行);
2.然后对调用它的程序进行内存保护(改成只读),防止调试器写入int 3中断,这里调用VirtualProtect()也实现不了


http://bbs.pediy.com/showthread.php?t=183253

------解决思路----------------------
反调试技巧总结-原理和实现
http://www.cnblogs.com/huhu0013/archive/2011/07/05/2098358.html