KeyGen Delphi Example creating incorrect keys

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.

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

However, I have

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?

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

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


Never mind, changed pHardwareID : PAnsiChar;

It works now. Thanks.