Manual
Function KG_VerifyRegistrationInfoKG_VerifyRegistrationInfo is used for verifying the registration information and extracting registration key parameters from ANSI-based registration information. The function has one parameter - a pointer to the TKeyVerifyParams structure. Please note, the TKeyVerifyParams structure should contain secure parameters from the Enigma Protector project. These parameters are PublicKey, KeyMode, KeyBase and EncryptedConstant (see the Registration Features - Common panel, Information for Custom Generator box). Return Values
DefinitionShow/Hide Delphi function definition function KG_VerifyRegistrationInfo(kv : PKeyVerifyParams) : dword; external 'keygen.dll' name 'KG_VerifyRegistrationInfo'; Show/Hide C++ function definition extern "C" __declspec( dllimport ) __stdcall int KG_VerifyRegistrationInfo(PKeyVerifyParams kv); Show/Hide C# (.NET) function definition public class Enigma_KeyGen_IDE { [DllImport("keygen.dll", CallingConvention = CallingConvention.StdCall)] public static extern uint KG_VerifyRegistrationInfo(ref TKeyVerifyParams kv); } Show/Hide Visual Basic function definition Public Declare Function KG_VerifyRegistrationInfo Lib "keygen.dll" (ByRef kv As TKeyVerifyParams) As Long ExamplesShow/Hide Delphi function example procedure TfrmMain.btnVerifyClick(Sender: TObject); var kv : TKeyVerifyParams; i : integer; dwResult : dword; stemp : string; sresult : string; begin if eUserInfo.Text = '' then begin ShowMessage('User info field is empty!'); Exit; end; if mKey.Text = '' then begin ShowMessage('Key field is empty!'); Exit; end; kv.RegInfo := PAnsiChar(AnsiString(eUserInfo.Text)); kv.RegInfoLen := strlen(PAnsiChar(kv.RegInfo)); kv.Key := PAnsiChar(AnsiString(mKey.Text)); kv.KeyLen := strlen(PAnsiChar(kv.Key)); // Key mode kv.KeyMode := cbKeyMode.ItemIndex; // Key base kv.KeyBase := cbKeyBase.ItemIndex; case kv.KeyMode of RM_512: begin kv.PublicKey := '0201B810DA4A1ADD4351378790A98138533067CP4S86R7D8THS45GBCVUM635EPRQRMYRP3DAA5DUPZ6ABDSFP7F5AC' + 'P7ERGH4A7Y6B6NW6NMMBZF83WVER9Y4MMBNLBQDKR7KFVLGLV067CFDQC' + 'WCHGQVVRN24DECEPBL96YJQJTVDCRTNQG3E4WW4GK4GQ5X5L5H88D3XYH' + 'CBRBNASPD3P5CNYFKFHBCSDHHD6WPTCC4XVSM5S88067C2JSTCMVT48C8' + 'HC7SHKGTFJBM28P6XTBCNWHMV6J6KN6W5Q9TQLVR285U6GVCAAUTZLRTP' + 'SRGDQ742B4742XF4MACRR747YDP5FZZ9D'; end; RM_768: begin kv.PublicKey := '0201B810DA4A1ADD4351378790A9813853309AEHRR66KMK99UEPX8C54WQFDZQ5Y96WUCVZYMXBC32SJV7T5SBPR54E' + '2DBH8UD9RNHTJ9BLJV6NHX52W7PZDDTTJDDGF3YFVL7PJFL8RS8THTFDF' + '4RY7K3QXLTMXMC8DDSRVRWBVMMP3UYKCDDC7KGL9PG509ACPTRQ4MMUKG' + 'DAUJFFFGSCBFLYK9X9E74M58PW5FG9B9RTLXJQ4STPVCHJTEH8BP557VZ' + 'PQYDBUZJXXJNGVZELFL4UL3LHHE8A645CK593DVWCQBSX4ZCCQ3ST8GCZ' + 'LW2729XK3NT7GST3LMQGXSHLDWCXE09AENVX2QTX3VLT6FWB4JND875XZ' + 'WQ26GW76TV3KVVHK7U489LLPBQ39HUWKMA65U3HKWBDHKBZEB525PHEH2' + 'YQHRZGNJAAYZXMWN8RNZ9T7VMZAJMP2V3S9NXZ9RHL96F7AT3NTMN36V4' + 'ACSFEN4DR6TJR95'; end; RM_1024: begin kv.PublicKey := '0201B810DA4A1ADD4351378790A981385330CDG9YQSEUK2HT546KWW46NHSCHMD2TNCSPVNSKGQC6CHDUSU9CC4LDPL' + 'TD3NLRVD3TFV9BU2SYBUBU9TXKLQ3CTKZE5GN9VFG37R9YNK2FE58K7ZY' + 'WTUJYFSJTBMDLLGA9GJ2LJXGHSS9CESGC2K69H65YQGAC7CRGF5T3CPLA' + '5BDJZKVCUWPZRNA2DN7L956LZVZBQUDPX6PF30CDBH26Z82VE4QQ8N85L' + 'QHYJYYCJ6WQ89H9K9VVQX925SG5FJ79AGVZB6M8TTFKCJ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D4LVQ6MK9LCE7ZZP925JK7ZD' + '92SCV4DDJJ5EXMVBF'; end; end; // Hardware ID kv.UseHardwareLocking := cbHardwareID.Checked; if kv.UseHardwareLocking then begin kv.HardwareID := PAnsiChar(AnsiString(eHardware.Text)); end; // Secure constant (get it from project file)! kv.EncryptedConstant := 2113444489; dwResult := KG_VerifyRegistrationInfo(@kv); if dwResult = EP_NO_ERROR then begin sresult := 'Key is valid!'#13#10; sresult := format(sresult + 'Creation Date: %s'#13#10, [DateToStr(EncodeDate(kv.CreationYear, kv.CreationMonth, kv.CreationDay))]); if kv.UseKeyExpiration then begin sresult := format(sresult + 'Expiration Date: %s'#13#10, [DateToStr(EncodeDate(kv.ExpirationYear, kv.ExpirationMonth, kv.ExpirationDay))]); end; if kv.UseRegisterAfter then begin sresult := format(sresult + 'Register After Date: %s'#13#10, [DateToStr(EncodeDate(kv.RegisterAfterYear, kv.RegisterAfterMonth, kv.RegisterAfterDay))]); end; if kv.UseRegisterBefore then begin sresult := format(sresult + 'Register Before Date: %s'#13#10, [DateToStr(EncodeDate(kv.RegisterBeforeYear, kv.RegisterBeforeMonth, kv.RegisterBeforeDay))]); end; if kv.UseCountyLimit then begin for i := 0 to length(KEY_COUNTRIES) - 1 do begin if kv.CountryCode = KEY_COUNTRIES[i].Code then begin stemp := KEY_COUNTRIES[i].Name; break; end; end; sresult := format(sresult + 'Locked to country: %s'#13#10, [stemp]); end; if kv.UseExecutionsLimit then begin sresult := format(sresult + 'Executions limit: %d executions'#13#10, [kv.ExecutionsCount]); end; if kv.UseDaysLimit then begin sresult := format(sresult + 'Days limit: %d days'#13#10, [kv.DaysCount]); end; if kv.UseRunTimeLimit then begin sresult := format(sresult + 'Run-time limit: %d minutes'#13#10, [kv.RunTimeMinutes]); end; if kv.UseGlobalTimeLimit then begin sresult := format(sresult + 'Global Time limit: %d minutes'#13#10, [kv.GlobalTimeMinutes]); end; for i := 1 to NUMBER_OF_CRYPTED_SECTIONS do begin if kv.EncryptedSections[i] then begin sresult := format(sresult + 'Unlocked section #%d'#13#10, [i]); end; end; end else begin case dwResult of EP_ERROR_UNKNOWN : sresult := 'EP_ERROR_UNKNOWN '; EP_ERROR_KEYBUFFEREMPTY : sresult := 'EP_ERROR_KEYBUFFEREMPTY '; EP_ERROR_KEYBUFFERISLESS : sresult := 'EP_ERROR_KEYBUFFERISLESS '; EP_ERROR_REGINFOEMPTY : sresult := 'EP_ERROR_REGINFOEMPTY '; EP_ERROR_REGINFOTOOLARGE : sresult := 'EP_ERROR_REGINFOTOOLARGE '; EP_ERROR_PRIVATEKEYISNOTSET : sresult := 'EP_ERROR_PRIVATEKEYISNOTSET '; EP_ERROR_PUBLICKEYISNOTSET : sresult := 'EP_ERROR_PUBLICKEYISNOTSET '; EP_ERROR_PRIVATEKEYISINVALID : sresult := 'EP_ERROR_PRIVATEKEYISINVALID '; EP_ERROR_PUBLICKEYISINVALID : sresult := 'EP_ERROR_PUBLICKEYISINVALID '; EP_ERROR_KEYMODEISINVALID : sresult := 'EP_ERROR_KEYMODEISINVALID '; EP_ERROR_KEYBASEISINVALID : sresult := 'EP_ERROR_KEYBASEISINVALID '; EP_ERROR_CURRENTDATEISINVALID : sresult := 'EP_ERROR_CURRENTDATEISINVALID '; EP_ERROR_EXPIRATIONDATEISINVALID : sresult := 'EP_ERROR_EXPIRATIONDATEISINVALID'; EP_ERROR_KEYISINVALID : sresult := 'EP_ERROR_KEYISINVALID '; EP_ERROR_HARDWAREID : sresult := 'EP_ERROR_HARDWAREID '; EP_ERROR_HARDWAREBUFFEREMPTY : sresult := 'EP_ERROR_HARDWAREBUFFEREMPTY '; EP_ERROR_HARDWAREIDINVALIDFORKEY : sresult := 'EP_ERROR_HARDWAREIDINVALIDFORKEY'; EP_ERROR_PROJECTFILENOTFOUND : sresult := 'EP_ERROR_PROJECTFILENOTFOUND '; EP_ERROR_INVALIDPROJECTFILE : sresult := 'EP_ERROR_INVALIDPROJECTFILE '; EP_ERROR_EXECUTIONSNUMBERINVALID : sresult := 'EP_ERROR_EXECUTIONSNUMBERINVALID'; EP_ERROR_DAYSNUMBERINVALID : sresult := 'EP_ERROR_DAYSNUMBERINVALID '; EP_ERROR_COUNTRYCODEINVALID : sresult := 'EP_ERROR_COUNTRYCODEINVALID '; EP_ERROR_RUNTIMEINVALID : sresult := 'EP_ERROR_RUNTIMEINVALID '; EP_ERROR_GLOBALTIMEINVALID : sresult := 'EP_ERROR_GLOBALTIMEINVALID '; EP_ERROR_INSTALLBEFOREINVALID : sresult := 'EP_ERROR_INSTALLBEFOREINVALID '; EP_ERROR_INSTALLAFTERINVALID : sresult := 'EP_ERROR_INSTALLAFTERINVALID '; else sresult := 'Unknown error'; end; end; ShowMessage(sresult); end; Show/Hide Borland C++ Builder function example void __fastcall TfrmMain::btnVerifyClick(TObject *Sender) { if (eUserInfo->Text == "") { ShowMessage("Registration info is empty!"); return; } if (mKey->Text == "") { ShowMessage("Registration key is empty!"); return; } TKeyVerifyParams kv; WORD wYear; WORD wDay; WORD wMonth; DWORD dwResult; // Clear params buffer memset(&kv, 0, sizeof(kv)); // Key mode kv.KeyMode = cbKeyMode->ItemIndex; // Key base kv.KeyBase = cbKeyBase->ItemIndex; AnsiString asPublicKey; switch (kv.KeyMode) { case RM_512: { asPublicKey = "0201B810DA4A1ADD4351378790A98138533067CP4S86R7D8THS45GBCVUM635EPRQRMYRP3DAA5DUPZ6ABDSFP7F5AC"; asPublicKey += "P7ERGH4A7Y6B6NW6NMMBZF83WVER9Y4MMBNLBQDKR7KFVLGLV067CFDQC"; asPublicKey += "WCHGQVVRN24DECEPBL96YJQJTVDCRTNQG3E4WW4GK4GQ5X5L5H88D3XYH"; asPublicKey += "CBRBNASPD3P5CNYFKFHBCSDHHD6WPTCC4XVSM5S88067C2JSTCMVT48C8"; asPublicKey += "HC7SHKGTFJBM28P6XTBCNWHMV6J6KN6W5Q9TQLVR285U6GVCAAUTZLRTP"; asPublicKey += "SRGDQ742B4742XF4MACRR747YDP5FZZ9D" + 0; break; } case RM_768: { asPublicKey = "0201B810DA4A1ADD4351378790A9813853309AEHRR66KMK99UEPX8C54WQFDZQ5Y96WUCVZYMXBC32SJV7T5SBPR54E"; asPublicKey += "2DBH8UD9RNHTJ9BLJV6NHX52W7PZDDTTJDDGF3YFVL7PJFL8RS8THTFDF"; asPublicKey += "4RY7K3QXLTMXMC8DDSRVRWBVMMP3UYKCDDC7KGL9PG509ACPTRQ4MMUKG"; asPublicKey += "DAUJFFFGSCBFLYK9X9E74M58PW5FG9B9RTLXJQ4STPVCHJTEH8BP557VZ"; asPublicKey += "PQYDBUZJXXJNGVZELFL4UL3LHHE8A645CK593DVWCQBSX4ZCCQ3ST8GCZ"; asPublicKey += "LW2729XK3NT7GST3LMQGXSHLDWCXE09AENVX2QTX3VLT6FWB4JND875XZ"; asPublicKey += "WQ26GW76TV3KVVHK7U489LLPBQ39HUWKMA65U3HKWBDHKBZEB525PHEH2"; asPublicKey += "YQHRZGNJAAYZXMWN8RNZ9T7VMZAJMP2V3S9NXZ9RHL96F7AT3NTMN36V4"; asPublicKey += "ACSFEN4DR6TJR95"; break; } case RM_1024: { asPublicKey = "0201B810DA4A1ADD4351378790A981385330CDG9YQSEUK2HT546KWW46NHSCHMD2TNCSPVNSKGQC6CHDUSU9CC4LDPL"; asPublicKey += "TD3NLRVD3TFV9BU2SYBUBU9TXKLQ3CTKZE5GN9VFG37R9YNK2FE58K7ZY"; asPublicKey += "WTUJYFSJTBMDLLGA9GJ2LJXGHSS9CESGC2K69H65YQGAC7CRGF5T3CPLA"; asPublicKey += "5BDJZKVCUWPZRNA2DN7L956LZVZBQUDPX6PF30CDBH26Z82VE4QQ8N85L"; asPublicKey += "QHYJYYCJ6WQ89H9K9VVQX925SG5FJ79AGVZB6M8TTFKCJ56FAREP8GSTC"; asPublicKey += "NKWCXEALDP9Y2ZLS9QKZV8JRNDHG9D8BRDSCTMDQK9NLAPZ9TGYFS9G7U"; asPublicKey += "LXHYJF7F9A89HPXGTU2N4FQQJL98WZ5QND2KTEMMUUZFAX953HCGNSWUW"; asPublicKey += "U2M7LBEWZSH9GW5SC0CDJDY2HC4HJYUSVTAVXZ7MYVJWF3CU9WC3SVPSL"; asPublicKey += "29WF46DVS2SYKSSAMATPPYGJDE3PBFMGS34CXWQSXKCEAE63L2EXTS9NE"; asPublicKey += "2G597XASY3S34XMYST5YZF4THUTYT5DY9UKKXU6PH8MLXRPZMPMMR83JU"; asPublicKey += "X2WGNEW8ZGL4SKUCUB8CEAB6UZ4FB66WTP3B64VMX7XG75T4Y35479"; break; } case RM_2048: { asPublicKey = "0201B810DA4A1ADD4351378790A98138533199H9KZC4CQ5ZKPEGYDW2EHN5AKZA5G5KP4HU8USWJR8XWW7MCH7244RV"; asPublicKey += "PSXFHVU6YQRK4LPUHM497XJYPLLA3DHUZWXK3CB5SUYF75NPYLTNPRUAP"; asPublicKey += "CTVDHAKYWTRQ97HES2E59WDN2LJKFYA2K8BGFSBHP4A6BF5FSDTS8NWLL"; asPublicKey += "C5NEQ76NJ9BAMWXG55UPFFMRQZTU5KV2G6LSPQUJJWA9U4LJ5SCJ9M9ZQ"; asPublicKey += "Z6K7LZA9UAMJ533UQ5J3JPNQAUWJGZFRFCTGAGSBWPWRRF9HRGF9MCX55"; asPublicKey += "QRYGPYMRE6DBJ65SJDX34FVPYWWKWQ48MCKXYXPHQ23BJ42U8ZMDD8CG5"; asPublicKey += "DPHZQ5XTXUKA277XK6PKSTLJ88ZZ9EBXH62REMRZZRGNPKHYM34RW722S"; asPublicKey += "SZHMPFKY7X8UZ19ADGX3UQ7X444XH7MZXEZYW2YLFHR8YL3PTCXVSYX89"; asPublicKey += "ZXN7KW2XNBE8XS3TQRGZVF6KA5USH56NEZYH5RNWBBPVE9LD6H42RQWR5"; asPublicKey += "YVQMT5EQYQTK6YM9V8DA5BJCLGGZ2UGD6NPA2X3SNUS47F7HJBNBCWHRA"; asPublicKey += "YPPCQ5HWCJNPDHUDQMRN2P6PWJFWJ6CLVNK8HXEFLE4ENPXAFN89CRS43"; asPublicKey += "RUMVGDJQCSRB535XYCS6BZYLA9Q6HJV425F26XXHRGA7C8R8BVMELAPEH"; asPublicKey += "5DSA9KXTCV4H2RNVDFHG3YJSERZVFPWHYA823LUBENBL5U3J4LJX2KQLW"; asPublicKey += "L5XGGESPSE2FQWKSQ4NUCDLBEJPQAT2A2477DYS2XEXKLYEAKUN22622C"; asPublicKey += "RLBCAHPFNEV2FJ2H8N3JQGXJRGP19AFHGRW6SS2ZSFYK8EZAPVYL4MCP4"; asPublicKey += "6UMR64Y9T89FHWEPXBRHKWJCSNNNGPU984J5XW4BWTU6PDWPN24W8RU55"; asPublicKey += "A9C3U9H7VHS5PFURASHBT4JAEE5ZKJBSYMCMDVBLU973R72RVPA6U96A2"; asPublicKey += "LX8HMASVST9RVJ7W66V4DYWRDZZQ3673W7C7LVF68TWPLNMYEUQ8FDZRN"; asPublicKey += "P38D9BX5YA3VENETDUUUMR9U7FFP4NZM7G4Y6J6EASK5SAXXTRMZ8F3AH"; asPublicKey += "5FC54E543N739BY5KVZQM7JZWD2P2HPE7BDRMM9JFCGPBWWASTZ7UDNRV"; asPublicKey += "6AFHVMBR9AGAERE9M6W6S2ZT8PBTABPDCKBPPPV6QW9DRXZUGAHDDRRSY"; asPublicKey += "XM4YXQ2QJX6CL33N7RV8846LK8A3DFLDXWZ2NKF8V"; break; } case RM_3072: { asPublicKey = "0201B810DA4A1ADD4351378790A98138533267BJBN6W8SY33Y47RWJHWS385XWRV9TSVSB5EM7ECZYNSJ44ZKSD8KV4"; asPublicKey += "6Y9T6TNC6QMDW4V6DBMADU3YUKLP88TCLEUD9FTEUHGXM6T57AQ2EMB59"; asPublicKey += "UPQVNSUT7Z4EHAMDQ6N77VK2A6P847MMWJH9E7C5XX6FNF6MHGWERPWQV"; asPublicKey += "9ZLVR9Z7X5D5Z2XQL6MBM7BDCT2DEDVRBFNDDBLG6LHZ9APM48LS5TKTJ"; asPublicKey += "AGDYFDRVHEGTDH47PCLL8YJ4ZAWCB59F8BN5PZL3NQACP32G3YNBX5E3J"; asPublicKey += "7S28XLRGAX55ZML5XE6Q68EUAL38VUBJ2MZ2UGCCHM7CE6S99N44X9RMV"; asPublicKey += "7B55HULJ4KHPFYSBDUSPQTCWGS76BEQST2QCZDZ2T4FBA4YUJFF47AACE"; asPublicKey += "A4EEFESEYWN48UZCSDZAMGSU5VB9UJKR2XQUSDFS3TNG9QKURQWS7N5Q3"; asPublicKey += "VPYT4QAGGQ5GW2MMXHDJYW55FQPHSS255GVJ7WLLP85JHS8K6DVTJWB4W"; asPublicKey += "4Y8ZEFF7KP6W74PAA8FVPZVDW4RKGMQ8V56Q6R4V34XFE5HR4FZS8GZ6R"; asPublicKey += "36RKW6WN34S2AHR9LCGF8LULB7ZN6NC2AA5RPDZYGWSPPME6267CGLZCP"; asPublicKey += "GG98W557RXCDWAETJHDCRPUXX7AD3E8SL9WMGBV9QFHMSV9UFV7H9NTX3"; asPublicKey += "QYV95CN9P9DSYQWL35R2BWB4GKW6CTWVB2X6WH3P2WFBE6X55KBLAMDB3"; asPublicKey += "SRDSDVY37GKH78MUHY7KDJDC8SJU5FUQRYZ49ULX3YSZL7E284GFVZSGD"; asPublicKey += "FTTQNR6VMBM3LLR78SUSVMJW88XT2K4UHEATRU3V9MMR2VGNGCY9S6R7M"; asPublicKey += "4ELNPEBBMQP2HVPLY5M5VPA92V7NU8ZZ58YYTW5QK9USZ5LV59UZGB2CF"; asPublicKey += "DPZ6HFYU5WB7UU3UYWVNSNKM3W7GBYKJP8TMFW2YN6GNSSE4ZKFVZRLUT"; asPublicKey += "8QPZBBEQT5H9H5Z53D7QV4AJTKTX4EMW62TDWXQVK24JZPSG2VXKCMYZL"; asPublicKey += "BUASE25R3EEK9KBLJ8VX83ZXGTBL5CCDBY33HJ6FKX8AW3WPRX3XTCS9G"; asPublicKey += "2B9SVK2XFFKNSPGFG6FZNS8P2HERFGFL79DKUZZFWHFH4H9UZ7F7F6W3Z"; asPublicKey += "WN84JRRA7SU8T89EQMRBEPVYMMGLGSUMFWWMEDLJM5EGP5WEX9LDUAQXS"; asPublicKey += "55LKDQVRKX4R8NNBHSYBHSNMFYA2C6KGQQFK3TN267DPSZT3PTKHTLNMU"; asPublicKey += "V2YYZZRX3953LPWAKYF8LJUVMEQT3ZC4F9SWMYGUHG6XX66PJFQWSRUW2"; asPublicKey += "C79YLGZ6ZAFS7HLXBTH55UD3EGFBZQ5CLNJDZTEJACDVBCM5FQBTX4DKK"; asPublicKey += "UDGNSMWWLC5UMQRHW89CTU5636WYDXVZZDAUZ529458LDN2DAR9QADWRZ"; asPublicKey += "UTU8MCKN8ACH3R36YKE52DDF67SM5UDUH7PTATHXE65UCGFRCV49UTF29"; asPublicKey += "BGDSUWGRMC839HUZYQVAG985YUF5KJCAVGKRD8E4YMPJ38KR6HD2KHDGY"; asPublicKey += "PJDMJMN4Y3DTJW5MYX3VUPF32637LMAWFM4QCU7BMP74SCF4N5QXZZVBE"; asPublicKey += "LAQMPYMJC2ZWJ9XFV33YXTTPH3SG9KMUABLL83P7L3UBVM763XJPR5UEH"; asPublicKey += "DZ73XJUGR9QP6299K5PU46XGVWKWFAKWYMRXUSLCFJ3WQTEC6QJH6E5V8"; asPublicKey += "X2RMA5TXGSBEWLGSMNQ2SH6G9MLKK4S486DN4M4QVDTYTM4JQETAJQGP7"; asPublicKey += "6NUR4UNDXR4W4JQSNWDTUGX69SEDC3AL8ZF4TJBQQRXSX2A86UUWCDCFH"; asPublicKey += "JE94A8EP3Q6A2QTYKEE62MV4VJB2AB"; break; } case RM_4096: { asPublicKey = "0201B810DA4A1ADD4351378790A98138533334BN75EUD4LFWYFVNFGBRCEMKKXG62QRBXL8GMHQ975B68FJVEMNXQQ7"; asPublicKey += "RKR7RCZMWDVP86QPB3LR49G9BM7EUUZXNCRZBXRF4PEY3RX6UXT4X286K"; asPublicKey += "WMR7AMEE6QNP9AEHGWJT9AVU3F62F37B5GVX2BQF73QWHRFQSQ6XMRP6M"; asPublicKey += "ZDRQ8JT89UF3YRK5UL34MM3L8HLDTWAJF5YY7MRWJUFDQRK9JNCJ6C9KJ"; asPublicKey += "WRE5ACQSNS24NEAHDYKS3AK75HBCTKP9NR2CSL7Q9PPXM4TF7L37USP77"; asPublicKey += "Z7WER6JY67F7YGKTP6MFRMKK9H8XFPZ9XWKK97XCFXK7AW4TB96WGEH4B"; asPublicKey += "YPF9QRF2DGC3LCHW8VTD2EMHVRDR6EEBUG8R4XYKJPLBPRCJP445DU2BW"; asPublicKey += "JWELKAY45GKDU5HLTTDTWRH2JFKJ7AVAKLPEELN29YHX5JR773P9ERW7N"; asPublicKey += "UFMWDKD4UL4YPU5QW2L4A7ZN3E8ZDQVEZUR6ZRDQXRLQRLUNHVB4XGBWD"; asPublicKey += "HM79NGJARHDBQJCD8NWZCWPBY26QARP7A5S48DCV29F7MUTHU3YAHYVS7"; asPublicKey += "ZPGXJZZA5HBBY4K5BQPUG6MVCBG8H3C7VL8KH9EH58NUVCE6F2CGMSM94"; asPublicKey += "4CQDKNVGWWWRNK4DG26UT88Y9ULUPJ25G9KLTQPK3TBXZEK43X8KPMJT8"; asPublicKey += "DF6MTQ5RB94XR2BT9H9NYYTXL29GF8KZY9QNHAW4LTT2RDQTD2ELWPSV4"; asPublicKey += "4AND9K8G5VKLQ287UBEVHA82CMSMGQQBMNQZVAZ9G8T5TD6G9F7XQHMJT"; asPublicKey += "HCL6PFEDUW5MN9JASF2EKPT2H33325A3SFGGM5C3RYKZSYSSQC5FLHNX9"; asPublicKey += "VHN4HQVWD66YECY4R97JZHQALRTCHXUWH85LSJCCTQZT8JF52FHG6FV9J"; asPublicKey += "UJWEU24K9Z7SKYTYA9NH7GW29FSNKUK3DMFXY48VEYZVDRTTMLFYSJH8B"; asPublicKey += "RQXV72REYGSM6SLX89EVQ52CN9N8YDLWHAWCDDNM89YN2FCRTLE8688XN"; asPublicKey += "F4MZMFE6GP9JK2JTFJVUKBLES2ZVWSBCJE9N3D7DG9LL9Z3U42QFJJPE2"; asPublicKey += "HE5XCRY25UND96R9D7655ZBSCPF796FJZ4GPLY7AMZLGLR77GRP467ELK"; asPublicKey += "PXSZ9ZF8MUYFDHV4EFACPZ79CDFTYW56NE9JDWDVUMNLY9EXDSF8ZNABE"; asPublicKey += "MDQU6T9RVLTNRMZJJ8EJSUM9TV8YA6MNWF2Y66MD3VQ9L662F5X6VE9ZC"; asPublicKey += "PPRTNMEV2DG9BUMFMSL7PUR9H5QG6VVBDBMEU3PLABL57HMSQ5C83E9X8"; asPublicKey += "RTPY4QSEH2H7R2QDJHT5LQSFNQJL2NZ24GLNTFXG468WC5UUTDD68G8HM"; asPublicKey += "477Z8P4F9ZZHUGZ6VPFF32A2MPWY8LPXNECCKM9EEVLDDPUJ8LXN2AE6K"; asPublicKey += "Y2Q42FVBCJM9GQTXNRHBED735KCFD4YGV4U5U3LJD6NJ886W6XQLWH3G7"; asPublicKey += "3VZ6T5YDUQP6DA5ZHLKQSGATDJHUWC2ELTE7QJFXH8H9EAQYZPPMW76JG"; asPublicKey += "Z48UBND9VXFXZMSGBNWQPNQG7E4TCBDMVKUSA9TTVSNLN3DXEZNXH787R"; asPublicKey += "N7XHFBJNZ5W74DUMNBYVHEQDYMZBQCFMS8LGSDUAU6QE9DD5Q334BX62T"; asPublicKey += "JP5WQQDS2ZEWW76XW7VMLX3L7V9UVD7RL297VDBVRFPQ5MYA3YFVBVNVA"; asPublicKey += "R5TJXMQ4X2U2PW6UWSKBXT58HG3QPZM2RVEX2PDMCVJDFTJMXR9NPLW4C"; asPublicKey += "6AE4Q9A8TTAQ68BSN9WWTFFTSX68ECVARFPDBBH5DMP4KYFARTFVCSWNF"; asPublicKey += "FGAPBYYGFJA4MGHEDWTNE54MPGER7EPCZEV2ESJRMM6XDMFGABG97HECN"; asPublicKey += "3SZFUBRKCNDZ2TE9F6EERULRCDAV5EMY6KVY9NY9MYNPP2FQ5WFWLMRYD"; asPublicKey += "4TNYYHE6EDMQ6KK79HH5Q5KBW6DDQYYNUR365W2454CHEZWZAPU82SX4H"; asPublicKey += "KHNZXBRVWAT7G9CJBKHNBPSVEL67X8UJHBFHZH8ZD4NSEVFZM4Y768TJ6"; asPublicKey += "QP3BGEKLTY4UZUWHG63QMKVWAQW9E7WRFNJCH4XRD97JHNKMFUTRFVH68"; asPublicKey += "G5CKSMGC725AZ9CBSL2JX43P4EY44CMF56AJ6BEXVCJP2ZDWCT9G55K4D"; asPublicKey += "F24J7TTJMFXTQH95CBNX67CBPNWEKHCWQV6VD73Y9KCZHNBFUFS8TCYNN"; asPublicKey += "WXRGFKNVRDFUKWHDWDDTSPEW8YCKLPMX2GUV3N4JFJMUE6TSJR6Z53C9F"; asPublicKey += "SKZAY3EN7G66JPBF5E9S6Y7RQHPWZHSRDQ7XH87PHUJFLJFGD7WNE3Q9P"; asPublicKey += "EXMW33LVJBFEUXKNUB6SU7ZYCEX96XT8G27FLUV7XPV4JK64DWDJCX9WV"; asPublicKey += "4VL8CK23FQJ28UG9JUZTQJ3DRL32BTJVRD4LVQ6MK9LCE7ZZP925JK7ZD"; asPublicKey += "92SCV4DDJJ5EXMVBF"; break; } } kv.PublicKey = asPublicKey.c_str(); // Fill key buffer char keybuf[2048]; memset(&keybuf, 0, sizeof(keybuf)); memcpy(&keybuf, mKey->Text.c_str(), mKey->Text.Length()); kv.Key = keybuf; kv.KeyLen = mKey->Text.Length(); // Fill User Info char namebuf[255]; memset(&namebuf, 0, sizeof(namebuf)); memcpy(&namebuf, eUserInfo->Text.c_str(), eUserInfo->Text.Length()); kv.RegInfo = namebuf; kv.RegInfoLen = eUserInfo->Text.Length(); // Hardware ID kv.UseHardwareLocking = cbHardware->Checked; if (kv.UseHardwareLocking) { char hdbuf[255]; memset(&hdbuf, 0, sizeof(hdbuf)); memcpy(&hdbuf, eHardware->Text.c_str(), eHardware->Text.Length()); kv.HardwareID = hdbuf; } // Secure constant (get it from project file)! kv.EncryptedConstant = 2113444489; dwResult = KG_VerifyRegistrationInfo(&kv); AnsiString sresult; if (dwResult == EP_NO_ERROR) { sresult = "Valid registration key!\n"; sresult += Format("Creation date %d/%d/%d\n", ARRAYOFCONST(((int)kv.CreationYear, (int)kv.CreationMonth, (int)kv.CreationDay))); if (kv.UseKeyExpiration) { sresult += Format("Expiration date %d/%d/%d\n", ARRAYOFCONST(((int)kv.ExpirationYear, (int)kv.ExpirationMonth, (int)kv.ExpirationDay))); } if (kv.UseRegisterAfter) { sresult += Format("Register After date %d/%d/%d\n", ARRAYOFCONST(((int)kv.RegisterAfterYear, (int)kv.RegisterAfterMonth, (int)kv.RegisterAfterDay))); } if (kv.UseRegisterBefore) { sresult += Format("Register Before date %d/%d/%d\n", ARRAYOFCONST(((int)kv.RegisterBeforeYear, (int)kv.RegisterBeforeMonth, (int)kv.RegisterBeforeDay))); } if (kv.UseExecutionsLimit) { sresult += Format("Executions %d\n", ARRAYOFCONST(((int)kv.ExecutionsCount))); } if (kv.UseDaysLimit) { sresult += Format("Days %d\n", ARRAYOFCONST(((int)kv.DaysCount))); } if (kv.UseRunTimeLimit) { sresult += Format("Run-time minutes %d\n", ARRAYOFCONST(((int)kv.RunTimeMinutes))); } if (kv.UseGlobalTimeLimit) { sresult += Format("Global Time minutes %d\n", ARRAYOFCONST(((int)kv.GlobalTimeMinutes))); } if (kv.UseCountyLimit) { for (int i = 0; i < ARRAYSIZE(KEY_COUNTRIES); i++) { if (kv.CountryCode == KEY_COUNTRIES[i].Code) { sresult += Format("Country Lock %s\n", ARRAYOFCONST((KEY_COUNTRIES[i].Name))); break; } } } for (int i = 0; i < NUMBER_OF_CRYPTED_SECTIONS; i++) { if (kv.EncryptedSections[i]) { sresult += Format("Unlocked section #%d\n", ARRAYOFCONST((i + 1))); } } } else { switch (dwResult) { case EP_ERROR_UNKNOWN: sresult = "EP_ERROR_UNKNOWN"; break; case EP_ERROR_KEYBUFFEREMPTY: sresult = "EP_ERROR_KEYBUFFEREMPTY"; break; case EP_ERROR_KEYBUFFERISLESS: sresult = "EP_ERROR_KEYBUFFERISLESS"; break; case EP_ERROR_REGINFOEMPTY: sresult = "EP_ERROR_REGINFOEMPTY"; break; case EP_ERROR_REGINFOTOOLARGE: sresult = "EP_ERROR_REGINFOTOOLARGE"; break; case EP_ERROR_PRIVATEKEYISNOTSET: sresult = "EP_ERROR_PRIVATEKEYISNOTSET"; break; case EP_ERROR_PUBLICKEYISNOTSET: sresult = "EP_ERROR_PUBLICKEYISNOTSET"; break; case EP_ERROR_PRIVATEKEYISINVALID: sresult = "EP_ERROR_PRIVATEKEYISINVALID"; break; case EP_ERROR_PUBLICKEYISINVALID: sresult = "EP_ERROR_PUBLICKEYISINVALID"; break; case EP_ERROR_KEYMODEISINVALID: sresult = "EP_ERROR_KEYMODEISINVALID"; break; case EP_ERROR_KEYBASEISINVALID: sresult = "EP_ERROR_KEYBASEISINVALID"; break; case EP_ERROR_CURRENTDATEISINVALID: sresult = "EP_ERROR_CURRENTDATEISINVALID"; break; case EP_ERROR_EXPIRATIONDATEISINVALID: sresult = "EP_ERROR_EXPIRATIONDATEISINVALID"; break; case EP_ERROR_KEYISINVALID: sresult = "EP_ERROR_KEYISINVALID"; break; case EP_ERROR_HARDWAREID: sresult = "EP_ERROR_HARDWAREID"; break; case EP_ERROR_HARDWAREBUFFEREMPTY: sresult = "EP_ERROR_HARDWAREBUFFEREMPTY"; break; case EP_ERROR_HARDWAREIDINVALIDFORKEY: sresult = "EP_ERROR_HARDWAREIDINVALIDFORKEY"; break; case EP_ERROR_PROJECTFILENOTFOUND: sresult = "EP_ERROR_PROJECTFILENOTFOUND"; break; case EP_ERROR_INVALIDPROJECTFILE: sresult = "EP_ERROR_INVALIDPROJECTFILE"; break; case EP_ERROR_EXECUTIONSNUMBERINVALID: mKey->Text = "EP_ERROR_EXECUTIONSNUMBERINVALID"; break; case EP_ERROR_DAYSNUMBERINVALID: mKey->Text = "EP_ERROR_DAYSNUMBERINVALID"; break; case EP_ERROR_COUNTRYCODEINVALID: mKey->Text = "EP_ERROR_COUNTRYCODEINVALID"; break; case EP_ERROR_RUNTIMEINVALID: mKey->Text = "EP_ERROR_RUNTIMEINVALID"; break; case EP_ERROR_GLOBALTIMEINVALID: mKey->Text = "EP_ERROR_GLOBALTIMEINVALID"; break; case EP_ERROR_INSTALLBEFOREINVALID: mKey->Text = "EP_ERROR_INSTALLBEFOREINVALID"; break; case EP_ERROR_INSTALLAFTERINVALID: mKey->Text = "EP_ERROR_INSTALLAFTERINVALID"; break; default: sresult = "Unknown error"; break; } } ShowMessage(sresult); } Show/Hide Visual C++ function example void CKeygenDlg::OnBnClickedButtonver() { // TODO: Add your control notification handler code here TKeyVerifyParams kv; char keybuffer[2048]; char username[255]; char hardwareid[255]; DWORD dwResult; // Clear params buffer memset(&kv, 0, sizeof(kv)); // Clear key buffer memset(&keybuffer, 0, sizeof(keybuffer)); GetDlgItemText(IDC_EDITKEY, (char*)&keybuffer, sizeof(keybuffer)); kv.Key = (char*) keybuffer; kv.KeyLen = strlen(kv.Key); // Fill User Info memset(&username, 0, sizeof(username)); GetDlgItemText(IDC_EDITNAME, (char*)&username, sizeof(username)); kv.RegInfo = (char*)&username; kv.RegInfoLen = strlen(kv.RegInfo); // Hardware ID if (IsDlgButtonChecked(IDC_CHECKHD) != 0) { kv.UseHardwareLocking = true; memset(&hardwareid, 0, sizeof(hardwareid)); GetDlgItemText(IDC_EDITHD, (char*)&hardwareid, sizeof(hardwareid)); kv.HardwareID = (char*)&hardwareid; } kv.KeyMode = com_key_mode.GetCurSel(); kv.KeyBase = com_key_base.GetCurSel(); kv.EncryptedConstant = 2113444489; switch (kv.KeyMode) { case RM_512: { char pl[] = "0201B810DA4A1ADD4351378790A98138533067CP4S86R7D8THS45GBCVUM635EPRQRMYRP3DAA5DUPZ6ABDSFP7F5AC" \ "P7ERGH4A7Y6B6NW6NMMBZF83WVER9Y4MMBNLBQDKR7KFVLGLV067CFDQC" \ "WCHGQVVRN24DECEPBL96YJQJTVDCRTNQG3E4WW4GK4GQ5X5L5H88D3XYH" \ "CBRBNASPD3P5CNYFKFHBCSDHHD6WPTCC4XVSM5S88067C2JSTCMVT48C8" \ "HC7SHKGTFJBM28P6XTBCNWHMV6J6KN6W5Q9TQLVR285U6GVCAAUTZLRTP" \ "SRGDQ742B4742XF4MACRR747YDP5FZZ9D"; kv.PublicKey = pl; break; } case RM_768: { char pl[] = "0201B810DA4A1ADD4351378790A9813853309AEHRR66KMK99UEPX8C54WQFDZQ5Y96WUCVZYMXBC32SJV7T5SBPR54E" \ "2DBH8UD9RNHTJ9BLJV6NHX52W7PZDDTTJDDGF3YFVL7PJFL8RS8THTFDF" \ "4RY7K3QXLTMXMC8DDSRVRWBVMMP3UYKCDDC7KGL9PG509ACPTRQ4MMUKG" \ "DAUJFFFGSCBFLYK9X9E74M58PW5FG9B9RTLXJQ4STPVCHJTEH8BP557VZ" \ "PQYDBUZJXXJNGVZELFL4UL3LHHE8A645CK593DVWCQBSX4ZCCQ3ST8GCZ" \ "LW2729XK3NT7GST3LMQGXSHLDWCXE09AENVX2QTX3VLT6FWB4JND875XZ" \ "WQ26GW76TV3KVVHK7U489LLPBQ39HUWKMA65U3HKWBDHKBZEB525PHEH2" \ "YQHRZGNJAAYZXMWN8RNZ9T7VMZAJMP2V3S9NXZ9RHL96F7AT3NTMN36V4" \ "ACSFEN4DR6TJR95"; kv.PublicKey = pl; break; } case RM_1024: { char pl[] = "0201B810DA4A1ADD4351378790A981385330CDG9YQSEUK2HT546KWW46NHSCHMD2TNCSPVNSKGQC6CHDUSU9CC4LDPL" \ "TD3NLRVD3TFV9BU2SYBUBU9TXKLQ3CTKZE5GN9VFG37R9YNK2FE58K7ZY" \ "WTUJYFSJTBMDLLGA9GJ2LJXGHSS9CESGC2K69H65YQGAC7CRGF5T3CPLA" \ "5BDJZKVCUWPZRNA2DN7L956LZVZBQUDPX6PF30CDBH26Z82VE4QQ8N85L" \ "QHYJYYCJ6WQ89H9K9VVQX925SG5FJ79AGVZB6M8TTFKCJ56FAREP8GSTC" \ "NKWCXEALDP9Y2ZLS9QKZV8JRNDHG9D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UMVGDJQCSRB535XYCS6BZYLA9Q6HJV425F26XXHRGA7C8R8BVMELAPEH" \ "5DSA9KXTCV4H2RNVDFHG3YJSERZVFPWHYA823LUBENBL5U3J4LJX2KQLW" \ "L5XGGESPSE2FQWKSQ4NUCDLBEJPQAT2A2477DYS2XEXKLYEAKUN22622C" \ "RLBCAHPFNEV2FJ2H8N3JQGXJRGP19AFHGRW6SS2ZSFYK8EZAPVYL4MCP4" \ "6UMR64Y9T89FHWEPXBRHKWJCSNNNGPU984J5XW4BWTU6PDWPN24W8RU55" \ "A9C3U9H7VHS5PFURASHBT4JAEE5ZKJBSYMCMDVBLU973R72RVPA6U96A2" \ "LX8HMASVST9RVJ7W66V4DYWRDZZQ3673W7C7LVF68TWPLNMYEUQ8FDZRN" \ "P38D9BX5YA3VENETDUUUMR9U7FFP4NZM7G4Y6J6EASK5SAXXTRMZ8F3AH" \ "5FC54E543N739BY5KVZQM7JZWD2P2HPE7BDRMM9JFCGPBWWASTZ7UDNRV" \ "6AFHVMBR9AGAERE9M6W6S2ZT8PBTABPDCKBPPPV6QW9DRXZUGAHDDRRSY" \ "XM4YXQ2QJX6CL33N7RV8846LK8A3DFLDXWZ2NKF8V"; kv.PublicKey = pl; break; } case RM_3072: { char pl[] = "0201B810DA4A1ADD4351378790A98138533267BJBN6W8SY33Y47RWJHWS385XWRV9TSVSB5EM7ECZYNSJ44ZKSD8KV4" \ "6Y9T6TNC6QMDW4V6DBMADU3YUKLP88TCLEUD9FTEUHGXM6T57AQ2EMB59" \ "UPQVNSUT7Z4EHAMDQ6N77VK2A6P847MMWJH9E7C5XX6FNF6MHGWERPWQV" \ "9ZLVR9Z7X5D5Z2XQL6MBM7BDCT2DEDVRBFNDDBLG6LHZ9APM48LS5TKTJ" \ "AGDYFDRVHEGTDH47PCLL8YJ4ZAWCB59F8BN5PZL3NQACP32G3YNBX5E3J" \ "7S28XLRGAX55ZML5XE6Q68EUAL38VUBJ2MZ2UGCCHM7CE6S99N44X9RMV" \ "7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D3EGFBZQ5CLNJDZTEJACDVBCM5FQBTX4DKK" \ "UDGNSMWWLC5UMQRHW89CTU5636WYDXVZZDAUZ529458LDN2DAR9QADWRZ" \ "UTU8MCKN8ACH3R36YKE52DDF67SM5UDUH7PTATHXE65UCGFRCV49UTF29" \ "BGDSUWGRMC839HUZYQVAG985YUF5KJCAVGKRD8E4YMPJ38KR6HD2KHDGY" \ "PJDMJMN4Y3DTJW5MYX3VUPF32637LMAWFM4QCU7BMP74SCF4N5QXZZVBE" \ "LAQMPYMJC2ZWJ9XFV33YXTTPH3SG9KMUABLL83P7L3UBVM763XJPR5UEH" \ "DZ73XJUGR9QP6299K5PU46XGVWKWFAKWYMRXUSLCFJ3WQTEC6QJH6E5V8" \ "X2RMA5TXGSBEWLGSMNQ2SH6G9MLKK4S486DN4M4QVDTYTM4JQETAJQGP7" \ "6NUR4UNDXR4W4JQSNWDTUGX69SEDC3AL8ZF4TJBQQRXSX2A86UUWCDCFH" \ "JE94A8EP3Q6A2QTYKEE62MV4VJB2AB"; kv.PublicKey = pl; break; } case RM_4096: { char pl[] = "0201B810DA4A1ADD4351378790A98138533334BN75EUD4LFWYFVNFGBRCEMKKXG62QRBXL8GMHQ975B68FJVEMNXQQ7" \ "RKR7RCZMWDVP86QPB3LR49G9BM7EUUZXNCRZBXRF4PEY3RX6UXT4X286K" \ "WMR7AMEE6QNP9AEHGWJT9AVU3F62F37B5GVX2BQF73QWHRFQSQ6XMRP6M" \ "ZDRQ8JT89UF3YRK5UL34MM3L8HLDTWAJF5YY7MRWJUFDQRK9JNCJ6C9KJ" \ "WRE5ACQSNS24NEAHDYKS3AK75HBCTKP9NR2CSL7Q9PPXM4TF7L37USP77" \ "Z7WER6JY67F7YGKTP6MFRMKK9H8XFPZ9XWKK97XCFXK7AW4TB96WGEH4B" \ "YPF9QRF2DGC3LCHW8VTD2EMHVRDR6EEBUG8R4XYKJPLBPRCJP445DU2BW" \ "JWELKAY45GKDU5HLTTDTWRH2JFKJ7AVAKLP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3DRL32BTJVRD4LVQ6MK9LCE7ZZP925JK7ZD" \ "92SCV4DDJJ5EXMVBF"; kv.PublicKey = pl; break; } } // Generate reg. key dwResult = KG_VerifyRegistrationInfo(&kv); if (dwResult == EP_NO_ERROR) { char tmp[255]; // Creation date char mes[2048] = "Valid Registration Key!\n"; sprintf(tmp, "Creation date: %d/%d/%d\n", kv.CreationDay, kv.CreationMonth, kv.CreationYear); strcat(mes, tmp); // Expiration date if (kv.UseKeyExpiration) { sprintf(tmp, "Expiration date: %d/%d/%d\n", kv.ExpirationDay, kv.ExpirationMonth, kv.ExpirationYear); strcat(mes, tmp); } // Register After date if (kv.UseRegisterAfter) { sprintf(tmp, "Register After date: %d/%d/%d\n", kv.RegisterAfterDay, kv.RegisterAfterMonth, kv.RegisterAfterYear); strcat(mes, tmp); } // Register Before date if (kv.UseRegisterBefore) { sprintf(tmp, "Register Before date: %d/%d/%d\n", kv.RegisterBeforeDay, kv.RegisterBeforeMonth, kv.RegisterBeforeYear); strcat(mes, tmp); } // Executions if (kv.UseExecutionsLimit) { sprintf(tmp, "Executions: %d\n", kv.ExecutionsCount); strcat(mes, tmp); } // Days if (kv.UseDaysLimit) { sprintf(tmp, "Days: %d\n", kv.DaysCount); strcat(mes, tmp); } // Run-time if (kv.UseRunTimeLimit) { sprintf(tmp, "Run-time: %d minutes\n", kv.RunTimeMinutes); strcat(mes, tmp); } // Global Time if (kv.UseGlobalTimeLimit) { sprintf(tmp, "Global Time: %d minutes\n", kv.GlobalTimeMinutes); strcat(mes, tmp); } // Country if (kv.UseCountyLimit) { for (int i = 0; i < ARRAYSIZE(KEY_COUNTRIES); i++) { if (kv.CountryCode == KEY_COUNTRIES[i].Code) { sprintf(tmp, "Country Lock: %s\n", KEY_COUNTRIES[i].Name); strcat(mes, tmp); break; } } } for (int i = 0; i < NUMBER_OF_CRYPTED_SECTIONS; i++) { if (kv.EncryptedSections[i]) { sprintf(tmp, "Unlocked section: #%d\n", i + 1); strcat(mes, tmp); } } MessageBox(mes); } else { char* sError; switch (dwResult) { case EP_ERROR_UNKNOWN: sError = "EP_ERROR_UNKNOWN"; break; case EP_ERROR_KEYBUFFEREMPTY: sError = "EP_ERROR_KEYBUFFEREMPTY"; break; case EP_ERROR_KEYBUFFERISLESS: sError = "EP_ERROR_KEYBUFFERISLESS"; break; case EP_ERROR_REGINFOEMPTY: sError = "EP_ERROR_REGINFOEMPTY"; break; case EP_ERROR_REGINFOTOOLARGE: sError = "EP_ERROR_REGINFOTOOLARGE"; break; case EP_ERROR_PRIVATEKEYISNOTSET: sError = "EP_ERROR_PRIVATEKEYISNOTSET"; break; case EP_ERROR_PUBLICKEYISNOTSET: sError = "EP_ERROR_PUBLICKEYISNOTSET"; break; case EP_ERROR_PRIVATEKEYISINVALID: sError = "EP_ERROR_PRIVATEKEYISINVALID"; break; case EP_ERROR_PUBLICKEYISINVALID: sError = "EP_ERROR_PUBLICKEYISINVALID"; break; case EP_ERROR_KEYMODEISINVALID: sError = "EP_ERROR_KEYMODEISINVALID"; break; case EP_ERROR_KEYBASEISINVALID: sError = "EP_ERROR_KEYBASEISINVALID"; break; case EP_ERROR_CURRENTDATEISINVALID: sError = "EP_ERROR_CURRENTDATEISINVALID"; break; case EP_ERROR_EXPIRATIONDATEISINVALID: sError = "EP_ERROR_EXPIRATIONDATEISINVALID"; break; case EP_ERROR_KEYISINVALID: sError = "EP_ERROR_KEYISINVALID"; break; case EP_ERROR_HARDWAREID: sError = "EP_ERROR_HARDWAREID"; break; case EP_ERROR_HARDWAREBUFFEREMPTY: sError = "EP_ERROR_HARDWAREBUFFEREMPTY"; break; case EP_ERROR_HARDWAREIDINVALIDFORKEY: sError = "EP_ERROR_HARDWAREIDINVALIDFORKEY"; break; case EP_ERROR_PROJECTFILENOTFOUND: sError = "EP_ERROR_PROJECTFILENOTFOUND"; break; case EP_ERROR_INVALIDPROJECTFILE: sError = "EP_ERROR_INVALIDPROJECTFILE"; break; case EP_ERROR_EXECUTIONSNUMBERINVALID: sError = "EP_ERROR_EXECUTIONSNUMBERINVALID"; break; case EP_ERROR_DAYSNUMBERINVALID: sError = "EP_ERROR_DAYSNUMBERINVALID"; break; case EP_ERROR_COUNTRYCODEINVALID: sError = "EP_ERROR_COUNTRYCODEINVALID"; break; case EP_ERROR_RUNTIMEINVALID: sError = "EP_ERROR_RUNTIMEINVALID"; break; case EP_ERROR_GLOBALTIMEINVALID: sError = "EP_ERROR_GLOBALTIMEINVALID"; break; case EP_ERROR_INSTALLBEFOREINVALID: sError = "EP_ERROR_INSTALLBEFOREINVALID"; break; case EP_ERROR_INSTALLAFTERINVALID: sError = "EP_ERROR_INSTALLAFTERINVALID"; break; default: sError = "Unknown error"; break; } MessageBox(sError); } } Show/Hide C# (.NET) function example private void btnVerify_Click(object sender, EventArgs e) { if (tbUserInfo.Text == string.Empty) { MessageBox.Show("User info field is empty!"); return; } if (tbUserInfo.Text == string.Empty) { MessageBox.Show("Registration key field is empty!"); return; } Enigma_KeyGen_IDE.TKeyVerifyParams kv = new Enigma_KeyGen_IDE.TKeyVerifyParams(); kv.KeyMode = cbKeyMode.SelectedIndex; kv.KeyBase = cbKeyBase.SelectedIndex; switch (kv.KeyMode) { case Enigma_KeyGen_IDE.RM_512: { kv.PublicKey = "0201B810DA4A1ADD4351378790A98138533067CP4S86R7D8THS45GBCVUM635EPRQRMYRP3DAA5DUPZ6ABDSFP7F5AC" + "P7ERGH4A7Y6B6NW6NMMBZF83WVER9Y4MMBNLBQDKR7KFVLGLV067CFDQC" + "WCHGQVVRN24DECEPBL96YJQJTVDCRTNQG3E4WW4GK4GQ5X5L5H88D3XYH" + "CBRBNASPD3P5CNYFKFHBCSDHHD6WPTCC4XVSM5S88067C2JSTCMVT48C8" + "HC7SHKGTFJBM28P6XTBCNWHMV6J6KN6W5Q9TQLVR285U6GVCAAUTZLRTP" + "SRGDQ742B4742XF4MACRR747YDP5FZZ9D"; break; } case Enigma_KeyGen_IDE.RM_768: { kv.PublicKey = "0201B810DA4A1ADD4351378790A9813853309AEHRR66KMK99UEPX8C54WQFDZQ5Y96WUCVZYMXBC32SJV7T5SBPR54E" + "2DBH8UD9RNHTJ9BLJV6NHX52W7PZDDTTJDDGF3YFVL7PJFL8RS8THTFDF" + "4RY7K3QXLTMXMC8DDSRVRWBVMMP3UYKCDDC7KGL9PG509ACPTRQ4MMUKG" + "DAUJFFFGSCBFLYK9X9E74M58PW5FG9B9RTLXJQ4STPVCHJTEH8BP557VZ" + "PQYDBUZJXXJNGVZELFL4UL3LHHE8A645CK593DVWCQBSX4ZCCQ3ST8GCZ" + "LW2729XK3NT7GST3LMQGXSHLDWCXE09AENVX2QTX3VLT6FWB4JND875XZ" + "WQ26GW76TV3KVVHK7U489LLPBQ39HUWKMA65U3HKWBDHKBZEB525PHEH2" + "YQHRZGNJAAYZXMWN8RNZ9T7VMZAJMP2V3S9NXZ9RHL96F7AT3NTMN36V4" + "ACSFEN4DR6TJR95"; break; } case Enigma_KeyGen_IDE.RM_1024: { kv.PublicKey = "0201B810DA4A1ADD4351378790A981385330CDG9YQSEUK2HT546KWW46NHSCHMD2TNCSPVNSKGQC6CHDUSU9CC4LDPL" + "TD3NLRVD3TFV9BU2SYBUBU9TXKLQ3CTKZE5GN9VFG37R9YNK2FE58K7ZY" + "WTUJYFSJTBMDLLGA9GJ2LJXGHSS9CESGC2K69H65YQGAC7CRGF5T3CPLA" + "5BDJZKVCUWPZRNA2DN7L956LZVZBQUDPX6PF30CDBH26Z82VE4QQ8N85L" + "QHYJYYCJ6WQ89H9K9VVQX925SG5FJ79AGVZB6M8TTFKCJ56FAREP8GSTC" + "NKWCXEALDP9Y2ZLS9QKZV8JRNDHG9D8BRDSCTMDQK9NLAPZ9TGYFS9G7U" + "LXHYJF7F9A89HPXGTU2N4FQQJL98WZ5QND2KTEMMUUZFAX953HCGNSWUW" + "U2M7LBEWZSH9GW5SC0CDJDY2HC4HJYUSVTAVXZ7MYVJWF3CU9WC3SVPSL" + "29WF46DVS2SYKSSAMATPPYGJDE3PBFMGS34CXWQSXKCEAE63L2EXTS9NE" + "2G597XASY3S34XMYST5YZF4THUTYT5DY9UKKXU6PH8MLXRPZMPMMR83JU" + "X2WGNEW8ZGL4SKUCUB8CEAB6UZ4FB66WTP3B64VMX7XG75T4Y35479"; break; } case Enigma_KeyGen_IDE.RM_2048: { kv.PublicKey = "0201B810DA4A1ADD4351378790A98138533199H9KZC4CQ5ZKPEGYDW2EHN5AKZA5G5KP4HU8USWJR8XWW7MCH7244RV" + "PSXFHVU6YQRK4LPUHM497XJYPLLA3DHUZWXK3CB5SUYF75NPYLTNPRUAP" + "CTVDHAKYWTRQ97HES2E59WDN2LJKFYA2K8BGFSBHP4A6BF5FSDTS8NWLL" + "C5NEQ76NJ9BAMWXG55UPFFMRQZTU5KV2G6LSPQUJJWA9U4LJ5SCJ9M9ZQ" + "Z6K7LZA9UAMJ533UQ5J3JPNQAUWJGZFRFCTGAGSBWPWRRF9HRGF9MCX55" + "QRYGPYMRE6DBJ65SJDX34FVPYWWKWQ48MCKXYXPHQ23BJ42U8ZMDD8CG5" + "DPHZQ5XTXUKA277XK6PKSTLJ88ZZ9EBXH62REMRZZRGNPKHYM34RW722S" + "SZHMPFKY7X8UZ19ADGX3UQ7X444XH7MZXEZYW2YLFHR8YL3PTCXVSYX89" + "ZXN7KW2XNBE8XS3TQRGZVF6KA5USH56NEZYH5RNWBBPVE9LD6H42RQWR5" + "YVQMT5EQYQTK6YM9V8DA5BJCLGGZ2UGD6NPA2X3SNUS47F7HJBNBCWHRA" + "YPPCQ5HWCJNPDHUDQMRN2P6PWJFWJ6CLVNK8HXEFLE4ENPXAFN89CRS43" + "RUMVGDJQCSRB535XYCS6BZYLA9Q6HJV425F26XXHRGA7C8R8BVMELAPEH" + "5DSA9KXTCV4H2RNVDFHG3YJSERZVFPWHYA823LUBENBL5U3J4LJX2KQLW" + "L5XGGESPSE2FQWKSQ4NUCDLBEJPQAT2A2477DYS2XEXKLYEAKUN22622C" + "RLBCAHPFNEV2FJ2H8N3JQGXJRGP19AFHGRW6SS2ZSFYK8EZAPVYL4MCP4" + "6UMR64Y9T89FHWEPXBRHKWJCSNNNGPU984J5XW4BWTU6PDWPN24W8RU55" + "A9C3U9H7VHS5PFURASHBT4JAEE5ZKJBSYMCMDVBLU973R72RVPA6U96A2" + "LX8HMASVST9RVJ7W66V4DYWRDZZQ3673W7C7LVF68TWPLNMYEUQ8FDZRN" + "P38D9BX5YA3VENETDUUUMR9U7FFP4NZM7G4Y6J6EASK5SAXXTRMZ8F3AH" + "5FC54E543N739BY5KVZQM7JZWD2P2HPE7BDRMM9JFCGPBWWASTZ7UDNRV" + "6AFHVMBR9AGAERE9M6W6S2ZT8PBTABPDCKBPPPV6QW9DRXZUGAHDDRRSY" + "XM4YXQ2QJX6CL33N7RV8846LK8A3DFLDXWZ2NKF8V"; break; } case Enigma_KeyGen_IDE.RM_3072: { kv.PublicKey = "0201B810DA4A1ADD4351378790A98138533267BJBN6W8SY33Y47RWJHWS385XWRV9TSVSB5EM7ECZYNSJ44ZKSD8KV4" + "6Y9T6TNC6QMDW4V6DBMADU3YUKLP88TCLEUD9FTEUHGXM6T57AQ2EMB59" + "UPQVNSUT7Z4EHAMDQ6N77VK2A6P847MMWJH9E7C5XX6FNF6MHGWERPWQV" + "9ZLVR9Z7X5D5Z2XQL6MBM7BDCT2DEDVRBFNDDBLG6LHZ9APM48LS5TKTJ" + "AGDYFDRVHEGTDH47PCLL8YJ4ZAWCB59F8BN5PZL3NQACP32G3YNBX5E3J" + "7S28XLRGAX55ZML5XE6Q68EUAL38VUBJ2MZ2UGCCHM7CE6S99N44X9RMV" + "7B55HULJ4KHPFYSBDUSPQTCWGS76BEQST2QCZDZ2T4FBA4YUJFF47AACE" + "A4EEFESEYWN48UZCSDZAMGSU5VB9UJKR2XQUSDFS3TNG9QKURQWS7N5Q3" + "VPYT4QAGGQ5GW2MMXHDJYW55FQPHSS255GVJ7WLLP85JHS8K6DVTJWB4W" + "4Y8ZEFF7KP6W74PAA8FVPZVDW4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W5MYX3VUPF32637LMAWFM4QCU7BMP74SCF4N5QXZZVBE" + "LAQMPYMJC2ZWJ9XFV33YXTTPH3SG9KMUABLL83P7L3UBVM763XJPR5UEH" + "DZ73XJUGR9QP6299K5PU46XGVWKWFAKWYMRXUSLCFJ3WQTEC6QJH6E5V8" + "X2RMA5TXGSBEWLGSMNQ2SH6G9MLKK4S486DN4M4QVDTYTM4JQETAJQGP7" + "6NUR4UNDXR4W4JQSNWDTUGX69SEDC3AL8ZF4TJBQQRXSX2A86UUWCDCFH" + "JE94A8EP3Q6A2QTYKEE62MV4VJB2AB"; break; } case Enigma_KeyGen_IDE.RM_4096: { kv.PublicKey = "0201B810DA4A1ADD4351378790A98138533334BN75EUD4LFWYFVNFGBRCEMKKXG62QRBXL8GMHQ975B68FJVEMNXQQ7" + "RKR7RCZMWDVP86QPB3LR49G9BM7EUUZXNCRZBXRF4PEY3RX6UXT4X286K" + "WMR7AMEE6QNP9AEHGWJT9AVU3F62F37B5GVX2BQF73QWHRFQSQ6XMRP6M" + "ZDRQ8JT89UF3YRK5UL34MM3L8HLDTWAJF5YY7MRWJUFDQRK9JNCJ6C9KJ" + "WRE5ACQSNS24NEAHDYKS3AK75HBCTKP9NR2CSL7Q9PPXM4TF7L37USP77" + "Z7WER6JY67F7YGKTP6MFRMKK9H8XFPZ9XWKK97XCFXK7AW4TB96WGEH4B" + "YPF9QRF2DGC3LCHW8VTD2EMHVRDR6EEBUG8R4XYKJPLBPRCJP445DU2BW" + "JWELKAY45GKDU5HLTTDTWRH2JFKJ7AVAKLPEELN29YHX5JR773P9ERW7N" + "UFMWDKD4UL4YPU5QW2L4A7ZN3E8ZDQVEZUR6ZRDQXRLQRLUNHVB4XGBWD" + "HM79NGJARHDBQJCD8NWZCWPBY26QARP7A5S48DCV29F7MUTHU3YAHYVS7" + "ZPGXJZZA5HBBY4K5BQPUG6MVCBG8H3C7VL8KH9EH58NUVCE6F2CGMSM94" + "4CQDKNVGWWWRNK4DG26UT88Y9ULUP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XW7VMLX3L7V9UVD7RL297VDBVRFPQ5MYA3YFVBVNVA" + "R5TJXMQ4X2U2PW6UWSKBXT58HG3QPZM2RVEX2PDMCVJDFTJMXR9NPLW4C" + "6AE4Q9A8TTAQ68BSN9WWTFFTSX68ECVARFPDBBH5DMP4KYFARTFVCSWNF" + "FGAPBYYGFJA4MGHEDWTNE54MPGER7EPCZEV2ESJRMM6XDMFGABG97HECN" + "3SZFUBRKCNDZ2TE9F6EERULRCDAV5EMY6KVY9NY9MYNPP2FQ5WFWLMRYD" + "4TNYYHE6EDMQ6KK79HH5Q5KBW6DDQYYNUR365W2454CHEZWZAPU82SX4H" + "KHNZXBRVWAT7G9CJBKHNBPSVEL67X8UJHBFHZH8ZD4NSEVFZM4Y768TJ6" + "QP3BGEKLTY4UZUWHG63QMKVWAQW9E7WRFNJCH4XRD97JHNKMFUTRFVH68" + "G5CKSMGC725AZ9CBSL2JX43P4EY44CMF56AJ6BEXVCJP2ZDWCT9G55K4D" + "F24J7TTJMFXTQH95CBNX67CBPNWEKHCWQV6VD73Y9KCZHNBFUFS8TCYNN" + "WXRGFKNVRDFUKWHDWDDTSPEW8YCKLPMX2GUV3N4JFJMUE6TSJR6Z53C9F" + "SKZAY3EN7G66JPBF5E9S6Y7RQHPWZHSRDQ7XH87PHUJFLJFGD7WNE3Q9P" + "EXMW33LVJBFEUXKNUB6SU7ZYCEX96XT8G27FLUV7XPV4JK64DWDJCX9WV" + "4VL8CK23FQJ28UG9JUZTQJ3DRL32BTJVRD4LVQ6MK9LCE7ZZP925JK7ZD" + "92SCV4DDJJ5EXMVBF"; break; } } kv.Key = tbKey.Text; kv.KeyLen = tbKey.Text.Length; kv.RegInfo = tbUserInfo.Text; kv.RegInfoLen = tbUserInfo.Text.Length; // Hardware ID kv.UseHardwareLocking = cbHardware.Checked; if (kv.UseHardwareLocking) { kv.HardwareID = tbHardware.Text; } // Secure constant (get it from project file)! kv.EncryptedConstant = 2113444489; // Generate reg. key uint dwResult = Enigma_KeyGen_IDE.KG_VerifyRegistrationInfo(ref kv); string sout = string.Empty; if (dwResult == Enigma_KeyGen_IDE.EP_NO_ERROR) { // sout = "Valid key!\n"; sout = string.Format(sout + "Creation Date: {0}/{1}/{2}\n", kv.CreationDay, kv.CreationMonth, kv.CreationYear); if (kv.UseKeyExpiration) { sout += string.Format("Expiration Date: {0}/{1}/{2}\n", kv.ExpirationDay, kv.ExpirationMonth, kv.ExpirationYear); } if (kv.UseRegisterAfter) { sout += string.Format("Register After: {0}/{1}/{2}\n", kv.RegisterAfterDay, kv.RegisterAfterMonth, kv.RegisterAfterYear); } if (kv.UseRegisterBefore) { sout += string.Format("Register Before: {0}/{1}/{2}\n", kv.RegisterBeforeDay, kv.RegisterBeforeMonth, kv.RegisterBeforeYear); } if (kv.UseCountyLimit) { Enigma_KeyGen_IDE ide = new Enigma_KeyGen_IDE(); foreach (Enigma_KeyGen_IDE.TKeyCountries country in ide.KEY_COUNTRIES) { if (country.Code == kv.CountryCode) { sout += string.Format("Country Lock: {0}\n", country.Name); break; } } } if (kv.UseExecutionsLimit) { sout += string.Format("Executions: {0}\n", kv.ExecutionsCount); } if (kv.UseDaysLimit) { sout += string.Format("Days: {0}\n", kv.DaysCount); } if (kv.UseRunTimeLimit) { sout += string.Format("Runtime: {0}\n", kv.RunTimeMinutes); } if (kv.UseGlobalTimeLimit) { sout += string.Format("Global Time: {0}\n", kv.GlobalTimeMinutes); } for (int i = 0; i < Enigma_KeyGen_IDE.NUMBER_OF_CRYPTED_SECTIONS; i++) { if (Convert.ToBoolean(kv.EncryptedSections[i])) { sout += string.Format("Unlock section: #{0}\n", i + 1); } } } else { switch (dwResult) { case Enigma_KeyGen_IDE.EP_ERROR_UNKNOWN: sout = "EP_ERROR_UNKNOWN"; break; case Enigma_KeyGen_IDE.EP_ERROR_KEYBUFFEREMPTY: sout = "EP_ERROR_KEYBUFFEREMPTY"; break; case Enigma_KeyGen_IDE.EP_ERROR_KEYBUFFERISLESS: sout = "EP_ERROR_KEYBUFFERISLESS"; break; case Enigma_KeyGen_IDE.EP_ERROR_REGINFOEMPTY: sout = "EP_ERROR_REGINFOEMPTY"; break; case Enigma_KeyGen_IDE.EP_ERROR_REGINFOTOOLARGE: sout = "EP_ERROR_REGINFOTOOLARGE"; break; case Enigma_KeyGen_IDE.EP_ERROR_PRIVATEKEYISNOTSET: sout = "EP_ERROR_PRIVATEKEYISNOTSET"; break; case Enigma_KeyGen_IDE.EP_ERROR_PUBLICKEYISNOTSET: sout = "EP_ERROR_PUBLICKEYISNOTSET"; break; case Enigma_KeyGen_IDE.EP_ERROR_PRIVATEKEYISINVALID: sout = "EP_ERROR_PRIVATEKEYISINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_PUBLICKEYISINVALID: sout = "EP_ERROR_PUBLICKEYISINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_KEYMODEISINVALID: sout = "EP_ERROR_KEYMODEISINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_KEYBASEISINVALID: sout = "EP_ERROR_KEYBASEISINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_CURRENTDATEISINVALID: sout = "EP_ERROR_CURRENTDATEISINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_EXPIRATIONDATEISINVALID: sout = "EP_ERROR_EXPIRATIONDATEISINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_KEYISINVALID: sout = "EP_ERROR_KEYISINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_HARDWAREID: sout = "EP_ERROR_HARDWAREID"; break; case Enigma_KeyGen_IDE.EP_ERROR_HARDWAREBUFFEREMPTY: sout = "EP_ERROR_HARDWAREBUFFEREMPTY"; break; case Enigma_KeyGen_IDE.EP_ERROR_HARDWAREIDINVALIDFORKEY: sout = "EP_ERROR_HARDWAREIDINVALIDFORKEY"; break; case Enigma_KeyGen_IDE.EP_ERROR_PROJECTFILENOTFOUND: sout = "EP_ERROR_PROJECTFILENOTFOUND"; break; case Enigma_KeyGen_IDE.EP_ERROR_INVALIDPROJECTFILE: sout = "EP_ERROR_INVALIDPROJECTFILE"; break; case Enigma_KeyGen_IDE.EP_ERROR_EXECUTIONSNUMBERINVALID: tbKey.Text = "EP_ERROR_EXECUTIONSNUMBERINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_DAYSNUMBERINVALID: tbKey.Text = "EP_ERROR_DAYSNUMBERINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_COUNTRYCODEINVALID: tbKey.Text = "EP_ERROR_COUNTRYCODEINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_RUNTIMEINVALID: tbKey.Text = "EP_ERROR_RUNTIMEINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_GLOBALTIMEINVALID: tbKey.Text = "EP_ERROR_GLOBALTIMEINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_INSTALLBEFOREINVALID: tbKey.Text = "EP_ERROR_INSTALLBEFOREINVALID"; break; case Enigma_KeyGen_IDE.EP_ERROR_INSTALLAFTERINVALID: tbKey.Text = "EP_ERROR_INSTALLAFTERINVALID"; break; default: sout = "Unknown error"; break; } } MessageBox.Show(sout); } Show/Hide Visual Basic function example Private Sub btnVerify_Click() Dim kv As TKeyVerifyParams Dim I As Integer Dim dwResult As Long Dim sresult As String If tbUserInfo.Text = vbNullString Then MsgBox "User info field is empty!" Exit Sub End If If tKey.Text = vbNullString Then MsgBox "Key field is empty!" Exit Sub End If ' Key mode kv.KeyMode = cbKeyMode.ListIndex ' Key base kv.KeyBase = cbKeyBase.ListIndex Select Case kv.KeyMode Case RM_512 kv.PublicKey = "0201B810DA4A1ADD4351378790A98138533067CP4S86R7D8THS45GBCVUM635EPRQRMYRP3DAA5DUPZ6ABDSFP7F5AC" & _ "P7ERGH4A7Y6B6NW6NMMBZF83WVER9Y4MMBNLBQDKR7KFVLGLV067CFDQC" & _ "WCHGQVVRN24DECEPBL96YJQJTVDCRTNQG3E4WW4GK4GQ5X5L5H88D3XYH" & _ "CBRBNASPD3P5CNYFKFHBCSDHHD6WPTCC4XVSM5S88067C2JSTCMVT48C8" & _ "HC7SHKGTFJBM28P6XTBCNWHMV6J6KN6W5Q9TQLVR285U6GVCAAUTZLRTP" & _ "SRGDQ742B4742XF4MACRR747YDP5FZZ9D" & vbNullChar Case RM_768 kv.PublicKey = "0201B810DA4A1ADD4351378790A98138533067CP4S86R7D8THS45GBCVUM635EPRQRMYRP3DAA5DUPZ6ABDSFP7F5AC" & _ "P7ERGH4A7Y6B6NW6NMMBZF83WVER9Y4MMBNLBQDKR7KFVLGLV067CFDQC" & _ "WCHGQVVRN24DECEPBL96YJQJTVDCRTNQG3E4WW4GK4GQ5X5L5H88D3XYH" & _ "CBRBNASPD3P5CNYFKFHBCSDHHD6WPTCC4XVSM5S88067C2JSTCMVT48C8" & _ "HC7SHKGTFJBM28P6XTBCNWHMV6J6KN6W5Q9TQLVR285U6GVCAAUTZLRTP" & _ "SRGDQ742B4742XF4MACRR747YDP5FZZ9D" & vbNullChar Case RM_1024 kv.PublicKey = "0201B810DA4A1ADD4351378790A981385330CDG9YQSEUK2HT546KWW46NHSCHMD2TNCSPVNSKGQC6CHDUSU9CC4LDPL" & _ "TD3NLRVD3TFV9BU2SYBUBU9TXKLQ3CTKZE5GN9VFG37R9YNK2FE58K7ZY" & _ "WTUJYFSJTBMDLLGA9GJ2LJXGHSS9CESGC2K69H65YQGAC7CRGF5T3CPLA" & _ "5BDJZKVCUWPZRNA2DN7L956LZVZBQUDPX6PF30CDBH26Z82VE4QQ8N85L" & _ "QHYJYYCJ6WQ89H9K9VVQX925SG5FJ79AGVZB6M8TTFKCJ56FAREP8GSTC" & _ "NKWCXEALDP9Y2ZLS9QKZV8JRNDHG9D8BRDSCTMDQK9NLAPZ9TGYFS9G7U" & _ "LXHYJF7F9A89HPXGTU2N4FQQJL98WZ5QND2KTEMMUUZFAX953HCGNSWUW" & _ "U2M7LBEWZSH9GW5SC0CDJDY2HC4HJYUSVTAVXZ7MYVJWF3CU9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4NUCDLBEJPQAT2A2477DYS2XEXKLYEAKUN22622C" & _ "RLBCAHPFNEV2FJ2H8N3JQGXJRGP19AFHGRW6SS2ZSFYK8EZAPVYL4MCP4" & _ "6UMR64Y9T89FHWEPXBRHKWJCSNNNGPU984J5XW4BWTU6PDWPN24W8RU55" & _ "A9C3U9H7VHS5PFURASHBT4JAEE5ZKJBSYMCMDVBLU973R72RVPA6U96A2" & _ "LX8HMASVST9RVJ7W66V4DYWRDZZQ3673W7C7LVF68TWPLNMYEUQ8FDZRN" & _ "P38D9BX5YA3VENETDUUUMR9U7FFP4NZM7G4Y6J6EASK5SAXXTRMZ8F3AH" & _ "5FC54E543N739BY5KVZQM7JZWD2P2HPE7BDRMM9JFCGPBWWASTZ7UDNRV" & _ "6AFHVMBR9AGAERE9M6W6S2ZT8PBTABPDCKBPPPV6QW9DRXZUGAHDDRRSY" & _ "XM4YXQ2QJX6CL33N7RV8846LK8A3DFLDXWZ2NKF8V" & vbNullChar Case RM_3072 kv.PublicKey = "0201B810DA4A1ADD4351378790A98138533267BJBN6W8SY33Y47RWJHWS385XWRV9TSVSB5EM7ECZYNSJ44ZKSD8KV4" & _ "6Y9T6TNC6QMDW4V6DBMADU3YUKLP88TCLEUD9FTEUHGXM6T57AQ2EMB59" & _ "UPQVNSUT7Z4EHAMDQ6N77VK2A6P847MMWJH9E7C5XX6FNF6MHGWERPWQV" & _ "9ZLVR9Z7X5D5Z2XQL6MBM7BDCT2DEDVRBFNDDBLG6LHZ9APM48LS5TKTJ" & _ "AGDYFDRVHEGTDH47PCLL8YJ4ZAWCB59F8BN5PZL3NQACP32G3YNBX5E3J" & _ "7S28XLRGAX55ZML5XE6Q68EUAL38VUBJ2MZ2UGCCHM7CE6S99N44X9RMV" & _ "7B55HULJ4KHPFYSBDUSPQTCWGS76BEQST2QCZDZ2T4FBA4YUJFF47AACE" & _ "A4EEFESEYWN48UZCSDZAMGSU5VB9UJKR2XQUSDFS3TNG9QKURQWS7N5Q3" & _ "VPYT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WRZ" & _ "UTU8MCKN8ACH3R36YKE52DDF67SM5UDUH7PTATHXE65UCGFRCV49UTF29" & _ "BGDSUWGRMC839HUZYQVAG985YUF5KJCAVGKRD8E4YMPJ38KR6HD2KHDGY" & _ "PJDMJMN4Y3DTJW5MYX3VUPF32637LMAWFM4QCU7BMP74SCF4N5QXZZVBE" & _ "LAQMPYMJC2ZWJ9XFV33YXTTPH3SG9KMUABLL83P7L3UBVM763XJPR5UEH" & _ "DZ73XJUGR9QP6299K5PU46XGVWKWFAKWYMRXUSLCFJ3WQTEC6QJH6E5V8" & _ "X2RMA5TXGSBEWLGSMNQ2SH6G9MLKK4S486DN4M4QVDTYTM4JQETAJQGP7" & _ "6NUR4UNDXR4W4JQSNWDTUGX69SEDC3AL8ZF4TJBQQRXSX2A86UUWCDCFH" & _ "JE94A8EP3Q6A2QTYKEE62MV4VJB2AB" & vbNullChar Case RM_4096 kv.PublicKey = "0201B810DA4A1ADD4351378790A98138533334BN75EUD4LFWYFVNFGBRCEMKKXG62QRBXL8GMHQ975B68FJVEMNXQQ7" & _ "RKR7RCZMWDVP86QPB3LR49G9BM7EUUZXNCRZBXRF4PEY3RX6UXT4X286K" & _ "WMR7AMEE6QNP9AEHGWJT9AVU3F62F37B5GVX2BQF73QWHRFQSQ6XMRP6M" & _ "ZDRQ8JT89UF3YRK5UL34MM3L8HLDTWAJF5YY7MRWJUFDQRK9JNCJ6C9KJ" & _ "WRE5ACQSNS24NEAHDYKS3AK75HBCTKP9NR2CSL7Q9PPXM4TF7L37USP77" & _ "Z7WER6JY67F7YGKTP6MFRMKK9H8XFPZ9XWKK97XCFXK7AW4TB96WGEH4B" & _ "YPF9QRF2DGC3LCHW8VTD2EMHVRDR6EEBUG8R4XYKJPLBPRCJP445DU2BW" & _ "JWELKAY45GKDU5HLTTDTWRH2JFKJ7AVAKLPEELN29YHX5JR773P9ERW7N" & _ "UFMWDKD4UL4YPU5QW2L4A7ZN3E8ZDQVEZUR6ZRDQXRLQRLUNHVB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ZZP925JK7ZD" & _ "92SCV4DDJJ5EXMVBF" & vbNullChar End Select ' Fill key buffer kv.Key = tKey.Text kv.KeyLen = Len(tKey.Text) ' Fill User Info buffer kv.RegInfo = tbUserInfo.Text kv.RegInfoLen = Len(tbUserInfo.Text) ' Hardware ID kv.UseHardwareLocking = cbHardware.Value If kv.UseHardwareLocking Then kv.HardwareID = tbHardware.Text End If kv.EncryptedConstant = 2113444489 ' Verify reg. key dwResult = KG_VerifyRegistrationInfo(kv) If dwResult = ERROR_OK Then sresult = "Key is valid!" & Chr$(13) sresult = sresult & "Key creation date: " & Str$(kv.CreationDay) & "/" & Str$(kv.CreationMonth) & "/" & Str$(kv.CreationYear) & Chr$(13) If kv.UseKeyExpiration Then sresult = sresult & "Key expiration date: " & Str$(kv.ExpirationDay) & "/" & Str$(kv.ExpirationMonth) & "/" & Str$(kv.ExpirationYear) & Chr$(13) End If If kv.UseRegisterAfter Then sresult = sresult & "Register After date: " & Str$(kv.RegisterAfterDay) & "/" & Str$(kv.RegisterAfterMonth) & "/" & Str$(kv.RegisterAfterYear) & Chr$(13) End If If kv.UseRegisterBefore Then sresult = sresult & "Register Before date: " & Str$(kv.RegisterBeforeDay) & "/" & Str$(kv.RegisterBeforeMonth) & "/" & Str$(kv.RegisterBeforeYear) & Chr$(13) End If If kv.UseExecutionsLimit Then sresult = sresult & "Executions: " & Str$(kv.ExecutionsCount) & Chr$(13) End If If kv.UseDaysLimit Then sresult = sresult & "Days: " & Str$(kv.DaysCount) & Chr$(13) End If If kv.UseRunTimeLimit Then sresult = sresult & "Runtime: " & Str$(kv.RunTimeMinutes) & Chr$(13) End If If kv.UseGlobalTimeLimit Then sresult = sresult & "Global Time: " & Str$(kv.GlobalTimeMinutes) & Chr$(13) End If If kv.UseCountyLimit Then For I = 0 To comCountries.ListCount - 1 If comCountries.ItemData(I) = kv.CountryCode Then sresult = sresult & "Country Lock: " & comCountries.List(I) & Chr$(13) End If Next I End If For I = 1 To NUMBER_OF_CRYPTED_SECTIONS If kv.EncryptedSections(I - 1) = 1 Then sresult = sresult & "Unlock section #" & Str$(I) & Chr$(13) End If Next I Else Select Case dwResult Case EP_ERROR_UNKNOWN sresult = "EP_ERROR_UNKNOWN" Case EP_ERROR_KEYBUFFEREMPTY sresult = "EP_ERROR_KEYBUFFEREMPTY" Case EP_ERROR_KEYBUFFERISLESS sresult = "EP_ERROR_KEYBUFFERISLESS" Case EP_ERROR_REGINFOEMPTY sresult = "EP_ERROR_REGINFOEMPTY" Case EP_ERROR_REGINFOTOOLARGE sresult = "EP_ERROR_REGINFOTOOLARGE" Case EP_ERROR_PRIVATEKEYISNOTSET sresult = "EP_ERROR_PRIVATEKEYISNOTSET" Case EP_ERROR_PUBLICKEYISNOTSET sresult = "EP_ERROR_PUBLICKEYISNOTSET" Case EP_ERROR_PRIVATEKEYISINVALID sresult = "EP_ERROR_PRIVATEKEYISINVALID" Case EP_ERROR_PUBLICKEYISINVALID sresult = "EP_ERROR_PUBLICKEYISINVALID" Case EP_ERROR_KEYMODEISINVALID sresult = "EP_ERROR_KEYMODEISINVALID" Case EP_ERROR_KEYBASEISINVALID sresult = "EP_ERROR_KEYBASEISINVALID" Case EP_ERROR_CURRENTDATEISINVALID sresult = "EP_ERROR_CURRENTDATEISINVALID" Case EP_ERROR_EXPIRATIONDATEISINVALID sresult = "EP_ERROR_EXPIRATIONDATEISINVALID" Case EP_ERROR_KEYISINVALID sresult = "EP_ERROR_KEYISINVALID" Case EP_ERROR_HARDWAREID sresult = "EP_ERROR_HARDWAREID" Case EP_ERROR_HARDWAREBUFFEREMPTY sresult = "EP_ERROR_HARDWAREBUFFEREMPTY" Case EP_ERROR_HARDWAREIDINVALIDFORKEY sresult = "EP_ERROR_HARDWAREIDINVALIDFORKEY" Case EP_ERROR_PROJECTFILENOTFOUND sresult = "EP_ERROR_PROJECTFILENOTFOUND" Case EP_ERROR_INVALIDPROJECTFILE sresult = "EP_ERROR_INVALIDPROJECTFILE" Case EP_ERROR_EXECUTIONSNUMBERINVALID tKey.Text = "EP_ERROR_EXECUTIONSNUMBERINVALID" Case EP_ERROR_DAYSNUMBERINVALID tKey.Text = "EP_ERROR_DAYSNUMBERINVALID" Case EP_ERROR_COUNTRYCODEINVALID tKey.Text = "EP_ERROR_COUNTRYCODEINVALID" Case EP_ERROR_RUNTIMEINVALID tKey.Text = "EP_ERROR_RUNTIMEINVALID" Case EP_ERROR_GLOBALTIMEINVALID tKey.Text = "EP_ERROR_GLOBALTIMEINVALID" Case EP_ERROR_INSTALLBEFOREINVALID tKey.Text = "EP_ERROR_INSTALLBEFOREINVALID" Case EP_ERROR_INSTALLAFTERINVALID tKey.Text = "EP_ERROR_INSTALLAFTERINVALID" Case Else sresult = "Unknown error" End Select End If MsgBox sresult End Sub See function examples in the installation folder, Examples\Keygen subfolder. |
The Enigma Protector in - China https://enigmaprotector.cn - India https://enigmaprotector.in
Copyright © 2004-2024, The Enigma Protector Developers Team. All rights reserved.