感谢师叔的科普。

下面代码来源于52pojie。不想自己写,我是懒人。

#include <windows.h>
   
BOOL DetectFuncBreakpoints();
   
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
   
    if (DetectFuncBreakpoints())
    {
        MessageBox(NULL, "检测到int3断点", "结果", MB_OK);
        return 0;
    }
    else
    {
        MessageBox(NULL, "没有检测到int3断点", "结果", MB_OK);
    }
   
    return 0;
}
   
BOOL DetectFuncBreakpoints()
{
    BOOL bFoundOD;
    bFoundOD=FALSE;
    DWORD dwAddr;
    dwAddr = (DWORD)GetProcAddress(LoadLibrary("user32.dll"),"MessageBoxA"); //将FARPROC类型转换成DWORD
    __asm
    {
            cld               ;检测代码开始
            mov     edi,dwAddr
            mov     ecx,100  ;100bytes
            mov     al,0CCH ;字母前面必须有0
            repne   scasb
            jnz     ODNotFound
            mov bFoundOD,1
ODNotFound:             
    }
    return bFoundOD;
}
c++

相关文章:

  • 2021-10-15
  • 2022-01-04
  • 2022-01-13
  • 2021-07-25
  • 2022-01-07
  • 2021-12-07
猜你喜欢
  • 2021-08-02
  • 2021-08-01
  • 2021-11-30
  • 2022-12-23
  • 2021-12-22
  • 2021-06-07
  • 2021-07-09
相关资源
相似解决方案