Page 1 of 1

EP_RegLoadAndCheckKey problem

Posted: Mon Jan 14, 2013 6:36 pm
by ck_
I need custom license dialog, so I have to check registration manually.
I do the following:

Code: Select all

# include <EnigmaSDK/VC/unreg_crypt_begin1.inc>
   // Show message "unreg" for testing
# include <EnigmaSDK/VC/unreg_crypt_end1.inc>

# include <EnigmaSDK/VC/vm_begin.inc>
if (EP_RegLoadAndCheckKey() == 1)
  // Show message "ok" and run the app
else
  // Show message "fail" and open custom license dialog
# include <EnigmaSDK/VC/vm_end.inc>
Then I also enable Enigma's Registration dialog: Use custom registration dialog + Show if the trial has expired + Show if unregistered.

Then I protect app and generate key for 3 execution + section1 decryption
I see the following behaviour:

run 1:
* Enigma license dialog (I press "try")
* "unreg" message
* "fail" message
in the custom dialog enter key and close the app.

run 2:
* "ok" message, working with programm, close

run 3:
I see "fail" message, but there is no Enigma dialog or "unreg" message
custom license dialog is showing.

run 4:
Enigma license is showing.

Why at "run 3" EP_RegLoadAndCheckKey() returns zero (note: unreg section was not executed, so key is still decrypt it)?

In the docs:
The function fails in the following cases:
the registration information is not present;
the registration information is incorrect;
the application is not protected.
Step by step:
the registration information is not present - it is definitely present (Enigma dialog has not been shown)
the registration information is incorrect - again Enigma dialog has not been shown so info is ok
the application is not protected - it definitely protected

Thanks.

Re: EP_RegLoadAndCheckKey problem

Posted: Mon Jan 14, 2013 6:42 pm
by ck_
Hey, I think I understood the problem.

at "run 3" before EP_RegLoadAndCheckKey() key becomes invalid since we execute the app 3rd time, so EP_RegLoadAndCheckKey() returns 0. Am I right?