VMProtectBegin/VMProtectEnd question

Issues related to VMProtect
Post Reply
tryvmp
Posts: 13
Joined: Sun Apr 24, 2011 5:27 am

VMProtectBegin/VMProtectEnd question

Post by tryvmp »

for these markers, can i include the whole function with return in it?


ie

DWORD function1(int a,int b)
{
VMProtectBegin("function1");

if(a==1)
return 1;
else if(a==3)
return 3;

else return 4;

VMProtectEnd();


}
is this ok or i need to have return outside the marker.

i read the help files, it said "you must not allow jumps from unprotected sections inside a marker"
does this mean jump from inside marker or jump into the marker?

void function 2()
{
VMProtectBegin("function1");
__asm{
cmp eax,3
jne jmpcode
ret
jmpcode:
jmp function3

}
VMProtectEnd();
}

is this valid?
Admin
Site Admin
Posts: 2691
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: VMProtectBegin/VMProtectEnd question

Post by Admin »

does this mean jump from inside marker or jump into the marker?
It means jump into the marker:

Code: Select all

VMProtectBegin(NULL);
for (int i = 0; i < 10; i++)
{
...
VMProtectEnd();
...
} // it`s will be the jump into marker
P.S. Your examples are valid.
Post Reply