HardwareID example does not work

Post here messages if you have any problems with working of Enigma Protector
Post Reply
dwilbourn
Posts: 14
Joined: Wed Jul 01, 2009 10:11 am

HardwareID example does not work

Post by dwilbourn »

I have been trying to test the HardwareID locking and cannot make it work. I am using the Delphi program from Examples. I changed pChar to pAnsiChar (for D2009). I compiled then protected the program, ran it and entered a Username. I then copied the Username and Hardware ID to the Key Generator. This made a Key which I copied back to the program. However this reports the registration information is incorrect.

What am I doing wrong?

I think it might help if the EP_RegCheckAndSaveKey function could return something more than just '0' for an error. A range of negative numbers for different error reasons would make debugging much easier!

David.
Enigma
Site Admin
Posts: 2945
Joined: Wed Aug 20, 2008 2:24 pm

Re: HardwareID example does not work

Post by Enigma »

Hi David,

D2009 problem is not only in conversation from PChar to PAnsiChar. When you set name and key to key check routine, you have to covert Edit.Text (TCaption) to AnsiString firstly, and then AnsiString to PAnsiChar.
For example,
if EP_RegCheckAndSaveKey(PAnsiChar(AnsiString(Name.Text)), PAnsiChar(AnsiString(Key.Text))) then
begin
end;

Attached are repaired sources of Delphi examples HardwareID, KeyExpiration, Registration, they are working well with D2009.

Regards
Vladimir
Attachments
Registration.zip
(15.35 KiB) Downloaded 1372 times
KeyExpiration.zip
(15.18 KiB) Downloaded 1393 times
HardwareID.zip
(16.11 KiB) Downloaded 1445 times
dwilbourn
Posts: 14
Joined: Wed Jul 01, 2009 10:11 am

Re: HardwareID example does not work

Post by dwilbourn »

Hi Vladimir,

When did "string" get so complicated :shock:

Thanks for the information, it works now.

David.
dwilbourn
Posts: 14
Joined: Wed Jul 01, 2009 10:11 am

Re: HardwareID example does not work

Post by dwilbourn »

Vladimir,

I spoke too soon. The example works OK but I still can't get my program to work. I even tried using the example form inside my program and that does not work. I think something inside my program must be changing the way PChar & Ansi are used, but I have no idea what. Can you suggest anything that might help track down the problem?

David.
Enigma
Site Admin
Posts: 2945
Joined: Wed Aug 20, 2008 2:24 pm

Re: HardwareID example does not work

Post by Enigma »

David, not sure, but some people, what asked something similar, did very simple mistake, they used old enigma_ide.pas. The old means the enigma_ide.pas where all string pointers were in pchar, not in PAnsiChar as it is now. Just be sure that you are using enigma_ide.pas from the latest version.

Also, where could be a problem, be sure that the project file, with that you protect file and generate a key is the same.

If this does not help, just email me your project, sources/compiled but not protected exe, at support@enigmaprotector.com and I will check it out!

Regards
Vladimir
dwilbourn
Posts: 14
Joined: Wed Jul 01, 2009 10:11 am

Re: HardwareID example does not work

Post by dwilbourn »

Hi Vladimir,

The wrong enigma_ide.pas would have been too easy (but very possible :roll: ) - I checked and I only have one version - the new one.

The project is a full commercial app so I will have to strip it down to almost nothing before I can send it. That will take a while. Perhaps I will find what is causing the problem while I do that.

David.
Enigma
Site Admin
Posts: 2945
Joined: Wed Aug 20, 2008 2:24 pm

Re: HardwareID example does not work

Post by Enigma »

David, problem is solved :)
Could you please write here your mistake, to avoid mistaking of other people?

Thanks
Vladimir
Post Reply