(Assembly) Trap Flag by External

June 22, 2022, 1:52 a.m. | 2 weeks

Code

            BOOL IsDebuggerPresent_TrapFlag()
{
    __try
    { 
        __asm
       {
           pushfd
           or word ptr[esp], 0x100
           popfd
           nop
       }
    }
    __except(1) 
    { 
        return FALSE; 
    }
    return TRUE;
}
        

Comment