Inserting markers in functions

Issues related to VMProtect
Post Reply
blowfish
Posts: 1
Joined: Sat Jan 23, 2016 3:57 pm

Inserting markers in functions

Post 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.
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Inserting markers in functions

Post 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;
    }
Post Reply