Any questions? Ask us: support@enigmaprotector.com

Can't compile KeyGen 64 Project

x64 version issues

Can't compile KeyGen 64 Project

Postby samsonite131 » Tue Nov 19, 2013 3:26 pm

Hello,
I'm trying to compile the KeyGen Example project (VCx64) for 64-bit, however, I'm getting linker errors:

Code: Select all
1>------ Build started: Project: keygen, Configuration: Release_x64 x64 ------
1>Linking...
1>keygenDlg.obj : error LNK2001: unresolved external symbol __imp_KG_GenerateRegistrationKeyFromProject
1>keygenDlg.obj : error LNK2001: unresolved external symbol __imp_KG_VerifyRegistrationInfo
1>keygenDlg.obj : error LNK2001: unresolved external symbol __imp_KG_GenerateRegistrationKey
1>keygenDlg.obj : error LNK2001: unresolved external symbol __imp_KG_VerifyRegistrationInfoFromProject
1>keygen_64.exe : fatal error LNK1120: 4 unresolved externals


keygen64.lib is included. I checked it many times. I even copied all SDK library files directly
to project folder. Still didn't work.

Note that the KeyGen project (VCx64) is not initially setup as a 64-bit project.
I had to create a new x64 configuration and also add _WIN64 to the Preprocessor Definitions.
I'm compiling the project under Microsoft VS 2008, x64 Release mode.

OS: Windows 7 Professional, 64-bit.
Enigma Protector 64, v3.150 Demo

Any suggestions?
Last edited by samsonite131 on Wed Nov 20, 2013 12:49 pm, edited 1 time in total.
samsonite131
 
Posts: 30
Joined: Tue Oct 15, 2013 10:35 pm

Re: Can't compile KeyGen 64 Project

Postby samsonite131 » Wed Nov 20, 2013 12:49 pm

I can run and compile the 32-bit keygen version with no problems.
But, that doesn't do me much good, as I can only use 64-bit programs with Enigma Protector 64.
So, I must use a 64-bit keygen. So, why doesn't it compile?
samsonite131
 
Posts: 30
Joined: Tue Oct 15, 2013 10:35 pm

Re: Can't compile KeyGen 64 Project

Postby Enigma » Wed Nov 20, 2013 2:31 pm

Hi samsonite131,

Please replace this file with the one that x64 keygen uses and it will compile well.

By the way, you may use any version of keys generator because both 32 bit and 64 bit will return same registration keys. Keys generated by 32 bit keygen will be accepted by both Enigma Protector x86 and x64, and same for 64 bit keys generator.
Attachments
enigma_keygen_ide64.zip
(4.36 KiB) Downloaded 637 times
Enigma
Site Admin
 
Posts: 2199
Joined: Wed Aug 20, 2008 2:24 pm

Re: Can't compile KeyGen 64 Project

Postby samsonite131 » Wed Nov 20, 2013 10:26 pm

Thanks for the help, it's working now. But that's strange, I have created my own custom DLLs in the past, and I have always surrounded my exported DLL functions with extern "C", as habit.

By the way, you may use any version of keys generator because both 32 bit and 64 bit will return same registration keys. Keys generated by 32 bit keygen will be accepted by both Enigma Protector x86 and x64, and same for 64 bit keys generator.


I was thinking about that too. If I generate registration keys from my webserver, then I will have to upload a 32-bit or 64-bit keygen DLL. My webserver uses ASP.NET. I have used 32-bit DLLs before, but I have not tested whether uploading a 64-bit DLL to the bin directory will work. But, I was assuming 32-bit and 64-bit DLLs can work side-by-side on a ASP.NET webserver? Does that sound correct?
samsonite131
 
Posts: 30
Joined: Tue Oct 15, 2013 10:35 pm

Re: Can't compile KeyGen 64 Project

Postby Enigma » Thu Nov 21, 2013 7:09 am

samsonite131 wrote:Thanks for the help, it's working now. But that's strange, I have created my own custom DLLs in the past, and I have always surrounded my exported DLL functions with extern "C", as habit.


Same here.. Moreover, this file was made specially, and we were able to compile it in the past. No ideas why it stopped to work. Probably because we've used VS2005 to create it initially.

samsonite131 wrote:I was thinking about that too. If I generate registration keys from my webserver, then I will have to upload a 32-bit or 64-bit keygen DLL. My webserver uses ASP.NET. I have used 32-bit DLLs before, but I have not tested whether uploading a 64-bit DLL to the bin directory will work. But, I was assuming 32-bit and 64-bit DLLs can work side-by-side on a ASP.NET webserver? Does that sound correct?


This depends how your site is configured and what is the server configuration. For example, if on your server is installed Windows x86, then of course you can't use 64 bit keys generator. If the server's Windows is x64, then you may use 64 bit keys generator, but only if the option "Allow 32 bit applications" is not set in the site properties.
Enigma
Site Admin
 
Posts: 2199
Joined: Wed Aug 20, 2008 2:24 pm

Re: Can't compile KeyGen 64 Project

Postby samsonite131 » Thu Nov 21, 2013 8:12 am

Thanks, I have a new problem. I was able to compile the Keygen VCx64 example, protect it, and run it.
However, when I click on the "Generate" button, I get EP_ERROR_HARDWAREID.

If I uncheck the HardwareID box, I get EP_ERROR_PRIVATEKEYISINVALID.

However, these two buttons work:
Generate From Project
Verify From Project

The program is protected and I am entering a valid hardware ID that I got from the "HardwareID" SDK example.

BTW, I noticed you can create a keygen from the Enimga program, "Tools -> Export Key generator".
The Generate and Verify buttons work for the exported keygen, but not for my compiled keygen.

Perhaps am I getting these errors because the demo is limited to the default project?
samsonite131
 
Posts: 30
Joined: Tue Oct 15, 2013 10:35 pm

Re: Can't compile KeyGen 64 Project

Postby Enigma » Thu Nov 21, 2013 9:08 am

samsonite131 wrote:I was able to compile the Keygen VCx64 example, protect it, and run it.


Sorry, not understand why do you need to protect the keys generator? It is used to generate keys for existing program, why do you want to protect it?

samsonite131 wrote:I get EP_ERROR_HARDWAREID.


This error appears when you try to generate a key with Hardware ID locking, but you did not enter the Hardware ID. You should retrieve Hardware ID from protected program first.

samsonite131 wrote:If I uncheck the HardwareID box, I get EP_ERROR_PRIVATEKEYISINVALID.


Yes, for keys generator you have to set up private and public keys. Take these keys from Enigma Protector project file, open it in protector and take the keys from Registration Features - Common panel.

samsonite131 wrote:However, these two buttons work:Generate From ProjectVerify From Project


Sure, these buttons extract private and public keys from project file automatically. Check functions description.
Enigma
Site Admin
 
Posts: 2199
Joined: Wed Aug 20, 2008 2:24 pm

Re: Can't compile KeyGen 64 Project

Postby samsonite131 » Thu Nov 21, 2013 8:13 pm

I protected the keygen because I thought that was the reason why I was getting the EP_ERROR_HARDWAREID error message. But, it's good to know it's not needed.

I did enter a valid HWID from my protected program. And the Hardware ID field is checked.

I see that the keygen is already setting public/private keys:
Code: Select all
      kp.PublicKey = pl;
      kp.PrivateKey = pr;


I changed nothing, because the keygen values already match my demo project.

I cannot generate new public/private keys, because the demo is limited to the default project?
Last edited by samsonite131 on Fri Dec 13, 2013 7:20 pm, edited 1 time in total.
samsonite131
 
Posts: 30
Joined: Tue Oct 15, 2013 10:35 pm

Re: Can't compile KeyGen 64 Project

Postby samsonite131 » Sat Nov 23, 2013 5:40 am

My Enimga project private/public keys are identical to the keygen private/public keys.

But, I still get an error when clicking on the Generate button.
I didn't have to change anything. They were already identical to the demo project.

Encryption constant is also identical. No change.
Last edited by samsonite131 on Fri Dec 13, 2013 7:20 pm, edited 1 time in total.
samsonite131
 
Posts: 30
Joined: Tue Oct 15, 2013 10:35 pm

Re: Can't compile KeyGen 64 Project

Postby samsonite131 » Tue Nov 26, 2013 11:02 pm

Are you saying this is user error? If so, then how would I fix it?
What am I doing wrong?
samsonite131
 
Posts: 30
Joined: Tue Oct 15, 2013 10:35 pm

Next

Return to Enigma Protector x64

Who is online

Users browsing this forum: No registered users and 5 guests