Jump to content
Tuts 4 You

ASProtect 2.56 SKE - polymarker


deepzero

Recommended Posts

Hi,

I wanted to experiment a little with asprotects virtualization options and tried to virtualize a simple function:


int deepzero(int x){User_Polymarkerint y = 22;
y = (y * x) /5;
y += 100;return (y);
}

But it doesnt work, User_Polymarker is not defined.

The polymarker stuff is defined in a file called PB.inc, but it doesnt look like c++ to me...:

' PB include fileMACRO USER_POLY_BUFFER = ! DB &HEB, &H04, &HEB, &H05, &H39, &H19MACRO CRC_BEGIN
! DB &HEB, &H04, &HEB, &H05, &H19, &H01, &HE9, &H25, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00
! DB &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00
! DB &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00
END MACRO.....

So how can i use the polymarker feature in my MSVC++08 IDE? :turned:

:help

edit:

This is what the help file says about it:

C/C++ markers are defined via include directive (*.h or *.inc files) and appear as a special sequence of the assembly code that is detected by ASProtect in the protection phase.

You can find markers usage examples in your ASProtect installation directory.

Edited by deepzero
Link to comment

Uhm, did some testing, let me see if I can find the notes I made. ;) Make sure you're using up some registers (like doing a mov eax, blah) so ASPro can use it as junk register till next register assignment.

Edit: Didn't find the notes, unfortunately. Also had troubles finding the headers in a retail release, the demo though got it:

// v3.01#ifdef __BORLANDC__ #define CRC_CHECK_BEGIN 	__emit__ (0xEB,0x04,0xEB,0x05,0x19,0x01);
#define CRC_CHECK_END __emit__ (0xEB,0x04,0xEB,0x05,0x29,0x01); #define CRC_BUFFER_BEGIN __emit__ (0xE9,0x25,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0);
#define CRC_BUFFER_END __emit__ (0xE9,0x85,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0); #define ENVELOPE_CHECK __emit__ (0xEB,0x04,0xEB,0x05,0x97,0x01);
#define ENVELOPE_CHECK_FUNC __emit__ (0xEB,0x04,0xEB,0x05,0x97,0x02); #define USER_POLYBUFFER __emit__ (0xEB,0x04,0xEB,0x05,0x39,0x19); #define ENVELOPE_CHECK_BUFFER __emit__ (0xE9,0x05,0x01,0,0,0,0,0,0,0);
#define ENVELOPE_CHECK_FUNC_BUFFER __emit__ (0x33,0xC0,0xE9,0x03,0x01,0,0,0,0,0); #define DEFAULT_BUFFER __emit__ (0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0);#else #define CRC_CHECK_BEGIN \
__asm _emit 0xEB \
__asm _emit 0x04 \
__asm _emit 0xEB \
__asm _emit 0x05 \
__asm _emit 0x19 \
__asm _emit 0x01 #define CRC_CHECK_END \
__asm _emit 0xEB \
__asm _emit 0x04 \
__asm _emit 0xEB \
__asm _emit 0x05 \
__asm _emit 0x29 \
__asm _emit 0x01 #define CRC_BUFFER_BEGIN \
__asm _emit 0xE9 \
__asm _emit 0x25 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 #define CRC_BUFFER_END \
__asm _emit 0xE9 \
__asm _emit 0x85 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 #define ENVELOPE_CHECK \
__asm _emit 0xEB \
__asm _emit 0x04 \
__asm _emit 0xEB \
__asm _emit 0x05 \
__asm _emit 0x97 \
__asm _emit 0x01 #define ENVELOPE_CHECK_FUNC \
__asm _emit 0xEB \
__asm _emit 0x04 \
__asm _emit 0xEB \
__asm _emit 0x05 \
__asm _emit 0x97 \
__asm _emit 0x02 #define USER_POLYBUFFER \
__asm _emit 0xEB \
__asm _emit 0x04 \
__asm _emit 0xEB \
__asm _emit 0x05 \
__asm _emit 0x39 \
__asm _emit 0x19 #define ENVELOPE_CHECK_BUFFER \
__asm _emit 0xE9 \
__asm _emit 0x05 \
__asm _emit 0x01 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 #define ENVELOPE_CHECK_FUNC_BUFFER \
__asm _emit 0x33 \
__asm _emit 0xC0 \
__asm _emit 0xE9 \
__asm _emit 0x03 \
__asm _emit 0x01 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 \
__asm _emit 0x00 #define DEFAULT_BUFFER \
__asm _emit 0x0 __asm _emit 0x0 __asm _emit 0x0 __asm _emit 0x0 \
__asm _emit 0x0 __asm _emit 0x0 __asm _emit 0x0 __asm _emit 0x0 \#endif
Edited by metr0
Unable to type. ;)
Link to comment

Thanks, where did you find that header though? What was it called?

I checked a demo and a retail installer, no header files there :/

Link to comment

I am using your code now and its working.

I have a 2.56 build 03.17. retail and a trial here neither of them contains a SDK dir in the "Examples"... :wacko:

thanks!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...