Page 1 of 1

Inserting markers in functions

Posted: Sat Jan 23, 2016 4:01 pm
by blowfish
Hello, is this correct way to insert markers inside of code? or not?

Code: Select all

    DWORD dwGetVMTCount( PDWORD pdwVMT )
    {
        VMProtectBeginMutation( "vmthook_count" );
        DWORD dwIndex = 0;
        blablabla
        ...
        ...
        VMProtectEnd( );
        return dwIndex;
    }
or should I insert it in other place? I'm asking it because of return statement, when I insert marker after return statement compiler is optimizing out marker, so I put it before return.

Re: Inserting markers in functions

Posted: Sun Jan 24, 2016 5:01 am
by Admin
In this case you can skip VMProtectEnd if you use 3.0:

Code: Select all

    DWORD dwGetVMTCount( PDWORD pdwVMT )
    {
        VMProtectBeginMutation( "vmthook_count" );
        DWORD dwIndex = 0;
        blablabla
        ...
        ...
        return dwIndex;
    }