KeyGen Delphi Example creating incorrect keys

Issues related to VMProtect
MrLot
Posts: 18
Joined: Sun Feb 17, 2019 8:21 am

KeyGen Delphi Example creating incorrect keys

Postby MrLot » Thu Feb 21, 2019 4:28 am

Hello,

I have one last question. I'm having a problem getting my keygen program written in Delphi to create the correct keys.
I exported info from project and placed in program, I specify HWID and Name and attempt to run code. It creates a license but it's never a valid license, it seems like it's short a few chars of a working license made with VMProtect. Any ideas what I may be doing wrong?


I basically took the example found in the keygen folder for Delphi and used the KeyGen.dll found in Lib folder.

MrLot
Posts: 18
Joined: Sun Feb 17, 2019 8:21 am

Re: KeyGen Delphi Example creating incorrect keys

Postby MrLot » Thu Feb 21, 2019 5:55 am

Ok I fixed the issue with generating license, I forgot a dispose statement.

However, I have

Code: Select all

si.flags := HAS_USER_NAME or HAS_HARDWARE_ID;
si.pUserName := (PWideChar(Edit1.Text));
si.pHardwareID := (PWideChar(RichEdit1.Text));
pBuf := nil;
res := VMProtectGenerateSerialNumber(@pi, @si, @pBuf);


but only the user name is being placed in license and not the HWID. What's wrong?

Admin
Site Admin
Posts: 1919
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: KeyGen Delphi Example creating incorrect keys

Postby Admin » Thu Feb 21, 2019 7:41 am

Code: Select all

si.pHardwareID := PAnsiChar(AnsiString(RichEdit1.Text));

MrLot
Posts: 18
Joined: Sun Feb 17, 2019 8:21 am

Re: KeyGen Delphi Example creating incorrect keys

Postby MrLot » Thu Feb 21, 2019 8:05 am

I get error on compile using that.
E2010 Incompatible types: ‘PWideChar’ and ‘PAnsiChar’


Never mind, changed pHardwareID : PAnsiChar;

It works now. Thanks.