Guest User

Enigma Protector: Strange crash

a guest
May 4th, 2012
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <enigma_ide.h>
  4.  
  5. int checkLicence( void )
  6. {
  7.     std::cout << "Checking licence..." << std::endl;
  8.  
  9.     int lRes = 0;
  10.     char* lName = NULL;
  11.     char* lKey = NULL;
  12.  
  13.     //  Get Name and Key
  14.     lRes = EP_RegLoadKey(&lName,&lKey);
  15.     if(lRes) {
  16.         std::cout << "Name and Key retrieved successfully! Name:'" << lName << "' Key:'" << lKey << "'" << std::endl;
  17.     } else {
  18.         std::cout << "Failed to retrieve Name and Key!" << std::endl;
  19.     }
  20.  
  21.     //  Get licence information
  22.     TKeyInformation lInfo ;
  23.     memset(&lInfo,0,sizeof(TKeyInformation));
  24.     //  I could even hardcode the licence name and key. The result would be the same!
  25.     lRes = EP_RegKeyInformation(lName,lKey,&lInfo);
  26.     if(lRes) {
  27.         std::cout << "Info retrieved successfully!" << std::endl;
  28.         for(int i = 0; i < 16; ++i) {
  29.             std::cout << "Section " << i+1 << ": " << (lInfo.EncryptedSections[i] ? "true" : "false") << std::endl;
  30.         }
  31.         std::cout << "Date: " << lInfo.ExpirationDay << " - " << lInfo.ExpirationMonth << " - " << lInfo.ExpirationYear << std::endl;
  32.     } else {
  33.         std::cout << "Failed to retrieve Info!" << std::endl;
  34.     }
  35.  
  36.     std::cout << "Licence check finished." << std::endl;
  37.  
  38.     return lRes;
  39. }
  40.  
  41. int main(int argc, char *argv[])
  42. {      
  43.     int result = checkLicence();
  44.  
  45.     system("pause");
  46.  
  47.     return EXIT_SUCCESS;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment