Page 1 of 1

Software opens without HWID in Serial

Posted: Sun Feb 17, 2019 8:28 am
by MrLot
I cannot for the life of me get my application to only accept HWID-locked serial numbers.
At the moment I can create a license without a serial number field and the program just opens.

I want to get my protected program HWID locked. I'm using Delphi and I don't see any example codes on how to accomplish this.

I appreciate the support. Thank you.

Re: Software opens without HWID in Serial

Posted: Sun Feb 17, 2019 12:30 pm
by Admin
Look at our examples from C:\Users\Public\Documents\VMProtect\Licensing\Delphi

Re: Software opens without HWID in Serial

Posted: Tue Feb 19, 2019 6:33 pm
by MrLot
I used exact example found in that folder but it still does not lock to HWID.
You can create a license without a HWID and the program will open.
If you create a license with the wrong HWID that doesn't match the machine you are on, it also opens.

It's reading machine HWID correctly and putting it to string 'buf' to 'HWID'.
It reads license correctly. I'm not sure what I'm missing here.

Re: Software opens without HWID in Serial

Posted: Wed Feb 20, 2019 2:46 am
by Admin
I used exact example found in that folder but it still does not lock to HWID.
It seems you still don't understand how our licensing system works. VMProtect doesn't do it automatically. You have to use VMProtectSetSerialNUmber for checking a serial number at the start of your application something like this:

Code: Select all

program Project2;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils, Classes, VMProtectSDK;

var
  FileName: String;
  Lines: TStringList;
  I, SerialState: Integer;
  Serial: AnsiString;
begin
  Serial:='';
  FileName:=ExtractFilePath(ParamStr(0))+'serial.key';
  if FileExists(FileName) then
   begin
     Lines:=TStringList.Create;
     Lines.LoadFromFile(FileName);
     for I:=0 to Lines.Count-1 do
      Serial:=Serial+AnsiString(Lines[I]);
     Lines.Free;
   end;
  if (Serial = '') then
   begin
     Writeln('ERROR: Serial number not foud');
     exit;
   end;
  SerialState := VMProtectSetSerialNumber(PAnsiChar(Serial));
  if (SerialState <> SERIAL_STATE_SUCCESS) then
   begin
     Writeln('ERROR: VMProtectSetSerialNumber returns ' + IntToStr(SerialState));
     exit;
   end;
  Writeln('Hello world!');
end.

Re: Software opens without HWID in Serial

Posted: Wed Feb 20, 2019 5:03 am
by MrLot
I have it setting the serial number by reading a text file in the same folder. That’s not the problem. It reads serial number fine and will open when it’s the correct one, but it fails to actually lock to the HWID. I could set HWID incorrectly in license and program will still open.

Re: Software opens without HWID in Serial

Posted: Wed Feb 20, 2019 7:41 am
by Admin
I don't understand what is "set HWID incorrectly. Is this HWID from other computer?

P.S. I attached my example with my HWID in a license. Try to execute Project2.vmp.exe on your computer.

Re: Software opens without HWID in Serial

Posted: Thu Feb 21, 2019 1:05 am
by MrLot
Sorry I didn't explain well. It does appear the program is indeed checking the HWID to see if it matches or not, but if I create a serial number without HWID the program still opens. I want it to require a HWID in the serial number in order to open.

Meaning if a serial number is created without a HWID it should be seen as invalid and the program should not open.

Re: Software opens without HWID in Serial

Posted: Thu Feb 21, 2019 3:42 am
by Admin
Meaning if a serial number is created without a HWID it should be seen as invalid and the program should not open.
I don't see any problem - just always make serial numbers with HWID :))

Re: Software opens without HWID in Serial

Posted: Thu Feb 21, 2019 4:19 am
by MrLot
Someone could strip HWID out of license and make program no longer locked to machine. That defeats the purpose. There should be a way to force SDK to verify serial number with HWID included as GOOD STATE and serial number without HWID as BAD STATE. It's too easy to take the serial numbers apart and create an unlocked version.

Re: Software opens without HWID in Serial

Posted: Thu Feb 21, 2019 4:39 am
by Admin
Someone could strip HWID out of license and make program no longer locked to machine.
Could you explain us how it's possible?