(Assembly) Trap Flag by External

Created the Wednesday 22 June 2022. Updated 5 months, 1 week ago.

Code

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