Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <enigma_ide.h>
- int checkLicence( void )
- {
- std::cout << "Checking licence..." << std::endl;
- int lRes = 0;
- char* lName = NULL;
- char* lKey = NULL;
- // Get Name and Key
- lRes = EP_RegLoadKey(&lName,&lKey);
- if(lRes) {
- std::cout << "Name and Key retrieved successfully! Name:'" << lName << "' Key:'" << lKey << "'" << std::endl;
- } else {
- std::cout << "Failed to retrieve Name and Key!" << std::endl;
- }
- // Get licence information
- TKeyInformation lInfo ;
- memset(&lInfo,0,sizeof(TKeyInformation));
- // I could even hardcode the licence name and key. The result would be the same!
- lRes = EP_RegKeyInformation(lName,lKey,&lInfo);
- if(lRes) {
- std::cout << "Info retrieved successfully!" << std::endl;
- for(int i = 0; i < 16; ++i) {
- std::cout << "Section " << i+1 << ": " << (lInfo.EncryptedSections[i] ? "true" : "false") << std::endl;
- }
- std::cout << "Date: " << lInfo.ExpirationDay << " - " << lInfo.ExpirationMonth << " - " << lInfo.ExpirationYear << std::endl;
- } else {
- std::cout << "Failed to retrieve Info!" << std::endl;
- }
- std::cout << "Licence check finished." << std::endl;
- return lRes;
- }
- int main(int argc, char *argv[])
- {
- int result = checkLicence();
- system("pause");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment