<< Click to Display Table of Contents >> Navigation: WinLicense > SecureEngine® Macros > CheckRegistration macro |
The CHECK_REGISTRATION macro allows you to check if your application has been registered with a valid license key. You can also know if your application is registered via WLRegGetStatus. The CHECK_REGISTRATION macro can be used as a double check to make sure that your application has not been tampered.
NOTE: The current version of SecureEgine® does not support this macro for .NET languages or Visual Basic applications.
The CHECK_REGISTRATION macro can be called from inside other macros. In fact, it's highly recommend to call the CHECK_REGISTRATION macro from inside VM macros.
The CHECK_REGISTRATION macro has a special syntax:
CHECK_REGISTRATION (user_variable, user_value)
Where "user_variable" is any local or global variable in the application and "user_value" is any immediate value (constant value). The way that it works is the following:
•The CHECK_REGISTRATION macro is called.
•SecureEngine takes control of the processor and make special checks to know if your application is correctly registered.
•If your application is correctly registered, SecureEngine sets "user_variable" equal to "user_value".
•If the application is not registered, SecureEngine does not set "user_variable". You should take care of initializing "user_variable" to something else from "user_value".
•SecureEngine returns control to the protected application. The protected application should check the value of "user_variable" and execute the desired action if the application is not registered.
int MyCheckVar;
VM_START
// your code goes here
CHECK_REGISTRATION(MyCheckVar, 0x12345678)
// your code goes here
if (MyCheckVar != 0x12345678) printf("Application is not registered");
VM_END |
var MyCheckVar: Integer;
begin
{$I VM_Start.inc}
// your code goes here
{$I CheckRegistration_Prolog.inc} asm push 11111111 // 11111111 is our special constant pop MyCheckVar // SecureEngine will set "MyCheckVar" to 11111111 if application is registered end; {$I CheckRegistration_Epilog.inc}
// your code goes here
if MyCheckVar <> 11111111 then ShowMessage("Application is not registered!");
{$I VM_End.inc} |