Parsi Coders
C++ Anti-Debug: Another trick - نسخه قابل چاپ

+- Parsi Coders (http://parsicoders.com)
+-- انجمن: Cracking / Anti Crack (http://parsicoders.com/forumdisplay.php?fid=75)
+--- انجمن: Anti Debug (http://parsicoders.com/forumdisplay.php?fid=76)
+--- موضوع: C++ Anti-Debug: Another trick (/showthread.php?tid=907)



C++ Anti-Debug: Another trick - Amin_Mansouri - 09-22-2011

کد:
DWORD __inline SiberianTiger::CheckIDT( )
{
    DWORD returnVal;
    DWORD_PTR *IDTP = new DWORD_PTR[4];
    DWORD IDT;
    OSVERSIONINFO osvi;

    osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
    if( GetVersionEx( &osvi ) == 0 )
    {
        #ifdef AGGRESSIVE
            return( 0 );
        #else
            return( 1 );
        #endif
    }

    if( osvi.dwMajorVersion < 6 )
    {
        #ifdef __INTRIN_H_
            __sidt( IDTP );
        #else
            __asm SIDT [IDTP]
        #endif
        IDT = ( DWORD ) IDTP;

        returnVal = ( IDT & 0x373FC8 ) == IDT;
    }
    else
    {
        returnVal = 1;
    }

    return( returnVal );
}