KeyGen Delphi Example creating incorrect keys

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

KeyGen Delphi Example creating incorrect keys

Post by MrLot »

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: 19
Joined: Sun Feb 17, 2019 8:21 am

Re: KeyGen Delphi Example creating incorrect keys

Post by MrLot »

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: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: KeyGen Delphi Example creating incorrect keys

Post by Admin »

Code: Select all

si.pHardwareID := PAnsiChar(AnsiString(RichEdit1.Text));
MrLot
Posts: 19
Joined: Sun Feb 17, 2019 8:21 am

Re: KeyGen Delphi Example creating incorrect keys

Post by MrLot »

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


Never mind, changed pHardwareID : PAnsiChar;

It works now. Thanks.
Post Reply