Delphi License Problem

Issues related to VMProtect
robbie84
Posts: 10
Joined: Sun Aug 29, 2010 12:05 pm

Re: Delphi License Problem

Post by robbie84 »

Admin wrote:
so when I press that button I get error unless valid serial is provided.
When I press the button in your application - I have this message:
---------------------------
TestApp.vmp.exe
---------------------------
Protected code succesfully executed
---------------------------
ОК
---------------------------

Where you see the error message - I don`t understand.
Read the post carefully.
I don't see any error message. I get "Protected code succesfully executed" when I click the button which is not common sense since valid key needs to be inputted so when yo press the button, THEN you get "Protected code succesfully executed". If Memo is empty or key invalid, user should get ERROR message saying "Invalid key bla bla bla).

Then how to make that when you click that button:

Code: Select all

if(serial==invalid)
displaymessage "Wrong Serial"
else if (serial==valid)
displaymessage "Registered!"
Please I really need this, because when I created my test app (with 1 procedure), I can't register it because every time I click the button, disabled features become enabled. So please if you can help me here. It is 5-10min work MAX. I really need this so I can see options on how to implement it. Just to this:

Create Blank Delphi Form and leave it empty.
Add Menu to Form and Edit it. For example -

Code: Select all

make 3 master menus, every master has 2 childs and every child has 1 baby.
In a nutshell, I need to disable 3 master menus for unregistered. After key is entered it all unlocks. As you see this is 5min of work so please help me :)
And if you have other advices about Menus, please say :). And also, please send me complete source so I can see what have you done.

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

Re: Delphi License Problem

Post by Admin »

I've already written that before to ask - check the help of VMProtect. But I don`t understand why you don`t want to do it.

There is the source from help file ("The software licensing system - Example of usage - Step #2: Add license checking code"):

Code: Select all

#include <windows.h>
#include <stdio.h>
#include "VMProtectSDK.h"

int main(int argc, char **argv)
{
	char *serial = "X-serial-number";

	int res = VMProtectSetSerialNumber(serial);
	printf("res = 0x%08X\n", res);

	if (res)
	{
		printf("please register!\n");
		return 0;
	}
	printf("We are registered.\n");
	return 0;
}
P.S. "Licensing module API":
VMProtectSetSerialNumber
Function passes serial number to the licensing module. Full specification follows:

INT __stdcall VMProtectSetSerialNumber(const char *SerialNumber);
Parameter SerialNumber should contain text string with serial number generated by the License Manager or by standalone generator. Serial number is base-64-encoded string, terminated by '\0'. Function returns set of bit flags, like the VMProtectGetSerialNumberState() does. Flags show if serial number is correct or invalid and describe why. If serial number is correct, function returns 0.


VMProtectGetSerialNumberState
Function returns state of serial number, set by VMProtectSetSerialNumber() call. Full specification is simple:

INT __stdcall VMProtectGetSerialNumberState();
If at least one bit of returned value is set - key is invalid and application should terminate or fall back to the demo mode. Below is a description of possible flags:

Flag Value Description
SERIAL_STATE_FLAG_CORRUPTED 0x00000001 - Licensing module is corrupted. This may be caused by cracking attempts. Usually you will never get this flag.
SERIAL_STATE_FLAG_INVALID 0x00000002 - Serial number is invalid. You will get this flag if licensing module will be unable to decrypt serial number of if the serial number is not yet set or it is empty.
SERIAL_STATE_FLAG_BLACKLISTED - 0x00000004 Serial number is correct, but it was blacklisted in the License Manager.
SERIAL_STATE_FLAG_DATE_EXPIRED - 0x00000008 Serial number is expired. You will get this flag if serial number has expiration date chunk and this date is in the past. You may read the expiration date by calling VMProtectGetSerialNumberData() function.
SERIAL_STATE_FLAG_RUNNING_TIME_OVER - 0x00000010 Running time limit for this session is over. You may read limit value by calling VMProtectGetSerialNumberData() function.
SERIAL_STATE_FLAG_BAD_HWID - 0x00000020 Serial number is locked to another hardware identifier.
SERIAL_STATE_FLAG_MAX_BUILD_EXPIRED - 0x00000040 Serial number will not work with this version of application, because it has "Max Build Date" block and the application was build after those date. You may read maximal build date by calling VMProtectGetSerialNumberData() function.
robbie84
Posts: 10
Joined: Sun Aug 29, 2010 12:05 pm

Re: Delphi License Problem

Post by robbie84 »

I checked the Help file :) Read it all. But there is only C++ code in the License Example. I was working on C++ with Help.

But ok, I'll figure it out for Delphi.

Thanks.
ouiouioui
Posts: 3
Joined: Thu Dec 17, 2009 4:56 pm
Contact:

Re: Delphi License Problem

Post by ouiouioui »

Hello, this is a sample in Delphi. Demontrate one way you can enter code, enable full menu, show state of the program.

Read in help - introduction - protection recommendations
it's in Delphi.
Attachments
vmptest.zip
(1.94 KiB) Downloaded 1125 times
Post Reply