AVLock Pro v3.1 (c) Alcides Valega, 2004
Table of contents
What is New in v3.1?
*
The LoadLangList method has been added. This allows you an ease way to
implement multilanguage applications. Please see the demo2 sample.
* Some minor bugs has been fixed.
WHAT IS AVLOCK PRO?
AVLock Pro is a Delphi component which allow you to convert any application into a time limited trial in a very ease way.
Drop an AVLock Pro component onto your main form, add one line of code to your current project and enjoy your program converted into a fully featured trial application.
AVLockPro is a full featured product, this has been carefully designed with a modern and nice look and a highly customizable interface.
You can to place your own logo into the registration form,
You can to configure the standatd registration form through the AllowConfig, AllowModules, ShowProgress and Days BeforeWarning properties.
Make your own registration interface.
OrderCode generated by the user include embeded into all data needed to calculate the Registration Key.
The standard interface of AVLock Pro allow you to define your own customized messages for several special status.
Congratulations message while the trial period, Warning for shortly expiration and Message for expired application.
The standard interface of AVLock Pro allow you to define three different ways to sell your program: Online registration, Via email and By Post.
Registrations can be done in permanent way (for ever) or Temporary (time limited). Permanent is for selling and temporary for rent your software.
Include the KeyGen utility by generation of Registration and Unregister to remove registrations.
You can chose between two different versions of Avlock Gold.
Standard edition (without sources).
This include pack's for D4, D5, D6 and D7 versions of Delphi. The KeyGen and Unregister utilities and demo applications. This package is very similar to the freeware one with the only difference that the ad image on the registration form has been removed and you have the rigth of use it on commercial applications.
Direct order link
https://secure.element5.com/shareit/checkout.html?productid=209900&language=English
Developer edition (all souces included).
This include all from the standard version plus the sources for the AVLockPro component and sources for the KeyGen and Unregister utilities.
Direct order link
https://secure.element5.com/shareit/checkout.html?productid=209901&language=English
AVLock Lite v2.0 (Delphi 4,5,6,7)
Free edition:
Download from delphipages
http://www.delphipages.com/edit/count.cfm?ID=2756&E=917
Standard edition: (without sources). This include pack's for 4, 5, 6 and 7 versions of Delphi. The KeyGen and Unregister utilities and demo applications. This package is very similar to the freeware one with the only difference that the ad image on the registration form has been removed and you have the rigth of use it on commercial applications.
Direct order link
https://secure.element5.com/shareit/checkout.html?productid=174347&language=English
Developer edition: (all souces included). This have all included on the standard version plus the sources for the AVLock Lite component, the KeyGen and Unregister utilities.
Direct order link
https://secure.element5.com/shareit/checkout.html?productid=174348&language=English
AVLock Pro v2.4.1 (Delphi 4,5,6,7)
Free version:
Download from delphipages
http://www.delphipages.com/edit/count.cfm?ID=3684&E=1737
Commercial version: (without sources). This include pack's for 4, 5, 6 and 7 versions of Delphi. The KeyGen and Unregister utilities and demo applications. This package is very similar to the freeware one with the only difference that the ad image on the registration form has been removed and you have the rigth of use it on commercial applications.
Direct order link
https://secure.element5.com/shareit/checkout.html?productid=200930&language=English
Full pack with sources: (all souces included). This have all included on the standard version plus the sources for the AVLock Pro component, the KeyGen and Unregister utilities.
Direct order link
https://secure.element5.com/shareit/checkout.html?productid=200931&language=English
If you have any question about these components please email us to alcidesvalega@ciudad.com.ar
How to install AVLock Pro
The way to install AVLockPro is the common procedure to install any other component. Simply you must follow these four steps:
1. Unzip the zip file for the component into a given folder.
2. From your Delphi IDE open the AVLock3ProD(x).dpk package.
3. If you get the message "This package appears to be in an older format. Would you like to convert it to the new format?" then reply No.
4. Press the install button. Wait for the Delphi message "The following new commponent(s) have been registered:. . ."
5. Review your Library Path into the Tools|Environment Options|Library tab. Here you should to have one entry (only one) pointing to the folder where you unziped the component. If you don´t have this entry then create it manually. If you have more than one entry for AVLockPro, then remove the wrong ones.
Design time Properties
AllowBackDate Type: boolean.
When this value is True then the user is able to set back the system date to reuse an expired period, otherwise the application become expired when the user set back the system date.
AllowConfig Type: boolean.
When this value is True then the section "Configure your registration" is displayed in the auxiliary form. So, the user is able to configure his Order Code with three diferent kind of registrations: For ever, Time limited and Free Trial..
AllowModules Type: boolean.
When this value is True then is displayed in the Registration Form the corresponding sections "Allowed Modules" and in the auxiliary form the section entitled "Enter the modules you want to register". So, the user is able to configure his Order Code including in it the selected modules he want to register.
AppID Type: word.
Numeric value to identify the application. The default value is 123456789 but you should to assign a different value for each application. In basis to this number is calculated the value for the ProgID property which correspond to the registry key where is saved the registration data. Besides, this number is used as a key in the encryption algorithm.
AppName Type: string.
Name assigned to your application. This appear on the title bar of the registration windows.
Company Type: string.
Name of your company. This is used in the auxiliary form in the option "Print an order Form"
DaysBeforeWarning Type: byte.
This is the number of days before expiration, from where you want to show the TextWarning message. The default value is 15.
EmailAddress Type: string.
Email address used by users to send you the purchase information.
Logo Type: TBitmap.
This property allow you to place your own logo on the registration form.
MachineSources Type: set of (Bios_SN, CPU_ID, HD_SN, Random_Number).
This property allow you to choose from where the MachineCode property will get its value. The sources may be chosen (one or more) between these ones: Bios_SN (The serial Number from the Bios), CPU_ID (a code from the CPU), HD_SN (The Hard Disk Serial Number) and RandomNumber (a random number generated the first time the app runs and stored into the Windows registry).
Module(x)Text Type: string.
There are eight properties, from Module1Text to Module8Text to save the names of the modules that you want to manage. Only fill the used modules. The modules that you leave without text will be ignored.
Name Type: TComponentName.
Inherited from TComponent.
PostalAddress Type: string.
Your Postal Address. This is used in the auxiliary form in the option "Print an order Form"
RegistryRootKey Type: (CURRENT_USER, LOCAL_MACHINE).
This property allows you to select the appropriate registry rootkey to store the registration data.
RequestWay Type: set of (Via_Email, On_Line, Order_Form).
This property allow you to include into the auxiliary form the selling method more suitable to your needs. The options can be:
Via_Email: Show a link with the prompt "Send us an email to request your RegKey"
If the user click in this link, automatically will be generated and sended to the vendor (EmailAddress property) an email with the following data: Program Name, Order code, User name, Company, Postal address and Email address.
On_Line: Show a link with the prompt "Get your RegKey from our web site"
If the user click in this link, automatically will be opened the default web browser in the site indicated in the WebSite property.
Order_Form: Show a link with the prompt "Print an order form". If the user click in this link, then will be printed with the default printer an order form with the following data: Program Name, Order code, User name, Company, Postal address, Email address and some other lines to be filled later by the user as well as Order amount and Payment way.
ShowProgress Type: Boolean.
ShowProgress: If true then will be displayed into the registration form a progress bar with the position of the current date in the authorized period between the initial and final dates.
Tag Type: longint.
Inherited from TComponent.
TrialBeginDate Type: TDate.
Date to start the trial period. Only applicable when the TrialMode property is tmAbsolute.
TrialDays Type: word.
Number of days for the initial trial period. default 30.
TrialMode Type: (tmAbsolute, tmRelative, tmNone).
This property define the kind of trial that will be generated, its values can be:
tmAbsolute: the trial will start with the date of the TrialBeginDate property.
tmRelative: the trial will start with the current system date.
tmNone: the trial will not start automatically.
This property determines the type of trial that will be generated when the program run by first time. If you chose tmAbsolute, the trial will begin with the date of the TrialBeginDate property, but if you chose tmRelative, the trial will begin with the current system date. TmRelative is more flexible and suitable but tmAbsolute and tmNone are more safely and can not be easily cracked.
The more secure way is with the tmNone value, then, the first time the user runs the app this becomes expired and show in the regform a special welcome message to invite the user to request your free trial period. Please see the Hacking Cautions section.
WebSite Type: string.
Put here your WebSite link. This is used in the auxiliary form in the Request way option "From our Web Site".
Run-Time properties
BeginDate Type: boolean.
Date from where started the current authorized period.
Days Type: word.
Number of days for the current authorized period.
EndDate Type: date.
Date where finish the authorized period.
Expired Type: boolean.
When it is True, this mean that trial/authorized period was expired.
FirstTime Type: boolean.
When it is True, this mean the app is running at first time in that computer.
MachineCode Type: string; Length: 8.
Hexadecimal Strig Value. When your application runs on the user PCs, AVLock Pro calculate a hexadecimal number called MachineCode, distinct one for each PC and calculated from several sources (see MachineSources property). This code is embeded into the OrderCode property which must be sent to you from the users so you can generate with the KeyGen utility the appropriate RegKeys for your users.
Mods Type: array[1..8] of boolean.
This property is an array of eight boolean values, one for each module, the values is true when the module is allowed.
OrderCode Type: string; Length: 19. Format: XXXX-XXXX-XXXX-XXXX
This is an alphanumeric code make up with four segments of four characters each and separated by hyphens.
This code contain embeder into several values:
Hexadecimal Strig Value. When your application runs on the user PCs, AVLock Pro calculate a hexadecimal number called MachineCode, distinct one for each PC and calculated from several sources (see MachineSources property). This code is embeded into the OrderCode property which must be sent to you from the users so you can generate with the KeyGen utility the appropriate RegKeys for your users.
ProgID Type: string.
This property holds the registry key calculated in basis to the AppID to store the registration data.
RegKey Type: string.
The RegKey. Saved in Windows registry.
Status Type: byte.
The Status of the application. This can be:
0: TRIAL
The app is in the trial period.
1: AUTHORIZED
The app is registered in temporary way (time limited).
2: REGISTERED
The app is definitely registered (for ever).
Text properties Type: string.
These properties whose values coming from the avlockPro.res file allow you to customize most text messages in the component, . The most proper way to assign values to these properties is changing the resource file. However, you can to modify its values at run time in your program, for example: PromptCompany :='Organization';
Below, a list of these properties with its default values coming from the english res file.
Property Default Value
TextRegStatus 'Registration status'
TextStatus0 'TRIAL'
TextStatus1 'AUTHORIZED'
TextStatus2 'REGISTERED'
TextModules 'Registered modules'
TextBeforeExpire 'Trial period remaining days: '
TextAfterExpire 'Trial period expired'
TextInstallCode 'Install code:'
TextRegisterNow 'To register now'
TextRegisterNow1 'Click here to get your RegKey'
TextRegisterNow2 'Enter your RegKey, then press the [Register] button'
TextEnterRegKey 'Enter the Registration Key, then click the [Register] button'
TextBtnRegister 'Register'
TextBtnCancel 'Cancel'
TextBtnContinue 'Continue >>'
TextSuccessful 'Registration successful'
TextInvalidRegKey 'Invalid Registration Key'
TextWarning 'Warning! This program will be expiring shortly. If you want to continue using it please renew your registration.'
TextCongratulation 'Congratulations!!! You are in the trial period of MyPROOGRAM, enjoy it!'
TextRequestTrial 'To start with your free trial period please request your Registration Key.'
TextExpired 'Trial period expired! If you want to continue using this program please register it.'
TextEnterName 'Please enter your full user name and company then press [continue >>]'
TextUserName 'User name:'
TextCompany 'Company:'
TextEnterUserData 'Enter your user data'
TextEmailAddress 'Email address:'
TextPostalAddress 'Postal address:'
TExtEnterModules 'Enter the modules you want to register'
TextConfigure 'Configure your registration'
TextForEver 'ForEver'
TextTimeLimited 'Time limited'
TextFreeTrial 'Free trial'
TextDaysToRegister 'Days to register'
TextStartingFrom 'Starting from'
TextRequestRegKey 'Request your RegKey'
TextSendEmail 'Send us an email to request your RegKey'
TextGetFromWebSite 'Get your RegKey from our website'
TextPrintOrderForm 'Print an Order Form'
TextOtherwise 'Otherwise send us the following'
TextOrderCode 'Order code:'
TextProgramName 'Program Name'
TextOrderAmount 'Order amount: $_______.__'
TextPaymentWay 'Paiment way: [ ]Cash, [ ]Check, [ ]Wire transfer.'
TextSendMe 'Please send me a copy of your Program:'
TxtMods Type: TTxtMods = array [1..8] of string;
This property is an array of eight string values with the names of the modules, equivalent to the Module(x)Text properties.
UserCompany Type: string.
The User Company. Saved in the Windows registry.
UserName Type: string.
The User Name. Saved in the Windows registry.
Methods
Check procedure Check;
This method have the following two lines:
readkey;
if expired then application.terminate;
To avoid some hacking chances, call this method in some often called routines. See the "legend" procedure into the Demo3 program.
Decode function decode(a:dword;mc,RKey:string;var dat,day,modul:word;var mcode:string):integer;
This method decrypt a given and return its fields into several output parameters, then compare this fields with the given ones in the input parameters then return a error code if anyone does not match.
Input parameters:
rkey is the RegKey and the a and mc values are given to compare it with the existing ones into the RegKey.
rkey : the registration key.
a : input application id. Set this value to 0 if you don't want to check this field.
mc : input machine code. Set this value to '' if you don't want to check this field.
output parameters:
These values are fields extracted from the .
dat :
day :
modul : byte with the flags for the modules (equivalent to eight boolean values)
mcode : The
returned value:
This function cheks the values passed as parameters and retun the following integer values:
0: No error
1: Key length mismath
2: Machine code mismatch
3: Validation error
4: AppID mismatch
EraseReg function EraseReg(App:dword):boolean;
This method erases the registration data into the registry for the given App application, therefore the next time the application executes this becomes trial.
Execute procedure Execute;
This method is intended to make all functions needed to convert your program into a trial time limited application. When the app run by first time onto the user computer generates and register a trial regkey (that is accomplished by the MakeTrial procedure), the generated regkey is configured according the , and TrialMode properties.
This procedure check the registration status; if the application is not registered yet then bring up the Registration Form allowing to the user the instance of register your application, if the status is expired then the continue button is disabled so the user is forced to register or cancel the application. For more details about how to use it see the Demo1 and Demo2 applications.
MakeTrial procedure MakeTrial;
This method automatically generates and register a trial registration key which establish the trial period. MakeTrial only is invoked when the firsttime property is true. For more details about how to use it see the Demo3 application.
DoExecute function DoExecute: boolean;
This method show the built-in registration form. You can call it to invoque the registration form in any location of your application. The Execute method call it to show the registration form. This function return true if the user press the Continue button or successfully register a Registration Key. For more details about how to use it see the Demo1 and Demo2 applications.
ReadKey procedure ReadKey;
This method read the registration data from the Windows registry and put its values into the properties of the component.
These are the properties whose values are assigned by ReadKey:
For an sample about how to use this method please see the Demo3.
WriteLastDate procedure WriteLastDate;
This method write the last system date into the registry. This procedure is called for the Execute method to keep track of the last date reached for the application, so when the user set back the system date and the property is false then the application become expired. For more details about how to use it see the Demo3 application.
GenKey function GenKey(AAppID:dword;AMCode:string; ADays:word; ABegindate:tdate; AModules:byte):string;
This function generates a RegKey with the values passed through of his parameters as follow:
AAppID: The Application ID.
AMCode: The Machine code.
ADays: Number of days of the trial/authorized period.
ABeginDate: Date from where start the trial/authorized period.
AModules: a byte with the flags for the eigth modules (equivalent to eight boolean values).
Used in the MakeTrial method and in the KeyGen utility.
Hacking cautions
About the TrialMode property configuration
Now at the new version 4.3 you can to choose the tmNone option from the TrialMode property.
1. TrialMode=tmRelative
Normally, for massive distribution of inexpensive applications, you might wish to use the tmRelative option for the TrialMode property. It is very suitable and give you a reasonable level of security against the common user meddlings, but doesn't provide a good level of security against advanced hackers. At this way, the first time the user runs the app the trial period automatically start in the current system date, immediately the app is in the first day of the trial period. For the next runs the trial status remains unchanged.
To implement this behavior it is needed to store data in any place in the hard disk, normally the registry or an ini file, or any other location in the HD. This is the weak side of this method, since anyone may to find this location and delete this data and get the trial period in the starting point again, the first day of the trial period. In order to avoid this threat, in the current version 4.3 I have added the tmNone option for the TrialMode property.
2. TrialMode=tmNone
The better way to avoid the above mentioned peril is with the tmNone option in the TrialMode property. Then, the first time the user runs the app, this become expired. No problem, it is a very good opportunity to contact to the new user and request him valuable information in return for a free registration period (equivalent to the trial period). Ask from the user his registration data (InstallCode or Username) and send to him the registration key for an evaluation period. You eventually may to implement an online registration method with php code to automatically generate the RegKey for this initial trial period and collect information from the users.
Now, when anyone deletes the registration data, the application returns to his original status, expired.
Hacking utilities
With the "Resource Hacker" utility* and similar ones it is quite easy to hack any normal exe file compiled with Delphi since all published properties from any component may be easily changed, any event manager deleted and any response to buttons changed. To avoid anyone use this way to crack your application, you can take the following cautions:
1. Don't use the event manager by events like oncreate or onshow to set properties or call the execute procedure, instead locate it into the project (dpr file). See the Demo2 application.
2. Leave unchanged all properties from the AVLockPro component at design time, instead assign it into the dpr file. Is very convenient to assign here a different value than 123456789 (the default value). See the Demo2 application.
3. Insert into some often called routines the following line:
AVLock3Pro1.check;4. Compress your final exe file with any exe compressor like UPX* or AsPack*.
Take a look to the *.dpr file for Demo3 to see how to apply this method.
See the AVLockPro section inserted between the application.createform and Application.Run lines.
program Project1; //Aplicacion Demo
uses
Forms,sysutils,avlockPro, //sysutils and avlockPro added
Unit2 in 'Unit2.pas' {Form1};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
//******* AVLockPro section ***********
with form1 do begin
avlock3pro1.allowbackdate:=False;
avlock3pro1.AppID := 123456783;
avlock3pro1.TrialDays := 30;
if not MyExecute(false) then application.terminate;
setmodules;
end;
//**************************************
Application.Run;
end.
* ReSource Hacker is a freeware utility copyright © 1999-2002 Angus Jhonson. UPX is a freeware utility copyright © 1996-2001 Markus Oberhumer & Laszlo Molnar, and AsPack is a shareware utility copyright © 1998-1999 Alexey Solodovnikov.
If you have any questions not answered by this help file, please don't hesitate to email me to .
AVLOCK GOLD SOFTWARE LICENSE AGREEMENT
BEFORE PROCEEDING WITH THE INSTALLATION AND/OR USE OF THIS SOFTWARE, CAREFULLY READ THE FOLLOWING TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT AND LIMITED WARRANTY (The "Agreement").
BY INSTALLING OR USING THIS SOFTWARE YOU INDICATE YOUR ACCEPTANCE OF THIS AGREEMENT. IF YOU DO NOT ACCEPT OR AGREE WITH THESE TERMS, YOU MAY NOT INSTALL OR USE THIS SOFTWARE !
LICENSE
AVLock Gold Software, including documentation, source code, object code and/or additional materials (the "Software") is owned by Alcides Valega (the "Author"). This Agreement does not provide you with title or ownership of Product, but only a right of limited use as outlined in this license agreement. Software author hereby grant you a non-exclusive, royalty free license to use the Software.
REDISTRIBUTION RIGHTS
You are granted a non-exclusive, royalty-free right to reproduce and redistribute executable files created using the Software (the "Executable Code") in conjunction with software products that you develop and/or market (the "Applications").
LIMITED WARRANTY
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PRODUCT IS WITH YOU. SHOULD THE PRODUCT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING OR ERROR CORRECTION.
THE AUTHOR OF AVLock Gold DO NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR FREE.
________________________________________________________
If you have any questions regarding this agreement, or you have any comments, suggestions or bug-reports, please forward it to: alcidesvalega@ciudad.com.ar
Author : Alcides Valega
Address : Santa Cruz 1468, 3400-Corrientes, Argentina
E-mail : alcidesvalega@ciudad.com.ar
URL : http://www.avsoft.sitio.net