Software opens without HWID in Serial

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

Software opens without HWID in Serial

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

Re: Software opens without HWID in Serial

Post by Admin »

Look at our examples from C:\Users\Public\Documents\VMProtect\Licensing\Delphi
MrLot
Posts: 19
Joined: Sun Feb 17, 2019 8:21 am

Re: Software opens without HWID in Serial

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

Re: Software opens without HWID in Serial

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

Re: Software opens without HWID in Serial

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

Re: Software opens without HWID in Serial

Post 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.
Attachments
Project2.zip
(4.91 MiB) Downloaded 527 times
MrLot
Posts: 19
Joined: Sun Feb 17, 2019 8:21 am

Re: Software opens without HWID in Serial

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

Re: Software opens without HWID in Serial

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

Re: Software opens without HWID in Serial

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

Re: Software opens without HWID in Serial

Post 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?
Post Reply