Page 2 of 2

Re: TKeyGenParams passing Key as Empty

Posted: Mon Dec 10, 2018 11:46 am
by Enigma
Also, try the following: rebuild the exe file, then run it directly from explorer (not from Visual Studio). Would be result the same?

I do not understand where the caption "Press any key..." comes from in your example?

Re: TKeyGenParams passing Key as Empty

Posted: Mon Dec 10, 2018 12:12 pm
by Riski1588
Running from explorer is exactly the same.

The "Press any key" comes from Console.ReadKey()

Enabling Native DLL debugger I get the same exception as posted before:
Exception thrown at 0x0000000110003751 (keygen64.dll) in Test.exe: 0xC0000005: Access violation writing location 0x00000000D0F2985D.

Re: TKeyGenParams passing Key as Empty

Posted: Mon Dec 10, 2018 12:41 pm
by Enigma
We reproduced the problem on Windows 10, strange that other versions of Windows are not affected this issue.

Will keep you informed.

Re: TKeyGenParams passing Key as Empty

Posted: Mon Dec 10, 2018 12:45 pm
by Riski1588
Perfect! Thought I was going insane! Thanks.

Re: TKeyGenParams passing Key as Empty

Posted: Mon Dec 10, 2018 1:43 pm
by Enigma
Thank you for the point to the very interesting problem!

We have found and fix that, thank you again.

Please use attached keygen64.dll The problem was affected x64 version of keygen only.

Re: TKeyGenParams passing Key as Empty

Posted: Wed Dec 12, 2018 10:05 pm
by Riski1588
Thank you, whilst it does generate a registration key, the registration key appears to be invalid.

I've attached the CS files which show the problem and the enigma project.

The key generated in the test expires 15/12/2018 and is:
23744433232486285326311775417563147131225363221371456433345685872422125487824721568683778161436667557721742178

Re: TKeyGenParams passing Key as Empty

Posted: Thu Dec 13, 2018 12:02 pm
by Riski1588
I noticed that when I was generating the KeyGenParams, I wasn't adding in the encrypted constant, so I've now added that in. I added in UseKeyExpiration (as somehow I missed that as well).

I've attached the updated code, funnily enough, the registration key outputted is still incorrect :(

Re: TKeyGenParams passing Key as Empty

Posted: Thu Dec 13, 2018 1:32 pm
by Enigma
Riski1588 wrote: Thu Dec 13, 2018 12:02 pm 've attached the updated code, funnily enough, the registration key outputted is still incorrect
In your project file you have the option Registration Features - Common - Uncode enabled.

If so, the function KG_GenerateRegistrationKeyW should be used instead.
KG_GenerateRegistrationKey that you use is the same as KG_GenerateRegistrationKeyA and used for non-Unicode projects.

Re: TKeyGenParams passing Key as Empty

Posted: Thu Dec 13, 2018 1:56 pm
by Riski1588
Enigma wrote: Thu Dec 13, 2018 1:32 pm In your project file you have the option Registration Features - Common - Uncode enabled.
Wow, something as simple as that. Cheers Enigma and great support as always.

Re: TKeyGenParams passing Key as Empty

Posted: Thu Dec 13, 2018 2:23 pm
by Enigma
Glad to help! :)