Page 1 of 1
Marker issues
Posted: Mon Sep 14, 2009 6:50 pm
by roxaz
I test VMProtect on x64 dll, so i have to use marker call. Thing is that VMProtect reports that there are 4 unpaired markers, and it does not display any marked functions in the list of functions to virtualize. So not a single marked function is virtualized. Is demo version supposed not to handle marked functions or whats wrong? By the way i checked my dll in disassembler - i have matching count of calls to virtualization start and end callbacks.
Posted: Mon Sep 21, 2009 7:14 am
by Admin
The cause of this situation - the code optimization. In the result you have some VMProtectEnd on one VMProtectBegin.
Posted: Mon Nov 16, 2009 3:14 am
by ssack
Admin wrote:The cause of this situation - the code optimization. In the result you have some VMProtectEnd on one VMProtectBegin.
how to solve?
Posted: Mon Nov 16, 2009 3:28 am
by Admin
Use MACRO markers instead API markers.
Posted: Mon Nov 16, 2009 3:42 am
by ssack
new makers no macro define
Posted: Mon Nov 16, 2009 4:23 pm
by Admin
You can use markers from previous version:
Code: Select all
#define VMProtectBegin \
__asm _emit 0xEB \
__asm _emit 0x10 \
__asm _emit 0x56 \
__asm _emit 0x4D \
__asm _emit 0x50 \
__asm _emit 0x72 \
__asm _emit 0x6F \
__asm _emit 0x74 \
__asm _emit 0x65 \
__asm _emit 0x63 \
__asm _emit 0x74 \
__asm _emit 0x20 \
__asm _emit 0x62 \
__asm _emit 0x65 \
__asm _emit 0x67 \
__asm _emit 0x69 \
__asm _emit 0x6E \
__asm _emit 0x00 \
#define VMProtectBeginVirtualization \
__asm _emit 0xEB \
__asm _emit 0x10 \
__asm _emit 0x56 \
__asm _emit 0x4D \
__asm _emit 0x50 \
__asm _emit 0x72 \
__asm _emit 0x6F \
__asm _emit 0x74 \
__asm _emit 0x65 \
__asm _emit 0x63 \
__asm _emit 0x74 \
__asm _emit 0x20 \
__asm _emit 0x62 \
__asm _emit 0x65 \
__asm _emit 0x67 \
__asm _emit 0x69 \
__asm _emit 0x6E \
__asm _emit 0x01 \
#define VMProtectBeginMutation \
__asm _emit 0xEB \
__asm _emit 0x10 \
__asm _emit 0x56 \
__asm _emit 0x4D \
__asm _emit 0x50 \
__asm _emit 0x72 \
__asm _emit 0x6F \
__asm _emit 0x74 \
__asm _emit 0x65 \
__asm _emit 0x63 \
__asm _emit 0x74 \
__asm _emit 0x20 \
__asm _emit 0x62 \
__asm _emit 0x65 \
__asm _emit 0x67 \
__asm _emit 0x69 \
__asm _emit 0x6E \
__asm _emit 0x02 \
#define VMProtectBeginUltra \
__asm _emit 0xEB \
__asm _emit 0x10 \
__asm _emit 0x56 \
__asm _emit 0x4D \
__asm _emit 0x50 \
__asm _emit 0x72 \
__asm _emit 0x6F \
__asm _emit 0x74 \
__asm _emit 0x65 \
__asm _emit 0x63 \
__asm _emit 0x74 \
__asm _emit 0x20 \
__asm _emit 0x62 \
__asm _emit 0x65 \
__asm _emit 0x67 \
__asm _emit 0x69 \
__asm _emit 0x6E \
__asm _emit 0x03 \
#define VMProtectEnd \
__asm _emit 0xEB \
__asm _emit 0x0E \
__asm _emit 0x56 \
__asm _emit 0x4D \
__asm _emit 0x50 \
__asm _emit 0x72 \
__asm _emit 0x6F \
__asm _emit 0x74 \
__asm _emit 0x65 \
__asm _emit 0x63 \
__asm _emit 0x74 \
__asm _emit 0x20 \
__asm _emit 0x65 \
__asm _emit 0x6E \
__asm _emit 0x64 \
__asm _emit 0x00 \
Re: Marker issues
Posted: Thu Jan 28, 2010 10:06 am
by gnjp
I had this problem too, turning optimization of using pragma fixed it:
in MSVC++
#pragma optimize( "g", off )
// code
#pragma optimize( "g", on )
Re: Marker issues
Posted: Fri Dec 17, 2010 1:48 pm
by sjsteve33171
Thanks to both of you it fixed my error of unmatched pairs.
One other way is to edit the properties of the project, expand C++, select Optimization and disable it from the top option. After that select Code Generation and disable the Buffer Security Check.
Everything works after that.