diff --git a/components/onguard/docs/Help/Delphi/ONGUARD.GID b/components/onguard/docs/Help/Delphi/ONGUARD.GID
new file mode 100644
index 000000000..8c3b84098
Binary files /dev/null and b/components/onguard/docs/Help/Delphi/ONGUARD.GID differ
diff --git a/components/onguard/docs/Help/Delphi/onguard.cnt b/components/onguard/docs/Help/Delphi/onguard.cnt
new file mode 100644
index 000000000..5f7ea529a
--- /dev/null
+++ b/components/onguard/docs/Help/Delphi/onguard.cnt
@@ -0,0 +1,19 @@
+:Base ONGUARD.HLP
+:Title Components
+1 Overview
+2 Contents=OnGuard_Contents
+1 Classes
+2 TOgCodeBase Class=TOgCodeBase_Class
+1 Components
+2 TOgDateCode Component=TOgDateCode_Component
+2 TOgDaysCode Component=TOgDaysCode_Component
+2 TOgMakeCodes Component=TOgMakeCodes_Component
+2 TOgMakeKeys Component=TOgMakeKeys_Component
+2 TOgNetCode Component=TOgNetCode_Component
+2 TOgProtectExe Component=TOgProtectExe_Component
+2 TOgRegistrationCode Component=TOgRegistrationCode_Component
+2 TOgSerialNumberCode Component=TOgSerialNumberCode_Component
+2 TOgSpecialCode Component=TOgSpecialCode_Component
+2 TOgUsageCode Component=TOgUsageCode_Component
+1 Low-Level Routines
+2 API Reference=API_Reference
diff --git a/components/onguard/docs/Help/Delphi/onguard.hlp b/components/onguard/docs/Help/Delphi/onguard.hlp
new file mode 100644
index 000000000..a547ed700
Binary files /dev/null and b/components/onguard/docs/Help/Delphi/onguard.hlp differ
diff --git a/components/onguard/docs/Help/Delphi/onguard.kwf b/components/onguard/docs/Help/Delphi/onguard.kwf
new file mode 100644
index 000000000..46dc9a322
Binary files /dev/null and b/components/onguard/docs/Help/Delphi/onguard.kwf differ
diff --git a/components/onguard/docs/Manual.pdf b/components/onguard/docs/Manual.pdf
new file mode 100644
index 000000000..0d3eb07ea
Binary files /dev/null and b/components/onguard/docs/Manual.pdf differ
diff --git a/components/onguard/examples/codegen/ONGUARD.INI b/components/onguard/examples/codegen/ONGUARD.INI
new file mode 100644
index 000000000..4bfc092b2
--- /dev/null
+++ b/components/onguard/examples/codegen/ONGUARD.INI
@@ -0,0 +1,2 @@
+[Keys]
+Flamenco=$E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4
diff --git a/components/onguard/examples/codegen/codegen.lpi b/components/onguard/examples/codegen/codegen.lpi
new file mode 100644
index 000000000..211ddafe9
--- /dev/null
+++ b/components/onguard/examples/codegen/codegen.lpi
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/codegen/codegen.lpr b/components/onguard/examples/codegen/codegen.lpr
new file mode 100644
index 000000000..2b0015ab0
--- /dev/null
+++ b/components/onguard/examples/codegen/codegen.lpr
@@ -0,0 +1,19 @@
+program CodeGen;
+
+{$mode objfpc}{$H+}
+
+{.$MODE Delphi}
+
+uses
+ Interfaces,
+ Forms,
+ CODEGENU in 'CODEGENU.pas' {CodeGenFrm}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TCodeGenFrm, CodeGenFrm);
+ Application.Run;
+end.
+
+
diff --git a/components/onguard/examples/codegen/codegenu.lfm b/components/onguard/examples/codegen/codegenu.lfm
new file mode 100644
index 000000000..701876934
--- /dev/null
+++ b/components/onguard/examples/codegen/codegenu.lfm
@@ -0,0 +1,89 @@
+object CodeGenFrm: TCodeGenFrm
+ ActiveControl = GenerateBtn
+ Caption = 'Example Code Generator'
+ ClientHeight = 85
+ ClientWidth = 273
+ Font.Color = clText
+ Font.Height = 11
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ PixelsPerInch = 96
+ Position = poScreenCenter
+ ShowHint = True
+ TextHeight = 18
+ HorzScrollBar.Page = 272
+ HorzScrollBar.Range = 267
+ VertScrollBar.Page = 84
+ VertScrollBar.Range = 76
+ Left = 315
+ Height = 85
+ Top = 230
+ Width = 273
+ object CopySb: TSpeedButton
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888888444444444800000008888
+ 8884FFFFFFF48000000088888884F00000F48000000080000004FFFFFFF48000
+ 000080FFFFF4F00000F48000000080F00004FFFFFFF48000000080FFFFF4F00F
+ 44448000000080F00004FFFF4F488000000080FFFFF4FFFF44888000000080F0
+ 0F04444448888000000080FFFF0F088888888000000080FFFF00888888888000
+ 0000800000088888888880000000888888888888888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = CopySbClick
+ Left = 244
+ Height = 22
+ Hint = 'Copy code to clipboard'
+ Top = 21
+ Width = 23
+ end
+ object Label2: TLabel
+ Caption = 'Code'
+ Color = clNone
+ FocusControl = CodeEd
+ ParentColor = False
+ Left = 8
+ Height = 14
+ Top = 3
+ Width = 26
+ end
+ object GenerateBtn: TButton
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Generate Code'
+ OnClick = GenerateBtnClick
+ TabOrder = 0
+ Left = 8
+ Height = 25
+ Hint = 'Display code generation dialog'
+ Top = 51
+ Width = 105
+ end
+ object CodeEd: TEdit
+ ReadOnly = True
+ TabOrder = 1
+ Left = 8
+ Height = 24
+ Top = 19
+ Width = 233
+ end
+ object CloseBtn: TBitBtn
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 2
+ Left = 192
+ Height = 25
+ Top = 51
+ Width = 75
+ end
+ object OgMakeCodes1: TOgMakeCodes
+ KeyFileName = 'ONGUARD.INI'
+ ShowHints = True
+ left = 56
+ top = 152
+ end
+end
diff --git a/components/onguard/examples/codegen/codegenu.lrs b/components/onguard/examples/codegen/codegenu.lrs
new file mode 100644
index 000000000..3f65186f0
--- /dev/null
+++ b/components/onguard/examples/codegen/codegenu.lrs
@@ -0,0 +1,37 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TCodeGenFrm','FORMDATA',[
+ 'TPF0'#11'TCodeGenFrm'#10'CodeGenFrm'#13'ActiveControl'#7#11'GenerateBtn'#7'C'
+ +'aption'#6#22'Example Code Generator'#12'ClientHeight'#2'U'#11'ClientWidth'#3
+ +#17#1#10'Font.Color'#7#6'clText'#11'Font.Height'#2#11#9'Font.Name'#6#13'MS S'
+ +'ans Serif'#10'Font.Pitch'#7#10'fpVariable'#13'PixelsPerInch'#2'`'#8'Positio'
+ +'n'#7#14'poScreenCenter'#8'ShowHint'#9#10'TextHeight'#2#18#18'HorzScrollBar.'
+ +'Page'#3#16#1#19'HorzScrollBar.Range'#3#11#1#18'VertScrollBar.Page'#2'T'#19
+ +'VertScrollBar.Range'#2'L'#4'Left'#3';'#1#6'Height'#2'U'#3'Top'#3#230#0#5'Wi'
+ +'dth'#3#17#1#0#12'TSpeedButton'#6'CopySb'#5'Color'#7#9'clBtnFace'#10'Glyph.D'
+ +'ata'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0#0#0#17#0#0#0#17#0
+ +#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#128#128#128#0
+ +#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255#0#255#255
+ +#0#0#255#255#255#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136
+ +#136#136#136#136#128#0#0#0#136#136#136#132'DDDD'#128#0#0#0#136#136#136#132
+ +#255#255#255#244#128#0#0#0#136#136#136#132#240#0#0#244#128#0#0#0#128#0#0#4
+ +#255#255#255#244#128#0#0#0#128#255#255#244#240#0#0#244#128#0#0#0#128#240#0#4
+ +#255#255#255#244#128#0#0#0#128#255#255#244#240#15'DD'#128#0#0#0#128#240#0#4
+ +#255#255'OH'#128#0#0#0#128#255#255#244#255#255'D'#136#128#0#0#0#128#240#15#4
+ +'DDH'#136#128#0#0#0#128#255#255#15#8#136#136#136#128#0#0#0#128#255#255#0#136
+ +#136#136#136#128#0#0#0#128#0#0#8#136#136#136#136#128#0#0#0#136#136#136#136
+ +#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#9'NumGl'
+ +'yphs'#2#0#7'OnClick'#7#11'CopySbClick'#4'Left'#3#244#0#6'Height'#2#22#4'Hin'
+ +'t'#6#22'Copy code to clipboard'#3'Top'#2#21#5'Width'#2#23#0#0#6'TLabel'#6'L'
+ +'abel2'#7'Caption'#6#4'Code'#5'Color'#7#6'clNone'#12'FocusControl'#7#6'CodeE'
+ +'d'#11'ParentColor'#8#4'Left'#2#8#6'Height'#2#14#3'Top'#2#3#5'Width'#2#26#0#0
+ +#7'TButton'#11'GenerateBtn'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#13
+ +'Generate Code'#7'OnClick'#7#16'GenerateBtnClick'#8'TabOrder'#2#0#4'Left'#2#8
+ +#6'Height'#2#25#4'Hint'#6#30'Display code generation dialog'#3'Top'#2'3'#5'W'
+ +'idth'#2'i'#0#0#5'TEdit'#6'CodeEd'#8'ReadOnly'#9#8'TabOrder'#2#1#4'Left'#2#8
+ +#6'Height'#2#24#3'Top'#2#19#5'Width'#3#233#0#0#0#7'TBitBtn'#8'CloseBtn'#4'Ki'
+ +'nd'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#2#4'Left'#3#192#0#6'Height'
+ +#2#25#3'Top'#2'3'#5'Width'#2'K'#0#0#12'TOgMakeCodes'#12'OgMakeCodes1'#11'Key'
+ +'FileName'#6#11'ONGUARD.INI'#9'ShowHints'#9#4'left'#2'8'#3'top'#3#152#0#0#0#0
+]);
diff --git a/components/onguard/examples/codegen/codegenu.pas b/components/onguard/examples/codegen/codegenu.pas
new file mode 100644
index 000000000..01ad0e261
--- /dev/null
+++ b/components/onguard/examples/codegen/codegenu.pas
@@ -0,0 +1,67 @@
+unit CODEGENU;
+
+{$MODE Delphi}
+
+interface
+
+uses
+ LCLIntf,
+ SysUtils, Classes, Forms, Dialogs,
+ Buttons,LResources,StdCtrls, onguard,ogutil;
+
+type
+ TCodeGenFrm = class(TForm)
+ GenerateBtn: TButton;
+ CodeEd: TEdit;
+ Label2: TLabel;
+ CloseBtn: TBitBtn;
+ CopySb: TSpeedButton;
+ OgMakeCodes1: TOgMakeCodes;
+ procedure CopySbClick(Sender: TObject);
+ procedure GenerateBtnClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ CodeGenFrm: TCodeGenFrm;
+
+implementation
+
+
+procedure TCodeGenFrm.CopySbClick(Sender: TObject);
+var
+ OldSelStart : Integer;
+begin
+ OldSelStart := CodeEd.SelStart;
+ CodeEd.SelStart := 0;
+ CodeEd.SelLength := MaxInt;
+ CodeEd.CopyToClipboard;
+ CodeEd.SelStart := OldSelStart;
+ CodeEd.SelLength := 0;
+end;
+
+procedure TCodeGenFrm.GenerateBtnClick(Sender: TObject);
+const
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+var
+ Work : TCode;
+begin
+ {set default key to use}
+ OgMakeCodes1.SetKey(CKey);
+ if OgMakeCodes1.Execute then begin
+ {get the code}
+ OgMakeCodes1.GetCode(Work);
+ {display the code}
+ CodeEd.Text := OgUtil.BufferToHex(Work, SizeOf(Work));
+ end;
+
+
+end;
+
+initialization
+ {$i CODEGENU.lrs}
+
+end.
diff --git a/components/onguard/examples/exdmod/exdmod.lpi b/components/onguard/examples/exdmod/exdmod.lpi
new file mode 100644
index 000000000..e5a65ee72
--- /dev/null
+++ b/components/onguard/examples/exdmod/exdmod.lpi
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exdmod/exdmod.lpr b/components/onguard/examples/exdmod/exdmod.lpr
new file mode 100644
index 000000000..be0446354
--- /dev/null
+++ b/components/onguard/examples/exdmod/exdmod.lpr
@@ -0,0 +1,14 @@
+program Exdmod;
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ Exdmodu1 in 'EXDMODU1.PAS' {Form1},
+ Exdmodu2 in 'EXDMODU2.PAS' {SNEntryDlg}, tponguard;
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exdmod/exdmodu1.lfm b/components/onguard/examples/exdmod/exdmodu1.lfm
new file mode 100644
index 000000000..17c2bfdc9
--- /dev/null
+++ b/components/onguard/examples/exdmod/exdmodu1.lfm
@@ -0,0 +1,58 @@
+object Form1: TForm1
+ ActiveControl = Memo1
+ Caption = 'Serial Number Example'
+ ClientHeight = 186
+ ClientWidth = 240
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ OnActivate = FormActivate
+ PixelsPerInch = 83
+ Position = poScreenCenter
+ TextHeight = 13
+ HorzScrollBar.Page = 239
+ VertScrollBar.Page = 185
+ Left = 372
+ Height = 186
+ Top = 223
+ Width = 240
+ object Label1: TLabel
+ Alignment = taCenter
+ Caption = 'Serial #: '
+ Color = clNone
+ ParentColor = False
+ Left = 38
+ Height = 13
+ Top = 96
+ Width = 51
+ end
+ object Memo1: TMemo
+ Lines.Strings = (
+ 'If you can edit this, then your program was '
+ 'allowed to run'
+ )
+ ScrollBars = ssVertical
+ TabOrder = 0
+ Left = 3
+ Height = 79
+ Top = 4
+ Width = 223
+ end
+ object CloseBtn: TBitBtn
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 1
+ Left = 72
+ Height = 33
+ Top = 114
+ Width = 89
+ end
+ object OgSerialNumberCode1: TOgSerialNumberCode
+ OnChecked = OgSerialNumberCode1Checked
+ OnGetKey = OgSerialNumberCode1GetKey
+ OnGetCode = OgSerialNumberCode1GetCode
+ OnGetModifier = OgSerialNumberCode1GetModifier
+ left = 172
+ top = 88
+ end
+end
diff --git a/components/onguard/examples/exdmod/exdmodu1.lrs b/components/onguard/examples/exdmod/exdmodu1.lrs
new file mode 100644
index 000000000..a1cf513af
--- /dev/null
+++ b/components/onguard/examples/exdmod/exdmodu1.lrs
@@ -0,0 +1,21 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#13'ActiveControl'#7#5'Memo1'#7'Caption'#6#21'Serial'
+ +' Number Example'#12'ClientHeight'#3#186#0#11'ClientWidth'#3#240#0#10'Font.C'
+ +'olor'#7#7'clBlack'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#13
+ +'PixelsPerInch'#2'`'#8'Position'#7#14'poScreenCenter'#10'TextHeight'#2#13#18
+ +'HorzScrollBar.Page'#3#239#0#18'VertScrollBar.Page'#3#185#0#4'Left'#3't'#1#6
+ +'Height'#3#186#0#3'Top'#3#223#0#5'Width'#3#240#0#0#6'TLabel'#6'Label1'#9'Ali'
+ +'gnment'#7#8'taCenter'#7'Caption'#6#10'Serial #: '#5'Color'#7#6'clNone'#11'P'
+ +'arentColor'#8#4'Left'#2'&'#6'Height'#2#14#3'Top'#2'`'#5'Width'#2'-'#0#0#5'T'
+ +'Memo'#5'Memo1'#13'Lines.Strings'#1#6',If you can edit this, then your progr'
+ +'am was '#6#14'allowed to run'#0#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'
+ +#2#0#4'Left'#2#3#6'Height'#2'O'#3'Top'#2#4#5'Width'#3#223#0#0#0#7'TBitBtn'#8
+ +'CloseBtn'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#4'Left'#2'H'
+ +#6'Height'#2'!'#3'Top'#2'r'#5'Width'#2'Y'#0#0#19'TOgSerialNumberCode'#19'OgS'
+ +'erialNumberCode1'#9'OnChecked'#7#26'OgSerialNumberCode1Checked'#8'OnGetKey'
+ +#7#25'OgSerialNumberCode1GetKey'#9'OnGetCode'#7#26'OgSerialNumberCode1GetCod'
+ +'e'#13'OnGetModifier'#7#30'OgSerialNumberCode1GetModifier'#4'left'#3#172#0#3
+ +'top'#2'X'#0#0#0
+]);
diff --git a/components/onguard/examples/exdmod/exdmodu1.pas b/components/onguard/examples/exdmod/exdmodu1.pas
new file mode 100644
index 000000000..6b3e8089b
--- /dev/null
+++ b/components/onguard/examples/exdmod/exdmodu1.pas
@@ -0,0 +1,250 @@
+(*
+This example shows how to generate a machine modifier at run time
+while using the TOgSerialNumber component. This means the program
+will run only on the machine being used to run the application.
+
+If the program is being run the first time (as determined by the
+existance of an INI file, a dialog box is displayed showing the
+modifier value along with two entry fields: one for the serial
+number, the other for the release code. The user enters the
+values that you give him for these two items. The values are
+stored in the INI file and the program is allowed to run.
+
+The release code you give the user can be generated by the CODEGEN
+example program. Be sure to select the same type component, the
+key used to compile the application (the one returned in the
+OnGetKey event), and enter the machine modifier the user gives
+you - not the one automatically generated when you click the
+MachineModifier radio button. Also, if used, make sure the
+Expires date is the same.
+*)
+
+
+unit Exdmodu1;
+
+interface
+
+uses
+ SysUtils,Classes,Controls,
+ Forms, Dialogs, StdCtrls, Buttons,LResources,
+ OgUtil,OnGuard,IniFiles;
+
+const
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,
+ $1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ Label1: TLabel;
+ OgSerialNumberCode1: TOgSerialNumberCode;
+ procedure FormActivate(Sender: TObject);
+ procedure OgSerialNumberCode1GetKey(Sender: TObject; var Key: TKey);
+ procedure OgSerialNumberCode1GetCode(Sender: TObject; var Code: TCode);
+ procedure OgSerialNumberCode1Checked(Sender: TObject;
+ Status: TCodeStatus);
+ procedure OgSerialNumberCode1GetModifier(Sender: TObject;
+ var Value: Longint);
+ private
+ { Private declarations }
+ FExpired : Boolean;
+ public
+ { Public declarations }
+ TheDir : string;
+ IniSNVal : longint;
+ IniFile : TIniFile;
+
+ function GetSNData(var S : string) : integer;
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+uses
+ Exdmodu2;
+
+{=======================================================================}
+
+
+procedure TForm1.OgSerialNumberCode1GetKey(Sender: TObject; var Key: TKey);
+begin
+ Key := CKey;
+end;
+
+procedure TForm1.FormActivate(Sender: TObject);
+begin
+ if FExpired then Application.Terminate;
+end;
+
+
+{=======================================================================}
+
+
+procedure TForm1.OgSerialNumberCode1GetModifier(Sender: TObject;
+ var Value: Longint);
+begin
+ {Generate the value unique to this machine}
+ Value := GenerateMachineModifierPrim;
+end;
+
+
+{=======================================================================}
+
+procedure TForm1.OgSerialNumberCode1GetCode(Sender: TObject; var Code: TCode);
+var
+ S1 : string;
+ L : integer;
+begin
+ {force the INI file to be in the same directory as the application}
+ TheDir := ExtractFilePath(ParamStr(0));
+ {
+ L := Length(TheDir);
+ if (L > 3) and (TheDir[L] <> '\') then
+ TheDir := TheDir + '\';
+ }
+
+ (*
+ this check helps prevent an empty INI file. For the combination of
+ this component and using the MachineModifier, an empty or
+ incomplete INI file can cause problems, i.e., if something goes wrong
+ during the initial input of the SN and ReleaseCode, the program could
+ not be run again without deleting the INI file. In a "real world"
+ application, you would probably be hiding these values some how and
+ would either have to tell the user where to delete things or have a
+ utility program to do so.
+ *)
+ if not (FileExists(TheDir + 'snwmod.ini')) then
+ Exit;
+
+ {open Ini File}
+ IniFile := TIniFile.Create(TheDir + 'snwmod.ini');
+ try
+ {try to read release code}
+ S1 := IniFile.ReadString('Codes', 'SNCode', '');
+
+ (*
+ set a global variable to the value of the serial number.
+ Since, by design, the TOgSerialNumber component does not
+ confirm that the SN and ReleaseCode retrieved from the INI
+ file are compatible, this value will be used later to
+ see if the user has attempted to change the contents of
+ the INI file
+ *)
+ IniSNVal := IniFile.ReadInteger('Codes', 'SN', 0);
+
+ {convert retrieved string to a code}
+ HexToBuffer(S1, Code, SizeOf(Code));
+ finally
+ IniFile.Free;
+ end;
+end;
+
+{=======================================================================}
+
+function TForm1.GetSNData(var S : string) : integer;
+{method used to ask for user input of serial number and release code}
+var
+ TC : TCode;
+ SNC : string;
+ L : longint;
+ Key : TKey;
+begin
+ Application.CreateForm(TSNEntryDlg, SNEntryDlg);
+ try
+ {Display new SN and ask for release code}
+ SNEntryDlg.SNText.Text := '';
+ SNEntryDlg.CodeText.Text := '';
+
+ Result := SNEntryDlg.ShowModal;
+ if (SNEntryDlg.CodeText.Text = '') or
+ (SNEntryDlg.SNText.Text = '') then
+ Result := mrCancel;
+ if (Result = mrCancel) then begin
+ S := 'Invalid Code or Cancelled';
+ Exit;
+ end;
+
+ {Check that Release Code was entered correctly}
+ Key := CKey;
+ OgSerialNumberCode1.Modifier := SNEntryDlg.ModString.Text;
+
+ HexToBuffer(SNEntryDlg.ModString.Text, L, SizeOf(L));
+
+ HexToBuffer(SNEntryDlg.CodeText.Text, TC, SizeOf(TCode));
+ ApplyModifierToKeyPrim(L, Key, SizeOf(TKey));
+
+ if not (IsSerialNumberCodeValid(Key, TC)) then begin
+ S := 'Release code not entered correctly';
+ Result := mrCancel;
+ end else begin
+ IniFile := TIniFile.Create(TheDir + 'snwmod.ini');
+ try
+ {write SN to IniFile}
+ IniSNVal := StrToInt(SNEntryDlg.SNText.Text);
+ SNC := SNEntryDlg.CodeText.Text;
+ IniFile.WriteInteger('Codes', 'SN', IniSNVal);
+ IniFile.WriteString('Codes', 'SNCode', SNC);
+ finally
+ IniFile.Free;
+ end;
+ end;
+ finally
+ SNEntryDlg.Free;
+ end;
+end;
+
+{=======================================================================}
+
+procedure TForm1.OgSerialNumberCode1Checked(Sender: TObject;
+ Status: TCodeStatus);
+var
+ LI : longint;
+ S : string;
+begin
+ FExpired := false;
+ case Status of
+ ogValidCode : begin
+ {check if retrieved Serial Number matches Code}
+ LI := OgSerialNumberCode1.GetValue;
+
+ if (LI <> IniSNVal) then begin
+ S := 'The serial number has been changed';
+ end else begin
+ Label1.Caption := 'Serial #: ' + IntToStr(IniSNVal);
+ Exit;
+ end;
+ end;
+
+ ogInvalidCode : begin
+ {if INI file doesn't exist, presume this is first run}
+ if not (FileExists(TheDir + 'snwmod.ini')) then begin
+ if not (GetSNData(S) = mrCancel) then begin
+ {Check the SN/ReleaseCode}
+ OgSerialNumberCode1.CheckCode(True);
+ {must Exit since line above began a recursive call}
+ Exit;
+ end;
+ end else
+ S := 'Invalid Code';
+ end;
+
+ ogCodeExpired : S := 'Evaluation period expired';
+ end;
+
+ ShowMessage(S);
+ FExpired := true;
+end;
+
+initialization
+{$i exdmodu2.lrs}
+
+end.
+
diff --git a/components/onguard/examples/exdmod/exdmodu2.lfm b/components/onguard/examples/exdmod/exdmodu2.lfm
new file mode 100644
index 000000000..0006af672
--- /dev/null
+++ b/components/onguard/examples/exdmod/exdmodu2.lfm
@@ -0,0 +1,97 @@
+object SNEntryDlg: TSNEntryDlg
+ ActiveControl = SNText
+ Caption = 'Serial Number w/Modifer'
+ ClientHeight = 195
+ ClientWidth = 247
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ OnCreate = FormCreate
+ PixelsPerInch = 83
+ Position = poScreenCenter
+ TextHeight = 13
+ HorzScrollBar.Page = 246
+ VertScrollBar.Page = 194
+ Left = 406
+ Height = 195
+ Top = 376
+ Width = 247
+ object Label1: TLabel
+ Caption = 'SN'
+ Color = clNone
+ ParentColor = False
+ Left = 8
+ Height = 13
+ Top = 64
+ Width = 18
+ end
+ object Label2: TLabel
+ Caption = 'Code'
+ Color = clNone
+ ParentColor = False
+ Left = 8
+ Height = 13
+ Top = 90
+ Width = 31
+ end
+ object Label3: TLabel
+ Caption = 'Call your Vendor NOW to register!'
+ Color = clNone
+ ParentColor = False
+ Left = 40
+ Height = 13
+ Top = 7
+ Width = 193
+ end
+ object Label4: TLabel
+ Caption = 'Modifier'
+ Color = clNone
+ ParentColor = False
+ Left = 8
+ Height = 13
+ Top = 37
+ Width = 46
+ end
+ object SNText: TEdit
+ TabOrder = 1
+ Left = 52
+ Height = 20
+ Top = 60
+ Width = 121
+ end
+ object CodeText: TEdit
+ TabOrder = 2
+ Left = 52
+ Height = 20
+ Top = 86
+ Width = 175
+ end
+ object OKBtn: TBitBtn
+ Kind = bkOK
+ NumGlyphs = 0
+ TabOrder = 3
+ Left = 23
+ Height = 33
+ Top = 118
+ Width = 89
+ end
+ object CancelBtn: TBitBtn
+ Kind = bkCancel
+ NumGlyphs = 0
+ OnClick = CancelBtnClick
+ TabOrder = 4
+ Left = 127
+ Height = 33
+ Top = 118
+ Width = 89
+ end
+ object ModString: TEdit
+ ReadOnly = True
+ TabStop = False
+ TabOrder = 0
+ Left = 52
+ Height = 20
+ Top = 33
+ Width = 121
+ end
+end
diff --git a/components/onguard/examples/exdmod/exdmodu2.lrs b/components/onguard/examples/exdmod/exdmodu2.lrs
new file mode 100644
index 000000000..abf39e005
--- /dev/null
+++ b/components/onguard/examples/exdmod/exdmodu2.lrs
@@ -0,0 +1,46 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TSNEntryDlg','FORMDATA',[
+ 'TPF0'#11'TSNEntryDlg'#10'SNEntryDlg'#13'ActiveControl'#7#6'SNText'#7'Caption'
+ +#6#23'Serial Number w/Modifer'#12'ClientHeight'#3#195#0#11'ClientWidth'#3#247
+ +#0#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sa'
+ +'ns Serif'#8'OnCreate'#7#10'FormCreate'#13'PixelsPerInch'#2'S'#8'Position'#7
+ +#14'poScreenCenter'#10'TextHeight'#2#13#18'HorzScrollBar.Page'#3#246#0#18'Ve'
+ +'rtScrollBar.Page'#3#194#0#4'Left'#3#150#1#6'Height'#3#195#0#3'Top'#3'x'#1#5
+ +'Width'#3#247#0#0#6'TLabel'#6'Label1'#7'Caption'#6#2'SN'#5'Color'#7#6'clNone'
+ +#11'ParentColor'#8#4'Left'#2#8#6'Height'#2#13#3'Top'#2'@'#5'Width'#2#18#0#0#6
+ +'TLabel'#6'Label2'#7'Caption'#6#4'Code'#5'Color'#7#6'clNone'#11'ParentColor'
+ +#8#4'Left'#2#8#6'Height'#2#13#3'Top'#2'Z'#5'Width'#2#31#0#0#6'TLabel'#6'Labe'
+ +'l3'#7'Caption'#6'!Call your Vendor NOW to register!'#5'Color'#7#6'clNone'#11
+ +'ParentColor'#8#4'Left'#2'('#6'Height'#2#13#3'Top'#2#7#5'Width'#3#193#0#0#0#6
+ +'TLabel'#6'Label4'#7'Caption'#6#8'Modifier'#5'Color'#7#6'clNone'#11'ParentCo'
+ +'lor'#8#4'Left'#2#8#6'Height'#2#13#3'Top'#2'%'#5'Width'#2'.'#0#0#5'TEdit'#6
+ +'SNText'#8'TabOrder'#2#1#4'Left'#2'4'#6'Height'#2#20#3'Top'#2'<'#5'Width'#2
+ +'y'#0#0#5'TEdit'#8'CodeText'#8'TabOrder'#2#2#4'Left'#2'4'#6'Height'#2#20#3'T'
+ +'op'#2'V'#5'Width'#3#175#0#0#0#7'TBitBtn'#5'OKBtn'#4'Kind'#7#4'bkOK'#9'NumGl'
+ +'yphs'#2#0#8'TabOrder'#2#3#4'Left'#2#23#6'Height'#2'!'#3'Top'#2'v'#5'Width'#2
+ +'Y'#0#0#7'TBitBtn'#9'CancelBtn'#4'Kind'#7#8'bkCancel'#9'NumGlyphs'#2#0#7'OnC'
+ +'lick'#7#14'CancelBtnClick'#8'TabOrder'#2#4#4'Left'#2''#6'Height'#2'!'#3'To'
+ +'p'#2'v'#5'Width'#2'Y'#0#0#5'TEdit'#9'ModString'#8'ReadOnly'#9#7'TabStop'#8#8
+ +'TabOrder'#2#0#4'Left'#2'4'#6'Height'#2#20#3'Top'#2'!'#5'Width'#2'y'#0#0#0
+]);
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#13'ActiveControl'#7#5'Memo1'#7'Caption'#6#21'Serial'
+ +' Number Example'#12'ClientHeight'#3#186#0#11'ClientWidth'#3#240#0#10'Font.C'
+ +'olor'#7#7'clBlack'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#10
+ +'OnActivate'#7#12'FormActivate'#13'PixelsPerInch'#2'S'#8'Position'#7#14'poSc'
+ +'reenCenter'#10'TextHeight'#2#13#18'HorzScrollBar.Page'#3#239#0#18'VertScrol'
+ +'lBar.Page'#3#185#0#4'Left'#3't'#1#6'Height'#3#186#0#3'Top'#3#223#0#5'Width'
+ +#3#240#0#0#6'TLabel'#6'Label1'#9'Alignment'#7#8'taCenter'#7'Caption'#6#10'Se'
+ +'rial #: '#5'Color'#7#6'clNone'#11'ParentColor'#8#4'Left'#2'&'#6'Height'#2#13
+ +#3'Top'#2'`'#5'Width'#2'3'#0#0#5'TMemo'#5'Memo1'#13'Lines.Strings'#1#6',If y'
+ +'ou can edit this, then your program was '#6#14'allowed to run'#0#10'ScrollB'
+ +'ars'#7#10'ssVertical'#8'TabOrder'#2#0#4'Left'#2#3#6'Height'#2'O'#3'Top'#2#4
+ +#5'Width'#3#223#0#0#0#7'TBitBtn'#8'CloseBtn'#4'Kind'#7#7'bkClose'#9'NumGlyph'
+ +'s'#2#0#8'TabOrder'#2#1#4'Left'#2'H'#6'Height'#2'!'#3'Top'#2'r'#5'Width'#2'Y'
+ +#0#0#19'TOgSerialNumberCode'#19'OgSerialNumberCode1'#9'OnChecked'#7#26'OgSer'
+ +'ialNumberCode1Checked'#8'OnGetKey'#7#25'OgSerialNumberCode1GetKey'#9'OnGetC'
+ +'ode'#7#26'OgSerialNumberCode1GetCode'#13'OnGetModifier'#7#30'OgSerialNumber'
+ +'Code1GetModifier'#4'left'#3#172#0#3'top'#2'X'#0#0#0
+]);
diff --git a/components/onguard/examples/exdmod/exdmodu2.pas b/components/onguard/examples/exdmod/exdmodu2.pas
new file mode 100644
index 000000000..1af8c21c2
--- /dev/null
+++ b/components/onguard/examples/exdmod/exdmodu2.pas
@@ -0,0 +1,57 @@
+unit Exdmodu2;
+
+interface
+
+uses
+ SysUtils,Classes,Controls,
+ Forms, Dialogs, StdCtrls, Buttons,LResources;
+
+type
+ TSNEntryDlg = class(TForm)
+ Label1: TLabel;
+ Label2: TLabel;
+ SNText: TEdit;
+ CodeText: TEdit;
+ OKBtn: TBitBtn;
+ CancelBtn: TBitBtn;
+ Label3: TLabel;
+ Label4: TLabel;
+ ModString: TEdit;
+ procedure CancelBtnClick(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ SNEntryDlg: TSNEntryDlg;
+
+implementation
+
+
+
+uses
+ OnGuard,
+ OgUtil;
+
+
+procedure TSNEntryDlg.CancelBtnClick(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TSNEntryDlg.FormCreate(Sender: TObject);
+var
+ LI : longint;
+begin
+ LI := GenerateMachineModifierPrim;
+ ModString.Text := BufferToHex(LI, SizeOf(longint));
+end;
+
+initialization
+{$i exdmodu2.lrs}
+
+
+end.
diff --git a/components/onguard/examples/exdtp21/datep21.ini b/components/onguard/examples/exdtp21/datep21.ini
new file mode 100644
index 000000000..9ea8ca0a3
--- /dev/null
+++ b/components/onguard/examples/exdtp21/datep21.ini
@@ -0,0 +1,3 @@
+[Codes]
+
+DateCode=049CF7F37E44F6C6
\ No newline at end of file
diff --git a/components/onguard/examples/exdtp21/exdtp21.lpi b/components/onguard/examples/exdtp21/exdtp21.lpi
new file mode 100644
index 000000000..c080b9ae7
--- /dev/null
+++ b/components/onguard/examples/exdtp21/exdtp21.lpi
@@ -0,0 +1,225 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exdtp21/exdtp21.lpr b/components/onguard/examples/exdtp21/exdtp21.lpr
new file mode 100644
index 000000000..85c0d5cf3
--- /dev/null
+++ b/components/onguard/examples/exdtp21/exdtp21.lpr
@@ -0,0 +1,13 @@
+program Exdtp21;
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ Exdtp21u in 'exdtp21u.pas' {Form1}, tponguard;
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exdtp21/exdtp21u.lfm b/components/onguard/examples/exdtp21/exdtp21u.lfm
new file mode 100644
index 000000000..8a15a68e4
--- /dev/null
+++ b/components/onguard/examples/exdtp21/exdtp21u.lfm
@@ -0,0 +1,54 @@
+object Form1: TForm1
+ Left = 354
+ Height = 155
+ Top = 279
+ Width = 228
+ HorzScrollBar.Page = 227
+ VertScrollBar.Page = 154
+ ActiveControl = Memo1
+ Caption = 'Form1'
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ OnActivate = FormActivate
+ OnCreate = FormCreate
+ Position = poScreenCenter
+ object Label1: TLabel
+ Left = 50
+ Height = 13
+ Top = 70
+ Width = 113
+ Caption = 'Expires: 00/00/0000'
+ Color = clNone
+ ParentColor = False
+ end
+ object Memo1: TMemo
+ Left = 8
+ Height = 59
+ Top = 8
+ Width = 197
+ Lines.Strings = (
+ 'If you can edit this, your program '
+ 'was '
+ 'allowed to run'
+ )
+ ScrollBars = ssVertical
+ TabOrder = 0
+ end
+ object CloseBtn: TBitBtn
+ Left = 56
+ Height = 33
+ Top = 89
+ Width = 89
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 1
+ end
+ object OgDateCode1: TOgDateCode
+ OnChecked = OgDateCode1Checked
+ OnGetKey = OgDateCode1GetKey
+ OnGetCode = OgDateCode1GetCode
+ left = 158
+ top = 87
+ end
+end
diff --git a/components/onguard/examples/exdtp21/exdtp21u.lrs b/components/onguard/examples/exdtp21/exdtp21u.lrs
new file mode 100644
index 000000000..df119db2d
--- /dev/null
+++ b/components/onguard/examples/exdtp21/exdtp21u.lrs
@@ -0,0 +1,19 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'b'#1#6'Height'#3#155#0#3'Top'#3#23#1#5'Wi'
+ +'dth'#3#228#0#18'HorzScrollBar.Page'#3#227#0#18'VertScrollBar.Page'#3#154#0
+ +#13'ActiveControl'#7#5'Memo1'#7'Caption'#6#5'Form1'#10'Font.Color'#7#7'clBla'
+ +'ck'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#10'OnActivate'#7
+ +#12'FormActivate'#8'OnCreate'#7#10'FormCreate'#8'Position'#7#14'poScreenCent'
+ +'er'#0#6'TLabel'#6'Label1'#4'Left'#2'2'#6'Height'#2#13#3'Top'#2'F'#5'Width'#2
+ +'q'#7'Caption'#6#19'Expires: 00/00/0000'#5'Color'#7#6'clNone'#11'ParentColor'
+ +#8#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#2';'#3'Top'#2#8#5'Width'#3#197
+ +#0#13'Lines.Strings'#1#6'#If you can edit this, your program '#6#4'was '#6#14
+ +'allowed to run'#0#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'#2#0#0#0#7'TBi'
+ +'tBtn'#8'CloseBtn'#4'Left'#2'8'#6'Height'#2'!'#3'Top'#2'Y'#5'Width'#2'Y'#4'K'
+ +'ind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#11'TOgDateCode'#11'O'
+ +'gDateCode1'#9'OnChecked'#7#18'OgDateCode1Checked'#8'OnGetKey'#7#17'OgDateCo'
+ +'de1GetKey'#9'OnGetCode'#7#18'OgDateCode1GetCode'#4'left'#3#158#0#3'top'#2'W'
+ +#0#0#0
+]);
diff --git a/components/onguard/examples/exdtp21/exdtp21u.pas b/components/onguard/examples/exdtp21/exdtp21u.pas
new file mode 100644
index 000000000..192896585
--- /dev/null
+++ b/components/onguard/examples/exdtp21/exdtp21u.pas
@@ -0,0 +1,126 @@
+(*
+ This example uses the TOgDateCode component. The beginning of the
+ allowed date range is automatically set to the date the program
+ is first run and the expiration date 21 days thereafter
+*)
+unit Exdtp21u;
+
+interface
+
+uses
+ SysUtils,Classes,Controls,
+ Forms, Dialogs, StdCtrls, Buttons,LResources, OnGuard,
+ OgUtil,
+ IniFiles;
+
+const
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,
+ $1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ OgDateCode1: TOgDateCode;
+ Label1: TLabel;
+ procedure FormActivate(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure OgDateCode1GetKey(Sender: TObject; var Key: TKey);
+ procedure OgDateCode1GetCode(Sender: TObject; var Code: TCode);
+ procedure OgDateCode1Checked(Sender: TObject; Status: TCodeStatus);
+ private
+ FExpired : Boolean;
+ public
+ TheDir : string;
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+{==========================================================================}
+
+procedure TForm1.OgDateCode1GetKey(Sender: TObject; var Key: TKey);
+begin
+ Key := CKey;
+end;
+
+procedure TForm1.FormActivate(Sender: TObject);
+begin
+ if FExpired then Application.Terminate;
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+
+end;
+
+{==========================================================================}
+
+procedure TForm1.OgDateCode1GetCode(Sender: TObject; var Code: TCode);
+var
+ IniFile : TIniFile;
+ S : string;
+ SD,
+ ED : TDateTime;
+ L : integer;
+begin
+ {force the INI file to be in the same directory as the application}
+ TheDir := ExtractFilePath(ParamStr(0));
+
+ {open Ini File}
+ IniFile := TIniFile.Create(TheDir + 'datep21.ini');
+ try
+ {try to read release code}
+ S := IniFile.ReadString('Codes', 'DateCode', '');
+
+ {If default string returned, create code on the fly}
+ if (S = '') then begin
+ SD := Date;
+ ED := SD + 21.0;
+ InitDateCode(CKey, SD, ED, Code);
+
+ {save string representation of release code to Ini File}
+ S := BufferToHex(Code, SizeOf(Code));
+ IniFile.WriteString('Codes', 'DateCode', S);
+ end else
+ {convert retrieved string to a code}
+ HexToBuffer(S, Code, SizeOf(Code))
+ finally
+ IniFile.Free;
+ end;
+end;
+
+{==========================================================================}
+
+procedure TForm1.OgDateCode1Checked(Sender: TObject; Status: TCodeStatus);
+var
+ S : string;
+begin
+ FExpired := false;
+ ShortDateFormat := 'yyy-mm-dd';
+ case Status of
+ ogValidCode : begin
+ Label1.Caption := 'Expires: '
+ + DateToStr(OgDateCode1.GetValue);
+ Exit;
+ end;
+
+ ogPastEndDate : S := 'Past 21 days - please register';
+
+ ogInvalidCode : S := 'Invalid Code';
+ end;
+ ShowMessage(S);
+ FExpired := true;
+end;
+
+initialization
+{$i exdtp21u.lrs}
+
+end.
diff --git a/components/onguard/examples/exdtreg/ONGUARD.INI b/components/onguard/examples/exdtreg/ONGUARD.INI
new file mode 100644
index 000000000..7a109e025
--- /dev/null
+++ b/components/onguard/examples/exdtreg/ONGUARD.INI
@@ -0,0 +1,2 @@
+[Codes]
+DateCode=046FEF19C398AE1B
diff --git a/components/onguard/examples/exdtreg/exdtreg.lpi b/components/onguard/examples/exdtreg/exdtreg.lpi
new file mode 100644
index 000000000..5240cfd35
--- /dev/null
+++ b/components/onguard/examples/exdtreg/exdtreg.lpi
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exdtreg/exdtreg.lpr b/components/onguard/examples/exdtreg/exdtreg.lpr
new file mode 100644
index 000000000..4706c8170
--- /dev/null
+++ b/components/onguard/examples/exdtreg/exdtreg.lpr
@@ -0,0 +1,14 @@
+program ExDTReg;
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ exdtregu in 'exdtregu.pas' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exdtreg/exdtregu.lfm b/components/onguard/examples/exdtreg/exdtregu.lfm
new file mode 100644
index 000000000..58a31be75
--- /dev/null
+++ b/components/onguard/examples/exdtreg/exdtregu.lfm
@@ -0,0 +1,98 @@
+object Form1: TForm1
+ Left = 252
+ Height = 309
+ Top = 138
+ Width = 484
+ HorzScrollBar.Page = 483
+ VertScrollBar.Page = 308
+ BorderStyle = bsDialog
+ Caption = 'Date Code Example'
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Position = poScreenCenter
+ object StatusLbl: TLabel
+ Left = 8
+ Height = 13
+ Top = 262
+ Width = 35
+ Caption = 'Status'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label1: TLabel
+ Left = 240
+ Height = 13
+ Top = 14
+ Width = 77
+ Caption = 'Current code:'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeLbl: TLabel
+ Left = 328
+ Height = 13
+ Top = 14
+ Width = 113
+ Caption = '0000000000000000'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeBtn: TButton
+ Left = 8
+ Height = 25
+ Top = 8
+ Width = 89
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Enter Code'
+ OnClick = CodeBtnClick
+ TabOrder = 0
+ end
+ object Memo1: TMemo
+ Left = 8
+ Height = 209
+ Top = 40
+ Width = 465
+ Color = clBtnFace
+ Lines.Strings = (
+ 'The label at the bottom of this form indicates the status of the code. An invalid code indicates that '
+ 'the code is either the incorrect type or that none has been entered. '
+ ''
+ 'If the proper code has not been entered or the ONGUARD.INI file was deleted, the message will '
+ 'say that the code is invalid.'
+ ''
+ 'Use the "Enter Code" button to enter a code (the CODEGEN program can be used to generate '
+ 'the proper "Date" code). '
+ ''
+ 'The "Remove Code" button can be used to remove the entered code from the INI file. Doing so '
+ 'will cause the TOgDateCode component to report that the code is invalid.'
+ )
+ ReadOnly = True
+ TabOrder = 1
+ end
+ object CloseBtn: TBitBtn
+ Left = 400
+ Height = 25
+ Top = 256
+ Width = 75
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 2
+ end
+ object RemoveBtn: TButton
+ Left = 288
+ Height = 25
+ Top = 256
+ Width = 97
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Remove Code'
+ OnClick = RemoveBtnClick
+ TabOrder = 3
+ end
+ object OgDateCode1: TOgDateCode
+ OnChecked = CodeChecked
+ OnGetKey = GetKey
+ OnGetCode = GetCode
+ left = 16
+ top = 216
+ end
+end
diff --git a/components/onguard/examples/exdtreg/exdtregu.lrs b/components/onguard/examples/exdtreg/exdtregu.lrs
new file mode 100644
index 000000000..63de9cc8f
--- /dev/null
+++ b/components/onguard/examples/exdtreg/exdtregu.lrs
@@ -0,0 +1,34 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#252#0#6'Height'#3'5'#1#3'Top'#3#138#0#5'W'
+ +'idth'#3#228#1#18'HorzScrollBar.Page'#3#227#1#18'VertScrollBar.Page'#3'4'#1
+ +#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#17'Date Code Example'#11'Font.He'
+ +'ight'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScreenCente'
+ +'r'#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Height'#2#13#3'Top'#3#6#1#5'Width'
+ +#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TL'
+ +'abel'#6'Label1'#4'Left'#3#240#0#6'Height'#2#13#3'Top'#2#14#5'Width'#2'M'#7
+ +'Caption'#6#13'Current code:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'T'
+ +'Label'#7'CodeLbl'#4'Left'#3'H'#1#6'Height'#2#13#3'Top'#2#14#5'Width'#2'q'#7
+ +'Caption'#6#16'0000000000000000'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#7
+ +'TButton'#7'CodeBtn'#4'Left'#2#8#6'Height'#2#25#3'Top'#2#8#5'Width'#2'Y'#25
+ +'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Enter Code'#7'OnClick'#7#12
+ +'CodeBtnClick'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#3
+ +#209#0#3'Top'#2'('#5'Width'#3#209#1#5'Color'#7#9'clBtnFace'#13'Lines.Strings'
+ +#1#6'fThe label at the bottom of this form indicates the status of the code.'
+ +' An invalid code indicates that '#6'Ethe code is either the incorrect type '
+ +'or that none has been entered. '#6#0#6'^If the proper code has not been ent'
+ +'ered or the ONGUARD.INI file was deleted, the message will '#6#29'say that '
+ +'the code is invalid.'#6#0#6'YUse the "Enter Code" button to enter a code (t'
+ +'he CODEGEN program can be used to generate '#6#25'the proper "Date" code). '
+ +#6#0#6'\The "Remove Code" button can be used to remove the entered code from'
+ +' the INI file. Doing so '#6'Hwill cause the TOgDateCode component to report'
+ +' that the code is invalid.'#0#8'ReadOnly'#9#8'TabOrder'#2#1#0#0#7'TBitBtn'#8
+ +'CloseBtn'#4'Left'#3#144#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'K'#4'Kind'
+ +#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0#7'TButton'#9'RemoveBtn'#4
+ +'Left'#3' '#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'a'#25'BorderSpacing.Inn'
+ +'erBorder'#2#4#7'Caption'#6#11'Remove Code'#7'OnClick'#7#14'RemoveBtnClick'#8
+ +'TabOrder'#2#3#0#0#11'TOgDateCode'#11'OgDateCode1'#9'OnChecked'#7#11'CodeChe'
+ +'cked'#8'OnGetKey'#7#6'GetKey'#9'OnGetCode'#7#7'GetCode'#4'left'#2#16#3'top'
+ +#3#216#0#0#0#0
+]);
diff --git a/components/onguard/examples/exdtreg/exdtregu.pas b/components/onguard/examples/exdtreg/exdtregu.pas
new file mode 100644
index 000000000..9456a8911
--- /dev/null
+++ b/components/onguard/examples/exdtreg/exdtregu.pas
@@ -0,0 +1,130 @@
+unit ExDTRegU;
+
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ StdCtrls, Buttons,LResources, OnGuard, IniFiles, OgUtil;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ OgDateCode1: TOgDateCode;
+ CodeBtn: TButton;
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ StatusLbl: TLabel;
+ Label1: TLabel;
+ CodeLbl: TLabel;
+ RemoveBtn: TButton;
+ procedure CodeChecked(Sender: TObject; Status: TCodeStatus);
+ procedure GetKey(Sender: TObject; var Key: TKey);
+ procedure GetCode(Sender: TObject; var Code: TCode);
+ procedure CodeBtnClick(Sender: TObject);
+ procedure RemoveBtnClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+procedure TForm1.CodeChecked(Sender: TObject; Status: TCodeStatus);
+var
+ S : string;
+begin
+ ShortDateFormat := 'yyyy-mm-dd';
+ case Status of
+ ogValidCode : S := 'Valid Code - Ending date: ' + DateToStr(OgDateCode1.GetValue);
+ ogInvalidCode : S := 'Invalid release code';
+ ogPastEndDate : S := 'Date has expired';
+ ogDayCountUsed : S := 'Zero days of use remaining';
+ ogRunCountUsed : S := 'Usage count has expired';
+ ogNetCountUsed : S := 'Net usage count exceeded';
+ ogCodeExpired : S := 'Code has expired';
+ else
+ S := 'Unknown error';
+ end;
+ StatusLbl.Caption := S;
+end;
+
+procedure TForm1.GetKey(Sender: TObject; var Key: TKey);
+const
+ {this applications' key}
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+begin
+ Key := CKey;
+end;
+
+procedure TForm1.GetCode(Sender: TObject; var Code: TCode);
+var
+ Ini : TIniFile;
+ S : string;
+begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {get the date code from the ini file}
+ S := Ini.ReadString('Codes', 'DateCode', '');
+ {convert to proper form}
+ HexToBuffer(S, Code, SizeOf(Code));
+ {set code label caption}
+ CodeLbl.Caption := S;
+ finally
+ Ini.Free;
+ end;
+end;
+
+procedure TForm1.CodeBtnClick(Sender: TObject);
+var
+ Ini : TIniFile;
+ Work : TCode;
+ S : string;
+begin
+ S := '';
+ {ask for code}
+ if InputQuery('Date Code Entry', 'Enter the code', S) then begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {store the date code in the ini file if it looks OK}
+ if HexToBuffer(S, Work, SizeOf(Work)) then begin
+ {save the value}
+ Ini.WriteString('Codes', 'DateCode', S);
+ CodeLbl.Caption := S;
+
+ {tell the code component to test the new code, reporting the results}
+ OgDateCode1.CheckCode(True);
+ end;
+ finally
+ Ini.Free;
+ end;
+ end;
+end;
+
+procedure TForm1.RemoveBtnClick(Sender: TObject);
+var
+ IniFile : TIniFile;
+begin
+ IniFile := TIniFile.Create('ONGUARD.INI');
+ try
+ IniFile.DeleteKey('Codes', 'DateCode');
+ finally
+ IniFile.Free;
+ end;
+
+ {tell the code component to test the new code, reporting the results}
+ OgDateCode1.CheckCode(True);
+end;
+
+
+initialization
+{$i exdtregu.lrs}
+
+end.
diff --git a/components/onguard/examples/exdyreg/ONGUARD.INI b/components/onguard/examples/exdyreg/ONGUARD.INI
new file mode 100644
index 000000000..96b0c0d99
--- /dev/null
+++ b/components/onguard/examples/exdyreg/ONGUARD.INI
@@ -0,0 +1,2 @@
+[Codes]
+DaysCode=B166F4C9600A9E1A
diff --git a/components/onguard/examples/exdyreg/exdyreg.lpi b/components/onguard/examples/exdyreg/exdyreg.lpi
new file mode 100644
index 000000000..be600aca8
--- /dev/null
+++ b/components/onguard/examples/exdyreg/exdyreg.lpi
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exdyreg/exdyreg.lpr b/components/onguard/examples/exdyreg/exdyreg.lpr
new file mode 100644
index 000000000..819f50b87
--- /dev/null
+++ b/components/onguard/examples/exdyreg/exdyreg.lpr
@@ -0,0 +1,14 @@
+program ExDYReg;
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ ExDYRegU in 'ExDYRegU.pas' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exdyreg/exdyregu.lfm b/components/onguard/examples/exdyreg/exdyregu.lfm
new file mode 100644
index 000000000..f582abab6
--- /dev/null
+++ b/components/onguard/examples/exdyreg/exdyregu.lfm
@@ -0,0 +1,99 @@
+object Form1: TForm1
+ Left = 252
+ Height = 303
+ Top = 138
+ Width = 493
+ HorzScrollBar.Page = 492
+ VertScrollBar.Page = 302
+ BorderStyle = bsDialog
+ Caption = 'Days Code Example'
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Position = poScreenCenter
+ object StatusLbl: TLabel
+ Left = 8
+ Height = 13
+ Top = 262
+ Width = 35
+ Caption = 'Status'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label1: TLabel
+ Left = 232
+ Height = 13
+ Top = 14
+ Width = 77
+ Caption = 'Current code:'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeLbl: TLabel
+ Left = 320
+ Height = 13
+ Top = 14
+ Width = 113
+ Caption = '0000000000000000'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeBtn: TButton
+ Left = 8
+ Height = 25
+ Top = 8
+ Width = 89
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Enter Code'
+ OnClick = CodeBtnClick
+ TabOrder = 0
+ end
+ object Memo1: TMemo
+ Left = 8
+ Height = 209
+ Top = 40
+ Width = 465
+ Color = clBtnFace
+ Lines.Strings = (
+ 'The label at the bottom of this form indicates the status of the code. An invalid code indicates that '
+ 'the code is either the incorrect type or that none has been entered. '
+ ''
+ 'If the proper code has not been entered or the ONGUARD.INI file was deleted, the message will '
+ 'say that the code is invalid.'
+ ''
+ 'Use the "Enter Code" button to enter a code (the CODEGEN program can be used to generate '
+ 'the proper "Days" code). '
+ ''
+ 'The "Remove Code" button can be used to remove the entered code from the INI file. Doing so '
+ 'will cause the TOgDaysCode component to report that the code is invalid.'
+ )
+ ReadOnly = True
+ TabOrder = 1
+ end
+ object CloseBtn: TBitBtn
+ Left = 400
+ Height = 25
+ Top = 256
+ Width = 75
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 2
+ end
+ object RemoveBtn: TButton
+ Left = 288
+ Height = 25
+ Top = 256
+ Width = 97
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Remove Code'
+ OnClick = RemoveBtnClick
+ TabOrder = 3
+ end
+ object OgDaysCode1: TOgDaysCode
+ OnChecked = CodeChecked
+ OnGetKey = GetKey
+ OnGetCode = GetCode
+ OnChangeCode = ChangeCode
+ left = 16
+ top = 208
+ end
+end
diff --git a/components/onguard/examples/exdyreg/exdyregu.lrs b/components/onguard/examples/exdyreg/exdyregu.lrs
new file mode 100644
index 000000000..c22b2e718
--- /dev/null
+++ b/components/onguard/examples/exdyreg/exdyregu.lrs
@@ -0,0 +1,34 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#252#0#6'Height'#3'/'#1#3'Top'#3#138#0#5'W'
+ +'idth'#3#237#1#18'HorzScrollBar.Page'#3#236#1#18'VertScrollBar.Page'#3'.'#1
+ +#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#17'Days Code Example'#11'Font.He'
+ +'ight'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScreenCente'
+ +'r'#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Height'#2#13#3'Top'#3#6#1#5'Width'
+ +#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TL'
+ +'abel'#6'Label1'#4'Left'#3#232#0#6'Height'#2#13#3'Top'#2#14#5'Width'#2'M'#7
+ +'Caption'#6#13'Current code:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'T'
+ +'Label'#7'CodeLbl'#4'Left'#3'@'#1#6'Height'#2#13#3'Top'#2#14#5'Width'#2'q'#7
+ +'Caption'#6#16'0000000000000000'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#7
+ +'TButton'#7'CodeBtn'#4'Left'#2#8#6'Height'#2#25#3'Top'#2#8#5'Width'#2'Y'#25
+ +'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Enter Code'#7'OnClick'#7#12
+ +'CodeBtnClick'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#3
+ +#209#0#3'Top'#2'('#5'Width'#3#209#1#5'Color'#7#9'clBtnFace'#13'Lines.Strings'
+ +#1#6'fThe label at the bottom of this form indicates the status of the code.'
+ +' An invalid code indicates that '#6'Ethe code is either the incorrect type '
+ +'or that none has been entered. '#6#0#6'^If the proper code has not been ent'
+ +'ered or the ONGUARD.INI file was deleted, the message will '#6#29'say that '
+ +'the code is invalid.'#6#0#6'YUse the "Enter Code" button to enter a code (t'
+ +'he CODEGEN program can be used to generate '#6#25'the proper "Days" code). '
+ +#6#0#6'\The "Remove Code" button can be used to remove the entered code from'
+ +' the INI file. Doing so '#6'Hwill cause the TOgDaysCode component to report'
+ +' that the code is invalid.'#0#8'ReadOnly'#9#8'TabOrder'#2#1#0#0#7'TBitBtn'#8
+ +'CloseBtn'#4'Left'#3#144#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'K'#4'Kind'
+ +#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0#7'TButton'#9'RemoveBtn'#4
+ +'Left'#3' '#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'a'#25'BorderSpacing.Inn'
+ +'erBorder'#2#4#7'Caption'#6#11'Remove Code'#7'OnClick'#7#14'RemoveBtnClick'#8
+ +'TabOrder'#2#3#0#0#11'TOgDaysCode'#11'OgDaysCode1'#9'OnChecked'#7#11'CodeChe'
+ +'cked'#8'OnGetKey'#7#6'GetKey'#9'OnGetCode'#7#7'GetCode'#12'OnChangeCode'#7
+ +#10'ChangeCode'#4'left'#2#16#3'top'#3#208#0#0#0#0
+]);
diff --git a/components/onguard/examples/exdyreg/exdyregu.pas b/components/onguard/examples/exdyreg/exdyregu.pas
new file mode 100644
index 000000000..aadbf991a
--- /dev/null
+++ b/components/onguard/examples/exdyreg/exdyregu.pas
@@ -0,0 +1,149 @@
+unit ExDYRegU;
+
+{$H+}
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ StdCtrls, Buttons,LResources, OnGuard, IniFiles, OgUtil;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ CodeBtn: TButton;
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ StatusLbl: TLabel;
+ Label1: TLabel;
+ CodeLbl: TLabel;
+ RemoveBtn: TButton;
+ OgDaysCode1: TOgDaysCode;
+ procedure CodeChecked(Sender: TObject; Status: TCodeStatus);
+ procedure GetKey(Sender: TObject; var Key: TKey);
+ procedure GetCode(Sender: TObject; var Code: TCode);
+ procedure CodeBtnClick(Sender: TObject);
+ procedure RemoveBtnClick(Sender: TObject);
+ procedure ChangeCode(Sender: TObject; Code: TCode);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+procedure TForm1.CodeChecked(Sender: TObject; Status: TCodeStatus);
+var
+ S : string;
+begin
+ case Status of
+ ogValidCode : S := 'Valid Code - Days remaining: ' + IntToStr(OgDaysCode1.GetValue);
+ ogInvalidCode : S := 'Invalid release code';
+ ogPastEndDate : S := 'Date has expired';
+ ogDayCountUsed : S := 'Zero days of use remaining';
+ ogRunCountUsed : S := 'Usage count has expired';
+ ogNetCountUsed : S := 'Net usage count exceeded';
+ ogCodeExpired : S := 'Code has expired';
+ else
+ S := 'Unknown error';
+ end;
+ StatusLbl.Caption := S;
+end;
+
+procedure TForm1.GetKey(Sender: TObject; var Key: TKey);
+const
+ {this applications' key}
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+begin
+ Key := CKey;
+end;
+
+procedure TForm1.GetCode(Sender: TObject; var Code: TCode);
+var
+ Ini : TIniFile;
+ S : string;
+begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {get the days code from the ini file}
+ S := Ini.ReadString('Codes', 'DaysCode', '');
+ {convert to proper form}
+ HexToBuffer(S, Code, SizeOf(Code));
+ {set code label caption}
+ CodeLbl.Caption := S;
+ finally
+ Ini.Free;
+ end;
+end;
+
+procedure TForm1.CodeBtnClick(Sender: TObject);
+var
+ Ini : TIniFile;
+ Work : TCode;
+ S : string;
+begin
+ S := '';
+ {ask for code}
+ if InputQuery('Days Code Entry', 'Enter the code', S) then begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {store the date code in the ini file if it looks OK}
+ if HexToBuffer(S, Work, SizeOf(Work)) then begin
+ {save the value}
+ Ini.WriteString('Codes', 'DaysCode', S);
+ CodeLbl.Caption := S;
+
+ {tell the code component to test the new code, reporting the results}
+ OgDaysCode1.CheckCode(True);
+ end;
+ finally
+ Ini.Free;
+ end;
+ end;
+end;
+
+procedure TForm1.RemoveBtnClick(Sender: TObject);
+var
+ IniFile : TIniFile;
+begin
+ IniFile := TIniFile.Create('ONGUARD.INI');
+ try
+ IniFile.DeleteKey('Codes', 'DaysCode');
+ finally
+ IniFile.Free;
+ end;
+
+ {tell the code component to test the new code, reporting the results}
+ OgDaysCode1.CheckCode(True);
+end;
+
+procedure TForm1.ChangeCode(Sender: TObject; Code: TCode);
+var
+ Ini : TIniFile;
+ S : string;
+begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {store the days code in the ini file}
+ S := BufferToHex(Code, SizeOf(Code));
+ Ini.WriteString('Codes', 'DaysCode', S);
+ CodeLbl.Caption := S;
+
+ {tell the code component to test the new code, reporting the results}
+ OgDaysCode1.CheckCode(True);
+ finally
+ Ini.Free;
+ end;
+end;
+
+initialization
+{$i exdyregu.lrs}
+
+end.
diff --git a/components/onguard/examples/exdys30/Days30.INI b/components/onguard/examples/exdys30/Days30.INI
new file mode 100644
index 000000000..b0ac1982b
--- /dev/null
+++ b/components/onguard/examples/exdys30/Days30.INI
@@ -0,0 +1,2 @@
+[Codes]
+DaysCode=82FC3292E294CC3A
diff --git a/components/onguard/examples/exdys30/exdys30.lpi b/components/onguard/examples/exdys30/exdys30.lpi
new file mode 100644
index 000000000..d167c5b67
--- /dev/null
+++ b/components/onguard/examples/exdys30/exdys30.lpi
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exdys30/exdys30.lpr b/components/onguard/examples/exdys30/exdys30.lpr
new file mode 100644
index 000000000..bee12ccd2
--- /dev/null
+++ b/components/onguard/examples/exdys30/exdys30.lpr
@@ -0,0 +1,14 @@
+program Exdys30;
+{$objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ Exdys30u in 'EXDYS30U.PAS' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exdys30/exdys30u.lfm b/components/onguard/examples/exdys30/exdys30u.lfm
new file mode 100644
index 000000000..1de9b5cf0
--- /dev/null
+++ b/components/onguard/examples/exdys30/exdys30u.lfm
@@ -0,0 +1,52 @@
+object Form1: TForm1
+ Left = 324
+ Height = 158
+ Top = 260
+ Width = 229
+ HorzScrollBar.Page = 228
+ VertScrollBar.Page = 157
+ Caption = 'Form1'
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Position = poScreenCenter
+ object Label1: TLabel
+ Left = 64
+ Height = 13
+ Top = 74
+ Width = 99
+ Alignment = taCenter
+ Caption = 'Days Remaining: '
+ Color = clNone
+ ParentColor = False
+ end
+ object Memo1: TMemo
+ Left = 6
+ Height = 45
+ Top = 14
+ Width = 213
+ Lines.Strings = (
+ 'If you can edit this, then your program '
+ 'was allowed to run'
+ )
+ ScrollBars = ssVertical
+ TabOrder = 0
+ end
+ object CloseBtn: TBitBtn
+ Left = 64
+ Height = 33
+ Top = 92
+ Width = 89
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 1
+ end
+ object OgDaysCode1: TOgDaysCode
+ OnChecked = OgDaysCode1Checked
+ OnGetKey = OgDaysCode1GetKey
+ OnGetCode = OgDaysCode1GetCode
+ OnChangeCode = OgDaysCode1ChangeCode
+ left = 88
+ top = 176
+ end
+end
diff --git a/components/onguard/examples/exdys30/exdys30u.lrs b/components/onguard/examples/exdys30/exdys30u.lrs
new file mode 100644
index 000000000..2ea6a107d
--- /dev/null
+++ b/components/onguard/examples/exdys30/exdys30u.lrs
@@ -0,0 +1,18 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'D'#1#6'Height'#3#158#0#3'Top'#3#4#1#5'Wid'
+ +'th'#3#229#0#18'HorzScrollBar.Page'#3#228#0#18'VertScrollBar.Page'#3#157#0#7
+ +'Caption'#6#5'Form1'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#245#9'Fon'
+ +'t.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScreenCenter'#0#6'TLabel'#6
+ +'Label1'#4'Left'#2'@'#6'Height'#2#13#3'Top'#2'J'#5'Width'#2'c'#9'Alignment'#7
+ +#8'taCenter'#7'Caption'#6#16'Days Remaining: '#5'Color'#7#6'clNone'#11'Paren'
+ +'tColor'#8#0#0#5'TMemo'#5'Memo1'#4'Left'#2#6#6'Height'#2'-'#3'Top'#2#14#5'Wi'
+ +'dth'#3#213#0#13'Lines.Strings'#1#6'(If you can edit this, then your program'
+ +' '#6#18'was allowed to run'#0#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'#2
+ +#0#0#0#7'TBitBtn'#8'CloseBtn'#4'Left'#2'@'#6'Height'#2'!'#3'Top'#2'\'#5'Widt'
+ +'h'#2'Y'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#11'TOgDay'
+ +'sCode'#11'OgDaysCode1'#9'OnChecked'#7#18'OgDaysCode1Checked'#8'OnGetKey'#7
+ +#17'OgDaysCode1GetKey'#9'OnGetCode'#7#18'OgDaysCode1GetCode'#12'OnChangeCode'
+ +#7#21'OgDaysCode1ChangeCode'#4'left'#2'X'#3'top'#3#176#0#0#0#0
+]);
diff --git a/components/onguard/examples/exdys30/exdys30u.pas b/components/onguard/examples/exdys30/exdys30u.pas
new file mode 100644
index 000000000..4211aede1
--- /dev/null
+++ b/components/onguard/examples/exdys30/exdys30u.pas
@@ -0,0 +1,138 @@
+(*
+ This program uses the TOgDaysCode component. The first time the
+ program is run, the necessary information is created and stored
+ in an INI file. In addition, the program is given a "drop dead"
+ date, i.e., regardless of how many days the program has been used,
+ it cannont be used after that date (1999 December 31).
+*)
+unit Exdys30u;
+
+interface
+
+uses
+ SysUtils, Classes, Controls,
+ Forms, Dialogs,LResources, StdCtrls, Buttons,
+ OnGuard,OgUtil,IniFiles;
+
+const
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,
+ $1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ OgDaysCode1: TOgDaysCode;
+ Label1: TLabel;
+ procedure OgDaysCode1GetKey(Sender: TObject; var Key: TKey);
+ procedure OgDaysCode1GetCode(Sender: TObject; var Code: TCode);
+ procedure OgDaysCode1ChangeCode(Sender: TObject; Code: TCode);
+ procedure OgDaysCode1Checked(Sender: TObject; Status: TCodeStatus);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ TheDir : string;
+ IniFile : TIniFile;
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+{==========================================================================}
+
+procedure TForm1.OgDaysCode1GetKey(Sender: TObject; var Key: TKey);
+begin
+ Key := CKey;
+end;
+
+{==========================================================================}
+
+procedure TForm1.OgDaysCode1GetCode(Sender: TObject; var Code: TCode);
+var
+ S : string;
+ Expires : TDateTime;
+ L : integer;
+begin
+ {force the INI file to be in the same directory as the application}
+ TheDir := ExtractFilePath(ParamStr(0));
+ {
+ L := Length(TheDir);
+ if (L > 3) and (TheDir[L] <> '\') then
+ TheDir := TheDir + '\';}
+
+ {open Ini File}
+ IniFile := TIniFile.Create(TheDir + 'Days30.INI');
+ try
+ {try to read release code}
+ S := IniFile.ReadString('Codes', 'DaysCode', 'NoCode');
+
+ {If default string returned, create code on the fly}
+ if (S = 'NoCode') then begin
+ {force absolute ("drop dead") expiration date of 1999 Dec. 31}
+ Expires := EncodeDate(1999, 12, 31);
+ InitDaysCode(CKey, 30, Expires, Code);
+
+ {save string representation of release code to Ini File}
+ S := BufferToHex(Code, SizeOf(Code));
+ IniFile.WriteString('Codes', 'DaysCode', S);
+ end else
+ {convert retrieved string to a code}
+ HexToBuffer(S, Code, SizeOf(Code));
+ finally
+ IniFile.Free;
+ end;
+end;
+
+{==========================================================================}
+
+procedure TForm1.OgDaysCode1ChangeCode(Sender: TObject; Code: TCode);
+var
+ S : string;
+begin
+ IniFile := TIniFile.Create(TheDir + 'Days30.INI');
+ try
+ {convert Code to string for writing to INI file}
+ S := BufferToHex(Code, SizeOf(Code));
+ IniFile.WriteString('Codes', 'DaysCode', S);
+ finally
+ IniFile.Free;
+ end;
+end;
+
+{==========================================================================}
+
+procedure TForm1.OgDaysCode1Checked(Sender: TObject; Status: TCodeStatus);
+var
+ S : string;
+begin
+ case Status of
+ ogValidCode : begin
+ Label1.Caption := 'Days Remaining: '
+ + IntToStr(OgDaysCode1.GetValue);
+ Exit;
+ end;
+
+ ogInvalidCode : S := 'Invalid Code';
+
+ ogDayCountUsed : S := 'Program used more than 30 days' + #13 +
+ 'Please register NOW';
+
+ ogCodeExpired : S := 'Evaluation period expired' + #13 +
+ 'Please register NOW';
+ end;
+ ShowMessage(S);
+ Application.Terminate;
+end;
+
+initialization
+{$i exdys30u.lrs}
+
+end.
diff --git a/components/onguard/examples/exinst/exinst.lpi b/components/onguard/examples/exinst/exinst.lpi
new file mode 100644
index 000000000..eca2c7ef0
--- /dev/null
+++ b/components/onguard/examples/exinst/exinst.lpi
@@ -0,0 +1,275 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exinst/exinst.lpr b/components/onguard/examples/exinst/exinst.lpr
new file mode 100644
index 000000000..7f389765f
--- /dev/null
+++ b/components/onguard/examples/exinst/exinst.lpr
@@ -0,0 +1,23 @@
+program Exinst;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,ogfirst,
+ EXINSTU in 'EXINSTU.pas' {FirstInstFrm};
+
+
+
+begin
+
+ Application.Initialize;
+ Application.Title := 'First instance example';
+ Application.CreateForm(TFirstInstFrm, FirstInstFrm);
+
+ if IsFirstInstance then
+ Application.Run
+ else
+ ActivateFirstInstance;
+
+end.
diff --git a/components/onguard/examples/exinst/exinstu.lfm b/components/onguard/examples/exinst/exinstu.lfm
new file mode 100644
index 000000000..b3aaff986
--- /dev/null
+++ b/components/onguard/examples/exinst/exinstu.lfm
@@ -0,0 +1,42 @@
+object FirstInstFrm: TFirstInstFrm
+ ActiveControl = Memo1
+ Caption = 'Single Instance Example'
+ ClientHeight = 140
+ ClientWidth = 320
+ Font.Color = clText
+ Font.Height = 11
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ PixelsPerInch = 96
+ TextHeight = 18
+ HorzScrollBar.Page = 319
+ HorzScrollBar.Range = 307
+ VertScrollBar.Page = 139
+ VertScrollBar.Range = 129
+ Left = 327
+ Height = 140
+ Top = 218
+ Width = 320
+ object Memo1: TMemo
+ Lines.Strings = (
+ 'Attempts to execute this application a second time result in '
+ 'the first instance to be activated and the second instance '
+ 'terminated.'
+ )
+ ReadOnly = True
+ TabOrder = 0
+ Left = 8
+ Height = 89
+ Top = 8
+ Width = 297
+ end
+ object BitBtn2: TBitBtn
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 1
+ Left = 232
+ Height = 25
+ Top = 104
+ Width = 75
+ end
+end
diff --git a/components/onguard/examples/exinst/exinstu.lrs b/components/onguard/examples/exinst/exinstu.lrs
new file mode 100644
index 000000000..cd9310c17
--- /dev/null
+++ b/components/onguard/examples/exinst/exinstu.lrs
@@ -0,0 +1,17 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TFirstInstFrm','FORMDATA',[
+ 'TPF0'#13'TFirstInstFrm'#12'FirstInstFrm'#13'ActiveControl'#7#5'Memo1'#7'Capt'
+ +'ion'#6#23'Single Instance Example'#12'ClientHeight'#3#140#0#11'ClientWidth'
+ +#3'@'#1#10'Font.Color'#7#6'clText'#11'Font.Height'#2#11#9'Font.Name'#6#13'MS'
+ +' Sans Serif'#10'Font.Pitch'#7#10'fpVariable'#13'PixelsPerInch'#2'`'#10'Text'
+ +'Height'#2#18#18'HorzScrollBar.Page'#3'?'#1#19'HorzScrollBar.Range'#3'3'#1#18
+ +'VertScrollBar.Page'#3#139#0#19'VertScrollBar.Range'#3#129#0#4'Left'#3'G'#1#6
+ +'Height'#3#140#0#3'Top'#3#218#0#5'Width'#3'@'#1#0#5'TMemo'#5'Memo1'#13'Lines'
+ +'.Strings'#1#6'=Attempts to execute this application a second time result in'
+ +' '#6';the first instance to be activated and the second instance '#6#11'ter'
+ +'minated.'#0#8'ReadOnly'#9#8'TabOrder'#2#0#4'Left'#2#8#6'Height'#2'Y'#3'Top'
+ +#2#8#5'Width'#3')'#1#0#0#7'TBitBtn'#7'BitBtn2'#4'Kind'#7#7'bkClose'#9'NumGly'
+ +'phs'#2#0#8'TabOrder'#2#1#4'Left'#3#232#0#6'Height'#2#25#3'Top'#2'h'#5'Width'
+ +#2'K'#0#0#0
+]);
diff --git a/components/onguard/examples/exinst/exinstu.pas b/components/onguard/examples/exinst/exinstu.pas
new file mode 100644
index 000000000..3b457b68e
--- /dev/null
+++ b/components/onguard/examples/exinst/exinstu.pas
@@ -0,0 +1,30 @@
+unit EXINSTU;
+
+interface
+
+uses
+ SysUtils, Classes, Graphics,
+ Forms, Dialogs, StdCtrls, Buttons, Controls,LResources;
+
+type
+
+ { TFirstInstFrm }
+
+ TFirstInstFrm = class(TForm)
+ Memo1: TMemo;
+ BitBtn2: TBitBtn;
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ FirstInstFrm: TFirstInstFrm;
+
+implementation
+
+initialization
+{$I exinstu.lrs}
+
+end.
diff --git a/components/onguard/examples/exmachid/exmachid.lpi b/components/onguard/examples/exmachid/exmachid.lpi
new file mode 100644
index 000000000..64edd0d27
--- /dev/null
+++ b/components/onguard/examples/exmachid/exmachid.lpi
@@ -0,0 +1,272 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exmachid/exmachid.lpr b/components/onguard/examples/exmachid/exmachid.lpr
new file mode 100644
index 000000000..ab6be6a74
--- /dev/null
+++ b/components/onguard/examples/exmachid/exmachid.lpr
@@ -0,0 +1,15 @@
+program ExMachID;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ umachid in 'umachid.pas';
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TfrmExMachineID,frmExMachineID);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exmachid/umachid.lfm b/components/onguard/examples/exmachid/umachid.lfm
new file mode 100644
index 000000000..293331c52
--- /dev/null
+++ b/components/onguard/examples/exmachid/umachid.lfm
@@ -0,0 +1,82 @@
+object frmExMachineID: TfrmExMachineID
+ ActiveControl = chkUser
+ BorderIcons = [biSystemMenu, biMinimize]
+ Caption = 'ExMachineID'
+ ClientHeight = 174
+ ClientWidth = 240
+ Font.Color = clText
+ Font.Height = 11
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ PixelsPerInch = 96
+ Position = poScreenCenter
+ TextHeight = 18
+ HorzScrollBar.Page = 239
+ HorzScrollBar.Range = 209
+ VertScrollBar.Page = 173
+ VertScrollBar.Range = 121
+ Left = 364
+ Height = 174
+ Top = 254
+ Width = 240
+ object GroupBox1: TGroupBox
+ Caption = ' Machine Info Set '
+ ClientHeight = 119
+ ClientWidth = 109
+ TabOrder = 0
+ Left = 8
+ Height = 137
+ Top = 8
+ Width = 113
+ object chkUser: TCheckBox
+ Caption = 'User'
+ TabOrder = 0
+ Left = 24
+ Height = 17
+ Top = 16
+ Width = 65
+ end
+ object chkSystem: TCheckBox
+ Caption = 'System'
+ TabOrder = 1
+ Left = 24
+ Height = 17
+ Top = 40
+ Width = 65
+ end
+ object chkNetwork: TCheckBox
+ Caption = 'Network'
+ TabOrder = 2
+ Left = 24
+ Height = 17
+ Top = 64
+ Width = 73
+ end
+ object chkDrives: TCheckBox
+ Caption = 'Drives'
+ TabOrder = 3
+ Left = 24
+ Height = 17
+ Top = 88
+ Width = 57
+ end
+ end
+ object btnGenerate: TButton
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Generate'
+ OnClick = btnGenerateClick
+ TabOrder = 1
+ Left = 131
+ Height = 25
+ Top = 32
+ Width = 75
+ end
+ object edtMachineID: TEdit
+ ReadOnly = True
+ TabOrder = 2
+ Left = 128
+ Height = 26
+ Top = 72
+ Width = 81
+ end
+end
diff --git a/components/onguard/examples/exmachid/umachid.lrs b/components/onguard/examples/exmachid/umachid.lrs
new file mode 100644
index 000000000..44d68fd51
--- /dev/null
+++ b/components/onguard/examples/exmachid/umachid.lrs
@@ -0,0 +1,25 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TfrmExMachineID','FORMDATA',[
+ 'TPF0'#15'TfrmExMachineID'#14'frmExMachineID'#13'ActiveControl'#7#7'chkUser'
+ +#11'BorderIcons'#11#12'biSystemMenu'#10'biMinimize'#0#7'Caption'#6#11'ExMach'
+ +'ineID'#12'ClientHeight'#3#174#0#11'ClientWidth'#3#240#0#10'Font.Color'#7#6
+ +'clText'#11'Font.Height'#2#11#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Pitch'
+ +#7#10'fpVariable'#13'PixelsPerInch'#2'`'#8'Position'#7#14'poScreenCenter'#10
+ +'TextHeight'#2#18#18'HorzScrollBar.Page'#3#239#0#19'HorzScrollBar.Range'#3
+ +#209#0#18'VertScrollBar.Page'#3#173#0#19'VertScrollBar.Range'#2'y'#4'Left'#3
+ +'l'#1#6'Height'#3#174#0#3'Top'#3#254#0#5'Width'#3#240#0#0#9'TGroupBox'#9'Gro'
+ +'upBox1'#7'Caption'#6#18' Machine Info Set '#12'ClientHeight'#2'w'#11'Client'
+ +'Width'#2'm'#8'TabOrder'#2#0#4'Left'#2#8#6'Height'#3#137#0#3'Top'#2#8#5'Widt'
+ +'h'#2'q'#0#9'TCheckBox'#7'chkUser'#7'Caption'#6#4'User'#8'TabOrder'#2#0#4'Le'
+ +'ft'#2#24#6'Height'#2#17#3'Top'#2#16#5'Width'#2'A'#0#0#9'TCheckBox'#9'chkSys'
+ +'tem'#7'Caption'#6#6'System'#8'TabOrder'#2#1#4'Left'#2#24#6'Height'#2#17#3'T'
+ +'op'#2'('#5'Width'#2'A'#0#0#9'TCheckBox'#10'chkNetwork'#7'Caption'#6#7'Netwo'
+ +'rk'#8'TabOrder'#2#2#4'Left'#2#24#6'Height'#2#17#3'Top'#2'@'#5'Width'#2'I'#0
+ +#0#9'TCheckBox'#9'chkDrives'#7'Caption'#6#6'Drives'#8'TabOrder'#2#3#4'Left'#2
+ +#24#6'Height'#2#17#3'Top'#2'X'#5'Width'#2'9'#0#0#0#7'TButton'#11'btnGenerate'
+ +#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#8'Generate'#7'OnClick'#7#16
+ +'btnGenerateClick'#8'TabOrder'#2#1#4'Left'#3#131#0#6'Height'#2#25#3'Top'#2' '
+ +#5'Width'#2'K'#0#0#5'TEdit'#12'edtMachineID'#8'ReadOnly'#9#8'TabOrder'#2#2#4
+ +'Left'#3#128#0#6'Height'#2#26#3'Top'#2'H'#5'Width'#2'Q'#0#0#0
+]);
diff --git a/components/onguard/examples/exmachid/umachid.pas b/components/onguard/examples/exmachid/umachid.pas
new file mode 100644
index 000000000..725de3d79
--- /dev/null
+++ b/components/onguard/examples/exmachid/umachid.pas
@@ -0,0 +1,67 @@
+unit uMachID;
+
+interface
+
+uses
+ SysUtils, Classes,
+ Graphics, Controls, Forms, Dialogs,Buttons, StdCtrls,LResources;
+
+type
+
+ { TfrmExMachineID }
+
+ TfrmExMachineID = class(TForm)
+ GroupBox1: TGroupBox;
+ chkUser: TCheckBox;
+ chkSystem: TCheckBox;
+ chkNetwork: TCheckBox;
+ chkDrives: TCheckBox;
+ btnGenerate: TButton;
+ edtMachineID: TEdit;
+ procedure btnGenerateClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ frmExMachineID: TfrmExMachineID;
+
+implementation
+
+
+
+uses
+ onguard, ogutil;
+
+procedure TfrmExMachineID.btnGenerateClick(Sender: TObject);
+var
+ InfoSet : TEsMachineInfoSet;
+ MachineID : Longint;
+begin
+ { initialize the machine information set }
+ InfoSet := [];
+ if chkUser.Checked then
+ InfoSet := InfoSet + [midUser];
+ if chkSystem.Checked then
+ InfoSet := InfoSet + [midSystem];
+ if chkNetwork.Checked then
+ InfoSet := InfoSet + [midNetwork];
+ if chkDrives.Checked then
+ InfoSet := InfoSet + [midDrives];
+
+ { create the machine ID and display in hex }
+ try
+ MachineID := CreateMachineID(InfoSet);
+ edtMachineID.Text := '$' + BufferToHex(MachineID, SizeOf(MachineID));
+ except on E:Exception do
+ ShowMessage(E.Message);
+ end;
+end;
+
+initialization
+{$I umachid.lrs}
+
+end.
+
diff --git a/components/onguard/examples/exnet/EXNET.NAF b/components/onguard/examples/exnet/EXNET.NAF
new file mode 100644
index 000000000..6fd4033f2
--- /dev/null
+++ b/components/onguard/examples/exnet/EXNET.NAF
@@ -0,0 +1 @@
+ô)#íȸgüû4
\ No newline at end of file
diff --git a/components/onguard/examples/exnet/ONGUARD.INI b/components/onguard/examples/exnet/ONGUARD.INI
new file mode 100644
index 000000000..69dc04c6d
--- /dev/null
+++ b/components/onguard/examples/exnet/ONGUARD.INI
@@ -0,0 +1,2 @@
+[Codes]
+NetCode=241918EC8E3BABBB
diff --git a/components/onguard/examples/exnet/exnet.lpi b/components/onguard/examples/exnet/exnet.lpi
new file mode 100644
index 000000000..d9c13ce58
--- /dev/null
+++ b/components/onguard/examples/exnet/exnet.lpi
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exnet/exnet.lpr b/components/onguard/examples/exnet/exnet.lpr
new file mode 100644
index 000000000..0bc106b62
--- /dev/null
+++ b/components/onguard/examples/exnet/exnet.lpr
@@ -0,0 +1,14 @@
+program Exnet;
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ Exnetu in 'EXNETU.PAS' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exnet/exnetu.lfm b/components/onguard/examples/exnet/exnetu.lfm
new file mode 100644
index 000000000..4c3bcece4
--- /dev/null
+++ b/components/onguard/examples/exnet/exnetu.lfm
@@ -0,0 +1,100 @@
+object Form1: TForm1
+ Left = 258
+ Height = 317
+ Top = 146
+ Width = 490
+ HorzScrollBar.Page = 489
+ VertScrollBar.Page = 316
+ BorderStyle = bsDialog
+ Caption = 'Network Code Example'
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ OnCreate = FormCreate
+ Position = poScreenCenter
+ object StatusLbl: TLabel
+ Left = 8
+ Height = 13
+ Top = 262
+ Width = 35
+ Caption = 'Status'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label1: TLabel
+ Left = 232
+ Height = 13
+ Top = 14
+ Width = 77
+ Caption = 'Current code:'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeLbl: TLabel
+ Left = 320
+ Height = 13
+ Top = 14
+ Width = 113
+ Caption = '0000000000000000'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeBtn: TButton
+ Left = 8
+ Height = 25
+ Top = 8
+ Width = 89
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Enter Code'
+ OnClick = CodeBtnClick
+ TabOrder = 0
+ end
+ object Memo1: TMemo
+ Left = 8
+ Height = 209
+ Top = 40
+ Width = 465
+ Color = clBtnFace
+ Lines.Strings = (
+ 'The label at the bottom of this form indicates the status of the code. An invalid code indicates that '
+ 'the code is either the incorrect type or that none has been entered. '
+ ''
+ 'If the proper code has not been entered or the ONGUARD.INI file was deleted, the message will '
+ 'say that the code is invalid.'
+ ''
+ 'Use the "Enter Code" button to enter a code (the CODEGEN program can be used to generate '
+ 'the proper "Usage" code). '
+ ''
+ 'The "Remove Code" button can be used to remove the entered code from the INI file. Doing so '
+ 'will cause the TOgNetCode component to report that the code is invalid.'
+ )
+ ReadOnly = True
+ TabOrder = 1
+ end
+ object CloseBtn: TBitBtn
+ Left = 400
+ Height = 25
+ Top = 256
+ Width = 75
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 2
+ end
+ object RemoveBtn: TButton
+ Left = 288
+ Height = 25
+ Top = 256
+ Width = 97
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Remove Code'
+ OnClick = RemoveBtnClick
+ TabOrder = 3
+ end
+ object OgNetCode1: TOgNetCode
+ OnChecked = CodeChecked
+ OnGetKey = GetKey
+ OnGetCode = GetCode
+ FileName = 'EXNET.NAF'
+ left = 16
+ top = 216
+ end
+end
diff --git a/components/onguard/examples/exnet/exnetu.lrs b/components/onguard/examples/exnet/exnetu.lrs
new file mode 100644
index 000000000..976f18125
--- /dev/null
+++ b/components/onguard/examples/exnet/exnetu.lrs
@@ -0,0 +1,34 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#2#1#6'Height'#3'='#1#3'Top'#3#146#0#5'Wid'
+ +'th'#3#234#1#18'HorzScrollBar.Page'#3#233#1#18'VertScrollBar.Page'#3'<'#1#11
+ +'BorderStyle'#7#8'bsDialog'#7'Caption'#6#20'Network Code Example'#11'Font.He'
+ +'ight'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'OnCreate'#7#10'FormCreate'#8
+ +'Position'#7#14'poScreenCenter'#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Heigh'
+ +'t'#2#13#3'Top'#3#6#1#5'Width'#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNo'
+ +'ne'#11'ParentColor'#8#0#0#6'TLabel'#6'Label1'#4'Left'#3#232#0#6'Height'#2#13
+ +#3'Top'#2#14#5'Width'#2'M'#7'Caption'#6#13'Current code:'#5'Color'#7#6'clNon'
+ +'e'#11'ParentColor'#8#0#0#6'TLabel'#7'CodeLbl'#4'Left'#3'@'#1#6'Height'#2#13
+ +#3'Top'#2#14#5'Width'#2'q'#7'Caption'#6#16'0000000000000000'#5'Color'#7#6'cl'
+ +'None'#11'ParentColor'#8#0#0#7'TButton'#7'CodeBtn'#4'Left'#2#8#6'Height'#2#25
+ +#3'Top'#2#8#5'Width'#2'Y'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10
+ +'Enter Code'#7'OnClick'#7#12'CodeBtnClick'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Me'
+ +'mo1'#4'Left'#2#8#6'Height'#3#209#0#3'Top'#2'('#5'Width'#3#209#1#5'Color'#7#9
+ +'clBtnFace'#13'Lines.Strings'#1#6'fThe label at the bottom of this form indi'
+ +'cates the status of the code. An invalid code indicates that '#6'Ethe code '
+ +'is either the incorrect type or that none has been entered. '#6#0#6'^If the'
+ +' proper code has not been entered or the ONGUARD.INI file was deleted, the '
+ +'message will '#6#29'say that the code is invalid.'#6#0#6'YUse the "Enter Co'
+ +'de" button to enter a code (the CODEGEN program can be used to generate '#6
+ +#26'the proper "Usage" code). '#6#0#6'\The "Remove Code" button can be used '
+ +'to remove the entered code from the INI file. Doing so '#6'Gwill cause the '
+ +'TOgNetCode component to report that the code is invalid.'#0#8'ReadOnly'#9#8
+ +'TabOrder'#2#1#0#0#7'TBitBtn'#8'CloseBtn'#4'Left'#3#144#1#6'Height'#2#25#3'T'
+ +'op'#3#0#1#5'Width'#2'K'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2
+ +#2#0#0#7'TButton'#9'RemoveBtn'#4'Left'#3' '#1#6'Height'#2#25#3'Top'#3#0#1#5
+ +'Width'#2'a'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#11'Remove Code'#7
+ +'OnClick'#7#14'RemoveBtnClick'#8'TabOrder'#2#3#0#0#10'TOgNetCode'#10'OgNetCo'
+ +'de1'#9'OnChecked'#7#11'CodeChecked'#8'OnGetKey'#7#6'GetKey'#9'OnGetCode'#7#7
+ +'GetCode'#8'FileName'#6#9'EXNET.NAF'#4'left'#2#16#3'top'#3#216#0#0#0#0
+]);
diff --git a/components/onguard/examples/exnet/exnetu.pas b/components/onguard/examples/exnet/exnetu.pas
new file mode 100644
index 000000000..40b72aeaf
--- /dev/null
+++ b/components/onguard/examples/exnet/exnetu.pas
@@ -0,0 +1,165 @@
+unit Exnetu;
+{$H+}
+
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ StdCtrls, Buttons,LResources, OnGuard, IniFiles, OgUtil, OgNetWrk;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ CodeBtn: TButton;
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ StatusLbl: TLabel;
+ Label1: TLabel;
+ CodeLbl: TLabel;
+ RemoveBtn: TButton;
+ OgNetCode1: TOgNetCode;
+ procedure CodeChecked(Sender: TObject; Status: TCodeStatus);
+ procedure GetKey(Sender: TObject; var Key: TKey);
+ procedure GetCode(Sender: TObject; var Code: TCode);
+ procedure CodeBtnClick(Sender: TObject);
+ procedure RemoveBtnClick(Sender: TObject);
+ procedure ChangeCode(Sender: TObject; Code: TCode);
+ procedure FormCreate(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+procedure TForm1.CodeChecked(Sender: TObject; Status: TCodeStatus);
+var
+ S : string;
+begin
+ case Status of
+ ogValidCode : S := 'Valid Code - Max Users: ' + IntToStr(OgNetCode1.MaxUsers);
+ ogInvalidCode : S := 'Invalid release code';
+ ogPastEndDate : S := 'Date has expired';
+ ogDayCountUsed : S := 'Zero days of use remaining';
+ ogRunCountUsed : S := 'Usage count has expired';
+ ogNetCountUsed : S := 'Net usage count exceeded';
+ ogCodeExpired : S := 'Code has expired';
+ else
+ S := 'Unknown error';
+ end;
+ StatusLbl.Caption := S;
+end;
+
+procedure TForm1.GetKey(Sender: TObject; var Key: TKey);
+const
+ {this applications' key}
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+begin
+ Key := CKey;
+end;
+
+procedure TForm1.GetCode(Sender: TObject; var Code: TCode);
+var
+ Ini : TIniFile;
+ S : string;
+begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {get the code from the ini file}
+ S := Ini.ReadString('Codes', 'NetCode', '');
+ {convert to proper form}
+ HexToBuffer(S, Code, SizeOf(Code));
+ {set code label caption}
+ CodeLbl.Caption := S;
+ finally
+ Ini.Free;
+ end;
+end;
+
+procedure TForm1.CodeBtnClick(Sender: TObject);
+var
+ Ini : TIniFile;
+ Work : TCode;
+ S : string;
+begin
+ S := '';
+ {ask for code}
+ if InputQuery('Net Code Entry', 'Enter the code', S) then begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {store the code in the ini file if it looks OK}
+ if HexToBuffer(S, Work, SizeOf(Work)) then begin
+ {save the value}
+ Ini.WriteString('Codes', 'NetCode', S);
+ CodeLbl.Caption := S;
+
+ {if a record in the NAF is already locked, this won't work - use NAFMGR}
+ {when the NAF is not in use}
+ DeleteFile(OgNetCode1.FileName);
+ OgNetCode1.CreateAccessFile;
+
+ {tell the code component to test the new code, reporting the results}
+ OgNetCode1.CheckCode(True);
+
+ ShowMessage('Exit and restart EXNET.EXE to use the new Network Access File and new settings');
+ end;
+ finally
+ Ini.Free;
+ end;
+ end;
+end;
+
+procedure TForm1.RemoveBtnClick(Sender: TObject);
+var
+ IniFile : TIniFile;
+begin
+ IniFile := TIniFile.Create('ONGUARD.INI');
+ try
+ IniFile.DeleteKey('Codes', 'NetCode');
+ finally
+ IniFile.Free;
+ end;
+
+ {tell the code component to test the new code, reporting the results}
+ OgNetCode1.CheckCode(True);
+end;
+
+procedure TForm1.ChangeCode(Sender: TObject; Code: TCode);
+var
+ Ini : TIniFile;
+ S : string;
+begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {store the code in the ini file}
+ S := BufferToHex(Code, SizeOf(Code));
+ Ini.WriteString('Codes', 'NetCode', S);
+ CodeLbl.Caption := S;
+
+ {tell the code component to test the new code, reporting the results}
+ OgNetCode1.CheckCode(True);
+ finally
+ Ini.Free;
+ end;
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+var
+ Code : TCode;
+begin
+ {force code label to update}
+ GetCode(Self, Code);
+end;
+
+initialization
+{$i exnetu.lrs}
+
+end.
diff --git a/components/onguard/examples/exprot/exprot.lpi b/components/onguard/examples/exprot/exprot.lpi
new file mode 100644
index 000000000..57a715331
--- /dev/null
+++ b/components/onguard/examples/exprot/exprot.lpi
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exprot/exprot.lpr b/components/onguard/examples/exprot/exprot.lpr
new file mode 100644
index 000000000..738d27985
--- /dev/null
+++ b/components/onguard/examples/exprot/exprot.lpr
@@ -0,0 +1,17 @@
+program ExProt;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ EXPROTU in 'EXPROTU.pas' {Form1}, tponguard;
+
+
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exprot/exprotu.lfm b/components/onguard/examples/exprot/exprotu.lfm
new file mode 100644
index 000000000..621a32631
--- /dev/null
+++ b/components/onguard/examples/exprot/exprotu.lfm
@@ -0,0 +1,55 @@
+object Form1: TForm1
+ Left = 258
+ Height = 151
+ Top = 146
+ Width = 446
+ HorzScrollBar.Page = 445
+ HorzScrollBar.Range = 441
+ VertScrollBar.Page = 150
+ VertScrollBar.Range = 145
+ ActiveControl = Memo1
+ Caption = 'Protect Exe Example'
+ Font.Color = clText
+ Font.Height = 11
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ Position = poScreenCenter
+ object StatusLbl: TLabel
+ Left = 8
+ Height = 13
+ Top = 126
+ Width = 35
+ Caption = 'Status'
+ Color = clNone
+ ParentColor = False
+ end
+ object Memo1: TMemo
+ Left = 8
+ Height = 105
+ Top = 8
+ Width = 433
+ Lines.Strings = (
+ 'The label at the bottom of this form indicates the status of the EXE file. '
+ ''
+ 'If the EXE file has not been stamped, use the StampEXE program to protect it.'
+ ''
+ 'The EXE file will need to be stamped after each compile since this re-writes the EXE file.'
+ )
+ ReadOnly = True
+ TabOrder = 0
+ end
+ object CloseBtn: TBitBtn
+ Left = 360
+ Height = 25
+ Top = 120
+ Width = 75
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 1
+ end
+ object OgProtectExe1: TOgProtectExe
+ OnChecked = OgProtectExe1Checked
+ left = 124
+ top = 120
+ end
+end
diff --git a/components/onguard/examples/exprot/exprotu.lrs b/components/onguard/examples/exprot/exprotu.lrs
new file mode 100644
index 000000000..f40b5ba38
--- /dev/null
+++ b/components/onguard/examples/exprot/exprotu.lrs
@@ -0,0 +1,20 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#2#1#6'Height'#3#151#0#3'Top'#3#146#0#5'Wi'
+ +'dth'#3#190#1#18'HorzScrollBar.Page'#3#189#1#19'HorzScrollBar.Range'#3#185#1
+ +#18'VertScrollBar.Page'#3#150#0#19'VertScrollBar.Range'#3#145#0#13'ActiveCon'
+ +'trol'#7#5'Memo1'#7'Caption'#6#19'Protect Exe Example'#10'Font.Color'#7#6'cl'
+ +'Text'#11'Font.Height'#2#11#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Pitch'#7
+ +#10'fpVariable'#8'Position'#7#14'poScreenCenter'#0#6'TLabel'#9'StatusLbl'#4
+ +'Left'#2#8#6'Height'#2#13#3'Top'#2'~'#5'Width'#2'#'#7'Caption'#6#6'Status'#5
+ +'Color'#7#6'clNone'#11'ParentColor'#8#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'He'
+ +'ight'#2'i'#3'Top'#2#8#5'Width'#3#177#1#13'Lines.Strings'#1#6'KThe label at '
+ +'the bottom of this form indicates the status of the EXE file. '#6#0#6'MIf t'
+ +'he EXE file has not been stamped, use the StampEXE program to protect it.'#6
+ +#0#6'ZThe EXE file will need to be stamped after each compile since this re-'
+ +'writes the EXE file.'#0#8'ReadOnly'#9#8'TabOrder'#2#0#0#0#7'TBitBtn'#8'Clos'
+ +'eBtn'#4'Left'#3'h'#1#6'Height'#2#25#3'Top'#2'x'#5'Width'#2'K'#4'Kind'#7#7'b'
+ +'kClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#13'TOgProtectExe'#13'OgProtect'
+ +'Exe1'#9'OnChecked'#7#20'OgProtectExe1Checked'#4'left'#2'|'#3'top'#2'x'#0#0#0
+]);
diff --git a/components/onguard/examples/exprot/exprotu.pas b/components/onguard/examples/exprot/exprotu.pas
new file mode 100644
index 000000000..845936a2c
--- /dev/null
+++ b/components/onguard/examples/exprot/exprotu.pas
@@ -0,0 +1,48 @@
+unit EXPROTU;
+
+interface
+
+uses
+ SysUtils, Classes,
+ Controls, Forms, Dialogs, StdCtrls, Buttons,LResources
+ ,ogutil, ogproexe;
+
+type
+ TForm1 = class(TForm)
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ StatusLbl: TLabel;
+ OgProtectExe1: TOgProtectExe;
+ procedure OgProtectExe1Checked(Sender: TObject; Status: TExeStatus);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+procedure TForm1.OgProtectExe1Checked(Sender: TObject; Status: TExeStatus);
+var
+ S : string;
+begin
+ case Status of
+ exeSuccess : S := 'EXE file is OK';
+ exeSizeError : S := 'EXE file size has changed';
+ exeIntegrityError : S := 'EXE Integrity Error';
+ exeNotStamped : S := 'EXE file is not stamped';
+ else
+ S := 'Unknown error';
+ end;
+ StatusLbl.Caption := S;
+end;
+
+initialization
+{$i exprotu.lrs}
+
+end.
diff --git a/components/onguard/examples/exreg/exreg.lpi b/components/onguard/examples/exreg/exreg.lpi
new file mode 100644
index 000000000..c1399213b
--- /dev/null
+++ b/components/onguard/examples/exreg/exreg.lpi
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exreg/exreg.lpr b/components/onguard/examples/exreg/exreg.lpr
new file mode 100644
index 000000000..0874d756a
--- /dev/null
+++ b/components/onguard/examples/exreg/exreg.lpr
@@ -0,0 +1,15 @@
+program ExReg;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ ExReg1 in 'ExReg1.pas' {frmExRegCode}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TfrmExRegCode, frmExRegCode);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exreg/exreg1.lfm b/components/onguard/examples/exreg/exreg1.lfm
new file mode 100644
index 000000000..8a89c443c
--- /dev/null
+++ b/components/onguard/examples/exreg/exreg1.lfm
@@ -0,0 +1,186 @@
+object frmExRegCode: TfrmExRegCode
+ Left = 391
+ Height = 298
+ Top = 180
+ Width = 391
+ HorzScrollBar.Page = 390
+ VertScrollBar.Page = 297
+ BorderStyle = bsDialog
+ Caption = 'Registration Code Example'
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ OnCreate = FormCreate
+ Position = poScreenCenter
+ object GroupBox1: TGroupBox
+ Left = 8
+ Height = 129
+ Top = 8
+ Width = 369
+ Caption = ' Registration Code Generator (vendor site) '
+ TabOrder = 0
+ object Label1: TLabel
+ Left = 39
+ Height = 13
+ Top = 28
+ Width = 72
+ Alignment = taRightJustify
+ Caption = 'User Name:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label2: TLabel
+ Left = 14
+ Height = 13
+ Top = 60
+ Width = 97
+ Alignment = taRightJustify
+ Caption = 'Expiration Date:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label3: TLabel
+ Left = 6
+ Height = 13
+ Top = 92
+ Width = 105
+ Alignment = taRightJustify
+ Caption = 'Registration Code:'
+ Color = clNone
+ ParentColor = False
+ end
+ object btnGenerate: TSpeedButton
+ Left = 328
+ Height = 22
+ Hint = 'Generate Registration Code'
+ Top = 88
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000001000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888880000088888800000008888
+ 0088808008888000000088808088888800888000000088088880008888088000
+ 0000880088000008880880000000808880098900808080000000808880089800
+ 8880800000008008800898008800800000008088800989008880800000008808
+ 8800000888088000000088080880008808088000000088808808888880888000
+ 0000888800888080088880000000888888000008888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = btnGenerateClick
+ ShowHint = True
+ ParentShowHint = False
+ end
+ object edtUserName1: TEdit
+ Left = 120
+ Height = 21
+ Top = 24
+ Width = 233
+ TabOrder = 0
+ end
+ object edtRegCode1: TEdit
+ Left = 120
+ Height = 21
+ Top = 88
+ Width = 201
+ Color = clBtnFace
+ ReadOnly = True
+ TabOrder = 1
+ end
+ object edDate: TEdit
+ Left = 121
+ Height = 21
+ Top = 57
+ Width = 118
+ TabOrder = 2
+ end
+ end
+ object GroupBox2: TGroupBox
+ Left = 8
+ Height = 129
+ Top = 152
+ Width = 369
+ Caption = ' Registration Code Verification (client site) '
+ TabOrder = 1
+ object Label4: TLabel
+ Left = 38
+ Height = 13
+ Top = 60
+ Width = 73
+ Alignment = taRightJustify
+ Caption = 'User Name:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label5: TLabel
+ Left = 6
+ Height = 13
+ Top = 28
+ Width = 105
+ Alignment = taRightJustify
+ Caption = 'Registration Code:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label6: TLabel
+ Left = 70
+ Height = 13
+ Top = 92
+ Width = 41
+ Alignment = taRightJustify
+ Caption = 'Status:'
+ Color = clNone
+ ParentColor = False
+ end
+ object btnVerify: TSpeedButton
+ Left = 224
+ Height = 22
+ Hint = 'Verify Registration Code'
+ Top = 88
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000001000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888888888888888800000008888
+ 8888888888888000000088888888888888888000000088880008888888888000
+ 0000888000008808888080000000880098900808008080000000880089800000
+ 0000800000008800898000000000800000008800989008888888800000008880
+ 0000888888888000000088880008888888888000000088888888888888888000
+ 0000888888888888888880000000888888888888888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = btnVerifyClick
+ ShowHint = True
+ ParentShowHint = False
+ end
+ object edtUserName2: TEdit
+ Left = 120
+ Height = 21
+ Top = 56
+ Width = 233
+ TabOrder = 0
+ end
+ object edtRegCode2: TEdit
+ Left = 120
+ Height = 21
+ Top = 24
+ Width = 233
+ TabOrder = 1
+ end
+ object edtStatus: TEdit
+ Left = 120
+ Height = 21
+ Top = 88
+ Width = 97
+ Color = clBtnFace
+ ReadOnly = True
+ TabOrder = 2
+ end
+ end
+end
diff --git a/components/onguard/examples/exreg/exreg1.lrs b/components/onguard/examples/exreg/exreg1.lrs
new file mode 100644
index 000000000..01fe17cde
--- /dev/null
+++ b/components/onguard/examples/exreg/exreg1.lrs
@@ -0,0 +1,69 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TfrmExRegCode','FORMDATA',[
+ 'TPF0'#13'TfrmExRegCode'#12'frmExRegCode'#4'Left'#3#135#1#6'Height'#3'*'#1#3
+ +'Top'#3#180#0#5'Width'#3#135#1#18'HorzScrollBar.Page'#3#134#1#18'VertScrollB'
+ +'ar.Page'#3')'#1#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#25'Registration '
+ +'Code Example'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'OnCr'
+ +'eate'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#0#9'TGroupBox'#9'Gr'
+ +'oupBox1'#4'Left'#2#8#6'Height'#3#129#0#3'Top'#2#8#5'Width'#3'q'#1#7'Caption'
+ +#6'+ Registration Code Generator (vendor site) '#8'TabOrder'#2#0#0#6'TLabel'
+ +#6'Label1'#4'Left'#2''''#6'Height'#2#13#3'Top'#2#28#5'Width'#2'H'#9'Alignmen'
+ +'t'#7#14'taRightJustify'#7'Caption'#6#10'User Name:'#5'Color'#7#6'clNone'#11
+ +'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#14#6'Height'#2#13#3'Top'#2
+ +'<'#5'Width'#2'a'#9'Alignment'#7#14'taRightJustify'#7'Caption'#6#16'Expirati'
+ +'on Date:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4
+ +'Left'#2#6#6'Height'#2#13#3'Top'#2'\'#5'Width'#2'i'#9'Alignment'#7#14'taRigh'
+ +'tJustify'#7'Caption'#6#18'Registration Code:'#5'Color'#7#6'clNone'#11'Paren'
+ +'tColor'#8#0#0#12'TSpeedButton'#11'btnGenerate'#4'Left'#3'H'#1#6'Height'#2#22
+ +#4'Hint'#6#26'Generate Registration Code'#3'Top'#2'X'#5'Width'#2#23#5'Color'
+ +#7#9'clBtnFace'#10'Glyph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0
+ +#0'('#0#0#0#17#0#0#0#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#16#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0
+ +#128#128#0#0#128#128#128#0#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255
+ +#0#0#0#255#0#255#0#255#255#0#0#255#255#255#0#136#136#136#136#136#136#136#136
+ +#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#0#0#8#136
+ +#136#128#0#0#0#136#136#0#136#128#128#8#136#128#0#0#0#136#128#128#136#136#136
+ +#0#136#128#0#0#0#136#8#136#128#0#136#136#8#128#0#0#0#136#0#136#0#0#8#136#8
+ +#128#0#0#0#128#136#128#9#137#0#128#128#128#0#0#0#128#136#128#8#152#0#136#128
+ +#128#0#0#0#128#8#128#8#152#0#136#0#128#0#0#0#128#136#128#9#137#0#136#128#128
+ +#0#0#0#136#8#136#0#0#8#136#8#128#0#0#0#136#8#8#128#0#136#8#8#128#0#0#0#136
+ +#128#136#8#136#136#128#136#128#0#0#0#136#136#0#136#128#128#8#136#128#0#0#0
+ +#136#136#136#0#0#8#136#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0
+ +#0#9'NumGlyphs'#2#0#7'OnClick'#7#16'btnGenerateClick'#8'ShowHint'#9#14'Paren'
+ +'tShowHint'#8#0#0#5'TEdit'#12'edtUserName1'#4'Left'#2'x'#6'Height'#2#21#3'To'
+ +'p'#2#24#5'Width'#3#233#0#8'TabOrder'#2#0#0#0#5'TEdit'#11'edtRegCode1'#4'Lef'
+ +'t'#2'x'#6'Height'#2#21#3'Top'#2'X'#5'Width'#3#201#0#5'Color'#7#9'clBtnFace'
+ +#8'ReadOnly'#9#8'TabOrder'#2#1#0#0#5'TEdit'#6'edDate'#4'Left'#2'y'#6'Height'
+ +#2#21#3'Top'#2'9'#5'Width'#2'v'#8'TabOrder'#2#2#0#0#0#9'TGroupBox'#9'GroupBo'
+ +'x2'#4'Left'#2#8#6'Height'#3#129#0#3'Top'#3#152#0#5'Width'#3'q'#1#7'Caption'
+ +#6'. Registration Code Verification (client site) '#8'TabOrder'#2#1#0#6'TLab'
+ +'el'#6'Label4'#4'Left'#2'&'#6'Height'#2#13#3'Top'#2'<'#5'Width'#2'I'#9'Align'
+ +'ment'#7#14'taRightJustify'#7'Caption'#6#10'User Name:'#5'Color'#7#6'clNone'
+ +#11'ParentColor'#8#0#0#6'TLabel'#6'Label5'#4'Left'#2#6#6'Height'#2#13#3'Top'
+ +#2#28#5'Width'#2'i'#9'Alignment'#7#14'taRightJustify'#7'Caption'#6#18'Regist'
+ +'ration Code:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label6'
+ +#4'Left'#2'F'#6'Height'#2#13#3'Top'#2'\'#5'Width'#2')'#9'Alignment'#7#14'taR'
+ +'ightJustify'#7'Caption'#6#7'Status:'#5'Color'#7#6'clNone'#11'ParentColor'#8
+ +#0#0#12'TSpeedButton'#9'btnVerify'#4'Left'#3#224#0#6'Height'#2#22#4'Hint'#6
+ +#24'Verify Registration Code'#3'Top'#2'X'#5'Width'#2#23#5'Color'#7#9'clBtnFa'
+ +'ce'#10'Glyph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0#0#0
+ +#17#0#0#0#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#16#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0
+ +#128#128#128#0#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0
+ +#255#0#255#255#0#0#255#255#255#0#136#136#136#136#136#136#136#136#128#0#0#0
+ +#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136#136
+ +#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136
+ +#136#136#128#0#0#0#136#136#0#8#136#136#136#136#128#0#0#0#136#128#0#0#136#8
+ +#136#128#128#0#0#0#136#0#152#144#8#8#0#128#128#0#0#0#136#0#137#128#0#0#0#0
+ +#128#0#0#0#136#0#137#128#0#0#0#0#128#0#0#0#136#0#152#144#8#136#136#136#128#0
+ +#0#0#136#128#0#0#136#136#136#136#128#0#0#0#136#136#0#8#136#136#136#136#128#0
+ +#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136
+ +#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136
+ +#136#136#136#128#0#0#0#9'NumGlyphs'#2#0#7'OnClick'#7#14'btnVerifyClick'#8'Sh'
+ +'owHint'#9#14'ParentShowHint'#8#0#0#5'TEdit'#12'edtUserName2'#4'Left'#2'x'#6
+ +'Height'#2#21#3'Top'#2'8'#5'Width'#3#233#0#8'TabOrder'#2#0#0#0#5'TEdit'#11'e'
+ +'dtRegCode2'#4'Left'#2'x'#6'Height'#2#21#3'Top'#2#24#5'Width'#3#233#0#8'TabO'
+ +'rder'#2#1#0#0#5'TEdit'#9'edtStatus'#4'Left'#2'x'#6'Height'#2#21#3'Top'#2'X'
+ ,#5'Width'#2'a'#5'Color'#7#9'clBtnFace'#8'ReadOnly'#9#8'TabOrder'#2#2#0#0#0#0
+]);
diff --git a/components/onguard/examples/exreg/exreg1.pas b/components/onguard/examples/exreg/exreg1.pas
new file mode 100644
index 000000000..76d0aaf41
--- /dev/null
+++ b/components/onguard/examples/exreg/exreg1.pas
@@ -0,0 +1,97 @@
+unit ExReg1;
+
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ StdCtrls, ComCtrls, Buttons,LResources, EditBtn;
+
+type
+
+ { TfrmExRegCode }
+
+ TfrmExRegCode = class(TForm)
+ edDate: TEdit;
+ GroupBox1: TGroupBox;
+ Label1: TLabel;
+ edtUserName1: TEdit;
+ Label2: TLabel;
+ Label3: TLabel;
+ edtRegCode1: TEdit;
+ GroupBox2: TGroupBox;
+ edtUserName2: TEdit;
+ Label4: TLabel;
+ edtRegCode2: TEdit;
+ Label5: TLabel;
+ Label6: TLabel;
+ edtStatus: TEdit;
+ btnGenerate: TSpeedButton;
+ btnVerify: TSpeedButton;
+ procedure btnGenerateClick(Sender: TObject);
+ procedure btnVerifyClick(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ frmExRegCode: TfrmExRegCode;
+
+implementation
+
+
+
+uses
+ OnGuard, OgUtil;
+
+const
+ EncryptionKey : TKey = ($E5, $8F, $84, $D6, $92, $C9, $A4, $D8,
+ $1A, $FA, $6F, $8D, $AB, $FC, $DF, $B4);
+
+
+procedure TfrmExRegCode.btnGenerateClick(Sender: TObject);
+var
+ Key : TKey;
+ Code : TCode;
+ Modifier : Longint;
+ D : TDateTime;
+begin
+ D := StrToDate(edDate.Text);
+ Key := EncryptionKey;
+ Modifier := StringHashELF(edtUserName1.Text);
+ ApplyModifierToKeyPrim(Modifier, Key, SizeOf(Key));
+ InitRegCode(Key, '', D, Code);
+ edtRegCode1.Text := BufferToHex(Code, SizeOf(Code));
+end;
+
+procedure TfrmExRegCode.btnVerifyClick(Sender: TObject);
+var
+ Key : TKey;
+ Code : TCode;
+ Modifier : Longint;
+begin
+ Key := EncryptionKey;
+ Modifier := StringHashELF(edtUserName2.Text);
+ ApplyModifierToKeyPrim(Modifier, Key, SizeOf(Key));
+ HexToBuffer(edtRegCode2.Text, Code, SizeOf(Code));
+ if IsRegCodeValid(Key, Code) then begin
+ if IsRegCodeExpired(Key, Code) then
+ edtStatus.Text := 'Expired'
+ else
+ edtStatus.Text := 'Valid';
+ end else
+ edtStatus.Text := 'Not Valid';
+end;
+
+procedure TfrmExRegCode.FormCreate(Sender: TObject);
+begin
+ ShortDateFormat := 'yyyy-mm-dd';
+ edDate.Text := DateToStr(Now);
+end;
+
+initialization
+{$i exreg1.lrs}
+
+end.
diff --git a/components/onguard/examples/exrgreg/ONGUARD.INI b/components/onguard/examples/exrgreg/ONGUARD.INI
new file mode 100644
index 000000000..901135d7e
--- /dev/null
+++ b/components/onguard/examples/exrgreg/ONGUARD.INI
@@ -0,0 +1,3 @@
+[Codes]
+RegistrationCode=B7972EDE905C8F0A
+RegistrationStr=945-136-16-73
diff --git a/components/onguard/examples/exrgreg/exrgreg.lpi b/components/onguard/examples/exrgreg/exrgreg.lpi
new file mode 100644
index 000000000..2452b4ebb
--- /dev/null
+++ b/components/onguard/examples/exrgreg/exrgreg.lpi
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exrgreg/exrgreg.lpr b/components/onguard/examples/exrgreg/exrgreg.lpr
new file mode 100644
index 000000000..a90847398
--- /dev/null
+++ b/components/onguard/examples/exrgreg/exrgreg.lpr
@@ -0,0 +1,14 @@
+program ExRgReg;
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ exrgregu in 'exrgregu.pas' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exrgreg/exrgregu.lfm b/components/onguard/examples/exrgreg/exrgregu.lfm
new file mode 100644
index 000000000..cde275a8c
--- /dev/null
+++ b/components/onguard/examples/exrgreg/exrgregu.lfm
@@ -0,0 +1,98 @@
+object Form1: TForm1
+ Left = 252
+ Height = 308
+ Top = 138
+ Width = 493
+ HorzScrollBar.Page = 492
+ VertScrollBar.Page = 307
+ BorderStyle = bsDialog
+ Caption = 'Registration Code Example'
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Position = poScreenCenter
+ object StatusLbl: TLabel
+ Left = 8
+ Height = 13
+ Top = 262
+ Width = 35
+ Caption = 'Status'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label1: TLabel
+ Left = 232
+ Height = 13
+ Top = 14
+ Width = 77
+ Caption = 'Current code:'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeLbl: TLabel
+ Left = 320
+ Height = 13
+ Top = 14
+ Width = 113
+ Caption = '0000000000000000'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeBtn: TButton
+ Left = 8
+ Height = 25
+ Top = 8
+ Width = 89
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Enter Code'
+ OnClick = CodeBtnClick
+ TabOrder = 0
+ end
+ object Memo1: TMemo
+ Left = 8
+ Height = 209
+ Top = 40
+ Width = 465
+ Color = clBtnFace
+ Lines.Strings = (
+ 'The label at the bottom of this form indicates the status of the code. An invalid code indicates that '
+ 'the code is either the incorrect type or that none has been entered. '
+ ''
+ 'If the proper code has not been entered or the ONGUARD.INI file was deleted, the message will '
+ 'say that the code is invalid.'
+ ''
+ 'Use the "Enter Code" button to enter a code (the CODEGEN program can be used to generate '
+ 'the proper "Usage" code). '
+ ''
+ 'The "Remove Code" button can be used to remove the entered code from the INI file. Doing so '
+ 'will cause the TOgRegistrationCode component to report that the code is invalid.'
+ )
+ ReadOnly = True
+ TabOrder = 1
+ end
+ object CloseBtn: TBitBtn
+ Left = 400
+ Height = 25
+ Top = 256
+ Width = 75
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 2
+ end
+ object RemoveBtn: TButton
+ Left = 288
+ Height = 25
+ Top = 256
+ Width = 97
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Remove Code'
+ OnClick = RemoveBtnClick
+ TabOrder = 3
+ end
+ object OgRegistrationCode1: TOgRegistrationCode
+ OnChecked = CodeChecked
+ OnGetKey = GetKey
+ OnGetCode = GetCode
+ left = 16
+ top = 208
+ end
+end
diff --git a/components/onguard/examples/exrgreg/exrgregu.lrs b/components/onguard/examples/exrgreg/exrgregu.lrs
new file mode 100644
index 000000000..81356aa07
--- /dev/null
+++ b/components/onguard/examples/exrgreg/exrgregu.lrs
@@ -0,0 +1,34 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#252#0#6'Height'#3'4'#1#3'Top'#3#138#0#5'W'
+ +'idth'#3#237#1#18'HorzScrollBar.Page'#3#236#1#18'VertScrollBar.Page'#3'3'#1
+ +#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#25'Registration Code Example'#11
+ +'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScre'
+ +'enCenter'#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Height'#2#13#3'Top'#3#6#1#5
+ +'Width'#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNone'#11'ParentColor'#8#0
+ +#0#6'TLabel'#6'Label1'#4'Left'#3#232#0#6'Height'#2#13#3'Top'#2#14#5'Width'#2
+ +'M'#7'Caption'#6#13'Current code:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0
+ +#6'TLabel'#7'CodeLbl'#4'Left'#3'@'#1#6'Height'#2#13#3'Top'#2#14#5'Width'#2'q'
+ +#7'Caption'#6#16'0000000000000000'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0
+ +#7'TButton'#7'CodeBtn'#4'Left'#2#8#6'Height'#2#25#3'Top'#2#8#5'Width'#2'Y'#25
+ +'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Enter Code'#7'OnClick'#7#12
+ +'CodeBtnClick'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#3
+ +#209#0#3'Top'#2'('#5'Width'#3#209#1#5'Color'#7#9'clBtnFace'#13'Lines.Strings'
+ +#1#6'fThe label at the bottom of this form indicates the status of the code.'
+ +' An invalid code indicates that '#6'Ethe code is either the incorrect type '
+ +'or that none has been entered. '#6#0#6'^If the proper code has not been ent'
+ +'ered or the ONGUARD.INI file was deleted, the message will '#6#29'say that '
+ +'the code is invalid.'#6#0#6'YUse the "Enter Code" button to enter a code (t'
+ +'he CODEGEN program can be used to generate '#6#26'the proper "Usage" code).'
+ +' '#6#0#6'\The "Remove Code" button can be used to remove the entered code f'
+ +'rom the INI file. Doing so '#6'Pwill cause the TOgRegistrationCode componen'
+ +'t to report that the code is invalid.'#0#8'ReadOnly'#9#8'TabOrder'#2#1#0#0#7
+ +'TBitBtn'#8'CloseBtn'#4'Left'#3#144#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2
+ +'K'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0#7'TButton'#9'R'
+ +'emoveBtn'#4'Left'#3' '#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'a'#25'Borde'
+ +'rSpacing.InnerBorder'#2#4#7'Caption'#6#11'Remove Code'#7'OnClick'#7#14'Remo'
+ +'veBtnClick'#8'TabOrder'#2#3#0#0#19'TOgRegistrationCode'#19'OgRegistrationCo'
+ +'de1'#9'OnChecked'#7#11'CodeChecked'#8'OnGetKey'#7#6'GetKey'#9'OnGetCode'#7#7
+ +'GetCode'#4'left'#2#16#3'top'#3#208#0#0#0#0
+]);
diff --git a/components/onguard/examples/exrgreg/exrgregu.pas b/components/onguard/examples/exrgreg/exrgregu.pas
new file mode 100644
index 000000000..ac2874dc0
--- /dev/null
+++ b/components/onguard/examples/exrgreg/exrgregu.pas
@@ -0,0 +1,137 @@
+unit exrgregu;
+
+{$H+}
+
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ StdCtrls, Buttons,LResources,OnGuard, IniFiles, OgUtil;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ CodeBtn: TButton;
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ StatusLbl: TLabel;
+ Label1: TLabel;
+ CodeLbl: TLabel;
+ RemoveBtn: TButton;
+ OgRegistrationCode1: TOgRegistrationCode;
+ procedure CodeChecked(Sender: TObject; Status: TCodeStatus);
+ procedure GetKey(Sender: TObject; var Key: TKey);
+ procedure GetCode(Sender: TObject; var Code: TCode);
+ procedure CodeBtnClick(Sender: TObject);
+ procedure RemoveBtnClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ RegStr : string;
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+procedure TForm1.CodeChecked(Sender: TObject; Status: TCodeStatus);
+var
+ S : string;
+begin
+ case Status of
+ ogValidCode : S := 'Valid Code - Registration: ' + RegStr;
+ ogInvalidCode : S := 'Invalid release code';
+ ogPastEndDate : S := 'Date has expired';
+ ogDayCountUsed : S := 'Zero days of use remaining';
+ ogRunCountUsed : S := 'Usage count has expired';
+ ogNetCountUsed : S := 'Net usage count exceeded';
+ ogCodeExpired : S := 'Code has expired';
+ else
+ S := 'Unknown error';
+ end;
+ StatusLbl.Caption := S;
+end;
+
+procedure TForm1.GetKey(Sender: TObject; var Key: TKey);
+const
+ {this applications' key}
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+begin
+ Key := CKey;
+end;
+
+procedure TForm1.GetCode(Sender: TObject; var Code: TCode);
+var
+ Ini : TIniFile;
+ S : string;
+begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {get the code from the ini file}
+ S := Ini.ReadString('Codes', 'RegistrationCode', '');
+ RegStr := Ini.ReadString('Codes', 'RegistrationStr', '');
+ {convert to proper form}
+ HexToBuffer(S, Code, SizeOf(Code));
+ {set code label caption}
+ CodeLbl.Caption := S;
+ finally
+ Ini.Free;
+ end;
+end;
+
+procedure TForm1.CodeBtnClick(Sender: TObject);
+var
+ Ini : TIniFile;
+ Work : TCode;
+ S : string;
+begin
+ S := '';
+ {ask for string and code}
+ if InputQuery('Registration String Entry', 'Enter the registration string', RegStr) then begin
+ if InputQuery('Registration Code Entry', 'Enter the code', S) then begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {store the code in the ini file if it looks OK}
+ if HexToBuffer(S, Work, SizeOf(Work)) then begin
+ {save the value}
+ Ini.WriteString('Codes', 'RegistrationCode', S);
+ Ini.WriteString('Codes', 'RegistrationStr', RegStr);
+ CodeLbl.Caption := S;
+
+ {tell the code component to test the new code, reporting the results}
+ OgRegistrationCode1.CheckCode(True);
+ end;
+ finally
+ Ini.Free;
+ end;
+ end;
+ end;
+end;
+
+procedure TForm1.RemoveBtnClick(Sender: TObject);
+var
+ IniFile : TIniFile;
+begin
+ IniFile := TIniFile.Create('ONGUARD.INI');
+ try
+ IniFile.DeleteKey('Codes', 'RegistrationCode');
+ IniFile.DeleteKey('Codes', 'RegistrationStr');
+ finally
+ IniFile.Free;
+ end;
+
+ {tell the code component to test the new code, reporting the results}
+ OgRegistrationCode1.CheckCode(True);
+end;
+
+
+initialization
+{$i exrgregu.lrs}
+
+end.
diff --git a/components/onguard/examples/exrgstr/RegCode.ini b/components/onguard/examples/exrgstr/RegCode.ini
new file mode 100644
index 000000000..4bbbe151f
--- /dev/null
+++ b/components/onguard/examples/exrgstr/RegCode.ini
@@ -0,0 +1,3 @@
+[Codes]
+RegStr=Lazarus
+RegCode=5323D1321979760B
diff --git a/components/onguard/examples/exrgstr/exrgstr.lpi b/components/onguard/examples/exrgstr/exrgstr.lpi
new file mode 100644
index 000000000..e58d3215b
--- /dev/null
+++ b/components/onguard/examples/exrgstr/exrgstr.lpi
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exrgstr/exrgstr.lpr b/components/onguard/examples/exrgstr/exrgstr.lpr
new file mode 100644
index 000000000..bd9f8c79a
--- /dev/null
+++ b/components/onguard/examples/exrgstr/exrgstr.lpr
@@ -0,0 +1,14 @@
+program Exrgstr;
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ Exrgstru in 'EXRGSTRU.PAS' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exrgstr/exrgstru.lfm b/components/onguard/examples/exrgstr/exrgstru.lfm
new file mode 100644
index 000000000..959d12e88
--- /dev/null
+++ b/components/onguard/examples/exrgstr/exrgstru.lfm
@@ -0,0 +1,51 @@
+object Form1: TForm1
+ Left = 301
+ Height = 192
+ Top = 218
+ Width = 262
+ HorzScrollBar.Page = 261
+ VertScrollBar.Page = 191
+ Caption = 'Form1'
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Position = poScreenCenter
+ object Label1: TLabel
+ Left = 69
+ Height = 13
+ Top = 98
+ Width = 77
+ Alignment = taCenter
+ Caption = 'Registered to:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Memo1: TMemo
+ Left = 13
+ Height = 79
+ Top = 10
+ Width = 223
+ Lines.Strings = (
+ 'If you can edit this, then your program was '
+ 'allowed to run'
+ )
+ ScrollBars = ssVertical
+ TabOrder = 0
+ end
+ object CloseBtn: TBitBtn
+ Left = 75
+ Height = 33
+ Top = 116
+ Width = 89
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 1
+ end
+ object OgRegistrationCode1: TOgRegistrationCode
+ OnChecked = OgRegistrationCode1Checked
+ OnGetKey = OgRegistrationCode1GetKey
+ OnGetCode = OgRegistrationCode1GetCode
+ left = 165
+ top = 118
+ end
+end
diff --git a/components/onguard/examples/exrgstr/exrgstru.lrs b/components/onguard/examples/exrgstr/exrgstru.lrs
new file mode 100644
index 000000000..6da6b0096
--- /dev/null
+++ b/components/onguard/examples/exrgstr/exrgstru.lrs
@@ -0,0 +1,18 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'-'#1#6'Height'#3#192#0#3'Top'#3#218#0#5'W'
+ +'idth'#3#6#1#18'HorzScrollBar.Page'#3#5#1#18'VertScrollBar.Page'#3#191#0#7'C'
+ +'aption'#6#5'Form1'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#245#9'Font'
+ +'.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScreenCenter'#0#6'TLabel'#6'L'
+ +'abel1'#4'Left'#2'E'#6'Height'#2#13#3'Top'#2'b'#5'Width'#2'M'#9'Alignment'#7
+ +#8'taCenter'#7'Caption'#6#14'Registered to:'#5'Color'#7#6'clNone'#11'ParentC'
+ +'olor'#8#0#0#5'TMemo'#5'Memo1'#4'Left'#2#13#6'Height'#2'O'#3'Top'#2#10#5'Wid'
+ +'th'#3#223#0#13'Lines.Strings'#1#6',If you can edit this, then your program '
+ +'was '#6#14'allowed to run'#0#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'#2#0
+ +#0#0#7'TBitBtn'#8'CloseBtn'#4'Left'#2'K'#6'Height'#2'!'#3'Top'#2't'#5'Width'
+ +#2'Y'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#19'TOgRegist'
+ +'rationCode'#19'OgRegistrationCode1'#9'OnChecked'#7#26'OgRegistrationCode1Ch'
+ +'ecked'#8'OnGetKey'#7#25'OgRegistrationCode1GetKey'#9'OnGetCode'#7#26'OgRegi'
+ +'strationCode1GetCode'#4'left'#3#165#0#3'top'#2'v'#0#0#0
+]);
diff --git a/components/onguard/examples/exrgstr/exrgstru.pas b/components/onguard/examples/exrgstr/exrgstru.pas
new file mode 100644
index 000000000..61eb85e5c
--- /dev/null
+++ b/components/onguard/examples/exrgstr/exrgstru.pas
@@ -0,0 +1,145 @@
+unit Exrgstru;
+{$H+}
+
+interface
+
+uses
+ SysUtils,Classes,Controls,
+ Forms, Dialogs, OnGuard, StdCtrls, Buttons,LResources,
+
+ OgUtil,
+ IniFiles;
+
+const
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,
+ $1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ OgRegistrationCode1: TOgRegistrationCode;
+ Label1: TLabel;
+ procedure OgRegistrationCode1GetKey(Sender: TObject; var Key: TKey);
+ procedure OgRegistrationCode1GetCode(Sender: TObject; var Code: TCode);
+ procedure OgRegistrationCode1Checked(Sender: TObject;
+ Status: TCodeStatus);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ TheDir,
+ CodeStr,
+ ARegStr : string;
+ IniFile : TIniFile;
+ ED : TDateTime;
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+{=======================================================================}
+
+procedure TForm1.OgRegistrationCode1GetKey(Sender: TObject; var Key: TKey);
+begin
+ Key := CKey;
+end;
+
+{=======================================================================}
+
+procedure TForm1.OgRegistrationCode1GetCode(Sender: TObject; var Code: TCode);
+var
+ L : integer;
+begin
+ TheDir := ExtractFilePath(ParamStr(0));
+{
+ L := Length(TheDir);
+ if (L > 3) and (TheDir[L] <> '\') then
+ TheDir := TheDir + '\';
+ }
+
+ if FileExists(TheDir + 'RegCode.ini') then begin
+ IniFile := TIniFile.Create(TheDir + 'RegCode.ini');
+ try
+ CodeStr := IniFile.ReadString('Codes', 'RegCode', '');
+ HexToBuffer(CodeStr, Code, SizeOf(Code));
+
+ ARegStr := IniFile.ReadString('Codes', 'RegStr', '');
+ finally
+ IniFile.Free;
+ end;
+ end;
+end;
+
+{=======================================================================}
+
+procedure TForm1.OgRegistrationCode1Checked(Sender: TObject; Status: TCodeStatus);
+var
+ S,
+ C1 : string;
+ TC : TCode;
+begin
+ {forced cutoff date of 1999 Dec. 31}
+ ED := EncodeDate(2006, 12, 31);
+
+ case Status of
+ ogValidCode : begin
+ InitRegCode(CKey, ARegStr, ED, TC);
+ C1 := BufferToHex(TC, SizeOf(TC));
+
+ if (CompareText(C1, CodeStr) <> 0) then begin
+ ShowMessage('The Registration Name has been changed');
+ Application.Terminate;
+ end else
+ Label1.Caption := 'Registered to: ' + ARegStr;
+ end;
+
+ ogInvalidCode : begin
+ if not FileExists(TheDir + 'RegCode.ini') then begin
+ if (InputQuery('Codes', 'Reg String', ARegStr)) then begin
+ if (ARegStr = '') then begin
+ S := 'Empty string not allowed';
+ Application.Terminate;
+ end else begin
+ IniFile := TIniFile.Create(TheDir + 'RegCode.ini');
+ try
+ IniFile.WriteString('Codes', 'RegStr', ARegStr);
+
+ InitRegCode(CKey, ARegStr, ED, TC);
+
+ {save string representation of release code to Ini File}
+ CodeStr := BufferToHex(TC, SizeOf(TC));
+ IniFile.WriteString('Codes', 'RegCode', CodeStr);
+ finally
+ IniFile.Free;
+ end;
+ OgRegistrationCode1.CheckCode(True);
+ Exit;
+ end;
+ end else
+ Application.Terminate;
+ end else
+ S := 'Invalid Code';
+ end;
+
+ ogCodeExpired : S := 'Evaluation period expired';
+ end;
+
+ if (Status <> ogValidCode) then begin
+ ShowMessage(S);
+ Application.Terminate;
+ end;
+end;
+
+
+initialization
+{$i exrgstru.lrs}
+
+end.
diff --git a/components/onguard/examples/exselapi/ExSelect.Dat b/components/onguard/examples/exselapi/ExSelect.Dat
new file mode 100644
index 000000000..83727ca17
--- /dev/null
+++ b/components/onguard/examples/exselapi/ExSelect.Dat
@@ -0,0 +1 @@
+iWŬşÓ=AtÁÙèTSÊò
\ No newline at end of file
diff --git a/components/onguard/examples/exselapi/exselap1.lfm b/components/onguard/examples/exselapi/exselap1.lfm
new file mode 100644
index 000000000..24c47f2ed
--- /dev/null
+++ b/components/onguard/examples/exselapi/exselap1.lfm
@@ -0,0 +1,76 @@
+object Form1: TForm1
+ Left = 287
+ Height = 266
+ Top = 102
+ Width = 357
+ HorzScrollBar.Page = 356
+ VertScrollBar.Page = 241
+ ActiveControl = Memo1
+ Caption = 'ExSelAPI: '
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Menu = MainMenu1
+ OnCreate = FormCreate
+ object Memo1: TMemo
+ Left = 16
+ Height = 145
+ Top = 8
+ Width = 313
+ Color = clAqua
+ Lines.Strings = (
+ ' This example uses the OgUsageCode and the OgSpecialCode'
+ ' (via OnGuard API functions) to implement a limited use'
+ ' "demo" application which allows only the required features.'
+ ' The program can be run 3 times and then a special code'
+ ' must be obtained to register the program and to enable'
+ ' various features. A machine modifier is used to prevent'
+ ' the application from being copied and run on another'
+ ' machine. To obtain the release code you need to run the'
+ ' companion example EXSLCODE. The release codes will be '
+ ' stored in a data file called EXSELECT.DAT'
+ )
+ ReadOnly = True
+ TabOrder = 0
+ end
+ object ModifyBtn: TButton
+ Left = 120
+ Height = 25
+ Top = 176
+ Width = 113
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Modify Features'
+ OnClick = ModifyBtnClick
+ TabOrder = 1
+ end
+ object MainMenu1: TMainMenu
+ left = 64
+ top = 112
+ object FeaturesMenu: TMenuItem
+ Caption = 'Features'
+ object FeaturesRequired: TMenuItem
+ Caption = 'Required'
+ Checked = True
+ end
+ object FeaturesHelp: TMenuItem
+ Caption = 'Help'
+ Enabled = False
+ end
+ object FeaturesExamples: TMenuItem
+ Caption = 'Examples'
+ Enabled = False
+ end
+ object FeaturesDatabase: TMenuItem
+ Caption = 'Database'
+ Enabled = False
+ end
+ object FeaturesFax: TMenuItem
+ Caption = 'Fax'
+ Enabled = False
+ end
+ object FeaturesGoodies: TMenuItem
+ Caption = 'Goodies'
+ Enabled = False
+ end
+ end
+ end
+end
diff --git a/components/onguard/examples/exselapi/exselap1.lrs b/components/onguard/examples/exselapi/exselap1.lrs
new file mode 100644
index 000000000..e3d1fdd0f
--- /dev/null
+++ b/components/onguard/examples/exselapi/exselap1.lrs
@@ -0,0 +1,29 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#31#1#6'Height'#3#10#1#3'Top'#2'f'#5'Width'
+ +#3'e'#1#18'HorzScrollBar.Page'#3'd'#1#18'VertScrollBar.Page'#3#241#0#13'Acti'
+ +'veControl'#7#5'Memo1'#7'Caption'#6#10'ExSelAPI: '#11'Font.Height'#2#245#9'F'
+ +'ont.Name'#6#13'MS Sans Serif'#4'Menu'#7#9'MainMenu1'#8'OnCreate'#7#10'FormC'
+ +'reate'#0#5'TMemo'#5'Memo1'#4'Left'#2#16#6'Height'#3#145#0#3'Top'#2#8#5'Widt'
+ +'h'#3'9'#1#5'Color'#7#6'clAqua'#13'Lines.Strings'#1#6': This example uses '
+ +'the OgUsageCode and the OgSpecialCode'#6'9 (via OnGuard API functions) to'
+ +' implement a limited use'#6'> "demo" application which allows only the re'
+ +'quired features.'#6'9 The program can be run 3 times and then a special c'
+ +'ode'#6'9 must be obtained to register the program and to enable'#6'; va'
+ +'rious features. A machine modifier is used to prevent'#6'7 the applicati'
+ +'on from being copied and run on another'#6'; machine. To obtain the rele'
+ +'ase code you need to run the'#6': companion example EXSLCODE. The releas'
+ +'e codes will be '#6', stored in a data file called EXSELECT.DAT'#0#8'Read'
+ +'Only'#9#8'TabOrder'#2#0#0#0#7'TButton'#9'ModifyBtn'#4'Left'#2'x'#6'Height'#2
+ +#25#3'Top'#3#176#0#5'Width'#2'q'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'
+ +#6#15'Modify Features'#7'OnClick'#7#14'ModifyBtnClick'#8'TabOrder'#2#1#0#0#9
+ +'TMainMenu'#9'MainMenu1'#4'left'#2'@'#3'top'#2'p'#0#9'TMenuItem'#12'Features'
+ +'Menu'#7'Caption'#6#8'Features'#0#9'TMenuItem'#16'FeaturesRequired'#7'Captio'
+ +'n'#6#8'Required'#7'Checked'#9#0#0#9'TMenuItem'#12'FeaturesHelp'#7'Caption'#6
+ +#4'Help'#7'Enabled'#8#0#0#9'TMenuItem'#16'FeaturesExamples'#7'Caption'#6#8'E'
+ +'xamples'#7'Enabled'#8#0#0#9'TMenuItem'#16'FeaturesDatabase'#7'Caption'#6#8
+ +'Database'#7'Enabled'#8#0#0#9'TMenuItem'#11'FeaturesFax'#7'Caption'#6#3'Fax'
+ +#7'Enabled'#8#0#0#9'TMenuItem'#15'FeaturesGoodies'#7'Caption'#6#7'Goodies'#7
+ +'Enabled'#8#0#0#0#0#0
+]);
diff --git a/components/onguard/examples/exselapi/exselap1.pas b/components/onguard/examples/exselapi/exselap1.pas
new file mode 100644
index 000000000..eac602efb
--- /dev/null
+++ b/components/onguard/examples/exselapi/exselap1.pas
@@ -0,0 +1,252 @@
+{*********************************************************}
+{* ONGUARD: EXSELAP1.PAS *}
+{* Copyright (c) TurboPower Software Co 1998 *}
+{* All rights reserved. *}
+{*********************************************************}
+
+ { This example uses the OgUsageCode and the OgSpecialCode
+ (via OnGuard API functions) to implement a limited use
+ "demo" application which allows only the required features.
+ The program can be run 3 times and then a special code
+ must be obtained to register the program and to enable
+ various features. A machine modifier is used to prevent
+ the application from being copied and run on another
+ machine. To obtain the release code you need to run the
+ companion example EXSLCODE. The release codes will be stored
+ in a data file called EXSELECT.DAT}
+
+unit Exselap1;
+{$H+}
+
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ StdCtrls, Menus,Buttons,LResources,OgUtil,OnGuard;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ ModifyBtn: TButton;
+ Memo1: TMemo;
+ MainMenu1: TMainMenu;
+ FeaturesMenu: TMenuItem;
+ FeaturesRequired: TMenuItem;
+ FeaturesHelp: TMenuItem;
+ FeaturesExamples: TMenuItem;
+ FeaturesDatabase: TMenuItem;
+ FeaturesFax: TMenuItem;
+ FeaturesGoodies: TMenuItem;
+ function FileGetCode(Index : Longint; var Code : TCode) : Boolean;
+ procedure FilePutCode(Index : Longint; Code : TCode);
+ procedure FormCreate(Sender: TObject);
+ function DecodeSpecialCode : Longint;
+ procedure ModifyBtnClick(Sender: TObject);
+ procedure EnableFeatures(Features : Longint);
+ end;
+
+var
+ Form1: TForm1;
+
+{----------------------------------------------------------------------}
+
+implementation
+
+
+
+const
+ { The key was created by a separate program (CODEGEN) and is generic
+ the examples, EXSELECT, EXSELAPI, and EXSLCODE }
+ TheKey: TKey = ($F1,$46,$8D,$E4,$70,$AE,$92,$DC,
+ $13,$1A,$03,$C4,$44,$25,$72,$F5);
+
+ { Initial code has 3 uses embedded }
+ InitCode : string = '13B1A08BD78AFCD3';
+ CodeFile : string = 'ExSelect.Dat';
+ DemoCaption : string = 'ExSelApi: Demo runs left = ';
+ RegisteredCap : string = 'ExSelApi: Registered';
+ NotRegisteredCap : string = 'ExSelApi: Not Registered';
+ ModifyStr : string = 'Modify Registration to enable this feature';
+
+ { Feature masks }
+ RequiredMask = $00000001;
+ HelpMask = $00000002;
+ ExamplesMask = $00000004;
+ DBMask = $00000008;
+ FaxMask = $00000010;
+ GoodiesMask = $00000020;
+
+var
+ UsageCode : TCode; {Index = 0}
+ SpecialCode : TCode; {Index = 1}
+
+
+{-------------------------------------------------------}
+
+function TForm1.FileGetCode(Index : Longint; var Code : TCode) : Boolean;
+var
+ Dir, Path : string;
+ FileHandle : Integer;
+begin
+ Dir := '';
+ GetDir(0, Dir);
+ Path := Dir + DirectorySeparator + CodeFile;
+ FillChar(Code, SizeOf(TCode), 0);
+ if FileExists(Path) then begin
+ FileHandle := FileOpen(Path, fmOpenRead);
+ FileSeek(FileHandle, Index * SizeOf(Code), 0);
+ FileRead(FileHandle, Code, SizeOf(Code));
+ FileClose(FileHandle);
+ Result := True;
+ end else
+ Result := False;
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.FilePutCode(Index : Longint; Code : TCode);
+var
+ Dir, Path : string;
+ FileHandle : Integer;
+begin
+ Dir := '';
+ GetDir(0, Dir);
+ Path := Dir + DirectorySeparator + CodeFile;
+ if not FileExists(Path) then
+ FileHandle := FileCreate(Path)
+ else
+ FileHandle := FileOpen(Path, fmOpenWrite);
+ FileSeek(FileHandle, Index * SizeOf(Code), 0);
+ FileWrite(FileHandle, Code, SizeOf(Code));
+ FileClose(FileHandle);
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.FormCreate(Sender: TObject);
+var
+ FreebiesLeft : Longint;
+ Features : Longint;
+begin
+ FillChar(SpecialCode, SizeOf(SpecialCode), 0);
+ if not FileGetCode(0, UsageCode) then
+ HexToBuffer(InitCode, UsageCode, SizeOf(UsageCode));
+ FreebiesLeft := GetUsageCodeValue(TheKey, UsageCode);
+ if (FreebiesLeft > 0) then begin {Still in demo phase}
+ DecUsageCode(TheKey, UsageCode);
+ FilePutCode(0, UsageCode);
+ EnableFeatures(RequiredMask);
+ Caption := DemoCaption + IntToStr(FreebiesLeft - 1);
+ end else begin {Registration phase}
+ FileGetCode(1, SpecialCode);
+ Features := DecodeSpecialCode;
+ if (Features <> 0) then begin
+ FilePutCode(1, SpecialCode);
+ EnableFeatures(Features);
+ Caption := RegisteredCap;
+ end else begin
+ EnableFeatures(0);
+ Caption := NotRegisteredCap;
+ end;
+ ModifyBtn.Enabled := True;
+ end;
+end;
+
+{-------------------------------------------------------}
+
+function TForm1.DecodeSpecialCode : Longint;
+var
+ CodeStr : string;
+ ModKey : TKey;
+ MachineID : string;
+ Modifier : longint;
+begin
+ Result := 0;
+ MachineID := '';
+ Modifier := GenerateMachineModifierPrim;
+ MachineID := BufferToHex(Modifier, SizeOf(Modifier));
+ ModKey := TheKey;
+ ApplyModifierToKeyPrim(Modifier, ModKey, SizeOf(ModKey));
+ {First see if existing Special code is valid}
+ if IsSpecialCodeValid(ModKey, SpecialCode) then begin
+ Result := GetSpecialCodeValue(ModKey, SpecialCode);
+ Exit;
+ end;
+ {Otherwise prompt user for Special code}
+ CodeStr := '';
+ if InputQuery('Machine ID: '+ MachineID ,
+ 'Run ExSLCODE To Obtain Release Code', CodeStr) then begin
+ HexToBuffer(CodeStr, SpecialCode, SizeOf(SpecialCode));
+ if IsSpecialCodeValid(ModKey, SpecialCode) then
+ Result := GetSpecialCodeValue(ModKey, SpecialCode);
+ end;
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.EnableFeatures(Features : Longint);
+begin
+ FeaturesRequired.Enabled := False;
+ FeaturesRequired.Checked := False;
+ FeaturesHelp.Enabled := False;
+ FeaturesHelp.Checked := False;
+ FeaturesExamples.Enabled := False;
+ FeaturesExamples.Checked := False;
+ FeaturesDatabase.Enabled := False;
+ FeaturesDatabase.Checked := False;
+ FeaturesFax.Enabled := False;
+ FeaturesFax.Checked := False;
+ FeaturesGoodies.Enabled := False;
+ FeaturesGoodies.Checked := False;
+ if (Features and RequiredMask) <> 0 then begin
+ FeaturesRequired.Enabled := True;
+ FeaturesRequired.Checked := True;
+ end;
+ if (Features and HelpMask) <> 0 then begin
+ FeaturesHelp.Enabled := True;
+ FeaturesHelp.Checked := True;
+ end;
+ if (Features and ExamplesMask) <> 0 then begin
+ FeaturesExamples.Enabled := True;
+ FeaturesExamples.Checked := True;
+ end;
+ if (Features and DBMask) <> 0 then begin
+ FeaturesDatabase.Enabled := True;
+ FeaturesDatabase.Checked := True;
+ end;
+ if (Features and FaxMask) <> 0 then begin
+ FeaturesFax.Enabled := True;
+ FeaturesFax.Checked := True;
+ end;
+ if (Features and GoodiesMask) <> 0 then begin
+ FeaturesGoodies.Enabled := True;
+ FeaturesGoodies.Checked := True;
+ end;
+ if (Features = 0) then
+ FeaturesMenu.Caption := 'No Features Enabled'
+ else
+ FeaturesMenu.Caption := '&Features';
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.ModifyBtnClick(Sender: TObject);
+var
+ Features : Longint;
+begin
+ FillChar(SpecialCode, SizeOf(SpecialCode), 0);
+ Features := DecodeSpecialCode;
+ if (Features <> 0) then begin
+ FilePutCode(1, SpecialCode);
+ EnableFeatures(Features);
+ Caption := RegisteredCap;
+ end;
+end;
+
+
+initialization
+{$i exselap1.lrs}
+
+end.
diff --git a/components/onguard/examples/exselapi/exselapi.lpi b/components/onguard/examples/exselapi/exselapi.lpi
new file mode 100644
index 000000000..4b8c11ff6
--- /dev/null
+++ b/components/onguard/examples/exselapi/exselapi.lpi
@@ -0,0 +1,230 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exselapi/exselapi.lpr b/components/onguard/examples/exselapi/exselapi.lpr
new file mode 100644
index 000000000..4da3656f5
--- /dev/null
+++ b/components/onguard/examples/exselapi/exselapi.lpr
@@ -0,0 +1,16 @@
+program Exselapi;
+
+{$mode objfpc}{$H+}
+
+
+uses
+ Interfaces,
+ Forms,
+ Exselap1 in 'EXSELAP1.PAS' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exselect/exselec1.lfm b/components/onguard/examples/exselect/exselec1.lfm
new file mode 100644
index 000000000..b64af12f2
--- /dev/null
+++ b/components/onguard/examples/exselect/exselec1.lfm
@@ -0,0 +1,96 @@
+object Form1: TForm1
+ Left = 287
+ Height = 274
+ Top = 102
+ Width = 369
+ HorzScrollBar.Page = 368
+ VertScrollBar.Page = 249
+ ActiveControl = Memo1
+ Caption = 'ExSelect: '
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Menu = MainMenu1
+ OnCreate = FormCreate
+ object Memo1: TMemo
+ Left = 16
+ Height = 145
+ Top = 8
+ Width = 329
+ Color = clAqua
+ Lines.Strings = (
+ ' This example uses the TOgUsageCode and the TOgSpecialCode'
+ ' components to implement a limited use "demo" application'
+ ' which allows only the required features. The program can be '
+ ' run 3 times and then a special code must be obtained to '
+ ' register the program and to enable various features. A'
+ ' machine modifier is used to prevent the application from being '
+ ' copied and run on another machine. To obtain the release '
+ ' release code you need to run the companion example '
+ ' EXSLCODE. The release codes will be stored in a data file '
+ ' called EXSELECT.DAT'
+ )
+ ReadOnly = True
+ TabOrder = 0
+ end
+ object ModifyBtn: TButton
+ Left = 120
+ Height = 25
+ Top = 176
+ Width = 113
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Modify Features'
+ Enabled = False
+ OnClick = ModifyBtnClick
+ TabOrder = 1
+ end
+ object MainMenu1: TMainMenu
+ left = 32
+ top = 168
+ object FeaturesMenu: TMenuItem
+ Caption = 'Features'
+ object FeaturesRequired: TMenuItem
+ Caption = 'Required'
+ Checked = True
+ end
+ object FeaturesHelp: TMenuItem
+ Caption = 'Help'
+ Enabled = False
+ end
+ object FeaturesExamples: TMenuItem
+ Caption = 'Examples'
+ Enabled = False
+ end
+ object FeaturesDatabase: TMenuItem
+ Caption = 'Database'
+ Enabled = False
+ end
+ object FeaturesFax: TMenuItem
+ Caption = 'Fax'
+ Enabled = False
+ end
+ object FeaturesGoodies: TMenuItem
+ Caption = 'Goodies'
+ Enabled = False
+ end
+ end
+ end
+ object OgUsageCode1: TOgUsageCode
+ AutoCheck = False
+ OnChecked = OgUsageCode1Checked
+ OnGetKey = OgUsageCode1GetKey
+ OnGetCode = OgUsageCode1GetCode
+ AutoDecrease = False
+ OnChangeCode = OgUsageCode1ChangeCode
+ left = 168
+ top = 48
+ end
+ object OgSpecialCode1: TOgSpecialCode
+ AutoCheck = False
+ OnChecked = OgSpecialCode1Checked
+ OnGetKey = OgSpecialCode1GetKey
+ OnGetCode = OgSpecialCode1GetCode
+ OnGetModifier = OgSpecialCode1GetModifier
+ left = 168
+ top = 16
+ end
+end
diff --git a/components/onguard/examples/exselect/exselec1.lrs b/components/onguard/examples/exselect/exselec1.lrs
new file mode 100644
index 000000000..65b95cc75
--- /dev/null
+++ b/components/onguard/examples/exselect/exselec1.lrs
@@ -0,0 +1,36 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#31#1#6'Height'#3#18#1#3'Top'#2'f'#5'Width'
+ +#3'q'#1#18'HorzScrollBar.Page'#3'p'#1#18'VertScrollBar.Page'#3#249#0#13'Acti'
+ +'veControl'#7#5'Memo1'#7'Caption'#6#10'ExSelect: '#11'Font.Height'#2#245#9'F'
+ +'ont.Name'#6#13'MS Sans Serif'#4'Menu'#7#9'MainMenu1'#8'OnCreate'#7#10'FormC'
+ +'reate'#0#5'TMemo'#5'Memo1'#4'Left'#2#16#6'Height'#3#145#0#3'Top'#2#8#5'Widt'
+ +'h'#3'I'#1#5'Color'#7#6'clAqua'#13'Lines.Strings'#1#6'< This example uses '
+ +'the TOgUsageCode and the TOgSpecialCode'#6'; components to implement a li'
+ +'mited use "demo" application'#6'@ which allows only the required features'
+ +'. The program can be '#6'< run 3 times and then a special code must be '
+ +'obtained to '#6': register the program and to enable various features. A'
+ +#6'B machine modifier is used to prevent the application from being '#6'= '
+ +' copied and run on another machine. To obtain the release '#6'6 release'
+ +' code you need to run the companion example '#6'> EXSLCODE. The release '
+ +'codes will be stored in a data file '#6#22' called EXSELECT.DAT'#0#8'Read'
+ +'Only'#9#8'TabOrder'#2#0#0#0#7'TButton'#9'ModifyBtn'#4'Left'#2'x'#6'Height'#2
+ +#25#3'Top'#3#176#0#5'Width'#2'q'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'
+ +#6#15'Modify Features'#7'Enabled'#8#7'OnClick'#7#14'ModifyBtnClick'#8'TabOrd'
+ +'er'#2#1#0#0#9'TMainMenu'#9'MainMenu1'#4'left'#2' '#3'top'#3#168#0#0#9'TMenu'
+ +'Item'#12'FeaturesMenu'#7'Caption'#6#8'Features'#0#9'TMenuItem'#16'FeaturesR'
+ +'equired'#7'Caption'#6#8'Required'#7'Checked'#9#0#0#9'TMenuItem'#12'Features'
+ +'Help'#7'Caption'#6#4'Help'#7'Enabled'#8#0#0#9'TMenuItem'#16'FeaturesExample'
+ +'s'#7'Caption'#6#8'Examples'#7'Enabled'#8#0#0#9'TMenuItem'#16'FeaturesDataba'
+ +'se'#7'Caption'#6#8'Database'#7'Enabled'#8#0#0#9'TMenuItem'#11'FeaturesFax'#7
+ +'Caption'#6#3'Fax'#7'Enabled'#8#0#0#9'TMenuItem'#15'FeaturesGoodies'#7'Capti'
+ +'on'#6#7'Goodies'#7'Enabled'#8#0#0#0#0#12'TOgUsageCode'#12'OgUsageCode1'#9'A'
+ +'utoCheck'#8#9'OnChecked'#7#19'OgUsageCode1Checked'#8'OnGetKey'#7#18'OgUsage'
+ +'Code1GetKey'#9'OnGetCode'#7#19'OgUsageCode1GetCode'#12'AutoDecrease'#8#12'O'
+ +'nChangeCode'#7#22'OgUsageCode1ChangeCode'#4'left'#3#168#0#3'top'#2'0'#0#0#14
+ +'TOgSpecialCode'#14'OgSpecialCode1'#9'AutoCheck'#8#9'OnChecked'#7#21'OgSpeci'
+ +'alCode1Checked'#8'OnGetKey'#7#20'OgSpecialCode1GetKey'#9'OnGetCode'#7#21'Og'
+ +'SpecialCode1GetCode'#13'OnGetModifier'#7#25'OgSpecialCode1GetModifier'#4'le'
+ +'ft'#3#168#0#3'top'#2#16#0#0#0
+]);
diff --git a/components/onguard/examples/exselect/exselec1.pas b/components/onguard/examples/exselect/exselec1.pas
new file mode 100644
index 000000000..b1dcf18e1
--- /dev/null
+++ b/components/onguard/examples/exselect/exselec1.pas
@@ -0,0 +1,330 @@
+{*********************************************************}
+{* ONGUARD: EXSELEC1.PAS *}
+{* Copyright (c) TurboPower Software Co 1998 *}
+{* All rights reserved. *}
+{*********************************************************}
+
+ { This example uses the TOgUsageCode and the TOgSpecialCode
+ components to implement a limited use "demo" application
+ which allows only the required features. The program can
+ be run 3 times and then a special code must be obtained
+ to register the program and to enable various features.
+ A machine modifier is used to prevent the application from
+ being copied and run on another machine. To obtain the
+ release code you need to run the companion example EXSLCODE.
+ The release codes will be stored in a data file called
+ EXSELECT.DAT}
+
+unit Exselec1;
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils, Classes, Controls, Forms, Dialogs,
+ StdCtrls, OnGuard, OgUtil, Menus,Buttons,LResources;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ ModifyBtn: TButton;
+ Memo1: TMemo;
+ MainMenu1: TMainMenu;
+ FeaturesMenu: TMenuItem;
+ FeaturesRequired: TMenuItem;
+ FeaturesHelp: TMenuItem;
+ FeaturesExamples: TMenuItem;
+ FeaturesDatabase: TMenuItem;
+ FeaturesFax: TMenuItem;
+ FeaturesGoodies: TMenuItem;
+ OgUsageCode1: TOgUsageCode;
+ OgSpecialCode1: TOgSpecialCode;
+ function DecodeSpecialCode : Longint;
+ procedure ModifyBtnClick(Sender: TObject);
+ procedure EnableFeatures(Features : Longint);
+ procedure OgUsageCode1GetKey(Sender: TObject; var Key: TKey);
+ procedure OgUsageCode1GetCode(Sender: TObject; var Code: TCode);
+ procedure OgUsageCode1Checked(Sender: TObject; Status: TCodeStatus);
+ procedure OgSpecialCode1GetKey(Sender: TObject; var Key: TKey);
+ procedure OgSpecialCode1GetCode(Sender: TObject; var Code: TCode);
+ procedure OgSpecialCode1GetModifier(Sender: TObject;
+ var Value: Longint);
+ procedure OgSpecialCode1Checked(Sender: TObject; Status: TCodeStatus);
+ procedure FormCreate(Sender: TObject);
+ function FileGetCode(Index : Longint; var Code : TCode) : Boolean;
+ procedure FilePutCode(Index : Longint; Code : TCode);
+ procedure OgUsageCode1ChangeCode(Sender: TObject; Code: TCode);
+ end;
+
+var
+ Form1: TForm1;
+
+{----------------------------------------------------------------------}
+
+implementation
+
+
+
+const
+ { The key was created by a separate program (CODEGEN) and is generic
+ the examples, EXSELECT, EXSELAPI, and EXSLCODE }
+ TheKey: TKey = ($F1,$46,$8D,$E4,$70,$AE,$92,$DC,
+ $13,$1A,$03,$C4,$44,$25,$72,$F5);
+
+ { Initial code has 3 uses embedded }
+ InitCode : string = '13B1A08BD78AFCD3';
+ CodeFile : string = 'ExSelect.Dat';
+ DemoCaption : string = 'ExSelect: Demo runs left = ';
+ RegisteredCap : string = 'ExSelect: Registered';
+ NotRegisteredCap : string = 'ExSelect: Not Registered';
+ ModifyStr : string = 'Modify Registration to enable this feature';
+
+ { Feature masks }
+ RequiredMask = $00000001;
+ HelpMask = $00000002;
+ ExamplesMask = $00000004;
+ DBMask = $00000008;
+ FaxMask = $00000010;
+ GoodiesMask = $00000020;
+
+var
+ UsageCode : TCode; {Index = 0}
+ SpecialCode : TCode; {Index = 1}
+
+
+{=========== Initialization and File I/O ===============}
+
+function TForm1.FileGetCode(Index : Longint; var Code : TCode) : Boolean;
+var
+ Dir, Path : string;
+ FileHandle : Integer;
+begin
+ Dir := '';
+ GetDir(0, Dir);
+ Path := Dir + DirectorySeparator + CodeFile;
+ FillChar(Code, SizeOf(TCode), 0);
+ if FileExists(Path) then begin
+ FileHandle := FileOpen(Path, fmOpenRead);
+ FileSeek(FileHandle, Index * SizeOf(Code), 0);
+ FileRead(FileHandle, Code, SizeOf(Code));
+ FileClose(FileHandle);
+ Result := True;
+ end else
+ Result := False;
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.FilePutCode(Index : Longint; Code : TCode);
+var
+ Dir, Path : string;
+ FileHandle : Integer;
+begin
+ Dir := '';
+ GetDir(0, Dir);
+ Path := Dir + DirectorySeparator + CodeFile;
+ if not FileExists(Path) then
+ FileHandle := FileCreate(Path)
+ else
+ FileHandle := FileOpen(Path, fmOpenWrite);
+ FileSeek(FileHandle, Index * SizeOf(Code), 0);
+ FileWrite(FileHandle, Code, SizeOf(Code));
+ FileClose(FileHandle);
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+ FillChar(SpecialCode, SizeOf(SpecialCode), 0);
+ if not FileGetCode(0, UsageCode) then
+ HexToBuffer(InitCode, UsageCode, SizeOf(UsageCode));
+ OgUsageCode1.CheckCode(True);
+end;
+
+
+{=================== Usage Code Stuff ==================}
+
+procedure TForm1.OgUsageCode1GetKey(Sender: TObject; var Key: TKey);
+begin
+ Key := TheKey;
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.OgUsageCode1GetCode(Sender: TObject; var Code: TCode);
+begin
+ Code := UsageCode;
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.OgUsageCode1Checked(Sender: TObject; Status: TCodeStatus);
+begin
+ { If usage code is valid, app is still in demo period so enable only
+ default features }
+ if (Status = ogValidCode) then begin
+ OgUsageCode1.Decrease;
+ EnableFeatures(RequiredMask);
+ end else begin { Usage count has expired, go on to special code stuff }
+ FileGetCode(1, SpecialCode);
+ ModifyBtn.Enabled := True;
+ OgSpecialCode1.CheckCode(True);
+ end;
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.OgUsageCode1ChangeCode(Sender: TObject; Code: TCode);
+var
+ FreebiesLeft : Longint;
+begin
+ FreebiesLeft := OgUsageCode1.GetValue - 1;
+ UsageCode := Code;
+ FilePutCode(0, UsageCode);
+ Caption := DemoCaption + IntToStr(FreebiesLeft);
+end;
+
+
+{================== Special Code Stuff =================}
+
+procedure TForm1.OgSpecialCode1GetKey(Sender: TObject; var Key: TKey);
+begin
+ Key := TheKey;
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.OgSpecialCode1GetCode(Sender: TObject; var Code: TCode);
+begin
+ Code := SpecialCode;
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.OgSpecialCode1GetModifier(Sender: TObject;
+ var Value: Longint);
+begin
+ Value := GenerateMachineModifierPrim;
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.OgSpecialCode1Checked(Sender: TObject;
+ Status: TCodeStatus);
+var
+ Features : Longint;
+begin
+ { If special code is valid, then app is registered so enable features }
+ if (Status = ogValidCode) then begin
+ FilePutCode(1, SpecialCode);
+ Features := OgSpecialCode1.GetValue;
+ EnableFeatures(Features);
+ Caption := RegisteredCap;
+ Exit;
+ end;
+ { Otherwise prompt for release code}
+ Features := DecodeSpecialCode;
+ if (Features <> 0) then begin
+ FilePutCode(1, SpecialCode);
+ EnableFeatures(Features);
+ Caption := RegisteredCap;
+ end else begin
+ EnableFeatures(0);
+ Caption := NotRegisteredCap;
+ end;
+end;
+
+
+{================== Registration Dialog ================}
+
+function TForm1.DecodeSpecialCode : Longint;
+var
+ CodeStr : string;
+ ModKey : TKey;
+ MachineID : string;
+ Modifier : longint;
+begin
+ Result := 0;
+ MachineID := '';
+ Modifier := GenerateMachineModifierPrim;
+ MachineID := BufferToHex(Modifier, SizeOf(Modifier));
+ ModKey := TheKey;
+ ApplyModifierToKeyPrim(Modifier, ModKey, SizeOf(ModKey));
+ CodeStr := '';
+ if InputQuery('Machine ID: '+ MachineID ,
+ 'Run EXSLCODE To Obtain Release Code', CodeStr) then begin
+ HexToBuffer(CodeStr, SpecialCode, SizeOf(SpecialCode));
+ if OgSpecialCode1.IsCodeValid then
+ Result := OgSpecialCode1.GetValue;
+ end;
+end;
+
+
+{================== The Rest of it ================}
+
+procedure TForm1.EnableFeatures(Features : Longint);
+begin
+ FeaturesRequired.Enabled := False;
+ FeaturesRequired.Checked := False;
+ FeaturesHelp.Enabled := False;
+ FeaturesHelp.Checked := False;
+ FeaturesExamples.Enabled := False;
+ FeaturesExamples.Checked := False;
+ FeaturesDatabase.Enabled := False;
+ FeaturesDatabase.Checked := False;
+ FeaturesFax.Enabled := False;
+ FeaturesFax.Checked := False;
+ FeaturesGoodies.Enabled := False;
+ FeaturesGoodies.Checked := False;
+ if (Features and RequiredMask) <> 0 then begin
+ FeaturesRequired.Enabled := True;
+ FeaturesRequired.Checked := True;
+ end;
+ if (Features and HelpMask) <> 0 then begin
+ FeaturesHelp.Enabled := True;
+ FeaturesHelp.Checked := True;
+ end;
+ if (Features and ExamplesMask) <> 0 then begin
+ FeaturesExamples.Enabled := True;
+ FeaturesExamples.Checked := True;
+ end;
+ if (Features and DBMask) <> 0 then begin
+ FeaturesDatabase.Enabled := True;
+ FeaturesDatabase.Checked := True;
+ end;
+ if (Features and FaxMask) <> 0 then begin
+ FeaturesFax.Enabled := True;
+ FeaturesFax.Checked := True;
+ end;
+ if (Features and GoodiesMask) <> 0 then begin
+ FeaturesGoodies.Enabled := True;
+ FeaturesGoodies.Checked := True;
+ end;
+ if (Features = 0) then
+ FeaturesMenu.Caption := 'No Features Enabled'
+ else
+ FeaturesMenu.Caption := '&Features';
+end;
+
+{-------------------------------------------------------}
+
+procedure TForm1.ModifyBtnClick(Sender: TObject);
+var
+ Features : Longint;
+begin
+ FillChar(SpecialCode, SizeOf(SpecialCode), 0);
+ Features := DecodeSpecialCode;
+ if (Features <> 0) then begin
+ FilePutCode(1, SpecialCode);
+ EnableFeatures(Features);
+ Caption := RegisteredCap;
+ end;
+end;
+
+initialization
+{$i exselec1.lrs}
+
+end.
diff --git a/components/onguard/examples/exselect/exselect.lpi b/components/onguard/examples/exselect/exselect.lpi
new file mode 100644
index 000000000..e8d71c52b
--- /dev/null
+++ b/components/onguard/examples/exselect/exselect.lpi
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exselect/exselect.lpr b/components/onguard/examples/exselect/exselect.lpr
new file mode 100644
index 000000000..6d260487a
--- /dev/null
+++ b/components/onguard/examples/exselect/exselect.lpr
@@ -0,0 +1,15 @@
+program Exselect;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ Exselec1 in 'EXSELEC1.PAS' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exslcode/exslcod1.lfm b/components/onguard/examples/exslcode/exslcod1.lfm
new file mode 100644
index 000000000..05583d1f2
--- /dev/null
+++ b/components/onguard/examples/exslcode/exslcod1.lfm
@@ -0,0 +1,112 @@
+object Form1: TForm1
+ ActiveControl = MachineID
+ Caption = ' Special Code Generator '
+ ClientHeight = 243
+ ClientWidth = 288
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ PixelsPerInch = 96
+ TextHeight = 13
+ HorzScrollBar.Page = 287
+ VertScrollBar.Page = 242
+ Left = 237
+ Height = 243
+ Top = 152
+ Width = 288
+ object Label1: TLabel
+ Caption = 'Machine ID'
+ Color = clNone
+ ParentColor = False
+ Left = 35
+ Height = 14
+ Top = 20
+ Width = 54
+ end
+ object GenBtn: TButton
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Generate Code'
+ OnClick = GenBtnClick
+ TabOrder = 1
+ Left = 18
+ Height = 25
+ Top = 176
+ Width = 89
+ end
+ object MachineID: TEdit
+ MaxLength = 8
+ TabOrder = 0
+ Left = 123
+ Height = 21
+ Top = 16
+ Width = 89
+ end
+ object GroupBox1: TGroupBox
+ Caption = 'Features'
+ ClientHeight = 79
+ ClientWidth = 221
+ TabOrder = 2
+ Left = 24
+ Height = 97
+ Top = 56
+ Width = 225
+ object ReqFeat: TCheckBox
+ Caption = 'Required'
+ Checked = True
+ Enabled = False
+ State = cbChecked
+ TabOrder = 0
+ Left = 16
+ Height = 17
+ Top = 24
+ Width = 81
+ end
+ object HelpFeat: TCheckBox
+ Caption = 'Help'
+ TabOrder = 1
+ Left = 16
+ Height = 17
+ Top = 40
+ Width = 81
+ end
+ object ExamplesFeat: TCheckBox
+ Caption = 'Examples'
+ TabOrder = 2
+ Left = 16
+ Height = 17
+ Top = 56
+ Width = 81
+ end
+ object DBFeat: TCheckBox
+ Caption = 'Database'
+ TabOrder = 3
+ Left = 120
+ Height = 17
+ Top = 24
+ Width = 81
+ end
+ object FaxFeat: TCheckBox
+ Caption = 'Fax'
+ TabOrder = 4
+ Left = 120
+ Height = 17
+ Top = 40
+ Width = 81
+ end
+ object GoodiesFeat: TCheckBox
+ Caption = 'Goodies'
+ TabOrder = 5
+ Left = 120
+ Height = 17
+ Top = 56
+ Width = 81
+ end
+ end
+ object CodeDisplay: TEdit
+ Color = clAqua
+ TabOrder = 3
+ Left = 123
+ Height = 21
+ Top = 178
+ Width = 126
+ end
+end
diff --git a/components/onguard/examples/exslcode/exslcod1.lrs b/components/onguard/examples/exslcode/exslcod1.lrs
new file mode 100644
index 000000000..e380ac8c7
--- /dev/null
+++ b/components/onguard/examples/exslcode/exslcod1.lrs
@@ -0,0 +1,30 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#13'ActiveControl'#7#9'MachineID'#7'Caption'#6#24' S'
+ +'pecial Code Generator '#12'ClientHeight'#3#243#0#11'ClientWidth'#3' '#1#11
+ +'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#13'PixelsPerInch'#2'`'
+ +#10'TextHeight'#2#13#18'HorzScrollBar.Page'#3#31#1#18'VertScrollBar.Page'#3
+ +#242#0#4'Left'#3#237#0#6'Height'#3#243#0#3'Top'#3#152#0#5'Width'#3' '#1#0#6
+ +'TLabel'#6'Label1'#7'Caption'#6#10'Machine ID'#5'Color'#7#6'clNone'#11'Paren'
+ +'tColor'#8#4'Left'#2'#'#6'Height'#2#14#3'Top'#2#20#5'Width'#2'6'#0#0#7'TButt'
+ +'on'#6'GenBtn'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#13'Generate Co'
+ +'de'#7'OnClick'#7#11'GenBtnClick'#8'TabOrder'#2#1#4'Left'#2#18#6'Height'#2#25
+ +#3'Top'#3#176#0#5'Width'#2'Y'#0#0#5'TEdit'#9'MachineID'#9'MaxLength'#2#8#8'T'
+ +'abOrder'#2#0#4'Left'#2'{'#6'Height'#2#21#3'Top'#2#16#5'Width'#2'Y'#0#0#9'TG'
+ +'roupBox'#9'GroupBox1'#7'Caption'#6#8'Features'#12'ClientHeight'#2'O'#11'Cli'
+ +'entWidth'#3#221#0#8'TabOrder'#2#2#4'Left'#2#24#6'Height'#2'a'#3'Top'#2'8'#5
+ +'Width'#3#225#0#0#9'TCheckBox'#7'ReqFeat'#7'Caption'#6#8'Required'#7'Checked'
+ +#9#7'Enabled'#8#5'State'#7#9'cbChecked'#8'TabOrder'#2#0#4'Left'#2#16#6'Heigh'
+ +'t'#2#17#3'Top'#2#24#5'Width'#2'Q'#0#0#9'TCheckBox'#8'HelpFeat'#7'Caption'#6
+ +#4'Help'#8'TabOrder'#2#1#4'Left'#2#16#6'Height'#2#17#3'Top'#2'('#5'Width'#2
+ +'Q'#0#0#9'TCheckBox'#12'ExamplesFeat'#7'Caption'#6#8'Examples'#8'TabOrder'#2
+ +#2#4'Left'#2#16#6'Height'#2#17#3'Top'#2'8'#5'Width'#2'Q'#0#0#9'TCheckBox'#6
+ +'DBFeat'#7'Caption'#6#8'Database'#8'TabOrder'#2#3#4'Left'#2'x'#6'Height'#2#17
+ +#3'Top'#2#24#5'Width'#2'Q'#0#0#9'TCheckBox'#7'FaxFeat'#7'Caption'#6#3'Fax'#8
+ +'TabOrder'#2#4#4'Left'#2'x'#6'Height'#2#17#3'Top'#2'('#5'Width'#2'Q'#0#0#9'T'
+ +'CheckBox'#11'GoodiesFeat'#7'Caption'#6#7'Goodies'#8'TabOrder'#2#5#4'Left'#2
+ +'x'#6'Height'#2#17#3'Top'#2'8'#5'Width'#2'Q'#0#0#0#5'TEdit'#11'CodeDisplay'#5
+ +'Color'#7#6'clAqua'#8'TabOrder'#2#3#4'Left'#2'{'#6'Height'#2#21#3'Top'#3#178
+ +#0#5'Width'#2'~'#0#0#0
+]);
diff --git a/components/onguard/examples/exslcode/exslcod1.pas b/components/onguard/examples/exslcode/exslcod1.pas
new file mode 100644
index 000000000..5ecb3d7f8
--- /dev/null
+++ b/components/onguard/examples/exslcode/exslcod1.pas
@@ -0,0 +1,97 @@
+{*********************************************************}
+{* ONGUARD: EXSLCOD1.PAS *}
+{* Copyright (c) TurboPower Software Co 1998 *}
+{* All rights reserved. *}
+{*********************************************************}
+
+ { This example generates a special release code (via OnGuard API)
+ to enable various features of the companion examples, EXSELECT
+ and EXSELAPI. Enter the machine identifier displayed by those
+ examples and make the desired feature selection. The generic
+ key used by these examples will be modified by the value entered
+ for machine identifier to create the special release code with
+ a numeric value representing the features selected.}
+
+unit Exslcod1;
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils, Classes, Controls, Forms, Dialogs,Buttons,
+ OnGuard, OgUtil, StdCtrls,LResources{, Mask};
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ Label1: TLabel;
+ GenBtn: TButton;
+ MachineID: TEdit;
+ GroupBox1: TGroupBox;
+ ReqFeat: TCheckBox;
+ HelpFeat: TCheckBox;
+ ExamplesFeat: TCheckBox;
+ DBFeat: TCheckBox;
+ FaxFeat: TCheckBox;
+ GoodiesFeat: TCheckBox;
+ CodeDisplay: TEdit;
+ procedure GenBtnClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+const
+ DemoKey: TKey = ($F1,$46,$8D,$E4,
+ $70,$AE,$92,$DC,
+ $13,$1A,$03,$C4,
+ $44,$25,$72,$F5);
+
+ RequiredMask: longint = $00000001;
+ HelpMask: longint = $00000002;
+ ExamplesMask: longint = $00000004;
+ DBMask: longint = $00000008;
+ FaxMask: longint = $00000010;
+ GoodiesMask: longint = $00000020;
+
+procedure TForm1.GenBtnClick(Sender: TObject);
+var
+ Key: TKey;
+ Modifier: Longint;
+ Code: TCode;
+ Expires: TDateTime;
+ Value: longint;
+begin
+ Key := DemoKey;
+ HexToBuffer(MachineID.Text, Modifier, SizeOf(Modifier));
+ ApplyModifierToKeyPrim(Modifier, Key, SizeOf(Key));
+ Expires := Date + 5;
+ Value := RequiredMask;
+ If HelpFeat.Checked then
+ Value := Value + HelpMask;
+ If ExamplesFeat.Checked then
+ Value := Value + ExamplesMask;
+ If DBFeat.Checked then
+ Value := Value + DBMask;
+ If FaxFeat.Checked then
+ Value := Value + FaxMask;
+ If GoodiesFeat.Checked then
+ Value := Value + GoodiesMask;
+ InitSpecialCode(Key, Value, Expires, Code);
+ CodeDisplay.Text := BufferToHex(Code, SizeOf(Code));
+end;
+
+initialization
+{$i exslcod1.lrs}
+
+end.
diff --git a/components/onguard/examples/exslcode/exslcode.lpi b/components/onguard/examples/exslcode/exslcode.lpi
new file mode 100644
index 000000000..6d2f29e44
--- /dev/null
+++ b/components/onguard/examples/exslcode/exslcode.lpi
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exslcode/exslcode.lpr b/components/onguard/examples/exslcode/exslcode.lpr
new file mode 100644
index 000000000..a5bfb31df
--- /dev/null
+++ b/components/onguard/examples/exslcode/exslcode.lpr
@@ -0,0 +1,15 @@
+program Exslcode;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ Exslcod1 in 'EXSLCOD1.PAS' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exsnreg/ONGUARD.INI b/components/onguard/examples/exsnreg/ONGUARD.INI
new file mode 100644
index 000000000..27787af3d
--- /dev/null
+++ b/components/onguard/examples/exsnreg/ONGUARD.INI
@@ -0,0 +1,5 @@
+[Keys]
+Flamenco=$E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4
+
+[Codes]
+SerialNumberCode=049CF7F37E44F6C6
diff --git a/components/onguard/examples/exsnreg/exsnreg.lpi b/components/onguard/examples/exsnreg/exsnreg.lpi
new file mode 100644
index 000000000..4605379fa
--- /dev/null
+++ b/components/onguard/examples/exsnreg/exsnreg.lpi
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exsnreg/exsnreg.lpr b/components/onguard/examples/exsnreg/exsnreg.lpr
new file mode 100644
index 000000000..2de0ac8b4
--- /dev/null
+++ b/components/onguard/examples/exsnreg/exsnreg.lpr
@@ -0,0 +1,15 @@
+program ExSNReg;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ ExSNRegU in 'ExSNRegU.pas' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exsnreg/exsnregu.lfm b/components/onguard/examples/exsnreg/exsnregu.lfm
new file mode 100644
index 000000000..912c6140b
--- /dev/null
+++ b/components/onguard/examples/exsnreg/exsnregu.lfm
@@ -0,0 +1,98 @@
+object Form1: TForm1
+ Left = 252
+ Height = 304
+ Top = 138
+ Width = 495
+ HorzScrollBar.Page = 494
+ VertScrollBar.Page = 303
+ BorderStyle = bsDialog
+ Caption = 'Serial Number Code Example'
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Position = poScreenCenter
+ object StatusLbl: TLabel
+ Left = 8
+ Height = 13
+ Top = 262
+ Width = 35
+ Caption = 'Status'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label1: TLabel
+ Left = 232
+ Height = 13
+ Top = 14
+ Width = 77
+ Caption = 'Current code:'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeLbl: TLabel
+ Left = 320
+ Height = 13
+ Top = 14
+ Width = 113
+ Caption = '0000000000000000'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeBtn: TButton
+ Left = 8
+ Height = 25
+ Top = 8
+ Width = 89
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Enter Code'
+ OnClick = CodeBtnClick
+ TabOrder = 0
+ end
+ object Memo1: TMemo
+ Left = 8
+ Height = 209
+ Top = 40
+ Width = 465
+ Color = clBtnFace
+ Lines.Strings = (
+ 'The label at the bottom of this form indicates the status of the code. An invalid code indicates that '
+ 'the code is either the incorrect type or that none has been entered. '
+ ''
+ 'If the proper code has not been entered or the ONGUARD.INI file was deleted, the message will '
+ 'say that the code is invalid.'
+ ''
+ 'Use the "Enter Code" button to enter a code (the CODEGEN program can be used to generate '
+ 'the proper "Usage" code). '
+ ''
+ 'The "Remove Code" button can be used to remove the entered code from the INI file. Doing so '
+ 'will cause the TOgSerialNumberCode component to report that the code is invalid.'
+ )
+ ReadOnly = True
+ TabOrder = 1
+ end
+ object CloseBtn: TBitBtn
+ Left = 400
+ Height = 25
+ Top = 256
+ Width = 75
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 2
+ end
+ object RemoveBtn: TButton
+ Left = 288
+ Height = 25
+ Top = 256
+ Width = 97
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Remove Code'
+ OnClick = RemoveBtnClick
+ TabOrder = 3
+ end
+ object OgSerialNumberCode1: TOgSerialNumberCode
+ OnChecked = CodeChecked
+ OnGetKey = GetKey
+ OnGetCode = GetCode
+ left = 16
+ top = 208
+ end
+end
diff --git a/components/onguard/examples/exsnreg/exsnregu.lrs b/components/onguard/examples/exsnreg/exsnregu.lrs
new file mode 100644
index 000000000..73d436cff
--- /dev/null
+++ b/components/onguard/examples/exsnreg/exsnregu.lrs
@@ -0,0 +1,34 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#252#0#6'Height'#3'0'#1#3'Top'#3#138#0#5'W'
+ +'idth'#3#239#1#18'HorzScrollBar.Page'#3#238#1#18'VertScrollBar.Page'#3'/'#1
+ +#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#26'Serial Number Code Example'#11
+ +'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScre'
+ +'enCenter'#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Height'#2#13#3'Top'#3#6#1#5
+ +'Width'#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNone'#11'ParentColor'#8#0
+ +#0#6'TLabel'#6'Label1'#4'Left'#3#232#0#6'Height'#2#13#3'Top'#2#14#5'Width'#2
+ +'M'#7'Caption'#6#13'Current code:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0
+ +#6'TLabel'#7'CodeLbl'#4'Left'#3'@'#1#6'Height'#2#13#3'Top'#2#14#5'Width'#2'q'
+ +#7'Caption'#6#16'0000000000000000'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0
+ +#7'TButton'#7'CodeBtn'#4'Left'#2#8#6'Height'#2#25#3'Top'#2#8#5'Width'#2'Y'#25
+ +'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Enter Code'#7'OnClick'#7#12
+ +'CodeBtnClick'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#3
+ +#209#0#3'Top'#2'('#5'Width'#3#209#1#5'Color'#7#9'clBtnFace'#13'Lines.Strings'
+ +#1#6'fThe label at the bottom of this form indicates the status of the code.'
+ +' An invalid code indicates that '#6'Ethe code is either the incorrect type '
+ +'or that none has been entered. '#6#0#6'^If the proper code has not been ent'
+ +'ered or the ONGUARD.INI file was deleted, the message will '#6#29'say that '
+ +'the code is invalid.'#6#0#6'YUse the "Enter Code" button to enter a code (t'
+ +'he CODEGEN program can be used to generate '#6#26'the proper "Usage" code).'
+ +' '#6#0#6'\The "Remove Code" button can be used to remove the entered code f'
+ +'rom the INI file. Doing so '#6'Pwill cause the TOgSerialNumberCode componen'
+ +'t to report that the code is invalid.'#0#8'ReadOnly'#9#8'TabOrder'#2#1#0#0#7
+ +'TBitBtn'#8'CloseBtn'#4'Left'#3#144#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2
+ +'K'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0#7'TButton'#9'R'
+ +'emoveBtn'#4'Left'#3' '#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'a'#25'Borde'
+ +'rSpacing.InnerBorder'#2#4#7'Caption'#6#11'Remove Code'#7'OnClick'#7#14'Remo'
+ +'veBtnClick'#8'TabOrder'#2#3#0#0#19'TOgSerialNumberCode'#19'OgSerialNumberCo'
+ +'de1'#9'OnChecked'#7#11'CodeChecked'#8'OnGetKey'#7#6'GetKey'#9'OnGetCode'#7#7
+ +'GetCode'#4'left'#2#16#3'top'#3#208#0#0#0#0
+]);
diff --git a/components/onguard/examples/exsnreg/exsnregu.pas b/components/onguard/examples/exsnreg/exsnregu.pas
new file mode 100644
index 000000000..21ea1ce1c
--- /dev/null
+++ b/components/onguard/examples/exsnreg/exsnregu.pas
@@ -0,0 +1,130 @@
+unit Exsnregu;
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ StdCtrls, Buttons,LResources, OnGuard, IniFiles, OgUtil;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ CodeBtn: TButton;
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ StatusLbl: TLabel;
+ Label1: TLabel;
+ CodeLbl: TLabel;
+ RemoveBtn: TButton;
+ OgSerialNumberCode1: TOgSerialNumberCode;
+ procedure CodeChecked(Sender: TObject; Status: TCodeStatus);
+ procedure GetKey(Sender: TObject; var Key: TKey);
+ procedure GetCode(Sender: TObject; var Code: TCode);
+ procedure CodeBtnClick(Sender: TObject);
+ procedure RemoveBtnClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+procedure TForm1.CodeChecked(Sender: TObject; Status: TCodeStatus);
+var
+ S : string;
+begin
+ case Status of
+ ogValidCode : S := 'Valid Code - SerialNumber: ' + IntToStr(OgSerialNumberCode1.GetValue);
+ ogInvalidCode : S := 'Invalid release code';
+ ogPastEndDate : S := 'Date has expired';
+ ogDayCountUsed : S := 'Zero days of use remaining';
+ ogRunCountUsed : S := 'Usage count has expired';
+ ogNetCountUsed : S := 'Net usage count exceeded';
+ ogCodeExpired : S := 'Code has expired';
+ else
+ S := 'Unknown error';
+ end;
+ StatusLbl.Caption := S;
+end;
+
+procedure TForm1.GetKey(Sender: TObject; var Key: TKey);
+const
+ {this applications' key}
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+begin
+ Key := CKey;
+end;
+
+procedure TForm1.GetCode(Sender: TObject; var Code: TCode);
+var
+ Ini : TIniFile;
+ S : string;
+begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {get the code from the ini file}
+ S := Ini.ReadString('Codes', 'SerialNumberCode', '');
+ {convert to proper form}
+ HexToBuffer(S, Code, SizeOf(Code));
+ {set code label caption}
+ CodeLbl.Caption := S;
+ finally
+ Ini.Free;
+ end;
+end;
+
+procedure TForm1.CodeBtnClick(Sender: TObject);
+var
+ Ini : TIniFile;
+ Work : TCode;
+ S : string;
+begin
+ S := '';
+ {ask for string and code}
+ if InputQuery('Serial Number Code Entry', 'Enter the code', S) then begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {store the code in the ini file if it looks OK}
+ if HexToBuffer(S, Work, SizeOf(Work)) then begin
+ {save the value}
+ Ini.WriteString('Codes', 'SerialNumberCode', S);
+ CodeLbl.Caption := S;
+
+ {tell the code component to test the new code, reporting the results}
+ OgSerialNumberCode1.CheckCode(True);
+ end;
+ finally
+ Ini.Free;
+ end;
+ end;
+end;
+
+procedure TForm1.RemoveBtnClick(Sender: TObject);
+var
+ IniFile : TIniFile;
+begin
+ IniFile := TIniFile.Create('ONGUARD.INI');
+ try
+ IniFile.DeleteKey('Codes', 'SerialNumberCode');
+ finally
+ IniFile.Free;
+ end;
+
+ {tell the code component to test the new code, reporting the results}
+ OgSerialNumberCode1.CheckCode(True);
+end;
+
+
+initialization
+{$i exsnregu.lrs}
+
+end.
diff --git a/components/onguard/examples/exspname/exspname.lpi b/components/onguard/examples/exspname/exspname.lpi
new file mode 100644
index 000000000..f1646c08e
--- /dev/null
+++ b/components/onguard/examples/exspname/exspname.lpi
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exspname/exspname.lpr b/components/onguard/examples/exspname/exspname.lpr
new file mode 100644
index 000000000..26a061426
--- /dev/null
+++ b/components/onguard/examples/exspname/exspname.lpr
@@ -0,0 +1,15 @@
+program ExSpName;
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ ExSpNamu in 'ExSpNamu.pas' {Form1}, tponguard;
+
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exspname/exspnamu.lfm b/components/onguard/examples/exspname/exspnamu.lfm
new file mode 100644
index 000000000..e171870d1
--- /dev/null
+++ b/components/onguard/examples/exspname/exspnamu.lfm
@@ -0,0 +1,112 @@
+object Form1: TForm1
+ Left = 200
+ Height = 295
+ Top = 108
+ Width = 372
+ HorzScrollBar.Page = 371
+ VertScrollBar.Page = 294
+ Caption = 'Build/Check Special Code with Name string'
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ object GroupBox1: TGroupBox
+ Left = 16
+ Height = 97
+ Top = 16
+ Width = 337
+ Caption = ' Generate the Code '
+ TabOrder = 0
+ object Label1: TLabel
+ Left = 24
+ Height = 13
+ Top = 28
+ Width = 53
+ Caption = 'User Name'
+ Color = clNone
+ ParentColor = False
+ end
+ object edtUserName1: TEdit
+ Left = 104
+ Height = 21
+ Top = 24
+ Width = 217
+ TabOrder = 0
+ end
+ object btnGenCode: TButton
+ Left = 6
+ Height = 25
+ Top = 54
+ Width = 85
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Gen Code'
+ OnClick = btnGenCodeClick
+ TabOrder = 1
+ end
+ object edtCode1: TEdit
+ Left = 104
+ Height = 21
+ Top = 56
+ Width = 217
+ ReadOnly = True
+ TabOrder = 2
+ end
+ end
+ object GroupBox2: TGroupBox
+ Left = 16
+ Height = 129
+ Top = 128
+ Width = 337
+ Caption = ' Check the Code '
+ TabOrder = 1
+ object Label2: TLabel
+ Left = 24
+ Height = 13
+ Top = 28
+ Width = 53
+ Caption = 'User Name'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label3: TLabel
+ Left = 24
+ Height = 13
+ Top = 60
+ Width = 25
+ Caption = 'Code'
+ Color = clNone
+ ParentColor = False
+ end
+ object lblCheckResult: TLabel
+ Left = 104
+ Height = 13
+ Top = 96
+ Width = 71
+ Caption = 'lblCheckResult'
+ Color = clNone
+ ParentColor = False
+ end
+ object edtUserName2: TEdit
+ Left = 104
+ Height = 21
+ Top = 24
+ Width = 217
+ TabOrder = 0
+ end
+ object edtCode2: TEdit
+ Left = 104
+ Height = 21
+ Top = 56
+ Width = 217
+ TabOrder = 1
+ end
+ object btnCheckCode: TButton
+ Left = 6
+ Height = 25
+ Top = 88
+ Width = 85
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Check Code'
+ OnClick = btnCheckCodeClick
+ TabOrder = 2
+ end
+ end
+end
diff --git a/components/onguard/examples/exspname/exspnamu.lrs b/components/onguard/examples/exspname/exspnamu.lrs
new file mode 100644
index 000000000..e1d6d0d2d
--- /dev/null
+++ b/components/onguard/examples/exspname/exspnamu.lrs
@@ -0,0 +1,30 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#200#0#6'Height'#3''''#1#3'Top'#2'l'#5'Wid'
+ +'th'#3't'#1#18'HorzScrollBar.Page'#3's'#1#18'VertScrollBar.Page'#3'&'#1#7'Ca'
+ +'ption'#6')Build/Check Special Code with Name string'#11'Font.Height'#2#245#9
+ +'Font.Name'#6#13'MS Sans Serif'#0#9'TGroupBox'#9'GroupBox1'#4'Left'#2#16#6'H'
+ +'eight'#2'a'#3'Top'#2#16#5'Width'#3'Q'#1#7'Caption'#6#19' Generate the Code '
+ +#8'TabOrder'#2#0#0#6'TLabel'#6'Label1'#4'Left'#2#24#6'Height'#2#13#3'Top'#2
+ +#28#5'Width'#2'5'#7'Caption'#6#9'User Name'#5'Color'#7#6'clNone'#11'ParentCo'
+ +'lor'#8#0#0#5'TEdit'#12'edtUserName1'#4'Left'#2'h'#6'Height'#2#21#3'Top'#2#24
+ +#5'Width'#3#217#0#8'TabOrder'#2#0#0#0#7'TButton'#10'btnGenCode'#4'Left'#2#6#6
+ +'Height'#2#25#3'Top'#2'6'#5'Width'#2'U'#25'BorderSpacing.InnerBorder'#2#4#7
+ +'Caption'#6#8'Gen Code'#7'OnClick'#7#15'btnGenCodeClick'#8'TabOrder'#2#1#0#0
+ +#5'TEdit'#8'edtCode1'#4'Left'#2'h'#6'Height'#2#21#3'Top'#2'8'#5'Width'#3#217
+ +#0#8'ReadOnly'#9#8'TabOrder'#2#2#0#0#0#9'TGroupBox'#9'GroupBox2'#4'Left'#2#16
+ +#6'Height'#3#129#0#3'Top'#3#128#0#5'Width'#3'Q'#1#7'Caption'#6#16' Check the'
+ +' Code '#8'TabOrder'#2#1#0#6'TLabel'#6'Label2'#4'Left'#2#24#6'Height'#2#13#3
+ +'Top'#2#28#5'Width'#2'5'#7'Caption'#6#9'User Name'#5'Color'#7#6'clNone'#11'P'
+ +'arentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2#24#6'Height'#2#13#3'Top'#2
+ +'<'#5'Width'#2#25#7'Caption'#6#4'Code'#5'Color'#7#6'clNone'#11'ParentColor'#8
+ +#0#0#6'TLabel'#14'lblCheckResult'#4'Left'#2'h'#6'Height'#2#13#3'Top'#2'`'#5
+ +'Width'#2'G'#7'Caption'#6#14'lblCheckResult'#5'Color'#7#6'clNone'#11'ParentC'
+ +'olor'#8#0#0#5'TEdit'#12'edtUserName2'#4'Left'#2'h'#6'Height'#2#21#3'Top'#2
+ +#24#5'Width'#3#217#0#8'TabOrder'#2#0#0#0#5'TEdit'#8'edtCode2'#4'Left'#2'h'#6
+ +'Height'#2#21#3'Top'#2'8'#5'Width'#3#217#0#8'TabOrder'#2#1#0#0#7'TButton'#12
+ +'btnCheckCode'#4'Left'#2#6#6'Height'#2#25#3'Top'#2'X'#5'Width'#2'U'#25'Borde'
+ +'rSpacing.InnerBorder'#2#4#7'Caption'#6#10'Check Code'#7'OnClick'#7#17'btnCh'
+ +'eckCodeClick'#8'TabOrder'#2#2#0#0#0#0
+]);
diff --git a/components/onguard/examples/exspname/exspnamu.pas b/components/onguard/examples/exspname/exspnamu.pas
new file mode 100644
index 000000000..098a9329a
--- /dev/null
+++ b/components/onguard/examples/exspname/exspnamu.pas
@@ -0,0 +1,84 @@
+unit ExSpNamu;
+
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ StdCtrls,Buttons,LResources;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ GroupBox1: TGroupBox;
+ Label1: TLabel;
+ edtUserName1: TEdit;
+ btnGenCode: TButton;
+ edtCode1: TEdit;
+ GroupBox2: TGroupBox;
+ Label2: TLabel;
+ edtUserName2: TEdit;
+ edtCode2: TEdit;
+ Label3: TLabel;
+ btnCheckCode: TButton;
+ lblCheckResult: TLabel;
+ procedure btnGenCodeClick(Sender: TObject);
+ procedure btnCheckCodeClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+uses
+ OnGuard, OgUtil;
+
+const
+ Key : TKey = ($E8,$B5,$DF,$7F,$F7,$01,$C6,$4A,
+ $24,$08,$02,$DC,$B0,$78,$CC,$43);
+
+
+{ generate unlocking code based on user name }
+procedure TForm1.btnGenCodeClick(Sender: TObject);
+var
+ HashValue : Longint;
+ Code : TCode;
+begin
+ HashValue := StringHashElf(edtUserName1.Text);
+ InitSpecialCode(Key, HashValue, Now + 30, Code);
+ edtCode1.Text := BufferToHex(Code, SizeOf(Code));
+end;
+
+{ check unlocking code against a user name }
+procedure TForm1.btnCheckCodeClick(Sender: TObject);
+var
+ HashValue : Longint;
+ Code : TCode;
+begin
+ HexToBuffer(edtCode2.Text, Code, SizeOf(Code));
+ if not IsSpecialCodeValid(Key, Code) then begin
+ lblCheckResult.Caption := 'Code Invalid';
+ Exit;
+ end;
+ if IsSpecialCodeExpired(Key, Code) then begin
+ lblCheckResult.Caption := 'Code Expired';
+ Exit;
+ end;
+ if GetSpecialCodeValue(Key, Code) <> StringHashElf(edtUserName2.Text) then
+ lblCheckResult.Caption := 'User name doesn''t match'
+ else
+ lblCheckResult.Caption := 'OK';
+end;
+
+initialization
+{$i exspnamu.lrs}
+
+end.
diff --git a/components/onguard/examples/exspreg/ONGUARD.INI b/components/onguard/examples/exspreg/ONGUARD.INI
new file mode 100644
index 000000000..f2533271d
--- /dev/null
+++ b/components/onguard/examples/exspreg/ONGUARD.INI
@@ -0,0 +1,2 @@
+[Codes]
+SpecialCode=B52A3ABB5EA876AC
diff --git a/components/onguard/examples/exspreg/exspreg.lpi b/components/onguard/examples/exspreg/exspreg.lpi
new file mode 100644
index 000000000..6b9610f50
--- /dev/null
+++ b/components/onguard/examples/exspreg/exspreg.lpi
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exspreg/exspreg.lpr b/components/onguard/examples/exspreg/exspreg.lpr
new file mode 100644
index 000000000..a1a376236
--- /dev/null
+++ b/components/onguard/examples/exspreg/exspreg.lpr
@@ -0,0 +1,15 @@
+program Exspreg;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ Exspregu in 'EXSPREGU.PAS' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exspreg/exspregu.lfm b/components/onguard/examples/exspreg/exspregu.lfm
new file mode 100644
index 000000000..180573119
--- /dev/null
+++ b/components/onguard/examples/exspreg/exspregu.lfm
@@ -0,0 +1,98 @@
+object Form1: TForm1
+ Left = 252
+ Height = 303
+ Top = 138
+ Width = 487
+ HorzScrollBar.Page = 486
+ VertScrollBar.Page = 302
+ BorderStyle = bsDialog
+ Caption = 'Special Registration Data Code Example'
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Position = poScreenCenter
+ object StatusLbl: TLabel
+ Left = 8
+ Height = 13
+ Top = 262
+ Width = 35
+ Caption = 'Status'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label1: TLabel
+ Left = 224
+ Height = 13
+ Top = 14
+ Width = 77
+ Caption = 'Current code:'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeLbl: TLabel
+ Left = 320
+ Height = 13
+ Top = 14
+ Width = 113
+ Caption = '0000000000000000'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeBtn: TButton
+ Left = 8
+ Height = 25
+ Top = 8
+ Width = 89
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Enter Code'
+ OnClick = CodeBtnClick
+ TabOrder = 0
+ end
+ object Memo1: TMemo
+ Left = 8
+ Height = 209
+ Top = 40
+ Width = 465
+ Color = clBtnFace
+ Lines.Strings = (
+ 'The label at the bottom of this form indicates the status of the code. An invalid code indicates that '
+ 'the code is either the incorrect type or that none has been entered. '
+ ''
+ 'If the proper code has not been entered or the ONGUARD.INI file was deleted, the message will '
+ 'say that the code is invalid.'
+ ''
+ 'Use the "Enter Code" button to enter a code (the CODEGEN program can be used to generate '
+ 'the proper "Special" code). '
+ ''
+ 'The "Remove Code" button can be used to remove the entered code from the INI file. Doing so '
+ 'will cause the TOgSpecialCode component to report that the code is invalid.'
+ )
+ ReadOnly = True
+ TabOrder = 1
+ end
+ object CloseBtn: TBitBtn
+ Left = 400
+ Height = 25
+ Top = 256
+ Width = 75
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 2
+ end
+ object RemoveBtn: TButton
+ Left = 288
+ Height = 25
+ Top = 256
+ Width = 97
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Remove Code'
+ OnClick = RemoveBtnClick
+ TabOrder = 3
+ end
+ object OgSpecialCode1: TOgSpecialCode
+ OnChecked = CodeChecked
+ OnGetKey = GetKey
+ OnGetCode = GetCode
+ left = 16
+ top = 216
+ end
+end
diff --git a/components/onguard/examples/exspreg/exspregu.lrs b/components/onguard/examples/exspreg/exspregu.lrs
new file mode 100644
index 000000000..63bd4402c
--- /dev/null
+++ b/components/onguard/examples/exspreg/exspregu.lrs
@@ -0,0 +1,34 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#252#0#6'Height'#3'/'#1#3'Top'#3#138#0#5'W'
+ +'idth'#3#231#1#18'HorzScrollBar.Page'#3#230#1#18'VertScrollBar.Page'#3'.'#1
+ +#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6'&Special Registration Data Code '
+ +'Example'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'Position'
+ +#7#14'poScreenCenter'#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Height'#2#13#3
+ +'Top'#3#6#1#5'Width'#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNone'#11'Par'
+ +'entColor'#8#0#0#6'TLabel'#6'Label1'#4'Left'#3#224#0#6'Height'#2#13#3'Top'#2
+ +#14#5'Width'#2'M'#7'Caption'#6#13'Current code:'#5'Color'#7#6'clNone'#11'Par'
+ +'entColor'#8#0#0#6'TLabel'#7'CodeLbl'#4'Left'#3'@'#1#6'Height'#2#13#3'Top'#2
+ +#14#5'Width'#2'q'#7'Caption'#6#16'0000000000000000'#5'Color'#7#6'clNone'#11
+ +'ParentColor'#8#0#0#7'TButton'#7'CodeBtn'#4'Left'#2#8#6'Height'#2#25#3'Top'#2
+ +#8#5'Width'#2'Y'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Enter Cod'
+ +'e'#7'OnClick'#7#12'CodeBtnClick'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Memo1'#4'Le'
+ +'ft'#2#8#6'Height'#3#209#0#3'Top'#2'('#5'Width'#3#209#1#5'Color'#7#9'clBtnFa'
+ +'ce'#13'Lines.Strings'#1#6'fThe label at the bottom of this form indicates t'
+ +'he status of the code. An invalid code indicates that '#6'Ethe code is eith'
+ +'er the incorrect type or that none has been entered. '#6#0#6'^If the proper'
+ +' code has not been entered or the ONGUARD.INI file was deleted, the message'
+ +' will '#6#29'say that the code is invalid.'#6#0#6'YUse the "Enter Code" but'
+ +'ton to enter a code (the CODEGEN program can be used to generate '#6#28'the'
+ +' proper "Special" code). '#6#0#6'\The "Remove Code" button can be used to r'
+ +'emove the entered code from the INI file. Doing so '#6'Kwill cause the TOgS'
+ +'pecialCode component to report that the code is invalid.'#0#8'ReadOnly'#9#8
+ +'TabOrder'#2#1#0#0#7'TBitBtn'#8'CloseBtn'#4'Left'#3#144#1#6'Height'#2#25#3'T'
+ +'op'#3#0#1#5'Width'#2'K'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2
+ +#2#0#0#7'TButton'#9'RemoveBtn'#4'Left'#3' '#1#6'Height'#2#25#3'Top'#3#0#1#5
+ +'Width'#2'a'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#11'Remove Code'#7
+ +'OnClick'#7#14'RemoveBtnClick'#8'TabOrder'#2#3#0#0#14'TOgSpecialCode'#14'OgS'
+ +'pecialCode1'#9'OnChecked'#7#11'CodeChecked'#8'OnGetKey'#7#6'GetKey'#9'OnGet'
+ +'Code'#7#7'GetCode'#4'left'#2#16#3'top'#3#216#0#0#0#0
+]);
diff --git a/components/onguard/examples/exspreg/exspregu.pas b/components/onguard/examples/exspreg/exspregu.pas
new file mode 100644
index 000000000..502009be6
--- /dev/null
+++ b/components/onguard/examples/exspreg/exspregu.pas
@@ -0,0 +1,151 @@
+unit Exspregu;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ StdCtrls, Buttons,LResources, OnGuard, IniFiles, OgUtil;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ CodeBtn: TButton;
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ StatusLbl: TLabel;
+ Label1: TLabel;
+ CodeLbl: TLabel;
+ RemoveBtn: TButton;
+ OgSpecialCode1: TOgSpecialCode;
+ procedure CodeChecked(Sender: TObject; Status: TCodeStatus);
+ procedure GetKey(Sender: TObject; var Key: TKey);
+ procedure GetCode(Sender: TObject; var Code: TCode);
+ procedure CodeBtnClick(Sender: TObject);
+ procedure RemoveBtnClick(Sender: TObject);
+ procedure ChangeCode(Sender: TObject; Code: TCode);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+procedure TForm1.CodeChecked(Sender: TObject; Status: TCodeStatus);
+var
+ S : string;
+begin
+ case Status of
+ ogValidCode : S := 'Valid Code - Special Data: ' + IntToStr(OgSpecialCode1.GetValue);
+ ogInvalidCode : S := 'Invalid release code';
+ ogPastEndDate : S := 'Date has expired';
+ ogDayCountUsed : S := 'Zero days of use remaining';
+ ogRunCountUsed : S := 'Usage count has expired';
+ ogNetCountUsed : S := 'Net usage count exceeded';
+ ogCodeExpired : S := 'Code has expired';
+ else
+ S := 'Unknown error';
+ end;
+ StatusLbl.Caption := S;
+end;
+
+procedure TForm1.GetKey(Sender: TObject; var Key: TKey);
+const
+ {this applications' key}
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+begin
+ Key := CKey;
+end;
+
+procedure TForm1.GetCode(Sender: TObject; var Code: TCode);
+var
+ Ini : TIniFile;
+ S : string;
+begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {get the code from the ini file}
+ S := Ini.ReadString('Codes', 'SpecialCode', '');
+ {convert to proper form}
+ HexToBuffer(S, Code, SizeOf(Code));
+ {set code label caption}
+ CodeLbl.Caption := S;
+ finally
+ Ini.Free;
+ end;
+end;
+
+procedure TForm1.CodeBtnClick(Sender: TObject);
+var
+ Ini : TIniFile;
+ Work : TCode;
+ S : string;
+begin
+ S := '';
+ {ask for code}
+ if InputQuery('Special Code Entry', 'Enter the code', S) then begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {store the code in the ini file if it looks OK}
+ if HexToBuffer(S, Work, SizeOf(Work)) then begin
+ {save the value}
+ Ini.WriteString('Codes', 'SpecialCode', S);
+ CodeLbl.Caption := S;
+
+ {tell the code component to test the new code, reporting the results}
+ OgSpecialCode1.CheckCode(True);
+ end;
+ finally
+ Ini.Free;
+ end;
+ end;
+end;
+
+procedure TForm1.RemoveBtnClick(Sender: TObject);
+var
+ IniFile : TIniFile;
+begin
+ IniFile := TIniFile.Create('ONGUARD.INI');
+ try
+ IniFile.DeleteKey('Codes', 'SpecialCode');
+ finally
+ IniFile.Free;
+ end;
+
+ {tell the code component to test the new code, reporting the results}
+ OgSpecialCode1.CheckCode(True);
+end;
+
+procedure TForm1.ChangeCode(Sender: TObject; Code: TCode);
+var
+ Ini : TIniFile;
+ S : string;
+begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {store the code in the ini file}
+ S := BufferToHex(Code, SizeOf(Code));
+ Ini.WriteString('Codes', 'SpecialCode', S);
+ CodeLbl.Caption := S;
+
+ {tell the code component to test the new code, reporting the results}
+ OgSpecialCode1.CheckCode(True);
+ finally
+ Ini.Free;
+ end;
+end;
+
+
+initialization
+{$i exspregu.lrs}
+
+end.
diff --git a/components/onguard/examples/exsrnm1/SNCode.INI b/components/onguard/examples/exsrnm1/SNCode.INI
new file mode 100644
index 000000000..e4dc286a1
--- /dev/null
+++ b/components/onguard/examples/exsrnm1/SNCode.INI
@@ -0,0 +1,3 @@
+[Codes]
+SN=113
+SNCode=8C6A4934ECB914DB
diff --git a/components/onguard/examples/exsrnm1/exsrnm1.lpi b/components/onguard/examples/exsrnm1/exsrnm1.lpi
new file mode 100644
index 000000000..9c0d9b7f2
--- /dev/null
+++ b/components/onguard/examples/exsrnm1/exsrnm1.lpi
@@ -0,0 +1,229 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exsrnm1/exsrnm1.lpr b/components/onguard/examples/exsrnm1/exsrnm1.lpr
new file mode 100644
index 000000000..f82737dfb
--- /dev/null
+++ b/components/onguard/examples/exsrnm1/exsrnm1.lpr
@@ -0,0 +1,16 @@
+program Exsrnm1;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ Exsrnmu1 in 'EXSRNMU1.PAS' {Form1},
+ Exsrnmu2 in 'EXSRNMU2.PAS' {SNEntryDlg}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exsrnm1/exsrnmu1.lfm b/components/onguard/examples/exsrnm1/exsrnmu1.lfm
new file mode 100644
index 000000000..d535d5390
--- /dev/null
+++ b/components/onguard/examples/exsrnm1/exsrnmu1.lfm
@@ -0,0 +1,52 @@
+object Form1: TForm1
+ Left = 413
+ Height = 186
+ Top = 458
+ Width = 240
+ HorzScrollBar.Page = 239
+ VertScrollBar.Page = 185
+ ActiveControl = Memo1
+ Caption = 'Serial Number Example'
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Position = poScreenCenter
+ object Label1: TLabel
+ Left = 38
+ Height = 13
+ Top = 96
+ Width = 51
+ Alignment = taCenter
+ Caption = 'Serial #: '
+ Color = clNone
+ ParentColor = False
+ end
+ object Memo1: TMemo
+ Left = 3
+ Height = 79
+ Top = 4
+ Width = 223
+ Lines.Strings = (
+ 'If you can edit this, then your program was '
+ 'allowed to run'
+ )
+ ScrollBars = ssVertical
+ TabOrder = 0
+ end
+ object CloseBtn: TBitBtn
+ Left = 72
+ Height = 33
+ Top = 114
+ Width = 89
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 1
+ end
+ object OgSerialNumberCode1: TOgSerialNumberCode
+ OnChecked = OgSerialNumberCode1Checked
+ OnGetKey = OgSerialNumberCode1GetKey
+ OnGetCode = OgSerialNumberCode1GetCode
+ left = 128
+ top = 16
+ end
+end
diff --git a/components/onguard/examples/exsrnm1/exsrnmu1.lrs b/components/onguard/examples/exsrnm1/exsrnmu1.lrs
new file mode 100644
index 000000000..e96f6b98a
--- /dev/null
+++ b/components/onguard/examples/exsrnm1/exsrnmu1.lrs
@@ -0,0 +1,19 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#157#1#6'Height'#3#186#0#3'Top'#3#202#1#5
+ +'Width'#3#240#0#18'HorzScrollBar.Page'#3#239#0#18'VertScrollBar.Page'#3#185#0
+ +#13'ActiveControl'#7#5'Memo1'#7'Caption'#6#21'Serial Number Example'#10'Font'
+ +'.Color'#7#7'clBlack'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'
+ +#8'Position'#7#14'poScreenCenter'#0#6'TLabel'#6'Label1'#4'Left'#2'&'#6'Heigh'
+ +'t'#2#13#3'Top'#2'`'#5'Width'#2'3'#9'Alignment'#7#8'taCenter'#7'Caption'#6#10
+ +'Serial #: '#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#5'TMemo'#5'Memo1'#4
+ +'Left'#2#3#6'Height'#2'O'#3'Top'#2#4#5'Width'#3#223#0#13'Lines.Strings'#1#6
+ +',If you can edit this, then your program was '#6#14'allowed to run'#0#10'Sc'
+ +'rollBars'#7#10'ssVertical'#8'TabOrder'#2#0#0#0#7'TBitBtn'#8'CloseBtn'#4'Lef'
+ +'t'#2'H'#6'Height'#2'!'#3'Top'#2'r'#5'Width'#2'Y'#4'Kind'#7#7'bkClose'#9'Num'
+ +'Glyphs'#2#0#8'TabOrder'#2#1#0#0#19'TOgSerialNumberCode'#19'OgSerialNumberCo'
+ +'de1'#9'OnChecked'#7#26'OgSerialNumberCode1Checked'#8'OnGetKey'#7#25'OgSeria'
+ +'lNumberCode1GetKey'#9'OnGetCode'#7#26'OgSerialNumberCode1GetCode'#4'left'#3
+ +#128#0#3'top'#2#16#0#0#0
+]);
diff --git a/components/onguard/examples/exsrnm1/exsrnmu1.pas b/components/onguard/examples/exsrnm1/exsrnmu1.pas
new file mode 100644
index 000000000..4f3731398
--- /dev/null
+++ b/components/onguard/examples/exsrnm1/exsrnmu1.pas
@@ -0,0 +1,214 @@
+(*
+ This example uses the TOgSerialNumber component. The first time
+ the program is run, the user is prompted for his serial number
+ and release code.
+
+ If the program is being run the first time (as determined by the
+ existance of an INI file, a dialog box is displayed showing two
+ entry fields: one for the serial number, the other for the release
+ code. The user enters the values that you give him for these two
+ items. The values are stored in the INI file and the program is
+ allowed to run.
+
+ The release code you give the user can be generated by the CODEGEN
+ example program. Be sure to select the same type component, the
+ key used to compile the application (the one returned in the
+ OnGetKey event), Also, if used, make sure the Expires date is
+ the same.
+*)
+
+unit Exsrnmu1;
+
+interface
+
+uses
+ SysUtils,Classes,Controls,
+ Forms, Dialogs, OnGuard, StdCtrls, Buttons,LResources,
+
+ OgUtil,
+ IniFiles;
+
+const
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,
+ $1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ Label1: TLabel;
+ OgSerialNumberCode1: TOgSerialNumberCode;
+ procedure OgSerialNumberCode1GetKey(Sender: TObject; var Key: TKey);
+ procedure OgSerialNumberCode1GetCode(Sender: TObject; var Code: TCode);
+ procedure OgSerialNumberCode1Checked(Sender: TObject;
+ Status: TCodeStatus);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ TheDir : string;
+ IniSNVal : longint;
+ IniFile : TIniFile;
+ ED : TDateTime;
+
+ function GetSNData(var S : string) : integer;
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+uses
+ Exsrnmu2;
+
+{=======================================================================}
+
+procedure TForm1.OgSerialNumberCode1GetKey(Sender: TObject; var Key: TKey);
+begin
+ Key := CKey;
+end;
+
+{=======================================================================}
+
+
+procedure TForm1.OgSerialNumberCode1GetCode(Sender: TObject; var Code: TCode);
+var
+ S1 : string;
+ L : integer;
+begin
+ {force the INI file to be in the same directory as the application}
+ TheDir := ExtractFilePath(ParamStr(0));
+
+ (*
+ this check helps prevent an empty INI file. An empty or incomplete
+ INI file can cause problems, i.e., if something goes wrong during
+ the initial input of the SN and ReleaseCode, the program could
+ not be run again without deleting the INI file. In a "real world"
+ application, you would probably be hiding these values some how and
+ would either have to tell the user where to delete things or have a
+ utility program to do so.
+ *)
+ if not (FileExists(TheDir + 'SNCode.INI')) then
+ Exit;
+
+ {open Ini File}
+ IniFile := TIniFile.Create(TheDir + 'SNCode.INI');
+ try
+ {try to read release code}
+ S1 := IniFile.ReadString('Codes', 'SNCode', '');
+ IniSNVal := IniFile.ReadInteger('Codes', 'SN', 0);
+
+ {convert retrieved string to a code}
+ HexToBuffer(S1, Code, SizeOf(Code));
+ finally
+ IniFile.Free;
+ end;
+end;
+
+{=======================================================================}
+
+function TForm1.GetSNData(var S : string) : integer;
+var
+ TC : TCode;
+ SNC : string;
+begin
+ Application.CreateForm(TSNEntryDlg, SNEntryDlg);
+ try
+ {Display new SN and ask for release code}
+ SNEntryDlg.SNText.Text := '';
+ SNEntryDlg.CodeText.Text := '';
+
+ Result := SNEntryDlg.ShowModal;
+ if (SNEntryDlg.CodeText.Text = '') or
+ (SNEntryDlg.SNText.Text = '') then
+ Result := mrCancel;
+ if (Result = mrCancel) then begin
+ S := 'Invalid Code or Cancelled';
+ Exit;
+ end;
+
+ {Check that Release Code was entered correctly}
+ HexToBuffer(SNEntryDlg.CodeText.Text, TC, SizeOf(TCode));
+ if not (IsSerialNumberCodeValid(CKey, TC)) then begin
+ S := 'Release code not entered correctly';
+ Result := mrCancel;
+ end else begin
+ IniFile := TIniFile.Create(TheDir + 'SNCode.INI');
+ try
+
+ {
+ Write SN to IniFile and set a global variable to the value
+ of the serial number. Since, by design, the TOgSerialNumber
+ component does not confirm that the SN and ReleaseCode retrieved
+ from the INI file are compatible, this value will be used later to
+ see if the user has attempted to change the contents of the INI file
+ }
+ IniSNVal := StrToInt(SNEntryDlg.SNText.Text);
+ SNC := SNEntryDlg.CodeText.Text;
+ IniFile.WriteInteger('Codes', 'SN', IniSNVal);
+ IniFile.WriteString('Codes', 'SNCode', SNC);
+ finally
+ IniFile.Free;
+ end;
+ end;
+ finally
+ SNEntryDlg.Free;
+ end;
+end;
+
+{=======================================================================}
+
+procedure TForm1.OgSerialNumberCode1Checked(Sender: TObject;
+ Status: TCodeStatus);
+var
+ S,
+ C1,
+ C2 : string;
+ TC : TCode;
+ LI : longint;
+begin
+ case Status of
+ ogValidCode : begin
+ {check if retrieved Serial Number matches Code}
+ LI := OgSerialNumberCode1.GetValue;
+
+ if (LI <> IniSNVal) then begin
+ Status := ogInvalidCode;
+ S := 'The serial number has been changed';
+ end else begin
+ Label1.Caption := 'Serial #: ' + IntToStr(IniSNVal);
+ Exit;
+ end;
+ end;
+
+ ogInvalidCode : begin
+ {if INI file doesn't exist, presume this is first run}
+ if not (FileExists(TheDir + 'SNCode.INI')) then begin
+ if not (GetSNData(S) = mrCancel) then begin
+ {Check the SN/ReleaseCode}
+ OgSerialNumberCode1.CheckCode(True);
+ {must Exit since line above began a recursive call}
+ Exit;
+ end;
+ end else
+ S := 'Invalid Code';
+ end;
+
+ ogCodeExpired : S := 'Evaluation period expired';
+ end;
+
+ ShowMessage(S);
+ Application.Terminate;
+end;
+
+initialization
+{$i exsrnmu1.lrs}
+
+end.
+
diff --git a/components/onguard/examples/exsrnm1/exsrnmu2.lfm b/components/onguard/examples/exsrnm1/exsrnmu2.lfm
new file mode 100644
index 000000000..1ef62e63b
--- /dev/null
+++ b/components/onguard/examples/exsrnm1/exsrnmu2.lfm
@@ -0,0 +1,74 @@
+object SNEntryDlg: TSNEntryDlg
+ Left = 403
+ Height = 166
+ Top = 282
+ Width = 247
+ HorzScrollBar.Page = 246
+ VertScrollBar.Page = 165
+ ActiveControl = SNText
+ Caption = 'Serial Number'
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ object Label1: TLabel
+ Left = 8
+ Height = 13
+ Top = 40
+ Width = 18
+ Caption = 'SN'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label2: TLabel
+ Left = 8
+ Height = 13
+ Top = 66
+ Width = 31
+ Caption = 'Code'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label3: TLabel
+ Left = 40
+ Height = 13
+ Top = 7
+ Width = 193
+ Caption = 'Call your Vendor NOW to register!'
+ Color = clNone
+ ParentColor = False
+ end
+ object SNText: TEdit
+ Left = 44
+ Height = 20
+ Top = 36
+ Width = 121
+ TabOrder = 0
+ end
+ object CodeText: TEdit
+ Left = 44
+ Height = 20
+ Top = 62
+ Width = 185
+ TabOrder = 1
+ end
+ object OKBtn: TBitBtn
+ Left = 23
+ Height = 33
+ Top = 94
+ Width = 89
+ Kind = bkOK
+ ModalResult = 1
+ NumGlyphs = 0
+ TabOrder = 2
+ end
+ object CancelBtn: TBitBtn
+ Left = 127
+ Height = 33
+ Top = 94
+ Width = 89
+ Kind = bkCancel
+ NumGlyphs = 0
+ OnClick = CancelBtnClick
+ TabOrder = 3
+ end
+end
diff --git a/components/onguard/examples/exsrnm1/exsrnmu2.lrs b/components/onguard/examples/exsrnm1/exsrnmu2.lrs
new file mode 100644
index 000000000..c3a860a5b
--- /dev/null
+++ b/components/onguard/examples/exsrnm1/exsrnmu2.lrs
@@ -0,0 +1,21 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TSNEntryDlg','FORMDATA',[
+ 'TPF0'#11'TSNEntryDlg'#10'SNEntryDlg'#4'Left'#3#147#1#6'Height'#3#166#0#3'Top'
+ +#3#26#1#5'Width'#3#247#0#18'HorzScrollBar.Page'#3#246#0#18'VertScrollBar.Pag'
+ +'e'#3#165#0#13'ActiveControl'#7#6'SNText'#7'Caption'#6#13'Serial Number'#10
+ +'Font.Color'#7#7'clBlack'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Se'
+ +'rif'#0#6'TLabel'#6'Label1'#4'Left'#2#8#6'Height'#2#13#3'Top'#2'('#5'Width'#2
+ +#18#7'Caption'#6#2'SN'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6
+ +'Label2'#4'Left'#2#8#6'Height'#2#13#3'Top'#2'B'#5'Width'#2#31#7'Caption'#6#4
+ +'Code'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'
+ +#2'('#6'Height'#2#13#3'Top'#2#7#5'Width'#3#193#0#7'Caption'#6'!Call your Ven'
+ +'dor NOW to register!'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#5'TEdit'#6
+ +'SNText'#4'Left'#2','#6'Height'#2#20#3'Top'#2'$'#5'Width'#2'y'#8'TabOrder'#2
+ +#0#0#0#5'TEdit'#8'CodeText'#4'Left'#2','#6'Height'#2#20#3'Top'#2'>'#5'Width'
+ +#3#185#0#8'TabOrder'#2#1#0#0#7'TBitBtn'#5'OKBtn'#4'Left'#2#23#6'Height'#2'!'
+ +#3'Top'#2'^'#5'Width'#2'Y'#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'
+ +#2#0#8'TabOrder'#2#2#0#0#7'TBitBtn'#9'CancelBtn'#4'Left'#2''#6'Height'#2'!'
+ +#3'Top'#2'^'#5'Width'#2'Y'#4'Kind'#7#8'bkCancel'#9'NumGlyphs'#2#0#7'OnClick'
+ +#7#14'CancelBtnClick'#8'TabOrder'#2#3#0#0#0
+]);
diff --git a/components/onguard/examples/exsrnm1/exsrnmu2.pas b/components/onguard/examples/exsrnm1/exsrnmu2.pas
new file mode 100644
index 000000000..27f336df5
--- /dev/null
+++ b/components/onguard/examples/exsrnm1/exsrnmu2.pas
@@ -0,0 +1,41 @@
+{form used for Serial Number/ReleaseCode input}
+unit Exsrnmu2;
+
+interface
+
+uses
+ SysUtils,Classes,Controls,
+ Forms, Dialogs, StdCtrls, Buttons,LResources;
+
+type
+ TSNEntryDlg = class(TForm)
+ Label1: TLabel;
+ Label2: TLabel;
+ SNText: TEdit;
+ CodeText: TEdit;
+ OKBtn: TBitBtn;
+ CancelBtn: TBitBtn;
+ Label3: TLabel;
+ procedure CancelBtnClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ SNEntryDlg: TSNEntryDlg;
+
+implementation
+
+
+
+procedure TSNEntryDlg.CancelBtnClick(Sender: TObject);
+begin
+ Close;
+end;
+
+initialization
+{$i exsrnmu2.lrs}
+
+end.
diff --git a/components/onguard/examples/exusg1/Usage1.ini b/components/onguard/examples/exusg1/Usage1.ini
new file mode 100644
index 000000000..c583f5d85
--- /dev/null
+++ b/components/onguard/examples/exusg1/Usage1.ini
@@ -0,0 +1,2 @@
+[Codes]
+Uses=FCFB2E2A29547C1C
diff --git a/components/onguard/examples/exusg1/exusg1.lpi b/components/onguard/examples/exusg1/exusg1.lpi
new file mode 100644
index 000000000..86b3ece1d
--- /dev/null
+++ b/components/onguard/examples/exusg1/exusg1.lpi
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exusg1/exusg1.lpr b/components/onguard/examples/exusg1/exusg1.lpr
new file mode 100644
index 000000000..efb2698c8
--- /dev/null
+++ b/components/onguard/examples/exusg1/exusg1.lpr
@@ -0,0 +1,15 @@
+program Exusg1;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ Exusg1u in 'EXUSG1U.PAS' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exusg1/exusg1u.lfm b/components/onguard/examples/exusg1/exusg1u.lfm
new file mode 100644
index 000000000..d2a51b6b0
--- /dev/null
+++ b/components/onguard/examples/exusg1/exusg1u.lfm
@@ -0,0 +1,53 @@
+object Form1: TForm1
+ Left = 367
+ Height = 155
+ Top = 289
+ Width = 218
+ HorzScrollBar.Page = 217
+ VertScrollBar.Page = 154
+ ActiveControl = Memo1
+ Caption = 'Usage Code Example'
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Position = poScreenCenter
+ object Label1: TLabel
+ Left = 56
+ Height = 13
+ Top = 72
+ Width = 100
+ Caption = 'Available Runs: 0'
+ Color = clNone
+ ParentColor = False
+ end
+ object Memo1: TMemo
+ Left = 8
+ Height = 59
+ Top = 8
+ Width = 197
+ Lines.Strings = (
+ 'If you can edit this, your program '
+ 'was '
+ 'allowed to run'
+ )
+ ScrollBars = ssVertical
+ TabOrder = 0
+ end
+ object CloseBtn: TBitBtn
+ Left = 56
+ Height = 33
+ Top = 89
+ Width = 89
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 1
+ end
+ object OgUsageCode1: TOgUsageCode
+ OnChecked = OgUsageCode1Checked
+ OnGetKey = OgUsageCode1GetKey
+ OnGetCode = OgUsageCode1GetCode
+ OnChangeCode = OgUsageCode1ChangeCode
+ left = 88
+ top = 160
+ end
+end
diff --git a/components/onguard/examples/exusg1/exusg1u.lrs b/components/onguard/examples/exusg1/exusg1u.lrs
new file mode 100644
index 000000000..9c7650142
--- /dev/null
+++ b/components/onguard/examples/exusg1/exusg1u.lrs
@@ -0,0 +1,19 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'o'#1#6'Height'#3#155#0#3'Top'#3'!'#1#5'Wi'
+ +'dth'#3#218#0#18'HorzScrollBar.Page'#3#217#0#18'VertScrollBar.Page'#3#154#0
+ +#13'ActiveControl'#7#5'Memo1'#7'Caption'#6#18'Usage Code Example'#10'Font.Co'
+ +'lor'#7#7'clBlack'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8
+ +'Position'#7#14'poScreenCenter'#0#6'TLabel'#6'Label1'#4'Left'#2'8'#6'Height'
+ +#2#13#3'Top'#2'H'#5'Width'#2'd'#7'Caption'#6#17'Available Runs: 0'#5'Color'#7
+ +#6'clNone'#11'ParentColor'#8#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#2';'
+ +#3'Top'#2#8#5'Width'#3#197#0#13'Lines.Strings'#1#6'#If you can edit this, yo'
+ +'ur program '#6#4'was '#6#14'allowed to run'#0#10'ScrollBars'#7#10'ssVertica'
+ +'l'#8'TabOrder'#2#0#0#0#7'TBitBtn'#8'CloseBtn'#4'Left'#2'8'#6'Height'#2'!'#3
+ +'Top'#2'Y'#5'Width'#2'Y'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2
+ +#1#0#0#12'TOgUsageCode'#12'OgUsageCode1'#9'OnChecked'#7#19'OgUsageCode1Check'
+ +'ed'#8'OnGetKey'#7#18'OgUsageCode1GetKey'#9'OnGetCode'#7#19'OgUsageCode1GetC'
+ +'ode'#12'OnChangeCode'#7#22'OgUsageCode1ChangeCode'#4'left'#2'X'#3'top'#3#160
+ +#0#0#0#0
+]);
diff --git a/components/onguard/examples/exusg1/exusg1u.pas b/components/onguard/examples/exusg1/exusg1u.pas
new file mode 100644
index 000000000..ff14403d7
--- /dev/null
+++ b/components/onguard/examples/exusg1/exusg1u.pas
@@ -0,0 +1,147 @@
+(*
+ This example uses the TOgUsageCode component. This is the most basic
+ example in that on first run, the INI file entries and component
+ properties are set to allow 5 runs of the program with a "drop dead"
+ date of 1999 December 31.
+*)
+
+unit Exusg1u;
+
+interface
+
+uses
+ SysUtils,Classes,Controls,
+ Forms, Dialogs, StdCtrls, Buttons, OnGuard,
+ LResources,
+ OgUtil,
+ IniFiles;
+
+const
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,
+ $1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ OgUsageCode1: TOgUsageCode;
+ Label1: TLabel;
+ procedure OgUsageCode1GetKey(Sender: TObject; var Key: TKey);
+ procedure OgUsageCode1GetCode(Sender: TObject; var Code: TCode);
+ procedure OgUsageCode1Checked(Sender: TObject; Status: TCodeStatus);
+ procedure OgUsageCode1ChangeCode(Sender: TObject; Code: TCode);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ TheDir : string;
+ IniFile : TIniFile;
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+{==========================================================================}
+
+procedure TForm1.OgUsageCode1GetKey(Sender: TObject; var Key: TKey);
+begin
+ Key := CKey;
+end;
+
+{==========================================================================}
+
+procedure TForm1.OgUsageCode1GetCode(Sender: TObject; var Code: TCode);
+var
+ S : string;
+ L : integer;
+begin
+ TheDir := ExtractFilePath(ParamStr(0));
+
+
+ if (FileExists(TheDir + 'Usage1.ini')) then begin
+ {open Ini File}
+ IniFile := TIniFile.Create(TheDir + 'Usage1.ini');
+ try
+ {try to read release code}
+ S := IniFile.ReadString('Codes', 'Uses', '');
+
+ {convert retrieved string to a code}
+ HexToBuffer(S, Code, SizeOf(Code));
+ finally
+ IniFile.Free;
+ end;
+ end;
+end;
+
+{==========================================================================}
+
+procedure TForm1.OgUsageCode1Checked(Sender: TObject; Status: TCodeStatus);
+var
+ S : string;
+ Code : TCode;
+begin
+ case Status of
+ ogValidCode : begin
+ Label1.Caption := 'Available Runs: '
+ + IntToStr(OgUsageCode1.GetValue);
+ Exit;
+ end;
+
+ ogRunCountUsed : S := 'No more runs allowed' + #13
+ + ' Register NOW ';
+
+ ogInvalidCode : begin
+ if not (FileExists(TheDir + 'Usage1.ini')) then begin
+ IniFile := TIniFile.Create(TheDir + 'Usage1.ini');
+ try
+ {hard coded release code for 5 users}
+ {and drop dead date of 2006 Dec. 31}
+ S := '602224E18B152CF2';//'AC5D76E4B10D642B';
+ HexToBuffer(S, Code, SizeOf(Code));
+ IniFile.WriteString('Codes', 'Uses', S);
+ finally
+ IniFile.Free;
+ end;
+ OgUsageCode1.CheckCode(True);
+ Exit;
+ end else
+ S := 'Invalid Code';
+ end;
+
+ ogCodeExpired : S := 'Trial Run period expired' + #13
+ + ' Register NOW ';
+ end;
+ ShowMessage(S);
+ Application.Terminate;
+end;
+
+{==========================================================================}
+
+procedure TForm1.OgUsageCode1ChangeCode(Sender: TObject; Code: TCode);
+var
+ S : string;
+begin
+ {open Ini File}
+ IniFile := TIniFile.Create(TheDir + 'Usage1.ini');
+ try
+ {convert code to string}
+ S := BufferToHex(Code, SizeOf(Code));
+ IniFile.WriteString('Codes', 'Uses', S);
+ finally
+ IniFile.Free;
+ end;
+end;
+
+
+initialization
+{$i exusg1u.lrs}
+
+end.
+
diff --git a/components/onguard/examples/exusg2/Usage2.ini b/components/onguard/examples/exusg2/Usage2.ini
new file mode 100644
index 000000000..99cf6504a
--- /dev/null
+++ b/components/onguard/examples/exusg2/Usage2.ini
@@ -0,0 +1,3 @@
+[Codes]
+Uses=FCFB2E2A29547C1C
+
diff --git a/components/onguard/examples/exusg2/exusg2.lpi b/components/onguard/examples/exusg2/exusg2.lpi
new file mode 100644
index 000000000..dd3792970
--- /dev/null
+++ b/components/onguard/examples/exusg2/exusg2.lpi
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exusg2/exusg2.lpr b/components/onguard/examples/exusg2/exusg2.lpr
new file mode 100644
index 000000000..93de40ed4
--- /dev/null
+++ b/components/onguard/examples/exusg2/exusg2.lpr
@@ -0,0 +1,15 @@
+program Exusg2;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ Exusg2u in 'EXUSG2U.PAS' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exusg2/exusg2u.lfm b/components/onguard/examples/exusg2/exusg2u.lfm
new file mode 100644
index 000000000..bb17d6441
--- /dev/null
+++ b/components/onguard/examples/exusg2/exusg2u.lfm
@@ -0,0 +1,53 @@
+object Form1: TForm1
+ Left = 331
+ Height = 155
+ Top = 225
+ Width = 218
+ HorzScrollBar.Page = 217
+ VertScrollBar.Page = 154
+ ActiveControl = Memo1
+ Caption = 'Usage Code Example'
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Position = poScreenCenter
+ object Label1: TLabel
+ Left = 56
+ Height = 13
+ Top = 72
+ Width = 100
+ Caption = 'Available Runs: 0'
+ Color = clNone
+ ParentColor = False
+ end
+ object Memo1: TMemo
+ Left = 8
+ Height = 59
+ Top = 8
+ Width = 197
+ Lines.Strings = (
+ 'If you can edit this, your program '
+ 'was '
+ 'allowed to run'
+ )
+ ScrollBars = ssVertical
+ TabOrder = 0
+ end
+ object CloseBtn: TBitBtn
+ Left = 56
+ Height = 33
+ Top = 89
+ Width = 89
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 1
+ end
+ object OgUsageCode2: TOgUsageCode
+ OnChecked = OgUsageCode2Checked
+ OnGetKey = OgUsageCode2GetKey
+ OnGetCode = OgUsageCode2GetCode
+ OnChangeCode = OgUsageCode2ChangeCode
+ left = 88
+ top = 160
+ end
+end
diff --git a/components/onguard/examples/exusg2/exusg2u.lrs b/components/onguard/examples/exusg2/exusg2u.lrs
new file mode 100644
index 000000000..7975051f8
--- /dev/null
+++ b/components/onguard/examples/exusg2/exusg2u.lrs
@@ -0,0 +1,19 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'K'#1#6'Height'#3#155#0#3'Top'#3#225#0#5'W'
+ +'idth'#3#218#0#18'HorzScrollBar.Page'#3#217#0#18'VertScrollBar.Page'#3#154#0
+ +#13'ActiveControl'#7#5'Memo1'#7'Caption'#6#18'Usage Code Example'#10'Font.Co'
+ +'lor'#7#7'clBlack'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8
+ +'Position'#7#14'poScreenCenter'#0#6'TLabel'#6'Label1'#4'Left'#2'8'#6'Height'
+ +#2#13#3'Top'#2'H'#5'Width'#2'd'#7'Caption'#6#17'Available Runs: 0'#5'Color'#7
+ +#6'clNone'#11'ParentColor'#8#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#2';'
+ +#3'Top'#2#8#5'Width'#3#197#0#13'Lines.Strings'#1#6'#If you can edit this, yo'
+ +'ur program '#6#4'was '#6#14'allowed to run'#0#10'ScrollBars'#7#10'ssVertica'
+ +'l'#8'TabOrder'#2#0#0#0#7'TBitBtn'#8'CloseBtn'#4'Left'#2'8'#6'Height'#2'!'#3
+ +'Top'#2'Y'#5'Width'#2'Y'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2
+ +#1#0#0#12'TOgUsageCode'#12'OgUsageCode2'#9'OnChecked'#7#19'OgUsageCode2Check'
+ +'ed'#8'OnGetKey'#7#18'OgUsageCode2GetKey'#9'OnGetCode'#7#19'OgUsageCode2GetC'
+ +'ode'#12'OnChangeCode'#7#22'OgUsageCode2ChangeCode'#4'left'#2'X'#3'top'#3#160
+ +#0#0#0#0
+]);
diff --git a/components/onguard/examples/exusg2/exusg2u.pas b/components/onguard/examples/exusg2/exusg2u.pas
new file mode 100644
index 000000000..f40ac320e
--- /dev/null
+++ b/components/onguard/examples/exusg2/exusg2u.pas
@@ -0,0 +1,159 @@
+(*
+ This example uses the TOgUsageCode component.
+
+ If the program is run the first time, an InputQuery dialog is
+ displayed. The user would call you to register. You would give
+ them a release code (using, e.g., CODEGEN) for a given number of
+ uses and, if desired, "drop date" or some other modifier.
+*)
+
+unit Exusg2u;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils,Classes,Controls,
+ Forms, Dialogs, StdCtrls, Buttons, OnGuard,
+ LResources,
+
+ OgUtil,
+ IniFiles;
+
+const
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,
+ $1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ OgUsageCode2: TOgUsageCode;
+ Label1: TLabel;
+ procedure OgUsageCode2GetKey(Sender: TObject; var Key: TKey);
+ procedure OgUsageCode2GetCode(Sender: TObject; var Code: TCode);
+ procedure OgUsageCode2Checked(Sender: TObject; Status: TCodeStatus);
+ procedure OgUsageCode2ChangeCode(Sender: TObject; Code: TCode);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ TheDir : string;
+ IniFile : TIniFile;
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+{==========================================================================}
+
+procedure TForm1.OgUsageCode2GetKey(Sender: TObject; var Key: TKey);
+begin
+ Key := CKey;
+end;
+
+{==========================================================================}
+
+procedure TForm1.OgUsageCode2GetCode(Sender: TObject; var Code: TCode);
+var
+ S : string;
+ L : integer;
+begin
+ TheDir := ExtractFilePath(ParamStr(0));
+
+ if (FileExists(TheDir + 'Usage2.ini')) then begin
+ {open Ini File}
+ IniFile := TIniFile.Create(TheDir + 'Usage2.ini');
+ try
+ {try to read release code}
+ S := IniFile.ReadString('Codes', 'Uses', '');
+
+ {convert retrieved string to a code}
+ HexToBuffer(S, Code, SizeOf(Code));
+ finally
+ IniFile.Free;
+ end;
+ end;
+end;
+
+{==========================================================================}
+
+procedure TForm1.OgUsageCode2Checked(Sender: TObject; Status: TCodeStatus);
+var
+ S : string;
+ Code : TCode;
+begin
+ case Status of
+ ogValidCode : begin
+ Label1.Caption := 'Available Runs: '
+ + IntToStr(OgUsageCode2.GetValue);
+ Exit;
+ end;
+
+ ogRunCountUsed : S := 'No more runs allowed' + #13
+ + ' Register NOW ';
+
+ ogInvalidCode : begin
+ if not (FileExists(TheDir + 'Usage2.ini')) then begin
+ S := '';
+ if (InputQuery('Call Vendor NOW', 'Code', S)) then begin
+ if HexToBuffer(S, Code, SizeOf(Code)) then begin
+ IniFile := TIniFile.Create(TheDir + 'Usage2.ini');
+ try
+ IniFile.WriteString('Codes', 'Uses', S);
+ finally
+ IniFile.Free;
+ end;
+ OgUsageCode2.CheckCode(True);
+ Exit;
+ end else
+ S := 'Invalid Code entered';
+ end else
+ S := 'No Code entered';
+ end else
+ S := 'Invalid Code';
+ end;
+
+ ogCodeExpired : S := 'Trial Run period expired' + #13
+ + ' Register NOW ';
+ end;
+
+ ShowMessage(S);
+ Application.Terminate;
+end;
+
+{==========================================================================}
+
+procedure TForm1.OgUsageCode2ChangeCode(Sender: TObject; Code: TCode);
+var
+ S : string;
+begin
+ if not (FileExists(TheDir + 'Usage2.ini')) then
+ Exit;
+
+ {open Ini File}
+ IniFile := TIniFile.Create(TheDir + 'Usage2.ini');
+ try
+ {convert code to string}
+ S := BufferToHex(Code, SizeOf(Code));
+ IniFile.WriteString('Codes', 'Uses', S);
+ finally
+ IniFile.Free;
+ end;
+end;
+
+
+initialization
+{$i exusg2u.lrs}
+
+
+end.
+
diff --git a/components/onguard/examples/exusreg/ONGUARD.INI b/components/onguard/examples/exusreg/ONGUARD.INI
new file mode 100644
index 000000000..026d39962
--- /dev/null
+++ b/components/onguard/examples/exusreg/ONGUARD.INI
@@ -0,0 +1,2 @@
+[Codes]
+UsageCode=5C41E51B9365B994
diff --git a/components/onguard/examples/exusreg/exusreg.lpi b/components/onguard/examples/exusreg/exusreg.lpi
new file mode 100644
index 000000000..bb085d5c3
--- /dev/null
+++ b/components/onguard/examples/exusreg/exusreg.lpi
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/exusreg/exusreg.lpr b/components/onguard/examples/exusreg/exusreg.lpr
new file mode 100644
index 000000000..a7005170d
--- /dev/null
+++ b/components/onguard/examples/exusreg/exusreg.lpr
@@ -0,0 +1,15 @@
+program ExUSReg;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ ExUSRegU in 'ExUSRegU.pas' {Form1}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/exusreg/exusregu.lfm b/components/onguard/examples/exusreg/exusregu.lfm
new file mode 100644
index 000000000..10d750ee1
--- /dev/null
+++ b/components/onguard/examples/exusreg/exusregu.lfm
@@ -0,0 +1,99 @@
+object Form1: TForm1
+ Left = 252
+ Height = 300
+ Top = 138
+ Width = 492
+ HorzScrollBar.Page = 491
+ VertScrollBar.Page = 299
+ BorderStyle = bsDialog
+ Caption = 'Usage Code Example'
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Position = poScreenCenter
+ object StatusLbl: TLabel
+ Left = 8
+ Height = 13
+ Top = 262
+ Width = 35
+ Caption = 'Status'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label1: TLabel
+ Left = 232
+ Height = 13
+ Top = 14
+ Width = 77
+ Caption = 'Current code:'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeLbl: TLabel
+ Left = 320
+ Height = 13
+ Top = 14
+ Width = 113
+ Caption = '0000000000000000'
+ Color = clNone
+ ParentColor = False
+ end
+ object CodeBtn: TButton
+ Left = 8
+ Height = 25
+ Top = 8
+ Width = 89
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Enter Code'
+ OnClick = CodeBtnClick
+ TabOrder = 0
+ end
+ object Memo1: TMemo
+ Left = 8
+ Height = 209
+ Top = 40
+ Width = 465
+ Color = clBtnFace
+ Lines.Strings = (
+ 'The label at the bottom of this form indicates the status of the code. An invalid code indicates that '
+ 'the code is either the incorrect type or that none has been entered. '
+ ''
+ 'If the proper code has not been entered or the ONGUARD.INI file was deleted, the message will '
+ 'say that the code is invalid.'
+ ''
+ 'Use the "Enter Code" button to enter a code (the CODEGEN program can be used to generate '
+ 'the proper "Usage" code). '
+ ''
+ 'The "Remove Code" button can be used to remove the entered code from the INI file. Doing so '
+ 'will cause the TOgUsageCode component to report that the code is invalid.'
+ )
+ ReadOnly = True
+ TabOrder = 1
+ end
+ object CloseBtn: TBitBtn
+ Left = 400
+ Height = 25
+ Top = 256
+ Width = 75
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 2
+ end
+ object RemoveBtn: TButton
+ Left = 288
+ Height = 25
+ Top = 256
+ Width = 97
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Remove Code'
+ OnClick = RemoveBtnClick
+ TabOrder = 3
+ end
+ object OgUsageCode1: TOgUsageCode
+ OnChecked = CodeChecked
+ OnGetKey = GetKey
+ OnGetCode = GetCode
+ OnChangeCode = ChangeCode
+ left = 16
+ top = 216
+ end
+end
diff --git a/components/onguard/examples/exusreg/exusregu.lrs b/components/onguard/examples/exusreg/exusregu.lrs
new file mode 100644
index 000000000..0a26935c3
--- /dev/null
+++ b/components/onguard/examples/exusreg/exusregu.lrs
@@ -0,0 +1,34 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#252#0#6'Height'#3','#1#3'Top'#3#138#0#5'W'
+ +'idth'#3#236#1#18'HorzScrollBar.Page'#3#235#1#18'VertScrollBar.Page'#3'+'#1
+ +#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#18'Usage Code Example'#11'Font.H'
+ +'eight'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScreenCent'
+ +'er'#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Height'#2#13#3'Top'#3#6#1#5'Widt'
+ +'h'#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6
+ +'TLabel'#6'Label1'#4'Left'#3#232#0#6'Height'#2#13#3'Top'#2#14#5'Width'#2'M'#7
+ +'Caption'#6#13'Current code:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'T'
+ +'Label'#7'CodeLbl'#4'Left'#3'@'#1#6'Height'#2#13#3'Top'#2#14#5'Width'#2'q'#7
+ +'Caption'#6#16'0000000000000000'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#7
+ +'TButton'#7'CodeBtn'#4'Left'#2#8#6'Height'#2#25#3'Top'#2#8#5'Width'#2'Y'#25
+ +'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Enter Code'#7'OnClick'#7#12
+ +'CodeBtnClick'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#3
+ +#209#0#3'Top'#2'('#5'Width'#3#209#1#5'Color'#7#9'clBtnFace'#13'Lines.Strings'
+ +#1#6'fThe label at the bottom of this form indicates the status of the code.'
+ +' An invalid code indicates that '#6'Ethe code is either the incorrect type '
+ +'or that none has been entered. '#6#0#6'^If the proper code has not been ent'
+ +'ered or the ONGUARD.INI file was deleted, the message will '#6#29'say that '
+ +'the code is invalid.'#6#0#6'YUse the "Enter Code" button to enter a code (t'
+ +'he CODEGEN program can be used to generate '#6#26'the proper "Usage" code).'
+ +' '#6#0#6'\The "Remove Code" button can be used to remove the entered code f'
+ +'rom the INI file. Doing so '#6'Iwill cause the TOgUsageCode component to re'
+ +'port that the code is invalid.'#0#8'ReadOnly'#9#8'TabOrder'#2#1#0#0#7'TBitB'
+ +'tn'#8'CloseBtn'#4'Left'#3#144#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'K'#4
+ +'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0#7'TButton'#9'Remove'
+ +'Btn'#4'Left'#3' '#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'a'#25'BorderSpac'
+ +'ing.InnerBorder'#2#4#7'Caption'#6#11'Remove Code'#7'OnClick'#7#14'RemoveBtn'
+ +'Click'#8'TabOrder'#2#3#0#0#12'TOgUsageCode'#12'OgUsageCode1'#9'OnChecked'#7
+ +#11'CodeChecked'#8'OnGetKey'#7#6'GetKey'#9'OnGetCode'#7#7'GetCode'#12'OnChan'
+ +'geCode'#7#10'ChangeCode'#4'left'#2#16#3'top'#3#216#0#0#0#0
+]);
diff --git a/components/onguard/examples/exusreg/exusregu.pas b/components/onguard/examples/exusreg/exusregu.pas
new file mode 100644
index 000000000..a85e0e6d2
--- /dev/null
+++ b/components/onguard/examples/exusreg/exusregu.pas
@@ -0,0 +1,151 @@
+unit ExUSRegU;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ StdCtrls, Buttons,LResources, OnGuard, IniFiles, OgUtil;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ CodeBtn: TButton;
+ Memo1: TMemo;
+ CloseBtn: TBitBtn;
+ StatusLbl: TLabel;
+ Label1: TLabel;
+ CodeLbl: TLabel;
+ RemoveBtn: TButton;
+ OgUsageCode1: TOgUsageCode;
+ procedure CodeChecked(Sender: TObject; Status: TCodeStatus);
+ procedure GetKey(Sender: TObject; var Key: TKey);
+ procedure GetCode(Sender: TObject; var Code: TCode);
+ procedure CodeBtnClick(Sender: TObject);
+ procedure RemoveBtnClick(Sender: TObject);
+ procedure ChangeCode(Sender: TObject; Code: TCode);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+
+
+procedure TForm1.CodeChecked(Sender: TObject; Status: TCodeStatus);
+var
+ S : string;
+begin
+ case Status of
+ ogValidCode : S := 'Valid Code - Uses remaining: ' + IntToStr(OgUsageCode1.GetValue-1);
+ ogInvalidCode : S := 'Invalid release code';
+ ogPastEndDate : S := 'Date has expired';
+ ogDayCountUsed : S := 'Zero days of use remaining';
+ ogRunCountUsed : S := 'Usage count has expired';
+ ogNetCountUsed : S := 'Net usage count exceeded';
+ ogCodeExpired : S := 'Code has expired';
+ else
+ S := 'Unknown error';
+ end;
+ StatusLbl.Caption := S;
+end;
+
+procedure TForm1.GetKey(Sender: TObject; var Key: TKey);
+const
+ {this applications' key}
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+begin
+ Key := CKey;
+end;
+
+procedure TForm1.GetCode(Sender: TObject; var Code: TCode);
+var
+ Ini : TIniFile;
+ S : string;
+begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {get the code from the ini file}
+ S := Ini.ReadString('Codes', 'UsageCode', '');
+ {convert to proper form}
+ HexToBuffer(S, Code, SizeOf(Code));
+ {set code label caption}
+ CodeLbl.Caption := S;
+ finally
+ Ini.Free;
+ end;
+end;
+
+procedure TForm1.CodeBtnClick(Sender: TObject);
+var
+ Ini : TIniFile;
+ Work : TCode;
+ S : string;
+begin
+ S := '';
+ {ask for code}
+ if InputQuery('Usage Code Entry', 'Enter the code', S) then begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {store the date code in the ini file if it looks OK}
+ if HexToBuffer(S, Work, SizeOf(Work)) then begin
+ {save the value}
+ Ini.WriteString('Codes', 'UsageCode', S);
+ CodeLbl.Caption := S;
+
+ {tell the code component to test the new code, reporting the results}
+ OgUsageCode1.CheckCode(True);
+ end;
+ finally
+ Ini.Free;
+ end;
+ end;
+end;
+
+procedure TForm1.RemoveBtnClick(Sender: TObject);
+var
+ IniFile : TIniFile;
+begin
+ IniFile := TIniFile.Create('ONGUARD.INI');
+ try
+ IniFile.DeleteKey('Codes', 'UsageCode');
+ finally
+ IniFile.Free;
+ end;
+
+
+ {tell the code component to test the new code, reporting the results}
+ OgUsageCode1.CheckCode(True);
+end;
+
+procedure TForm1.ChangeCode(Sender: TObject; Code: TCode);
+var
+ Ini : TIniFile;
+ S : string;
+begin
+ Ini := TIniFile.Create('ONGUARD.INI');
+ try
+ {store the code in the ini file}
+ S := BufferToHex(Code, SizeOf(Code));
+ Ini.WriteString('Codes', 'UsageCode', S);
+ CodeLbl.Caption := S;
+
+ {tell the code component to test the new code, reporting the results}
+ OgUsageCode1.CheckCode(True);
+ finally
+ Ini.Free;
+ end;
+end;
+
+initialization
+{$i exusregu.lrs}
+
+end.
diff --git a/components/onguard/examples/fixnaf/EXNET.NAF b/components/onguard/examples/fixnaf/EXNET.NAF
new file mode 100644
index 000000000..d6f868d36
--- /dev/null
+++ b/components/onguard/examples/fixnaf/EXNET.NAF
@@ -0,0 +1 @@
+ô)#íȸgüû4$ì;ĞğĜà_2;
\ No newline at end of file
diff --git a/components/onguard/examples/fixnaf/fixnaf.lpi b/components/onguard/examples/fixnaf/fixnaf.lpi
new file mode 100644
index 000000000..c94e3c2d2
--- /dev/null
+++ b/components/onguard/examples/fixnaf/fixnaf.lpi
@@ -0,0 +1,143 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/fixnaf/fixnaf.lpr b/components/onguard/examples/fixnaf/fixnaf.lpr
new file mode 100644
index 000000000..b91f0ae78
--- /dev/null
+++ b/components/onguard/examples/fixnaf/fixnaf.lpr
@@ -0,0 +1,22 @@
+program FixNAF;
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ ogfirst,
+ FIXNAF1 in 'FIXNAF1.pas' {MainFrm}, tponguard;
+
+
+
+
+begin
+ Application.Initialize;
+ Application.Title := 'Fix Network Access File';
+ Application.CreateForm(TMainFrm, MainFrm);
+
+ if IsFirstInstance then Application.Run
+ else
+ ActivateFirstInstance;
+
+end.
diff --git a/components/onguard/examples/fixnaf/fixnaf1.lfm b/components/onguard/examples/fixnaf/fixnaf1.lfm
new file mode 100644
index 000000000..7b54ce121
--- /dev/null
+++ b/components/onguard/examples/fixnaf/fixnaf1.lfm
@@ -0,0 +1,166 @@
+object MainFrm: TMainFrm
+ Left = 373
+ Height = 216
+ Top = 235
+ Width = 342
+ HorzScrollBar.Page = 341
+ HorzScrollBar.Range = 325
+ VertScrollBar.Page = 215
+ VertScrollBar.Range = 169
+ ActiveControl = AccessCodeEd
+ BorderIcons = [biSystemMenu, biMinimize]
+ Caption = 'Fix Network Access File'
+ Font.Color = clText
+ Font.Height = 11
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ OnCreate = FormCreate
+ Position = poScreenCenter
+ object GroupBox1: TGroupBox
+ Left = 8
+ Height = 96
+ Top = 8
+ Width = 315
+ Caption = 'File Settings'
+ TabOrder = 0
+ object Label4: TLabel
+ Left = 8
+ Height = 18
+ Top = 48
+ Width = 38
+ Caption = 'C&ode:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label5: TLabel
+ Left = 6
+ Height = 18
+ Top = 17
+ Width = 52
+ Caption = '&Filename:'
+ Color = clNone
+ ParentColor = False
+ end
+ object AccessCodeEd: TEdit
+ Left = 64
+ Height = 21
+ Top = 44
+ Width = 245
+ OnChange = AccessCodeEdChange
+ TabOrder = 1
+ end
+ object FileNamePn: TPanel
+ Left = 64
+ Height = 21
+ Top = 16
+ Width = 245
+ Alignment = taLeftJustify
+ BevelOuter = bvLowered
+ BorderWidth = 2
+ TabOrder = 0
+ end
+ end
+ object UpdateBt: TButton
+ Left = 8
+ Height = 25
+ Top = 176
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Update'
+ OnClick = UpdateBtClick
+ TabOrder = 2
+ end
+ object CreateBt: TButton
+ Left = 88
+ Height = 25
+ Top = 176
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Create'
+ Enabled = False
+ OnClick = CreateBtClick
+ TabOrder = 3
+ end
+ object ResetBt: TButton
+ Left = 168
+ Height = 25
+ Top = 176
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Reset'
+ OnClick = ResetBtClick
+ TabOrder = 4
+ end
+ object GroupBox2: TGroupBox
+ Left = 8
+ Height = 65
+ Top = 104
+ Width = 319
+ Caption = 'Access Slots'
+ TabOrder = 1
+ object Label1: TLabel
+ Left = 8
+ Height = 18
+ Top = 20
+ Width = 38
+ Caption = 'Total:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label2: TLabel
+ Left = 94
+ Height = 18
+ Top = 20
+ Width = 46
+ Caption = 'Locked:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label3: TLabel
+ Left = 182
+ Height = 18
+ Top = 20
+ Width = 49
+ Caption = 'Invalid:'
+ Color = clNone
+ ParentColor = False
+ end
+ object TotalSlotsLb: TLabel
+ Left = 54
+ Height = 18
+ Top = 20
+ Width = 6
+ Caption = '0'
+ Color = clNone
+ ParentColor = False
+ end
+ object LockedSlotsLb: TLabel
+ Left = 156
+ Height = 18
+ Top = 20
+ Width = 6
+ Caption = '0'
+ Color = clNone
+ ParentColor = False
+ end
+ object InvalidSlotsLb: TLabel
+ Left = 248
+ Height = 18
+ Top = 20
+ Width = 6
+ Caption = '0'
+ Color = clNone
+ ParentColor = False
+ end
+ end
+ object DeleteBt: TButton
+ Left = 248
+ Height = 25
+ Top = 176
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Delete'
+ OnClick = DeleteBtClick
+ TabOrder = 5
+ end
+end
diff --git a/components/onguard/examples/fixnaf/fixnaf1.lrs b/components/onguard/examples/fixnaf/fixnaf1.lrs
new file mode 100644
index 000000000..b31d9d3ff
--- /dev/null
+++ b/components/onguard/examples/fixnaf/fixnaf1.lrs
@@ -0,0 +1,44 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TMainFrm','FORMDATA',[
+ 'TPF0'#8'TMainFrm'#7'MainFrm'#4'Left'#3'u'#1#6'Height'#3#216#0#3'Top'#3#235#0
+ +#5'Width'#3'V'#1#18'HorzScrollBar.Page'#3'U'#1#19'HorzScrollBar.Range'#3'E'#1
+ +#18'VertScrollBar.Page'#3#215#0#19'VertScrollBar.Range'#3#169#0#13'ActiveCon'
+ +'trol'#7#12'AccessCodeEd'#11'BorderIcons'#11#12'biSystemMenu'#10'biMinimize'
+ +#0#7'Caption'#6#23'Fix Network Access File'#10'Font.Color'#7#6'clText'#11'Fo'
+ +'nt.Height'#2#11#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Pitch'#7#10'fpVari'
+ +'able'#8'OnCreate'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#0#9'TGr'
+ +'oupBox'#9'GroupBox1'#4'Left'#2#8#6'Height'#2'`'#3'Top'#2#8#5'Width'#3';'#1#7
+ +'Caption'#6#13'File Settings'#8'TabOrder'#2#0#0#6'TLabel'#6'Label4'#4'Left'#2
+ +#8#6'Height'#2#18#3'Top'#2'0'#5'Width'#2'&'#7'Caption'#6#6'C&ode:'#5'Color'#7
+ +#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label5'#4'Left'#2#6#6'Height'#2
+ +#18#3'Top'#2#17#5'Width'#2'4'#7'Caption'#6#10'&Filename:'#5'Color'#7#6'clNon'
+ +'e'#11'ParentColor'#8#0#0#5'TEdit'#12'AccessCodeEd'#4'Left'#2'@'#6'Height'#2
+ +#21#3'Top'#2','#5'Width'#3#245#0#8'OnChange'#7#18'AccessCodeEdChange'#8'TabO'
+ +'rder'#2#1#0#0#6'TPanel'#10'FileNamePn'#4'Left'#2'@'#6'Height'#2#21#3'Top'#2
+ +#16#5'Width'#3#245#0#9'Alignment'#7#13'taLeftJustify'#10'BevelOuter'#7#9'bvL'
+ +'owered'#11'BorderWidth'#2#2#8'TabOrder'#2#0#0#0#0#7'TButton'#8'UpdateBt'#4
+ +'Left'#2#8#6'Height'#2#25#3'Top'#3#176#0#5'Width'#2'K'#25'BorderSpacing.Inne'
+ +'rBorder'#2#4#7'Caption'#6#7'&Update'#7'OnClick'#7#13'UpdateBtClick'#8'TabOr'
+ +'der'#2#2#0#0#7'TButton'#8'CreateBt'#4'Left'#2'X'#6'Height'#2#25#3'Top'#3#176
+ +#0#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#7'&Create'#7
+ +'Enabled'#8#7'OnClick'#7#13'CreateBtClick'#8'TabOrder'#2#3#0#0#7'TButton'#7
+ +'ResetBt'#4'Left'#3#168#0#6'Height'#2#25#3'Top'#3#176#0#5'Width'#2'K'#25'Bor'
+ +'derSpacing.InnerBorder'#2#4#7'Caption'#6#6'&Reset'#7'OnClick'#7#12'ResetBtC'
+ +'lick'#8'TabOrder'#2#4#0#0#9'TGroupBox'#9'GroupBox2'#4'Left'#2#8#6'Height'#2
+ +'A'#3'Top'#2'h'#5'Width'#3'?'#1#7'Caption'#6#12'Access Slots'#8'TabOrder'#2#1
+ +#0#6'TLabel'#6'Label1'#4'Left'#2#8#6'Height'#2#18#3'Top'#2#20#5'Width'#2'&'#7
+ +'Caption'#6#6'Total:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6
+ +'Label2'#4'Left'#2'^'#6'Height'#2#18#3'Top'#2#20#5'Width'#2'.'#7'Caption'#6#7
+ +'Locked:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'L'
+ +'eft'#3#182#0#6'Height'#2#18#3'Top'#2#20#5'Width'#2'1'#7'Caption'#6#8'Invali'
+ +'d:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#12'TotalSlotsLb'#4
+ +'Left'#2'6'#6'Height'#2#18#3'Top'#2#20#5'Width'#2#6#7'Caption'#6#1'0'#5'Colo'
+ +'r'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#13'LockedSlotsLb'#4'Left'#3
+ +#156#0#6'Height'#2#18#3'Top'#2#20#5'Width'#2#6#7'Caption'#6#1'0'#5'Color'#7#6
+ +'clNone'#11'ParentColor'#8#0#0#6'TLabel'#14'InvalidSlotsLb'#4'Left'#3#248#0#6
+ +'Height'#2#18#3'Top'#2#20#5'Width'#2#6#7'Caption'#6#1'0'#5'Color'#7#6'clNone'
+ +#11'ParentColor'#8#0#0#0#7'TButton'#8'DeleteBt'#4'Left'#3#248#0#6'Height'#2
+ +#25#3'Top'#3#176#0#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'
+ +#6#7'&Delete'#7'OnClick'#7#13'DeleteBtClick'#8'TabOrder'#2#5#0#0#0
+]);
diff --git a/components/onguard/examples/fixnaf/fixnaf1.pas b/components/onguard/examples/fixnaf/fixnaf1.pas
new file mode 100644
index 000000000..4b9f48054
--- /dev/null
+++ b/components/onguard/examples/fixnaf/fixnaf1.pas
@@ -0,0 +1,153 @@
+unit FIXNAF1;
+
+interface
+
+uses
+ IniFiles, SysUtils, Forms, Classes, Dialogs,
+ StdCtrls, Controls, ExtCtrls,Buttons,LResources,onguard, ognetwrk, ogutil;
+
+type
+
+ { TMainFrm }
+
+ TMainFrm = class(TForm)
+ GroupBox1: TGroupBox;
+ UpdateBt: TButton;
+ CreateBt: TButton;
+ ResetBt: TButton;
+ GroupBox2: TGroupBox;
+ Label1: TLabel;
+ Label2: TLabel;
+ Label3: TLabel;
+ TotalSlotsLb: TLabel;
+ LockedSlotsLb: TLabel;
+ InvalidSlotsLb: TLabel;
+ AccessCodeEd: TEdit;
+ Label4: TLabel;
+ Label5: TLabel;
+ DeleteBt: TButton;
+ FileNamePn: TPanel;
+ procedure FormCreate(Sender: TObject);
+ procedure UpdateBtClick(Sender: TObject);
+ procedure CreateBtClick(Sender: TObject);
+ procedure ResetBtClick(Sender: TObject);
+ procedure AccessCodeEdChange(Sender: TObject);
+ procedure DeleteBtClick(Sender: TObject);
+ private
+ { Private declarations }
+ Key : TKey;
+ public
+ { Public declarations }
+ function UpdateInfoLabels(const FileName: string): Boolean;
+ function NumberOfSlots(const Str: string): Integer;
+ end;
+
+var
+ MainFrm: TMainFrm;
+
+
+implementation
+
+
+
+
+procedure TMainFrm.FormCreate(Sender: TObject);
+const
+ {change these lines to match your application.}
+ {they must be hardcoded, do not use .ini files, or}
+ {you'll loose security.}
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+begin
+ Key := CKey;
+
+ {change the file name to match your application}
+ FileNamePn.Caption := 'EXNET.NAF';
+
+ UpdateBt.Enabled := FileExists(FileNamePn.Caption);
+ ResetBt.Enabled := FileExists(FileNamePn.Caption);
+ DeleteBt.Enabled := FileExists(FileNamePn.Caption);
+end;
+
+procedure TMainFrm.AccessCodeEdChange(Sender: TObject);
+begin
+ CreateBt.Enabled := (NumberOfSlots(AccessCodeEd.Text) <> -1) and (FileNamePn.Caption <> '');
+end;
+
+procedure TMainFrm.UpdateBtClick(Sender: TObject);
+begin
+ if not UpdateInfoLabels(FileNamePn.Caption) then
+ MessageDlg('Unable to read network access file.', mtError, [mbOK], 0);
+end;
+
+procedure TMainFrm.CreateBtClick(Sender: TObject);
+begin
+ if (NumberOfSlots(AccessCodeEd.Text) <> -1) then
+ if not CreateNetAccessFile(FileNamePn.Caption, Key, NumberOfSlots(AccessCodeEd.Text)) then
+ MessageDlg('Unable to create network access file.', mtError, [mbOK], 0)
+ else
+ begin
+ if not UpdateInfoLabels(FileNamePn.Caption) then
+ MessageDlg('Unable to read network access file.', mtError, [mbOK], 0);
+
+ UpdateBt.Enabled := FileExists(FileNamePn.Caption);
+ ResetBt.Enabled := FileExists(FileNamePn.Caption);
+ DeleteBt.Enabled := FileExists(FileNamePn.Caption);
+ end;
+end;
+
+procedure TMainFrm.ResetBtClick(Sender: TObject);
+begin
+ if not ResetNetAccessFile(FileNamePn.Caption, Key) then
+ MessageDlg('Unable to reset network access file.', mtError, [mbOK], 0)
+ else
+ if not UpdateInfoLabels(FileNamePn.Caption) then
+ MessageDlg('Unable read network access file.', mtError, [mbOK], 0);
+end;
+
+procedure TMainFrm.DeleteBtClick(Sender: TObject);
+begin
+ if (MessageDlg('Are you sure you want to delete this network access file?',
+ mtConfirmation, [mbYes, mbNo], 0) = mrYes) then
+ begin
+ DeleteFile(FileNamePn.Caption);
+
+ TotalSlotsLb.Caption := '0';
+ LockedSlotsLb.Caption := '0';
+ InvalidSlotsLb.Caption := '0';
+
+ UpdateBt.Enabled := FileExists(FileNamePn.Caption);
+ ResetBt.Enabled := FileExists(FileNamePn.Caption);
+ DeleteBt.Enabled := FileExists(FileNamePn.Caption);
+ end;
+end;
+
+function TMainFrm.UpdateInfoLabels(const FileName: string): Boolean;
+var
+ NetAccessInfo: TNetAccessInfo;
+begin
+ if GetNetAccessFileInfo(FileName, Key, NetAccessInfo) then begin
+ TotalSlotsLb.Caption := IntToStr(NetAccessInfo.Total);
+ LockedSlotsLb.Caption := IntToStr(NetAccessInfo.Locked);
+ InvalidSlotsLb.Caption := IntToStr(NetAccessInfo.Invalid);
+ Result := True;
+ end else
+ Result := False;
+end;
+
+function TMainFrm.NumberOfSlots(const Str: string): Integer;
+var
+ Code : TCode;
+begin
+ Result := -1;
+ if (Length(Str) = SizeOf(Code) * 2) then begin
+ HexToBuffer(Str, Code, SizeOf(Code));
+ Result := DecodeNAFCountCode(Key, Code);
+ end;
+end;
+
+
+initialization
+{$i fixnaf1.lrs}
+
+end.
+
diff --git a/components/onguard/examples/nafmgr/nafmgr.lpi b/components/onguard/examples/nafmgr/nafmgr.lpi
new file mode 100644
index 000000000..f52d77dfa
--- /dev/null
+++ b/components/onguard/examples/nafmgr/nafmgr.lpi
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/nafmgr/nafmgr.lpr b/components/onguard/examples/nafmgr/nafmgr.lpr
new file mode 100644
index 000000000..9e736bcd9
--- /dev/null
+++ b/components/onguard/examples/nafmgr/nafmgr.lpr
@@ -0,0 +1,22 @@
+program NAFMgr;
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ ogfirst,
+ NAFMGR1 in 'NAFMGR1.pas' {NafFrm}, tponguard;
+
+
+
+
+begin
+ Application.Initialize;
+ Application.Title := 'Network File Access Manager';
+ Application.CreateForm(TNafFrm, NafFrm);
+
+ if IsFirstInstance then Application.Run
+ else
+ ActivateFirstInstance;
+
+end.
diff --git a/components/onguard/examples/nafmgr/nafmgr1.lfm b/components/onguard/examples/nafmgr/nafmgr1.lfm
new file mode 100644
index 000000000..d329c00fb
--- /dev/null
+++ b/components/onguard/examples/nafmgr/nafmgr1.lfm
@@ -0,0 +1,219 @@
+object NafFrm: TNafFrm
+ Left = 307
+ Height = 232
+ Top = 291
+ Width = 334
+ HorzScrollBar.Page = 333
+ HorzScrollBar.Range = 325
+ VertScrollBar.Page = 231
+ VertScrollBar.Range = 177
+ ActiveControl = AccessCodeEd
+ BorderIcons = [biSystemMenu, biMinimize]
+ Caption = 'Network Access File Manager'
+ Font.Color = clText
+ Font.Height = 11
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ OnCreate = FormCreate
+ Position = poScreenCenter
+ ShowHint = True
+ object GroupBox1: TGroupBox
+ Left = 8
+ Height = 97
+ Top = 8
+ Width = 317
+ Caption = 'File Settings'
+ TabOrder = 0
+ object GenerateCodeSb: TSpeedButton
+ Left = 288
+ Height = 23
+ Hint = 'Generate code'
+ Top = 19
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888880000088888800000008888
+ 0088808008888000000088808088888800888000000088088880008888088000
+ 0000880088000008880880000000808880098900808080000000808880089800
+ 8880800000008008800898008800800000008088800989008880800000008808
+ 8800000888088000000088080880008808088000000088808808888880888000
+ 0000888800888080088880000000888888000008888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = GenerateCodeSbClick
+ end
+ object Label4: TLabel
+ Left = 8
+ Height = 18
+ Top = 24
+ Width = 38
+ Caption = 'C&ode:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label5: TLabel
+ Left = 8
+ Height = 18
+ Top = 52
+ Width = 54
+ Caption = '&Filename:'
+ Color = clNone
+ ParentColor = False
+ end
+ object FileNameEd: TEdit
+ Left = 64
+ Height = 22
+ Top = 48
+ Width = 185
+ OnChange = FileNameEdChange
+ TabOrder = 1
+ end
+ object BrowseBt: TButton
+ Left = 253
+ Height = 25
+ Hint = 'Browse for network access file'
+ Top = 46
+ Width = 59
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Browse...'
+ OnClick = BrowseBtClick
+ TabOrder = 2
+ end
+ object AccessCodeEd: TEdit
+ Left = 64
+ Height = 22
+ Top = 20
+ Width = 221
+ OnChange = AccessCodeEdChange
+ TabOrder = 0
+ end
+ end
+ object UpdateBt: TButton
+ Left = 10
+ Height = 25
+ Hint = 'Update the selected NAF using the specified code'
+ Top = 200
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Update'
+ Enabled = False
+ OnClick = UpdateBtClick
+ TabOrder = 2
+ end
+ object CreateBt: TButton
+ Left = 90
+ Height = 25
+ Hint = 'Create teh NAF using the specified code'
+ Top = 200
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Create'
+ Enabled = False
+ OnClick = CreateBtClick
+ TabOrder = 3
+ end
+ object ResetBt: TButton
+ Left = 170
+ Height = 25
+ Hint = 'Reset the specified NAF, removing invalid slots'
+ Top = 200
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Reset'
+ Enabled = False
+ OnClick = ResetBtClick
+ TabOrder = 4
+ end
+ object GroupBox2: TGroupBox
+ Left = 8
+ Height = 72
+ Top = 112
+ Width = 320
+ Caption = 'Access Slots'
+ TabOrder = 1
+ object Label1: TLabel
+ Left = 8
+ Height = 18
+ Top = 20
+ Width = 33
+ Caption = 'Total:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label2: TLabel
+ Left = 96
+ Height = 18
+ Top = 20
+ Width = 46
+ Caption = 'Locked:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label3: TLabel
+ Left = 196
+ Height = 18
+ Top = 20
+ Width = 42
+ Caption = 'Invalid:'
+ Color = clNone
+ ParentColor = False
+ end
+ object TotalSlotsLb: TLabel
+ Left = 44
+ Height = 18
+ Top = 20
+ Width = 6
+ Caption = '0'
+ Color = clNone
+ ParentColor = False
+ end
+ object LockedSlotsLb: TLabel
+ Left = 148
+ Height = 18
+ Top = 20
+ Width = 6
+ Caption = '0'
+ Color = clNone
+ ParentColor = False
+ end
+ object InvalidSlotsLb: TLabel
+ Left = 240
+ Height = 18
+ Top = 20
+ Width = 6
+ Caption = '0'
+ Color = clNone
+ ParentColor = False
+ end
+ end
+ object DeleteBt: TButton
+ Left = 250
+ Height = 25
+ Hint = 'Delete teh selected NAF'
+ Top = 200
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Delete'
+ Enabled = False
+ OnClick = DeleteBtClick
+ TabOrder = 5
+ end
+ object OpenDg: TOpenDialog
+ Title = 'Otwórz istniejıcy plik'
+ DefaultExt = '.naf'
+ Filter = 'Network Access Files (*.naf)|*.naf|All Files (*.*)|*.*'
+ FilterIndex = 0
+ Options = []
+ left = 160
+ top = 72
+ end
+ object OgMakeCodes1: TOgMakeCodes
+ left = 136
+ top = 288
+ end
+end
diff --git a/components/onguard/examples/nafmgr/nafmgr1.lrs b/components/onguard/examples/nafmgr/nafmgr1.lrs
new file mode 100644
index 000000000..47b62a8a9
--- /dev/null
+++ b/components/onguard/examples/nafmgr/nafmgr1.lrs
@@ -0,0 +1,70 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TNafFrm','FORMDATA',[
+ 'TPF0'#7'TNafFrm'#6'NafFrm'#4'Left'#3'3'#1#6'Height'#3#232#0#3'Top'#3'#'#1#5
+ +'Width'#3'N'#1#18'HorzScrollBar.Page'#3'M'#1#19'HorzScrollBar.Range'#3'E'#1
+ +#18'VertScrollBar.Page'#3#231#0#19'VertScrollBar.Range'#3#177#0#13'ActiveCon'
+ +'trol'#7#12'AccessCodeEd'#11'BorderIcons'#11#12'biSystemMenu'#10'biMinimize'
+ +#0#7'Caption'#6#27'Network Access File Manager'#10'Font.Color'#7#6'clText'#11
+ +'Font.Height'#2#11#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Pitch'#7#10'fpVa'
+ +'riable'#8'OnCreate'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#8'Sho'
+ +'wHint'#9#0#9'TGroupBox'#9'GroupBox1'#4'Left'#2#8#6'Height'#2'a'#3'Top'#2#8#5
+ +'Width'#3'='#1#7'Caption'#6#13'File Settings'#8'TabOrder'#2#0#0#12'TSpeedBut'
+ +'ton'#14'GenerateCodeSb'#4'Left'#3' '#1#6'Height'#2#23#4'Hint'#6#13'Generate'
+ +' code'#3'Top'#2#19#5'Width'#2#23#5'Color'#7#9'clBtnFace'#10'Glyph.Data'#10
+ +'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0#0#0#17#0#0#0#17#0#0#0#1#0
+ +#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#128#0#0
+ +#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#128#128#128#0#192#192
+ +#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255#0#255#255#0#0#255
+ +#255#255#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136
+ +#136#136#128#0#0#0#136#136#136#0#0#8#136#136#128#0#0#0#136#136#0#136#128#128
+ +#8#136#128#0#0#0#136#128#128#136#136#136#0#136#128#0#0#0#136#8#136#128#0#136
+ +#136#8#128#0#0#0#136#0#136#0#0#8#136#8#128#0#0#0#128#136#128#9#137#0#128#128
+ +#128#0#0#0#128#136#128#8#152#0#136#128#128#0#0#0#128#8#128#8#152#0#136#0#128
+ +#0#0#0#128#136#128#9#137#0#136#128#128#0#0#0#136#8#136#0#0#8#136#8#128#0#0#0
+ +#136#8#8#128#0#136#8#8#128#0#0#0#136#128#136#8#136#136#128#136#128#0#0#0#136
+ +#136#0#136#128#128#8#136#128#0#0#0#136#136#136#0#0#8#136#136#128#0#0#0#136
+ +#136#136#136#136#136#136#136#128#0#0#0#9'NumGlyphs'#2#0#7'OnClick'#7#19'Gene'
+ +'rateCodeSbClick'#0#0#6'TLabel'#6'Label4'#4'Left'#2#8#6'Height'#2#18#3'Top'#2
+ +#24#5'Width'#2'&'#7'Caption'#6#6'C&ode:'#5'Color'#7#6'clNone'#11'ParentColor'
+ +#8#0#0#6'TLabel'#6'Label5'#4'Left'#2#8#6'Height'#2#18#3'Top'#2'4'#5'Width'#2
+ +'6'#7'Caption'#6#10'&Filename:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#5
+ +'TEdit'#10'FileNameEd'#4'Left'#2'@'#6'Height'#2#22#3'Top'#2'0'#5'Width'#3#185
+ +#0#8'OnChange'#7#16'FileNameEdChange'#8'TabOrder'#2#1#0#0#7'TButton'#8'Brows'
+ +'eBt'#4'Left'#3#253#0#6'Height'#2#25#4'Hint'#6#30'Browse for network access '
+ +'file'#3'Top'#2'.'#5'Width'#2';'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'
+ +#6#10'&Browse...'#7'OnClick'#7#13'BrowseBtClick'#8'TabOrder'#2#2#0#0#5'TEdit'
+ +#12'AccessCodeEd'#4'Left'#2'@'#6'Height'#2#22#3'Top'#2#20#5'Width'#3#221#0#8
+ +'OnChange'#7#18'AccessCodeEdChange'#8'TabOrder'#2#0#0#0#0#7'TButton'#8'Updat'
+ +'eBt'#4'Left'#2#10#6'Height'#2#25#4'Hint'#6'0Update the selected NAF using t'
+ +'he specified code'#3'Top'#3#200#0#5'Width'#2'K'#25'BorderSpacing.InnerBorde'
+ +'r'#2#4#7'Caption'#6#7'&Update'#7'Enabled'#8#7'OnClick'#7#13'UpdateBtClick'#8
+ +'TabOrder'#2#2#0#0#7'TButton'#8'CreateBt'#4'Left'#2'Z'#6'Height'#2#25#4'Hint'
+ +#6'''Create teh NAF using the specified code'#3'Top'#3#200#0#5'Width'#2'K'#25
+ +'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#7'&Create'#7'Enabled'#8#7'OnCli'
+ +'ck'#7#13'CreateBtClick'#8'TabOrder'#2#3#0#0#7'TButton'#7'ResetBt'#4'Left'#3
+ +#170#0#6'Height'#2#25#4'Hint'#6'/Reset the specified NAF, removing invalid s'
+ +'lots'#3'Top'#3#200#0#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#4#7'Capt'
+ +'ion'#6#6'&Reset'#7'Enabled'#8#7'OnClick'#7#12'ResetBtClick'#8'TabOrder'#2#4
+ +#0#0#9'TGroupBox'#9'GroupBox2'#4'Left'#2#8#6'Height'#2'H'#3'Top'#2'p'#5'Widt'
+ +'h'#3'@'#1#7'Caption'#6#12'Access Slots'#8'TabOrder'#2#1#0#6'TLabel'#6'Label'
+ +'1'#4'Left'#2#8#6'Height'#2#18#3'Top'#2#20#5'Width'#2'!'#7'Caption'#6#6'Tota'
+ +'l:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2
+ +'`'#6'Height'#2#18#3'Top'#2#20#5'Width'#2'.'#7'Caption'#6#7'Locked:'#5'Color'
+ +#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#3#196#0#6'Hei'
+ +'ght'#2#18#3'Top'#2#20#5'Width'#2'*'#7'Caption'#6#8'Invalid:'#5'Color'#7#6'c'
+ +'lNone'#11'ParentColor'#8#0#0#6'TLabel'#12'TotalSlotsLb'#4'Left'#2','#6'Heig'
+ +'ht'#2#18#3'Top'#2#20#5'Width'#2#6#7'Caption'#6#1'0'#5'Color'#7#6'clNone'#11
+ +'ParentColor'#8#0#0#6'TLabel'#13'LockedSlotsLb'#4'Left'#3#148#0#6'Height'#2
+ +#18#3'Top'#2#20#5'Width'#2#6#7'Caption'#6#1'0'#5'Color'#7#6'clNone'#11'Paren'
+ +'tColor'#8#0#0#6'TLabel'#14'InvalidSlotsLb'#4'Left'#3#240#0#6'Height'#2#18#3
+ +'Top'#2#20#5'Width'#2#6#7'Caption'#6#1'0'#5'Color'#7#6'clNone'#11'ParentColo'
+ +'r'#8#0#0#0#7'TButton'#8'DeleteBt'#4'Left'#3#250#0#6'Height'#2#25#4'Hint'#6
+ +#23'Delete teh selected NAF'#3'Top'#3#200#0#5'Width'#2'K'#25'BorderSpacing.I'
+ +'nnerBorder'#2#4#7'Caption'#6#7'&Delete'#7'Enabled'#8#7'OnClick'#7#13'Delete'
+ +'BtClick'#8'TabOrder'#2#5#0#0#11'TOpenDialog'#6'OpenDg'#5'Title'#6#22'Otw'
+ +#243'rz istniej'#185'cy plik'#10'DefaultExt'#6#4'.naf'#6'Filter'#6'6Network '
+ +'Access Files (*.naf)|*.naf|All Files (*.*)|*.*'#11'FilterIndex'#2#0#7'Optio'
+ ,'ns'#11#0#4'left'#3#160#0#3'top'#2'H'#0#0#12'TOgMakeCodes'#12'OgMakeCodes1'#4
+ +'left'#3#136#0#3'top'#3' '#1#0#0#0
+]);
diff --git a/components/onguard/examples/nafmgr/nafmgr1.pas b/components/onguard/examples/nafmgr/nafmgr1.pas
new file mode 100644
index 000000000..b5005d3a5
--- /dev/null
+++ b/components/onguard/examples/nafmgr/nafmgr1.pas
@@ -0,0 +1,173 @@
+unit NAFMGR1;
+
+interface
+
+uses
+ IniFiles, SysUtils, Dialogs, StdCtrls, Controls, Classes, Forms,
+ Buttons,LResources,onguard, ognetwrk, ogutil;
+
+type
+
+ { TNafFrm }
+
+ TNafFrm = class(TForm)
+ GroupBox1: TGroupBox;
+ FileNameEd: TEdit;
+ BrowseBt: TButton;
+ UpdateBt: TButton;
+ CreateBt: TButton;
+ ResetBt: TButton;
+ OpenDg: TOpenDialog;
+ GroupBox2: TGroupBox;
+ Label1: TLabel;
+ Label2: TLabel;
+ Label3: TLabel;
+ TotalSlotsLb: TLabel;
+ LockedSlotsLb: TLabel;
+ InvalidSlotsLb: TLabel;
+ AccessCodeEd: TEdit;
+ Label4: TLabel;
+ Label5: TLabel;
+ DeleteBt: TButton;
+ OgMakeCodes1: TOgMakeCodes;
+ GenerateCodeSb: TSpeedButton;
+ procedure FormCreate(Sender: TObject);
+ procedure UpdateBtClick(Sender: TObject);
+ procedure CreateBtClick(Sender: TObject);
+ procedure ResetBtClick(Sender: TObject);
+ procedure BrowseBtClick(Sender: TObject);
+ procedure AccessCodeEdChange(Sender: TObject);
+ procedure FileNameEdChange(Sender: TObject);
+ procedure DeleteBtClick(Sender: TObject);
+ procedure GenerateCodeSbClick(Sender: TObject);
+ private
+ { Private declarations }
+ Key : TKey;
+ public
+ { Public declarations }
+ function UpdateInfoLabels(const FileName: string): Boolean;
+ function NumberOfSlots(const Str: string): Integer;
+ end;
+
+var
+ NafFrm : TNafFrm;
+
+implementation
+
+
+
+const
+ {this applications' key}
+ CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
+
+procedure TNafFrm.FormCreate(Sender: TObject);
+begin
+ Key := CKey;
+end;
+
+procedure TNafFrm.BrowseBtClick(Sender: TObject);
+begin
+ if OpenDg.Execute then
+ FileNameEd.Text := OpenDg.FileName;
+end;
+
+procedure TNafFrm.AccessCodeEdChange(Sender: TObject);
+begin
+ CreateBt.Enabled := (NumberOfSlots(AccessCodeEd.Text) <> -1) and (FileNameEd.Text <> '');
+end;
+
+procedure TNafFrm.FileNameEdChange(Sender: TObject);
+begin
+ UpdateBt.Enabled := FileExists(FileNameEd.Text);
+ CreateBt.Enabled := (NumberOfSlots(AccessCodeEd.Text) <> -1) and (FileNameEd.Text <> '');
+ ResetBt.Enabled := FileExists(FileNameEd.Text);
+ DeleteBt.Enabled := FileExists(FileNameEd.Text);
+end;
+
+procedure TNafFrm.UpdateBtClick(Sender: TObject);
+begin
+ if not UpdateInfoLabels(FileNameEd.Text) then
+ MessageDlg('Unable to read network access file.', mtError, [mbOK], 0);
+end;
+
+procedure TNafFrm.CreateBtClick(Sender: TObject);
+begin
+ if (NumberOfSlots(AccessCodeEd.Text) <> -1) then
+ if not CreateNetAccessFile(FileNameEd.Text, Key, NumberOfSlots(AccessCodeEd.Text)) then
+ MessageDlg('Unable to create network access file.', mtError, [mbOK], 0)
+ else begin
+ if not UpdateInfoLabels(FileNameEd.Text) then
+ MessageDlg('Unable to read network access file.', mtError, [mbOK], 0);
+
+ UpdateBt.Enabled := FileExists(FileNameEd.Text);
+ ResetBt.Enabled := FileExists(FileNameEd.Text);
+ DeleteBt.Enabled := FileExists(FileNameEd.Text);
+ end;
+end;
+
+procedure TNafFrm.ResetBtClick(Sender: TObject);
+begin
+ if not ResetNetAccessFile(FileNameEd.Text, Key) then
+ MessageDlg('Unable to reset network access file.', mtError, [mbOK], 0)
+ else
+ if not UpdateInfoLabels(FileNameEd.Text) then
+ MessageDlg('Unable read network access file.', mtError, [mbOK], 0);
+end;
+
+procedure TNafFrm.DeleteBtClick(Sender: TObject);
+begin
+ if (MessageDlg('Are you sure you want to delete this network access file?',
+ mtConfirmation, [mbYes, mbNo], 0) = mrYes) then begin
+ DeleteFile(FileNameEd.Text);
+
+ TotalSlotsLb.Caption := '0';
+ LockedSlotsLb.Caption := '0';
+ InvalidSlotsLb.Caption := '0';
+
+ UpdateBt.Enabled := FileExists(FileNameEd.Text);
+ ResetBt.Enabled := FileExists(FileNameEd.Text);
+ DeleteBt.Enabled := FileExists(FileNameEd.Text);
+ end;
+end;
+
+function TNafFrm.UpdateInfoLabels(const FileName: string): Boolean;
+var
+ NetAccessInfo: TNetAccessInfo;
+begin
+ if GetNetAccessFileInfo(FileName, Key, NetAccessInfo) then begin
+ TotalSlotsLb.Caption := IntToStr(NetAccessInfo.Total);
+ LockedSlotsLb.Caption := IntToStr(NetAccessInfo.Locked);
+ InvalidSlotsLb.Caption := IntToStr(NetAccessInfo.Invalid);
+ Result := True;
+ end else
+ Result := False;
+end;
+
+function TNafFrm.NumberOfSlots(const Str: string): Integer;
+var
+ Code : TCode;
+begin
+ Result := -1;
+ if (Length(Str) = SizeOf(Code) * 2) then begin
+ HexToBuffer(Str, Code, SizeOf(Code));
+ Result := DecodeNAFCountCode(Key, Code);
+ end;
+end;
+
+procedure TNafFrm.GenerateCodeSbClick(Sender: TObject);
+var
+ Work : TCode;
+begin
+ OgMakeCodes1.SetKey(CKey);
+ OgMakeCodes1.CodeType := ctNetWork;
+ if OgMakeCodes1.Execute then begin
+ OgMakeCodes1.GetCode(Work);
+ AccessCodeEd.Text := BufferToHex(Work, SizeOf(Work));
+ end;
+end;
+
+initialization
+{$i nafmgr1.lrs}
+
+end.
+
diff --git a/components/onguard/examples/regdemo/OnGuard.ini b/components/onguard/examples/regdemo/OnGuard.ini
new file mode 100644
index 000000000..12483a53e
--- /dev/null
+++ b/components/onguard/examples/regdemo/OnGuard.ini
@@ -0,0 +1,2 @@
+[Keys]
+Hello World=3EC918787DACAFD364E0BC0A43682CF2
diff --git a/components/onguard/examples/regdemo/REGISTRATION.DAT b/components/onguard/examples/regdemo/REGISTRATION.DAT
new file mode 100644
index 000000000..9ae593eca
--- /dev/null
+++ b/components/onguard/examples/regdemo/REGISTRATION.DAT
@@ -0,0 +1,2 @@
+11345
+BE81DA11B7CAEC9C
diff --git a/components/onguard/examples/regdemo/frm_main.lfm b/components/onguard/examples/regdemo/frm_main.lfm
new file mode 100644
index 000000000..05308209e
--- /dev/null
+++ b/components/onguard/examples/regdemo/frm_main.lfm
@@ -0,0 +1,50 @@
+object frmMain: TfrmMain
+ ActiveControl = Button1
+ Caption = 'Hello World'
+ ClientHeight = 143
+ ClientWidth = 367
+ Font.Height = -13
+ Font.Name = 'Arial'
+ OnCreate = FormCreate
+ PixelsPerInch = 96
+ TextHeight = 16
+ HorzScrollBar.Page = 366
+ VertScrollBar.Page = 142
+ Left = 383
+ Height = 143
+ Top = 289
+ Width = 367
+ object Label1: TLabel
+ Alignment = taCenter
+ AutoSize = False
+ Caption = 'Hello World!'
+ Color = clNone
+ Font.Height = -33
+ Font.Name = 'Arial'
+ ParentColor = False
+ Left = 4
+ Height = 41
+ Top = 16
+ Width = 359
+ end
+ object Button1: TButton
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Close'
+ OnClick = Button1Click
+ TabOrder = 0
+ Left = 280
+ Height = 25
+ Top = 88
+ Width = 75
+ end
+ object btnReadme: TButton
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Readme...'
+ OnClick = btnReadmeClick
+ TabOrder = 1
+ Left = 16
+ Height = 25
+ Top = 88
+ Width = 75
+ end
+end
diff --git a/components/onguard/examples/regdemo/frm_main.lrs b/components/onguard/examples/regdemo/frm_main.lrs
new file mode 100644
index 000000000..a5c10b79b
--- /dev/null
+++ b/components/onguard/examples/regdemo/frm_main.lrs
@@ -0,0 +1,18 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TfrmMain','FORMDATA',[
+ 'TPF0'#8'TfrmMain'#7'frmMain'#13'ActiveControl'#7#7'Button1'#7'Caption'#6#11
+ +'Hello World'#12'ClientHeight'#3#143#0#11'ClientWidth'#3'o'#1#11'Font.Height'
+ +#2#243#9'Font.Name'#6#5'Arial'#8'OnCreate'#7#10'FormCreate'#13'PixelsPerInch'
+ +#2'`'#10'TextHeight'#2#16#18'HorzScrollBar.Page'#3'n'#1#18'VertScrollBar.Pag'
+ +'e'#3#142#0#4'Left'#3''#1#6'Height'#3#143#0#3'Top'#3'!'#1#5'Width'#3'o'#1#0
+ +#6'TLabel'#6'Label1'#9'Alignment'#7#8'taCenter'#8'AutoSize'#8#7'Caption'#6#12
+ +'Hello World!'#5'Color'#7#6'clNone'#11'Font.Height'#2#223#9'Font.Name'#6#5'A'
+ +'rial'#11'ParentColor'#8#4'Left'#2#4#6'Height'#2')'#3'Top'#2#16#5'Width'#3'g'
+ +#1#0#0#7'TButton'#7'Button1'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#5
+ +'Close'#7'OnClick'#7#12'Button1Click'#8'TabOrder'#2#0#4'Left'#3#24#1#6'Heigh'
+ +'t'#2#25#3'Top'#2'X'#5'Width'#2'K'#0#0#7'TButton'#9'btnReadme'#25'BorderSpac'
+ +'ing.InnerBorder'#2#4#7'Caption'#6#9'Readme...'#7'OnClick'#7#14'btnReadmeCli'
+ +'ck'#8'TabOrder'#2#1#4'Left'#2#16#6'Height'#2#25#3'Top'#2'X'#5'Width'#2'K'#0
+ +#0#0
+]);
diff --git a/components/onguard/examples/regdemo/frm_main.pas b/components/onguard/examples/regdemo/frm_main.pas
new file mode 100644
index 000000000..0cfd493a4
--- /dev/null
+++ b/components/onguard/examples/regdemo/frm_main.pas
@@ -0,0 +1,64 @@
+unit frm_Main;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils, Classes, Controls, Forms, Dialogs,
+ StdCtrls,Buttons,LResources ;
+
+type
+
+ { TfrmMain }
+
+ TfrmMain = class(TForm)
+ Label1: TLabel;
+ Button1: TButton;
+ btnReadme: TButton;
+ procedure FormCreate(Sender: TObject);
+ procedure Button1Click(Sender: TObject);
+ procedure btnReadmeClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ frmMain: TfrmMain;
+
+implementation
+
+uses
+ uni_RegCommon, frm_Readme;
+
+
+
+procedure TfrmMain.FormCreate(Sender: TObject);
+var
+ ReleaseCodeString: string;
+ var SerialNumber : longint;
+begin
+ GetRegistrationInformation (ReleaseCodeString, SerialNumber);
+ if not IsReleaseCodeValid (ReleaseCodeString, SerialNumber) then
+ Label1.Caption := 'Unregistered Demo!'
+ else
+ Label1.Caption := 'Hello World!';
+end;
+
+procedure TfrmMain.Button1Click(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TfrmMain.btnReadmeClick(Sender: TObject);
+begin
+ frmReadme.Show;
+end;
+
+
+initialization
+{$i frm_main.lrs}
+
+end.
diff --git a/components/onguard/examples/regdemo/frm_readme.lfm b/components/onguard/examples/regdemo/frm_readme.lfm
new file mode 100644
index 000000000..890333386
--- /dev/null
+++ b/components/onguard/examples/regdemo/frm_readme.lfm
@@ -0,0 +1,141 @@
+object frmReadme: TfrmReadme
+ ActiveControl = Memo1
+ Caption = 'Readme.txt'
+ ClientHeight = 462
+ ClientWidth = 539
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ OnActivate = FormActivate
+ PixelsPerInch = 96
+ TextHeight = 13
+ HorzScrollBar.Page = 538
+ VertScrollBar.Page = 461
+ Left = 192
+ Height = 462
+ Top = 107
+ Width = 539
+ object Memo1: TMemo
+ Align = alClient
+ Font.Height = -13
+ Font.Name = 'Courier New'
+ Lines.Strings = (
+ 'Registration Demo by Bill Mullen [TPX]'
+ '--------------------------------------'
+ ''
+ 'This demo consists of three applications and complete project '
+ 'code.'
+ 'The three applications are:'
+ ''
+ 'RCG.EXE - This is the application you use to gather information '
+ 'from '
+ 'your user. That information is then used to generate a release '
+ 'code '
+ 'that you will give back to the user. '
+ ''
+ 'REGISTRATION.EXE - A sample registration application that your '
+ 'user would run when they are ready to register their product '
+ 'with you.'
+ 'They enter the serial number that was on their disk or CD. When '
+ 'they call you, they will read you their serial number, and the '
+ 'machine '
+ 'identifier (MachineModifier). You will enter this information '
+ 'into RCG '
+ '(above) and calculate a release code. You will then read them '
+ 'the '
+ 'release code and they will enter it into the Release Code field. '
+ ''
+ 'When they click the SAVE button, it validates the release code '
+ 'and '
+ 'if it is valid, the serial number and release code are saved to '
+ 'a file'
+ 'called REGISTRATION.DAT. '
+ ''
+ 'HELLOWORLD.EXE - A simple application that demonstrates the '
+ 'use of the registration information found in the '
+ 'REGISTRATION.DAT'
+ 'file that was created by the REGISTRATION.EXE application. The '
+ 'serial number stored in the REGISTRATION.DAT file is used to '
+ 'calculate a release code on the machine the application is '
+ 'running '
+ 'on and it them compares this release code with the one stored in '
+ 'the '
+ 'REGISTRATION.DAT file. If the two release codes are the same, '
+ 'the application runs (displays "Hello World") otherwise it '
+ 'informs the '
+ 'user that they have an unregistered demo.'
+ ''
+ 'An OnGuard.ini file is included that contains the KEY that I use '
+ 'in '
+ 'this demo. When running the demo as shipped, you should use the '
+ 'supplied OnGuard.ini file when getting the application key.'
+ ''
+ 'Before opening and modifying any code, you should run the '
+ 'following '
+ 'test to see how these applications work with one another. '
+ ''
+ '1. Run the HELLOWORLD.EXE application. As you can see, it is '
+ 'not registered.'
+ ''
+ '2. Execute REGISTRATION.EXE. Enter any valid long integer '
+ 'value in the serial number field in the REGISTRATION.EXE '
+ 'application.'
+ 'Execute RCG.EXE and arrange the windows so that you can view '
+ 'both. '
+ ''
+ 'a. In the RCG application, load the key by pressing the speed '
+ 'button '
+ 'and selecting the Hello World application from the OnGuard.ini '
+ 'file that '
+ 'was supplied. '
+ ''
+ 'b. Select the "Apply a Machine Modifier" checkbox and enter the '
+ 'machine modifier that is displayed in the REGISTRATION.EXE '
+ 'application (this simulates the user reading that information to '
+ 'you). '
+ ''
+ 'c. Skip the Expiration portion as I did not use this feature in '
+ 'the '
+ 'other programs. '
+ ''
+ 'd. Next enter the serial number that is displayed in the '
+ 'REGISTRATION.EXE application (again, a simulation). '
+ ''
+ 'e. Generate a release code by pressing the speed button next to '
+ 'the Release Code edit field.'
+ ''
+ 'f. Have the user enter the release code in their '
+ 'REGISTRATION.EXE'
+ 'application that you read them from your RGC.EXE application '
+ '(simulated). For testing purposes, change any single character '
+ 'as '
+ 'you enter the data so you can see how the application will '
+ 'reject an'
+ 'invalid code. (Now simply copy and paste the release code from '
+ 'RGC to REGISTRATION to save yourself having to enter the whole'
+ 'string again.)'
+ ''
+ 'If you entered everything correctly, the REGISTRASTION.EXE '
+ 'application will inform you and save the data. Now let''s test '
+ 'the '
+ 'registration information.'
+ ''
+ '3. Run the HELLOWORLD.EXE application. If you entered '
+ 'everything correctly in step 2, you will see that the '
+ 'application is '
+ 'registered (It displays "HELLO WORLD").'
+ ''
+ 'If you have another computer, copy HELLOWORLD.EXE and '
+ 'REGISTRASTION.DAT to that machine and try to execute '
+ 'HELLOWORLD.EXE - you should be told that the application is '
+ 'an unregistered demo. You can also edit the any single '
+ 'character in REGISTRASTION.DAT and try to run '
+ 'HELLOWORLD.EXE. '
+ ''
+ )
+ ReadOnly = True
+ ScrollBars = ssBoth
+ TabOrder = 0
+ Height = 462
+ Width = 539
+ end
+end
diff --git a/components/onguard/examples/regdemo/frm_readme.lrs b/components/onguard/examples/regdemo/frm_readme.lrs
new file mode 100644
index 000000000..580e32156
--- /dev/null
+++ b/components/onguard/examples/regdemo/frm_readme.lrs
@@ -0,0 +1,71 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TfrmReadme','FORMDATA',[
+ 'TPF0'#10'TfrmReadme'#9'frmReadme'#13'ActiveControl'#7#5'Memo1'#7'Caption'#6
+ +#10'Readme.txt'#12'ClientHeight'#3#206#1#11'ClientWidth'#3#27#2#11'Font.Heig'
+ +'ht'#2#245#9'Font.Name'#6#13'MS Sans Serif'#10'OnActivate'#7#12'FormActivate'
+ +#13'PixelsPerInch'#2'`'#10'TextHeight'#2#13#18'HorzScrollBar.Page'#3#26#2#18
+ +'VertScrollBar.Page'#3#205#1#4'Left'#3#192#0#6'Height'#3#206#1#3'Top'#2'k'#5
+ +'Width'#3#27#2#0#5'TMemo'#5'Memo1'#5'Align'#7#8'alClient'#11'Font.Height'#2
+ +#243#9'Font.Name'#6#11'Courier New'#13'Lines.Strings'#1#6'&Registration Demo'
+ +' by Bill Mullen [TPX]'#6'&--------------------------------------'#6#0#6'>Th'
+ +'is demo consists of three applications and complete project '#6#5'code.'#6
+ +#27'The three applications are:'#6#0#6'@RCG.EXE - This is the application yo'
+ +'u use to gather information '#6#5'from '#6'@your user. That information is'
+ +' then used to generate a release '#6#5'code '#6'%that you will give back to'
+ +' the user. '#6#0#6'?REGISTRATION.EXE - A sample registration application th'
+ +'at your '#6'=user would run when they are ready to register their product '
+ +#6#9'with you.'#6'AThey enter the serial number that was on their disk or CD'
+ +'. When '#6'?they call you, they will read you their serial number, and the'
+ +' '#6#8'machine '#6'?identifier (MachineModifier). You will enter this info'
+ +'rmation '#6#9'into RCG '#6'?(above) and calculate a release code. You will'
+ +' then read them '#6#4'the '#6'Arelease code and they will enter it into the'
+ +' Release Code field. '#6#0#6'?When they click the SAVE button, it validates'
+ +' the release code '#6#4'and '#6'@if it is valid, the serial number and rele'
+ +'ase code are saved to '#6#6'a file'#6#25'called REGISTRATION.DAT. '#6#0#6'<'
+ +'HELLOWORLD.EXE - A simple application that demonstrates the '#6'1use of the'
+ +' registration information found in the '#6#16'REGISTRATION.DAT'#6'@file tha'
+ +'t was created by the REGISTRATION.EXE application. The '#6'=serial number '
+ +'stored in the REGISTRATION.DAT file is used to '#6';calculate a release cod'
+ +'e on the machine the application is '#6#8'running '#6'Aon and it them compa'
+ +'res this release code with the one stored in '#6#4'the '#6'?REGISTRATION.DA'
+ +'T file. If the two release codes are the same, '#6';the application runs ('
+ +'displays "Hello World") otherwise it '#6#12'informs the '#6')user that they'
+ +' have an unregistered demo.'#6#0#6'AAn OnGuard.ini file is included that co'
+ +'ntains the KEY that I use '#6#3'in '#6'@this demo. When running the demo as'
+ +' shipped, you should use the '#6';supplied OnGuard.ini file when getting th'
+ +'e application key.'#6#0#6':Before opening and modifying any code, you shoul'
+ +'d run the '#6#10'following '#6'RGC to REGISTRATION to sav'
+ +'e yourself having to enter the whole'#6#14'string again.)'#6#0#6';If you en'
+ +'tered everything correctly, the REGISTRASTION.EXE '#6'?application will inf'
+ +'orm you and save the data. Now let''s test '#6#4'the '#6#25'registration i'
+ +'nformation.'#6#0#6'83. Run the HELLOWORLD.EXE application. If you entered'
+ +' '#6'6everything correctly in step 2, you will see that the '#6#15'applicat'
+ +'ion is '#6'''registered (It displays "HELLO WORLD").'#6#0#6'6If you have an'
+ +'other computer, copy HELLOWORLD.EXE and '#6'5REGISTRASTION.DAT to that mach'
+ +'ine and try to execute '#6'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/regdemo/helloworld.lpr b/components/onguard/examples/regdemo/helloworld.lpr
new file mode 100644
index 000000000..e8ca962ea
--- /dev/null
+++ b/components/onguard/examples/regdemo/helloworld.lpr
@@ -0,0 +1,20 @@
+program HelloWorld;
+
+{$mode objfpc}{$H+}
+
+
+uses
+ Interfaces,
+ Forms,
+ frm_Main in 'frm_Main.pas' {frmMain},
+ uni_RegCommon in 'uni_RegCommon.pas',
+ frm_Readme in 'frm_Readme.pas' {frmReadme}, tponguard;
+
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TfrmMain, frmMain);
+ Application.CreateForm(TfrmReadme, frmReadme);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/regdemo/rcg.lpi b/components/onguard/examples/regdemo/rcg.lpi
new file mode 100644
index 000000000..332cb7b66
--- /dev/null
+++ b/components/onguard/examples/regdemo/rcg.lpi
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/regdemo/rcg.lpr b/components/onguard/examples/regdemo/rcg.lpr
new file mode 100644
index 000000000..333fa5a20
--- /dev/null
+++ b/components/onguard/examples/regdemo/rcg.lpr
@@ -0,0 +1,17 @@
+program RCG;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ rcg_Main in 'rcg_Main.pas' {rcgMain},
+ frm_Readme in 'frm_Readme.pas' {frmReadme}, tponguard;
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TrcgMain, rcgMain);
+ Application.CreateForm(TfrmReadme, frmReadme);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/regdemo/rcg_main.lfm b/components/onguard/examples/regdemo/rcg_main.lfm
new file mode 100644
index 000000000..184792a34
--- /dev/null
+++ b/components/onguard/examples/regdemo/rcg_main.lfm
@@ -0,0 +1,233 @@
+object rcgMain: TrcgMain
+ Left = 354
+ Height = 322
+ Top = 246
+ Width = 363
+ HorzScrollBar.Page = 362
+ VertScrollBar.Page = 321
+ ActiveControl = edtAppKey
+ BorderStyle = bsDialog
+ Caption = 'Release Code Generator'
+ Font.Height = -13
+ Font.Name = 'Arial'
+ ShowHint = True
+ object lblAppKey: TLabel
+ Left = 8
+ Height = 13
+ Top = 7
+ Width = 99
+ Caption = '&Application Key'
+ Color = clNone
+ FocusControl = edtAppKey
+ ParentColor = False
+ end
+ object lblSerialNumber: TLabel
+ Left = 8
+ Height = 13
+ Top = 156
+ Width = 89
+ Caption = '&Serial Number'
+ Color = clNone
+ FocusControl = edtSerialNumber
+ ParentColor = False
+ end
+ object lblReleaseCode: TLabel
+ Left = 8
+ Height = 13
+ Top = 222
+ Width = 80
+ Caption = 'Release Code'
+ Color = clNone
+ ParentColor = False
+ end
+ object Bevel1: TBevel
+ Left = 8
+ Height = 5
+ Top = 211
+ Width = 329
+ Shape = bsTopLine
+ end
+ object edtAppKey: TEdit
+ Left = 8
+ Height = 24
+ Top = 24
+ Width = 329
+ Font.Color = clRed
+ Font.Height = -13
+ Font.Name = 'MS Sans Serif'
+ OnChange = edtAppKeyChange
+ ReadOnly = True
+ TabStop = False
+ TabOrder = 0
+ end
+ object chkMachMod: TCheckBox
+ Left = 8
+ Height = 22
+ Top = 56
+ Width = 179
+ Caption = 'Apply a &Machine Modifier'
+ OnClick = chkMachModClick
+ TabOrder = 2
+ end
+ object edtMachineMod: TEdit
+ Left = 8
+ Height = 24
+ Top = 74
+ Width = 329
+ Enabled = False
+ MaxLength = 10
+ OnChange = edtAppKeyChange
+ TabOrder = 3
+ end
+ object edtSerialNumber: TEdit
+ Left = 8
+ Height = 24
+ Top = 173
+ Width = 329
+ MaxLength = 10
+ OnChange = edtAppKeyChange
+ TabOrder = 6
+ end
+ object edtReleaseCode: TEdit
+ Left = 8
+ Height = 24
+ Top = 238
+ Width = 329
+ ReadOnly = True
+ TabStop = False
+ TabOrder = 7
+ end
+ object btnExit: TButton
+ Left = 262
+ Height = 25
+ Top = 273
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Exit'
+ Default = True
+ OnClick = btnExitClick
+ TabOrder = 9
+ end
+ object chkExpires: TCheckBox
+ Left = 8
+ Height = 22
+ Top = 104
+ Width = 158
+ Caption = '&Release code expires '
+ OnClick = chkExpiresClick
+ TabOrder = 4
+ end
+ object edtExpires: TEdit
+ Left = 8
+ Height = 24
+ Top = 125
+ Width = 329
+ Enabled = False
+ OnChange = edtAppKeyChange
+ TabOrder = 5
+ end
+ object spdAppKey: TBitBtn
+ Left = 310
+ Height = 21
+ Top = 26
+ Width = 25
+ Glyph.Data = {
+ 26040000424D2604000000000000360000002800000012000000120000000100
+ 180000000000F003000000000000000000000000000000000000FFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFABABABEEEEEEFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFF0000FFFFFF1725345E656DF2F2F2E5E5E5FFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ 0000FFFFFF303E4D385460C4C4C42C3036AAAAAAFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFA2A2A2
+ 008DB0325E6A001B398B8B8BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000BFBFBF49494900426E0075AA0C29
+ 49CACACAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFF0000005E7300759E002842002D4F16283AFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ 0000A8B1B33A7381007CA000729D0E3145A2A2A2CCCCCCFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFDDDDDDA2A2A2B3B3B3FFFFFFFFFFFF0000FFFFFFEEEEEE
+ AAB5B7386F7D0081A6005F8B143855ACADAFF2F2F2FFFFFFFFFFFFFFFFFFFFFF
+ FF304E5E006B890856768C9196FFFFFF0000FFFFFFFFFFFFFFFFFFF2F2F2ACB1
+ B3147B97003E6A00577E385867AAAFB2D4D4D4FFFFFFAAAAAA063853979C9F4B
+ 818F125568EAEAEA0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCCCCCCA2A2A223
+ 6878048CB5005C82083352A8AAAC324F5F3A5462EEEEEED0D0D000708B8B8B8B
+ 0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0A0A025768B
+ 0075AA00335B004B755C656AFFFFFFD0D0D000415C8B8B8B0000FFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5E5E57373733472800081
+ A75C6A6EFFFFFF45606A00507F8B8B8B0000FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2F2F2005E735C6F73FFFFFF78
+ 8F9500648D8B8B8B0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFF718386107086D9D9D9D0D0D00037558B8B8B
+ 0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFA0A0A004637CB7B9BAD0D0D00037558B8B8B0000FFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FF235363197D974C616B0E2F46D4D4D40000FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD5D5D519667800
+ 556B62737CFFFFFF0000
+ }
+ NumGlyphs = 0
+ OnClick = spdAppKeyClick
+ TabOrder = 1
+ end
+ object spdReleaseCode: TBitBtn
+ Left = 311
+ Height = 21
+ Top = 240
+ Width = 25
+ Glyph.Data = {
+ 26040000424D2604000000000000360000002800000012000000120000000100
+ 180000000000F003000000000000000000000000000000000000FFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEAEAEA868C
+ 8D00576F17375D666D667077709395930000FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9B9B922515E3C555C2F80970165EF1B
+ 3F71656B65898E890000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFAFAFAF0889AC0FB1DD485B600432760049B6969796EFF0EF
+ 0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F9F9EFEFEFEFEFEFEFEFEFEFEFEF
+ A8A8A836444815A7CF0EB1DE010D14001535AFAFAFFFFFFF0000FFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF9F9F9F482F2C7F5F607F6260472A283F423F255D6D4D53
+ 5513AAD30059CE000917AFAFAFFFFFFF0000FFFFFFE1E1E18E8B8B27201F4A44
+ 41484C48905F5AFFBFC1FFC4C08F54513F423F117B982293B24D53550450BE00
+ 49B65D615DE7E8E70000FFFFFFAFAFAF5C423D3E2D29825D5727201E6C4743BF
+ 8F90BF93906B3F3C2F21203940422491AE258FAD030E19002F746F726FF3F3F3
+ 0000BBBDBB626462684A4538282590676059403B8E7175AF8F93AF8B89623A37
+ 8F54513644484E5253249BBB01387D0002056B6F6BD3D6D30000170B0B251212
+ 3E2E2D8A6C6F67494459403BCFA8ADFFE0E4FFD5DA8F75748F5451068CB0416B
+ 77818781599AF80033804D514DC0C3C000002914144F27268A696DFFC8CFB78F
+ 945E4645E4B2B9FFCBD2FFE3E68F7074502F2D8EA5A33AFBFB70ADA8A7ACA765
+ 86B64D514DC0C3C000001C0E0E422120341C1B7E6366FFC8CFEDAFB3EBB3B8AF
+ 898EAF8D91F1D5D9DFBABF7D808037B8B608F8F85E706B5A5E5A575D57C0C3C0
+ 0000382523AB6863BF716BC3746FFFB1B1D5A4A85B3E3E4C29276B4D47725C5A
+ F1D2D5F3CED37979792F5C5AB66F6A5A4C4BDBDCDBEFF0EF00006F423ED4847D
+ EB8E87FF9790FF9790C3817E4528275C2F2E6C413E513B38EBBEC3FFDFE3FFD5
+ DAFFB9B4FF97906F5C5AFFFFFFFFFFFF000037211F7F4B48603E3A87504CFF97
+ 90FF9790DE97977F63677F6367FFBABDFFC8CFE7BAC07F6E707F71737F4E4B57
+ 4E4DFFFFFFFFFFFF0000EFEFEFA4A4A4A15F5B784844EA8D86DA817BED8D86FF
+ AFAFFFC8CFD5999BBD9095FCC5CC987679472A28E0E0E0F3F3F3FFFFFFFFFFFF
+ 0000FFFFFFAFAFAF653C39EB8B85B5726C463938CF7A75FF9891FFAFAF8F7074
+ 979494B79397F8C2C947383AEFEFEFFFFFFFFFFFFFFFFFFF0000FFFFFFE6E6E6
+ 94716ED8807A8F7F7E9A9A9ACF7A75FF9790FF97908F5D5CDFDFDFB7B4B47363
+ 65AFAFAFFAFAFAFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFEAEAEA969696FFFF
+ FF9F9F9F5A35336F423E6F423E3E2523DFDFDFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFF0000
+ }
+ NumGlyphs = 0
+ OnClick = spdReleaseCodeClick
+ TabOrder = 8
+ end
+ object btnReadme: TButton
+ Left = 8
+ Height = 25
+ Top = 273
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Readme...'
+ OnClick = btnReadmeClick
+ TabOrder = 10
+ end
+ object OgMakeKeys1: TOgMakeKeys
+ left = 144
+ top = 272
+ end
+end
diff --git a/components/onguard/examples/regdemo/rcg_main.lrs b/components/onguard/examples/regdemo/rcg_main.lrs
new file mode 100644
index 000000000..5b3a0506b
--- /dev/null
+++ b/components/onguard/examples/regdemo/rcg_main.lrs
@@ -0,0 +1,135 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TrcgMain','FORMDATA',[
+ 'TPF0'#8'TrcgMain'#7'rcgMain'#4'Left'#3'b'#1#6'Height'#3'B'#1#3'Top'#3#246#0#5
+ +'Width'#3'k'#1#18'HorzScrollBar.Page'#3'j'#1#18'VertScrollBar.Page'#3'A'#1#13
+ +'ActiveControl'#7#9'edtAppKey'#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#22
+ +'Release Code Generator'#11'Font.Height'#2#243#9'Font.Name'#6#5'Arial'#8'Sho'
+ +'wHint'#9#0#6'TLabel'#9'lblAppKey'#4'Left'#2#8#6'Height'#2#13#3'Top'#2#7#5'W'
+ +'idth'#2'c'#7'Caption'#6#16'&Application Key'#5'Color'#7#6'clNone'#12'FocusC'
+ +'ontrol'#7#9'edtAppKey'#11'ParentColor'#8#0#0#6'TLabel'#15'lblSerialNumber'#4
+ +'Left'#2#8#6'Height'#2#13#3'Top'#3#156#0#5'Width'#2'Y'#7'Caption'#6#14'&Seri'
+ +'al Number'#5'Color'#7#6'clNone'#12'FocusControl'#7#15'edtSerialNumber'#11'P'
+ +'arentColor'#8#0#0#6'TLabel'#14'lblReleaseCode'#4'Left'#2#8#6'Height'#2#13#3
+ +'Top'#3#222#0#5'Width'#2'P'#7'Caption'#6#12'Release Code'#5'Color'#7#6'clNon'
+ +'e'#11'ParentColor'#8#0#0#6'TBevel'#6'Bevel1'#4'Left'#2#8#6'Height'#2#5#3'To'
+ +'p'#3#211#0#5'Width'#3'I'#1#5'Shape'#7#9'bsTopLine'#0#0#5'TEdit'#9'edtAppKey'
+ +#4'Left'#2#8#6'Height'#2#24#3'Top'#2#24#5'Width'#3'I'#1#10'Font.Color'#7#5'c'
+ +'lRed'#11'Font.Height'#2#243#9'Font.Name'#6#13'MS Sans Serif'#8'OnChange'#7
+ +#15'edtAppKeyChange'#8'ReadOnly'#9#7'TabStop'#8#8'TabOrder'#2#0#0#0#9'TCheck'
+ +'Box'#10'chkMachMod'#4'Left'#2#8#6'Height'#2#22#3'Top'#2'8'#5'Width'#3#179#0
+ +#7'Caption'#6#25'Apply a &Machine Modifier'#7'OnClick'#7#15'chkMachModClick'
+ +#8'TabOrder'#2#2#0#0#5'TEdit'#13'edtMachineMod'#4'Left'#2#8#6'Height'#2#24#3
+ +'Top'#2'J'#5'Width'#3'I'#1#7'Enabled'#8#9'MaxLength'#2#10#8'OnChange'#7#15'e'
+ +'dtAppKeyChange'#8'TabOrder'#2#3#0#0#5'TEdit'#15'edtSerialNumber'#4'Left'#2#8
+ +#6'Height'#2#24#3'Top'#3#173#0#5'Width'#3'I'#1#9'MaxLength'#2#10#8'OnChange'
+ +#7#15'edtAppKeyChange'#8'TabOrder'#2#6#0#0#5'TEdit'#14'edtReleaseCode'#4'Lef'
+ +'t'#2#8#6'Height'#2#24#3'Top'#3#238#0#5'Width'#3'I'#1#8'ReadOnly'#9#7'TabSto'
+ +'p'#8#8'TabOrder'#2#7#0#0#7'TButton'#7'btnExit'#4'Left'#3#6#1#6'Height'#2#25
+ +#3'Top'#3#17#1#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#4
+ +'Exit'#7'Default'#9#7'OnClick'#7#12'btnExitClick'#8'TabOrder'#2#9#0#0#9'TChe'
+ +'ckBox'#10'chkExpires'#4'Left'#2#8#6'Height'#2#22#3'Top'#2'h'#5'Width'#3#158
+ +#0#7'Caption'#6#22'&Release code expires '#7'OnClick'#7#15'chkExpiresClick'#8
+ +'TabOrder'#2#4#0#0#5'TEdit'#10'edtExpires'#4'Left'#2#8#6'Height'#2#24#3'Top'
+ +#2'}'#5'Width'#3'I'#1#7'Enabled'#8#8'OnChange'#7#15'edtAppKeyChange'#8'TabOr'
+ +'der'#2#5#0#0#7'TBitBtn'#9'spdAppKey'#4'Left'#3'6'#1#6'Height'#2#21#3'Top'#2
+ +#26#5'Width'#2#25#10'Glyph.Data'#10'*'#4#0#0'&'#4#0#0'BM&'#4#0#0#0#0#0#0'6'#0
+ +#0#0'('#0#0#0#18#0#0#0#18#0#0#0#1#0#24#0#0#0#0#0#240#3#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#0#0#255#255#255#171#171#171#238#238#238#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#0#0
+ +#255#255#255#23'%4^em'#242#242#242#229#229#229#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#0#0#255#255#255'0>M8T`'
+ +#196#196#196',06'#170#170#170#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#0#0#255#255#255#162#162#162#0#141#176'2^j'#0#27'9'#139
+ +#139#139#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#0#0#191#191#191'III'#0'Bn'#0'u'#170#12')I'#202#202#202#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#0#0#0'^s'#0'u'#158#0'(B'#0
+ +'-O'#22'(:'#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#0#0#168#177#179':s'#129#0'|'#160#0'r'#157#14'1E'#162#162#162
+ +#204#204#204#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#221#221#221#162#162#162#179#179#179#255#255#255#255#255#255#0#0#255
+ +#255#255#238#238#238#170#181#183'8o}'#0#129#166#0'_'#139#20'8U'#172#173#175
+ +#242#242#242#255#255#255#255#255#255#255#255#255#255#255#255'0N^'#0'k'#137#8
+ +'Vv'#140#145#150#255#255#255#0#0#255#255#255#255#255#255#255#255#255#242#242
+ +#242#172#177#179#20'{'#151#0'>j'#0'W~8Xg'#170#175#178#212#212#212#255#255#255
+ +#170#170#170#6'8S'#151#156#159'K'#129#143#18'Uh'#234#234#234#0#0#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#204#204#204#162#162#162'#hx'
+ +#4#140#181#0'\'#130#8'3R'#168#170#172'2O_:Tb'#238#238#238#208#208#208#0'p'
+ +#139#139#139#139#0#0#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ ,#255#255#255#255#255#255#255#255#255#255#160#160#160'%v'#139#0'u'#170#0'3['#0
+ +'Ku\ej'#255#255#255#208#208#208#0'A\'#139#139#139#0#0#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#229#229#229'sss4r'#128#0#129#167'\jn'#255#255#255'E`j'#0'P'#139#139
+ +#139#0#0#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#242#242#242
+ +#0'^s\os'#255#255#255'x'#143#149#0'd'#141#139#139#139#0#0#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255'q'#131#134#16'p'#134#217#217
+ +#217#208#208#208#0'7U'#139#139#139#0#0#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#160#160#160#4'c|'#183#185#186#208#208#208#0
+ +'7U'#139#139#139#0#0#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255'#Sc'#25'}'#151'Lak'#14'/F'#212#212#212#0#0#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#213
+ +#213#213#25'fx'#0'Ukbs|'#255#255#255#0#0#9'NumGlyphs'#2#0#7'OnClick'#7#14'sp'
+ +'dAppKeyClick'#8'TabOrder'#2#1#0#0#7'TBitBtn'#14'spdReleaseCode'#4'Left'#3'7'
+ +#1#6'Height'#2#21#3'Top'#3#240#0#5'Width'#2#25#10'Glyph.Data'#10'*'#4#0#0'&'
+ +#4#0#0'BM&'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#18#0#0#0#18#0#0#0#1#0#24#0#0#0#0
+ +#0#240#3#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#234#234#234#134#140#141#0'Wo'#23'7]fmfpwp'#147#149
+ +#147#0#0#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#255#255#255#255#255#255#255#255#255#255#185#185#185'"Q^-)'#130']W'' '#30'lGC'#191#143#144#191#147#144'k?'
+ +'! 9@B$'#145#174'%'#143#173#3#14#25#0'/toro'#243#243#243#0#0#187#189#187'bdb'
+ +'hJE8(%'#144'g`Y@;'#142'qu'#175#143#147#175#139#137'b:7'#143'TQ6DHNRS$'#155
+ +#187#1'8}'#0#2#5'kok'#211#214#211#0#0#23#11#11'%'#18#18'>.-'#138'logIDY@;'
+ +#207#168#173#255#224#228#255#213#218#143'ut'#143'TQ'#6#140#176'Akw'#129#135
+ +#129'Y'#154#248#0'3'#128'MQM'#192#195#192#0#0')'#20#20'O''&'#138'im'#255#200
+ +#207#183#143#148'^FE'#228#178#185#255#203#210#255#227#230#143'ptP/-'#142#165
+ +#163':'#251#251'p'#173#168#167#172#167'e'#134#182'MQM'#192#195#192#0#0#28#14
+ +#14'B! 4'#28#27'~cf'#255#200#207#237#175#179#235#179#184#175#137#142#175#141
+ +#145#241#213#217#223#186#191'}'#128#128'7'#184#182#8#248#248'^pkZ^ZW]W'#192
+ +#195#192#0#0'8%#'#171'hc'#191'qk'#195'to'#255#177#177#213#164#168'[>>L)''kMG'
+ +'r\Z'#241#210#213#243#206#211'yyy/\Z'#182'ojZLK'#219#220#219#239#240#239#0#0
+ +'oB>'#212#132'}'#235#142#135#255#151#144#255#151#144#195#129'~E(''\/.lA>Q;8'
+ +#235#190#195#255#223#227#255#213#218#255#185#180#255#151#144'o\Z'#255#255#255
+ +#255#255#255#0#0'7!'#31'KH`>:'#135'PL'#255#151#144#255#151#144#222#151#151
+ +'cgcg'#255#186#189#255#200#207#231#186#192'npqsNKWNM'#255#255#255#255
+ +#255#255#0#0#239#239#239#164#164#164#161'_[xHD'#234#141#134#218#129'{'#237
+ +#141#134#255#175#175#255#200#207#213#153#155#189#144#149#252#197#204#152'vyG'
+ +'*('#224#224#224#243#243#243#255#255#255#255#255#255#0#0#255#255#255#175#175
+ +#175'e<9'#235#139#133#181'rlF98'#207'zu'#255#152#145#255#175#175#143'pt'#151
+ +#148#148#183#147#151#248#194#201'G8:'#239#239#239#255#255#255#255#255#255#255
+ +#255#255#0#0#255#255#255#230#230#230#148'qn'#216#128'z'#143'~'#154#154#154
+ +#207'zu'#255#151#144#255#151#144#143']\'#223#223#223#183#180#180'sce'#175#175
+ +#175#250#250#250#255#255#255#255#255#255#255#255#255#0#0#255#255#255#255#255
+ +#255#234#234#234#150#150#150#255#255#255#159#159#159'Z53oB>oB>>%#'#223#223
+ +#223#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+ +#255#255#255#0#0#9'NumGlyphs'#2#0#7'OnClick'#7#19'spdReleaseCodeClick'#8'Tab'
+ +'Order'#2#8#0#0#7'TButton'#9'btnReadme'#4'Left'#2#8#6'Height'#2#25#3'Top'#3
+ ,#17#1#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#9'Readme.'
+ +'..'#7'OnClick'#7#14'btnReadmeClick'#8'TabOrder'#2#10#0#0#11'TOgMakeKeys'#11
+ +'OgMakeKeys1'#4'left'#3#144#0#3'top'#3#16#1#0#0#0
+]);
diff --git a/components/onguard/examples/regdemo/rcg_main.pas b/components/onguard/examples/regdemo/rcg_main.pas
new file mode 100644
index 000000000..29da0aff5
--- /dev/null
+++ b/components/onguard/examples/regdemo/rcg_main.pas
@@ -0,0 +1,159 @@
+unit rcg_Main;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ Buttons, StdCtrls,LResources, OnGuard, OgUtil, ExtCtrls;
+
+type
+
+ { TrcgMain }
+
+ TrcgMain = class(TForm)
+ OgMakeKeys1: TOgMakeKeys;
+
+ lblAppKey: TLabel;
+ edtAppKey: TEdit;
+
+ chkMachMod: TCheckBox;
+ edtMachineMod: TEdit;
+
+ edtSerialNumber: TEdit;
+ lblSerialNumber: TLabel;
+
+ lblReleaseCode: TLabel;
+ edtReleaseCode: TEdit;
+
+ Bevel1: TBevel;
+ btnExit: TButton;
+ chkExpires: TCheckBox;
+ edtExpires: TEdit;
+ spdAppKey: TBitBtn;
+ spdReleaseCode: TBitBtn;
+ btnReadme: TButton;
+
+ procedure spdAppKeyClick(Sender: TObject);
+ procedure chkMachModClick(Sender: TObject);
+ procedure spdReleaseCodeClick(Sender: TObject);
+ procedure btnExitClick(Sender: TObject);
+ procedure chkExpiresClick(Sender: TObject);
+ procedure edtAppKeyChange(Sender: TObject);
+ procedure btnReadmeClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ ApplicationKey : TKey;
+ end;
+
+var
+ rcgMain: TrcgMain;
+
+implementation
+
+
+
+uses
+ frm_Readme;
+
+procedure TrcgMain.spdAppKeyClick(Sender: TObject);
+begin
+ if OgMakeKeys1.Execute then begin
+ OgMakeKeys1.GetKey(ApplicationKey);
+ edtAppKey.Text := BufferToHex(ApplicationKey, sizeof(ApplicationKey));
+ end;
+end;
+
+procedure TrcgMain.chkMachModClick(Sender: TObject);
+begin
+ edtMachineMod.Enabled := chkMachMod.Checked;
+ if edtMachineMod.Enabled then begin
+ edtMachineMod.SetFocus;
+ edtMachineMod.SelectAll;
+ end;
+end;
+
+procedure TrcgMain.chkExpiresClick(Sender: TObject);
+begin
+ edtExpires.Enabled := chkExpires.Checked;
+ if edtExpires.Enabled then begin
+ edtExpires.SetFocus;
+ edtExpires.SelectAll;
+ end;
+end;
+
+procedure TrcgMain.spdReleaseCodeClick(Sender: TObject);
+var
+ Key : TKey;
+ Modifier : longint;
+ SerialNum : longint;
+ Expires : TDateTime;
+ ReleaseCode : TCode;
+ CodeString : string;
+begin
+ edtReleaseCode.Text := '';
+
+ // Get the key that will be used to generate the ReleaseCode
+ Key := ApplicationKey;
+ if chkMachMod.Checked then
+ try
+ Modifier := StrToInt(edtMachineMod.Text);
+ ApplyModifierToKeyPrim(Modifier, Key, sizeof(Key));
+ except
+ MessageDlg('Invalid Machine Modifier. Please check your entry and try again.', mtError, [mbOK], 0);
+ exit;
+ end;
+
+ // Get the expiration date
+ if chkExpires.Checked then
+ try
+ Expires := StrToDate(edtExpires.Text);
+ except
+ MessageDlg('Invalid Expiration Date. Please check your entry and try again.', mtError, [mbOK], 0);
+ exit;
+ end
+ else
+ Expires := 0;
+
+ // Get the serial number
+ try
+ SerialNum := StrToInt(edtSerialNumber.Text);
+ except
+ MessageDlg('Invalid Serial Number. Please check your entry and try again.', mtError, [mbOK], 0);
+ exit;
+ end;
+
+ // Create the release code for the data givien
+ InitSerialNumberCode(Key, SerialNum, Expires, ReleaseCode);
+ CodeString := BufferToHex(ReleaseCode, sizeof(ReleaseCode));
+
+ // Insert spaces in the release code string for easier reading
+ System.Insert(' ', CodeString, 13);
+ System.Insert(' ', CodeString, 09);
+ System.Insert(' ', CodeString, 05);
+ edtReleaseCode.Text := CodeString;
+end;
+
+procedure TrcgMain.edtAppKeyChange(Sender: TObject);
+begin
+ edtReleaseCode.Text := '';
+end;
+
+procedure TrcgMain.btnExitClick(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TrcgMain.btnReadmeClick(Sender: TObject);
+begin
+ frmReadme.Show;
+end;
+
+
+initialization
+{$i rcg_main.lrs}
+
+end.
diff --git a/components/onguard/examples/regdemo/reg_main.lfm b/components/onguard/examples/regdemo/reg_main.lfm
new file mode 100644
index 000000000..a69d2ae9e
--- /dev/null
+++ b/components/onguard/examples/regdemo/reg_main.lfm
@@ -0,0 +1,106 @@
+object regMain: TregMain
+ ActiveControl = edtSerial
+ BorderStyle = bsDialog
+ Caption = 'Registration Tools'
+ ClientHeight = 261
+ ClientWidth = 300
+ Font.Height = -13
+ Font.Name = 'Arial'
+ OnActivate = FormActivate
+ PixelsPerInch = 96
+ TextHeight = 16
+ HorzScrollBar.Page = 299
+ VertScrollBar.Page = 260
+ Left = 468
+ Height = 261
+ Top = 153
+ Width = 300
+ object Label1: TLabel
+ Caption = 'Enter your serial number from your CD'
+ Color = clNone
+ ParentColor = False
+ Left = 10
+ Height = 14
+ Top = 67
+ Width = 186
+ end
+ object Label2: TLabel
+ Caption = 'Machine Identifier'
+ Color = clNone
+ ParentColor = False
+ Left = 10
+ Height = 14
+ Top = 115
+ Width = 87
+ end
+ object Label3: TLabel
+ Caption = 'Enter the release code you were given by us'
+ Color = clNone
+ ParentColor = False
+ Left = 10
+ Height = 14
+ Top = 163
+ Width = 216
+ end
+ object edtSerial: TEdit
+ MaxLength = 10
+ TabOrder = 1
+ Left = 10
+ Height = 24
+ Top = 83
+ Width = 268
+ end
+ object Memo1: TMemo
+ Color = clBtnFace
+ Lines.Strings = (
+ 'Thank you for registering HelloWorld. To '
+ 'complete your registration, please contact us '
+ 'at (800) 555-1212.'
+ )
+ OnEnter = Memo1Enter
+ ReadOnly = True
+ TabOrder = 0
+ TabStop = False
+ Left = 10
+ Height = 49
+ Top = 8
+ Width = 268
+ end
+ object edtMachine: TEdit
+ ReadOnly = True
+ TabStop = False
+ TabOrder = 2
+ Left = 10
+ Height = 24
+ Top = 131
+ Width = 268
+ end
+ object edtRelease: TEdit
+ MaxLength = 19
+ TabOrder = 3
+ Left = 10
+ Height = 24
+ Top = 179
+ Width = 268
+ end
+ object btnSave: TButton
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Save'
+ OnClick = btnSaveClick
+ TabOrder = 4
+ Left = 203
+ Height = 25
+ Top = 215
+ Width = 75
+ end
+ object btnReadme: TButton
+ BorderSpacing.InnerBorder = 4
+ Caption = 'Readme...'
+ OnClick = btnReadmeClick
+ TabOrder = 5
+ Left = 10
+ Height = 25
+ Top = 215
+ Width = 75
+ end
+end
diff --git a/components/onguard/examples/regdemo/reg_main.lrs b/components/onguard/examples/regdemo/reg_main.lrs
new file mode 100644
index 000000000..079207772
--- /dev/null
+++ b/components/onguard/examples/regdemo/reg_main.lrs
@@ -0,0 +1,31 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TregMain','FORMDATA',[
+ 'TPF0'#8'TregMain'#7'regMain'#13'ActiveControl'#7#9'edtSerial'#11'BorderStyle'
+ +#7#8'bsDialog'#7'Caption'#6#18'Registration Tools'#12'ClientHeight'#3#5#1#11
+ +'ClientWidth'#3','#1#11'Font.Height'#2#243#9'Font.Name'#6#5'Arial'#10'OnActi'
+ +'vate'#7#12'FormActivate'#13'PixelsPerInch'#2'`'#10'TextHeight'#2#16#18'Horz'
+ +'ScrollBar.Page'#3'+'#1#18'VertScrollBar.Page'#3#4#1#4'Left'#3#212#1#6'Heigh'
+ +'t'#3#5#1#3'Top'#3#153#0#5'Width'#3','#1#0#6'TLabel'#6'Label1'#7'Caption'#6
+ +'%Enter your serial number from your CD'#5'Color'#7#6'clNone'#11'ParentColor'
+ +#8#4'Left'#2#10#6'Height'#2#14#3'Top'#2'C'#5'Width'#3#186#0#0#0#6'TLabel'#6
+ +'Label2'#7'Caption'#6#18'Machine Identifier'#5'Color'#7#6'clNone'#11'ParentC'
+ +'olor'#8#4'Left'#2#10#6'Height'#2#14#3'Top'#2's'#5'Width'#2'W'#0#0#6'TLabel'
+ +#6'Label3'#7'Caption'#6'+Enter the release code you were given by us'#5'Colo'
+ +'r'#7#6'clNone'#11'ParentColor'#8#4'Left'#2#10#6'Height'#2#14#3'Top'#3#163#0
+ +#5'Width'#3#216#0#0#0#5'TEdit'#9'edtSerial'#9'MaxLength'#2#10#8'TabOrder'#2#1
+ +#4'Left'#2#10#6'Height'#2#24#3'Top'#2'S'#5'Width'#3#12#1#0#0#5'TMemo'#5'Memo'
+ +'1'#5'Color'#7#9'clBtnFace'#13'Lines.Strings'#1#6'*Thank you for registering'
+ +' HelloWorld. To '#6'.complete your registration, please contact us '#6#18
+ +'at (800) 555-1212.'#0#7'OnEnter'#7#10'Memo1Enter'#8'ReadOnly'#9#8'TabOrder'
+ +#2#0#7'TabStop'#8#4'Left'#2#10#6'Height'#2'1'#3'Top'#2#8#5'Width'#3#12#1#0#0
+ +#5'TEdit'#10'edtMachine'#8'ReadOnly'#9#7'TabStop'#8#8'TabOrder'#2#2#4'Left'#2
+ +#10#6'Height'#2#24#3'Top'#3#131#0#5'Width'#3#12#1#0#0#5'TEdit'#10'edtRelease'
+ +#9'MaxLength'#2#19#8'TabOrder'#2#3#4'Left'#2#10#6'Height'#2#24#3'Top'#3#179#0
+ +#5'Width'#3#12#1#0#0#7'TButton'#7'btnSave'#25'BorderSpacing.InnerBorder'#2#4
+ +#7'Caption'#6#4'Save'#7'OnClick'#7#12'btnSaveClick'#8'TabOrder'#2#4#4'Left'#3
+ +#203#0#6'Height'#2#25#3'Top'#3#215#0#5'Width'#2'K'#0#0#7'TButton'#9'btnReadm'
+ +'e'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#9'Readme...'#7'OnClick'#7
+ +#14'btnReadmeClick'#8'TabOrder'#2#5#4'Left'#2#10#6'Height'#2#25#3'Top'#3#215
+ +#0#5'Width'#2'K'#0#0#0
+]);
diff --git a/components/onguard/examples/regdemo/reg_main.pas b/components/onguard/examples/regdemo/reg_main.pas
new file mode 100644
index 000000000..84237d5d1
--- /dev/null
+++ b/components/onguard/examples/regdemo/reg_main.pas
@@ -0,0 +1,92 @@
+unit reg_main;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils, Classes,Controls, Forms, Dialogs,
+ StdCtrls,Buttons,LResources;
+
+type
+
+ { TregMain }
+
+ TregMain = class(TForm)
+ Label1: TLabel;
+ edtSerial: TEdit;
+ Memo1: TMemo;
+ Label2: TLabel;
+ edtMachine: TEdit;
+ Label3: TLabel;
+ edtRelease: TEdit;
+ btnSave: TButton;
+ btnReadme: TButton;
+ procedure Memo1Enter(Sender: TObject);
+ procedure FormActivate(Sender: TObject);
+ procedure btnSaveClick(Sender: TObject);
+ procedure btnReadmeClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ regMain: TregMain;
+
+implementation
+
+uses
+ uni_RegCommon, frm_Readme;
+
+
+
+procedure TregMain.FormActivate(Sender: TObject);
+begin
+ edtMachine.Text := format('%d',[MachineModifier]);
+end;
+
+procedure TregMain.Memo1Enter(Sender: TObject);
+begin
+ edtSerial.SetFocus;
+end;
+
+procedure TregMain.btnSaveClick(Sender: TObject);
+var
+ SerialNum : longint;
+begin
+ // Validate the serial number
+ try
+ SerialNum := StrToInt(edtSerial.Text);
+ except
+ MessageDlg('Invalid Serial Number. Please check your entry and try again.', mtError, [mbOK], 0);
+ edtSerial.SetFocus;
+ edtSerial.SelectAll;
+ exit;
+ end;
+
+ // Validate the release code
+ if not IsReleaseCodeValid (edtRelease.Text, SerialNum) then begin
+ MessageDlg('Invalid Release Code. Please check your entry and try again.', mtError, [mbOK], 0);
+ edtRelease.SetFocus;
+ edtRelease.Text := '';
+ exit;
+ end else begin
+ MessageDlg('Registration complete.', mtInformation, [mbOK], 0);
+ SaveRegistrationInformation(edtRelease.Text, SerialNum);
+ Close;
+ end;
+end;
+
+procedure TregMain.btnReadmeClick(Sender: TObject);
+begin
+ frmReadme.Show;
+end;
+
+
+initialization
+{$i reg_main.lrs}
+
+
+end.
diff --git a/components/onguard/examples/regdemo/registration.lpi b/components/onguard/examples/regdemo/registration.lpi
new file mode 100644
index 000000000..f0d9afe10
--- /dev/null
+++ b/components/onguard/examples/regdemo/registration.lpi
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/regdemo/registration.lpr b/components/onguard/examples/regdemo/registration.lpr
new file mode 100644
index 000000000..3d59eed76
--- /dev/null
+++ b/components/onguard/examples/regdemo/registration.lpr
@@ -0,0 +1,19 @@
+program Registration;
+
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ reg_main in 'reg_main.pas' {regMain},
+ uni_RegCommon in 'uni_RegCommon.pas',
+ frm_Readme in 'frm_Readme.pas' {frmReadme}, tponguard;
+
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TregMain, regMain);
+ Application.CreateForm(TfrmReadme, frmReadme);
+ Application.Run;
+end.
diff --git a/components/onguard/examples/regdemo/uni_regcommon.pas b/components/onguard/examples/regdemo/uni_regcommon.pas
new file mode 100644
index 000000000..1409e3510
--- /dev/null
+++ b/components/onguard/examples/regdemo/uni_regcommon.pas
@@ -0,0 +1,76 @@
+unit uni_RegCommon;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ OnGuard, OgUtil, Classes;
+
+var
+ MachineModifier : longint;
+ MachineKey : TKey;
+ Expires : TDateTime;
+ RegistrationInfo : TStringList;
+
+function IsReleaseCodeValid (ReleaseCodeString: string; const SerialNumber : longint) : boolean;
+procedure SaveRegistrationInformation (const ReleaseCodeString: string; const SerialNumber : longint);
+procedure GetRegistrationInformation (var ReleaseCodeString: string; var SerialNumber : longint);
+
+implementation
+
+uses
+ SysUtils;
+
+const
+ RegistrationFile = 'REGISTRATION.DAT';
+
+function IsReleaseCodeValid (ReleaseCodeString: string; const SerialNumber : longint) : boolean;
+var
+ CalculatedReleaseCode : TCode;
+begin
+ // Remove spaces from the Release code
+ while pos(' ', ReleaseCodeString) > 0 do
+ System.Delete(ReleaseCodeString, pos(' ', ReleaseCodeString), 1);
+
+ // Calculate the release code based on the serial number and the calculated machine modifier
+ InitSerialNumberCode(MachineKey, SerialNumber, Expires, CalculatedReleaseCode);
+
+ // Compare the two release codes
+ result := AnsiUpperCase(ReleaseCodeString) = AnsiUpperCase(BufferToHex(CalculatedReleaseCode, sizeof(CalculatedReleaseCode)));
+end;
+
+procedure SaveRegistrationInformation (const ReleaseCodeString: string; const SerialNumber : longint);
+begin
+ // Save the information for the application
+ RegistrationInfo := TStringList.Create;
+ RegistrationInfo.Add(format('%d',[SerialNumber]));
+ RegistrationInfo.Add(ANSIUpperCase(ReleaseCodeString));
+ RegistrationInfo.SaveToFile(RegistrationFile);
+ RegistrationInfo.Free;
+end;
+
+procedure GetRegistrationInformation (var ReleaseCodeString: string; var SerialNumber : longint);
+begin
+ // Save the information for the application
+ if FileExists(RegistrationFile) then begin
+ RegistrationInfo := TStringList.Create;
+ RegistrationInfo.LoadFromFile(RegistrationFile);
+ SerialNumber := StrToInt(RegistrationInfo[0]);
+ ReleaseCodeString := RegistrationInfo[1];
+ RegistrationInfo.Free;
+ end else begin
+ SerialNumber := 0;
+ ReleaseCodeString := '';
+ end;
+end;
+
+const
+ Key : TKey = ($3E,$C9,$18,$78,$7D,$AC,$AF,$D3,$64,$E0,$BC,$0A,$43,$68,$2C,$F2);
+initialization
+ Expires := 0;
+ MachineKey := Key;
+ MachineModifier := ABS(CreateMachineID([midUser, midSystem, {midNetwork,} midDrives]));
+ ApplyModifierToKeyPrim(MachineModifier,MachineKey,sizeof(MachineKey));
+end.
+
diff --git a/components/onguard/examples/stampexe/stampex1.lfm b/components/onguard/examples/stampexe/stampex1.lfm
new file mode 100644
index 000000000..4b20cdbdc
--- /dev/null
+++ b/components/onguard/examples/stampexe/stampex1.lfm
@@ -0,0 +1,104 @@
+object frmStamp: TfrmStamp
+ Left = 282
+ Height = 160
+ Top = 192
+ Width = 428
+ HorzScrollBar.Page = 427
+ HorzScrollBar.Range = 409
+ VertScrollBar.Page = 159
+ VertScrollBar.Range = 130
+ ActiveControl = FileEd
+ Caption = 'Stamp EXE'
+ Font.Color = clText
+ Font.Height = 11
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ OnCreate = FormCreate
+ ShowHint = True
+ object Label1: TLabel
+ Left = 8
+ Height = 13
+ Top = 8
+ Width = 105
+ Caption = '&EXE file to stamp'
+ Color = clNone
+ FocusControl = FileEd
+ ParentColor = False
+ end
+ object StatusLbl: TLabel
+ Left = 8
+ Height = 13
+ Top = 112
+ Width = 35
+ Caption = 'Status'
+ Color = clNone
+ ParentColor = False
+ end
+ object FileEd: TEdit
+ Left = 8
+ Height = 26
+ Hint = 'Enter EXE file name'
+ Top = 32
+ Width = 305
+ OnChange = FileEdChange
+ TabOrder = 0
+ end
+ object BrowseBtn: TBitBtn
+ Left = 320
+ Height = 25
+ Hint = 'Search for EXE file'
+ Top = 29
+ Width = 89
+ Caption = '&Browse'
+ NumGlyphs = 0
+ OnClick = BrowseBtnClick
+ TabOrder = 1
+ end
+ object StampBtn: TBitBtn
+ Left = 8
+ Height = 25
+ Hint = 'Stamp EXE wiht signature record'
+ Top = 72
+ Width = 89
+ Caption = '&Stamp'
+ NumGlyphs = 0
+ OnClick = StampBtnClick
+ TabOrder = 2
+ end
+ object CloseBtn: TBitBtn
+ Left = 320
+ Height = 25
+ Top = 104
+ Width = 89
+ Kind = bkClose
+ NumGlyphs = 0
+ TabOrder = 3
+ end
+ object ClearBtn: TBitBtn
+ Left = 104
+ Height = 25
+ Hint = 'Reset EXE''s stamped signature'
+ Top = 72
+ Width = 89
+ Caption = '&Clear'
+ NumGlyphs = 0
+ OnClick = ClearBtnClick
+ TabOrder = 4
+ end
+ object EraseMarkerCb: TCheckBox
+ Left = 184
+ Height = 22
+ Hint = 'Erase marker used to locate signature record'
+ Width = 108
+ Caption = 'Erase &Marker'
+ TabOrder = 5
+ end
+ object OpenDialog1: TOpenDialog
+ Title = 'Select EXE File to Stamp'
+ DefaultExt = '.exe'
+ Filter = 'EXE files (*.exe)|*.exe|All files (*.*)|*.*|Linux executable|*'
+ FilterIndex = 0
+ Options = [ofHideReadOnly, ofPathMustExist, ofFileMustExist]
+ left = 133
+ end
+end
diff --git a/components/onguard/examples/stampexe/stampex1.lrs b/components/onguard/examples/stampexe/stampex1.lrs
new file mode 100644
index 000000000..4e9bd5380
--- /dev/null
+++ b/components/onguard/examples/stampexe/stampex1.lrs
@@ -0,0 +1,33 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TfrmStamp','FORMDATA',[
+ 'TPF0'#9'TfrmStamp'#8'frmStamp'#4'Left'#3#26#1#6'Height'#3#160#0#3'Top'#3#192
+ +#0#5'Width'#3#172#1#18'HorzScrollBar.Page'#3#171#1#19'HorzScrollBar.Range'#3
+ +#153#1#18'VertScrollBar.Page'#3#159#0#19'VertScrollBar.Range'#3#130#0#13'Act'
+ +'iveControl'#7#6'FileEd'#7'Caption'#6#9'Stamp EXE'#10'Font.Color'#7#6'clText'
+ +#11'Font.Height'#2#11#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Pitch'#7#10'f'
+ +'pVariable'#8'OnCreate'#7#10'FormCreate'#8'ShowHint'#9#0#6'TLabel'#6'Label1'
+ +#4'Left'#2#8#6'Height'#2#13#3'Top'#2#8#5'Width'#2'i'#7'Caption'#6#18'&EXE fi'
+ +'le to stamp'#5'Color'#7#6'clNone'#12'FocusControl'#7#6'FileEd'#11'ParentCol'
+ +'or'#8#0#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Height'#2#13#3'Top'#2'p'#5'W'
+ +'idth'#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0
+ +#5'TEdit'#6'FileEd'#4'Left'#2#8#6'Height'#2#26#4'Hint'#6#19'Enter EXE file n'
+ +'ame'#3'Top'#2' '#5'Width'#3'1'#1#8'OnChange'#7#12'FileEdChange'#8'TabOrder'
+ +#2#0#0#0#7'TBitBtn'#9'BrowseBtn'#4'Left'#3'@'#1#6'Height'#2#25#4'Hint'#6#19
+ +'Search for EXE file'#3'Top'#2#29#5'Width'#2'Y'#7'Caption'#6#7'&Browse'#9'Nu'
+ +'mGlyphs'#2#0#7'OnClick'#7#14'BrowseBtnClick'#8'TabOrder'#2#1#0#0#7'TBitBtn'
+ +#8'StampBtn'#4'Left'#2#8#6'Height'#2#25#4'Hint'#6#31'Stamp EXE wiht signatur'
+ +'e record'#3'Top'#2'H'#5'Width'#2'Y'#7'Caption'#6#6'&Stamp'#9'NumGlyphs'#2#0
+ +#7'OnClick'#7#13'StampBtnClick'#8'TabOrder'#2#2#0#0#7'TBitBtn'#8'CloseBtn'#4
+ +'Left'#3'@'#1#6'Height'#2#25#3'Top'#2'h'#5'Width'#2'Y'#4'Kind'#7#7'bkClose'#9
+ +'NumGlyphs'#2#0#8'TabOrder'#2#3#0#0#7'TBitBtn'#8'ClearBtn'#4'Left'#2'h'#6'He'
+ +'ight'#2#25#4'Hint'#6#29'Reset EXE''s stamped signature'#3'Top'#2'H'#5'Width'
+ +#2'Y'#7'Caption'#6#6'&Clear'#9'NumGlyphs'#2#0#7'OnClick'#7#13'ClearBtnClick'
+ +#8'TabOrder'#2#4#0#0#9'TCheckBox'#13'EraseMarkerCb'#4'Left'#3#184#0#6'Height'
+ +#2#22#4'Hint'#6',Erase marker used to locate signature record'#5'Width'#2'l'
+ +#7'Caption'#6#13'Erase &Marker'#8'TabOrder'#2#5#0#0#11'TOpenDialog'#11'OpenD'
+ +'ialog1'#5'Title'#6#24'Select EXE File to Stamp'#10'DefaultExt'#6#4'.exe'#6
+ +'Filter'#6'>EXE files (*.exe)|*.exe|All files (*.*)|*.*|Linux executable|*'
+ +#11'FilterIndex'#2#0#7'Options'#11#14'ofHideReadOnly'#15'ofPathMustExist'#15
+ +'ofFileMustExist'#0#4'left'#3#133#0#0#0#0
+]);
diff --git a/components/onguard/examples/stampexe/stampex1.pas b/components/onguard/examples/stampexe/stampex1.pas
new file mode 100644
index 000000000..b82ca083d
--- /dev/null
+++ b/components/onguard/examples/stampexe/stampex1.pas
@@ -0,0 +1,86 @@
+unit STAMPEX1;
+
+interface
+
+uses
+ SysUtils, Classes,
+ Controls, Forms, Dialogs, StdCtrls, Buttons,LResources,
+ ogproexe;
+
+type
+
+ { TfrmStamp }
+
+ TfrmStamp = class(TForm)
+ FileEd: TEdit;
+ BrowseBtn: TBitBtn;
+ Label1: TLabel;
+ StampBtn: TBitBtn;
+ CloseBtn: TBitBtn;
+ ClearBtn: TBitBtn;
+ OpenDialog1: TOpenDialog;
+ EraseMarkerCb: TCheckBox;
+ StatusLbl: TLabel;
+ procedure BrowseBtnClick(Sender: TObject);
+ procedure StampBtnClick(Sender: TObject);
+ procedure ClearBtnClick(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure FileEdChange(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ frmStamp: TfrmStamp;
+
+implementation
+
+
+
+procedure TfrmStamp.BrowseBtnClick(Sender: TObject);
+begin
+ OpenDialog1.FileName := FileEd.Text;
+ if OpenDialog1.Execute then
+ FileEd.Text := OpenDialog1.Filename;
+end;
+
+procedure TfrmStamp.StampBtnClick(Sender: TObject);
+begin
+ if FileEd.Text <> '' then
+ if ProtectExe(FileEd.Text, EraseMarkerCb.Checked) then
+ StatusLbl.Caption := 'File marked'
+ else
+ StatusLbl.Caption := 'Error while attemping to mark file';
+end;
+
+procedure TfrmStamp.ClearBtnClick(Sender: TObject);
+begin
+ if FileEd.Text <> '' then
+ if UnprotectExe(FileEd.Text) then
+ StatusLbl.Caption := 'EXE file signature record reset'
+ else
+ StatusLbl.Caption := 'Error while attemping to reset signature record';
+end;
+
+procedure TfrmStamp.FormCreate(Sender: TObject);
+begin
+ StatusLbl.Caption := '';
+ FileEdChange(Sender);
+end;
+
+procedure TfrmStamp.FileEdChange(Sender: TObject);
+begin
+ StampBtn.Enabled := FileExists(FileEd.Text);
+ ClearBtn.Enabled := FileExists(FileEd.Text);
+ if FileExists(FileEd.Text) then
+ StatusLbl.Caption := 'Valid filename'
+ else
+ StatusLbl.Caption := 'Invalid filename';
+end;
+
+initialization
+{$i stampex1.lrs}
+
+end.
diff --git a/components/onguard/examples/stampexe/stampexe.lpi b/components/onguard/examples/stampexe/stampexe.lpi
new file mode 100644
index 000000000..565acf406
--- /dev/null
+++ b/components/onguard/examples/stampexe/stampexe.lpi
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/examples/stampexe/stampexe.lpr b/components/onguard/examples/stampexe/stampexe.lpr
new file mode 100644
index 000000000..ed88fe882
--- /dev/null
+++ b/components/onguard/examples/stampexe/stampexe.lpr
@@ -0,0 +1,15 @@
+program Stampexe;
+{$mode objfpc}{$H+}
+
+uses
+ Interfaces,
+ Forms,
+ STAMPEX1 in 'STAMPEX1.pas' {frmStamp}, tponguard;
+
+
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TfrmStamp, frmStamp);
+ Application.Run;
+end.
diff --git a/components/onguard/images/BuildRC.bat b/components/onguard/images/BuildRC.bat
new file mode 100644
index 000000000..852a1a361
--- /dev/null
+++ b/components/onguard/images/BuildRC.bat
@@ -0,0 +1,2 @@
+@echo OFF
+lazres controls.lrs TOGUSAGECODE.xpm TOGSPECIALCODE.xpm TOGSERIALNUMBERCODE.xpm TOGREGISTRATIONCODE.xpm TOGPROTECTEXE.xpm TOGNETCODE.xpm TOGMAKEKEYS.xpm TOGMAKECODES.xpm TOGDAYSCODE.xpm TOGDATECODE.xpm
\ No newline at end of file
diff --git a/components/onguard/images/TOGDATECODE.bmp b/components/onguard/images/TOGDATECODE.bmp
new file mode 100644
index 000000000..f5f60c1ea
Binary files /dev/null and b/components/onguard/images/TOGDATECODE.bmp differ
diff --git a/components/onguard/images/TOGDATECODE.xpm b/components/onguard/images/TOGDATECODE.xpm
new file mode 100644
index 000000000..cffa7f296
--- /dev/null
+++ b/components/onguard/images/TOGDATECODE.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static char *TOGDATECODE_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 24 24 16 1",
+/* colors */
+"` c #000000",
+". c #800000",
+"# c #008000",
+"a c #808000",
+"b c #000080",
+"c c #800080",
+"d c #008080",
+"e c #808080",
+"f c #c0c0c0",
+"g c #ff0000",
+"h c #00ff00",
+"i c #ffff00",
+"j c #0000ff",
+"k c #ff00ff",
+"l c #00ffff",
+"m c #ffffff",
+/* pixels */
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"a```aaaaa`aa`````a````aa",
+"a`aa`aaa``aaaa`aaa`aaaaa",
+"a`aa`aa`aa`aaa`aaa````aa",
+"a`aa`aa````aaa`aaa`aaaaa",
+"a`aa`aa`aa`aaa`aaa`aaaaa",
+"a```aa``aa``aa`aaa````aa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa"
+};
diff --git a/components/onguard/images/TOGDAYSCODE.bmp b/components/onguard/images/TOGDAYSCODE.bmp
new file mode 100644
index 000000000..fc2d8df21
Binary files /dev/null and b/components/onguard/images/TOGDAYSCODE.bmp differ
diff --git a/components/onguard/images/TOGDAYSCODE.xpm b/components/onguard/images/TOGDAYSCODE.xpm
new file mode 100644
index 000000000..ba44ff32f
--- /dev/null
+++ b/components/onguard/images/TOGDAYSCODE.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static char *TOGDAYSCODE_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 24 24 16 1",
+/* colors */
+"` c #000000",
+". c #800000",
+"# c #008000",
+"a c #808000",
+"b c #000080",
+"c c #800080",
+"d c #008080",
+"e c #808080",
+"f c #c0c0c0",
+"g c #ff0000",
+"h c #00ff00",
+"i c #ffff00",
+"j c #0000ff",
+"k c #ff00ff",
+"l c #00ffff",
+"m c #ffffff",
+/* pixels */
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"a```aaaa`aaa`aaa`a```aaa",
+"a`aa`aaa``aaa`a`aa`aa`aa",
+"a`aa`aa```aaa```aa``aaaa",
+"a`aa`aa`aa`aaa`aaaaa``aa",
+"a`aa`aa````aaa`aaa`aa`aa",
+"a```aa``aa``aa`aaa```aaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa"
+};
diff --git a/components/onguard/images/TOGMAKECODES.bmp b/components/onguard/images/TOGMAKECODES.bmp
new file mode 100644
index 000000000..e4c7570f2
Binary files /dev/null and b/components/onguard/images/TOGMAKECODES.bmp differ
diff --git a/components/onguard/images/TOGMAKECODES.xpm b/components/onguard/images/TOGMAKECODES.xpm
new file mode 100644
index 000000000..8e4b72aed
--- /dev/null
+++ b/components/onguard/images/TOGMAKECODES.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static char *TOGMAKECODES_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 24 24 16 1",
+/* colors */
+"` c #000000",
+". c #800000",
+"# c #008000",
+"a c #808000",
+"b c #000080",
+"c c #800080",
+"d c #008080",
+"e c #808080",
+"f c #c0c0c0",
+"g c #ff0000",
+"h c #00ff00",
+"i c #ffff00",
+"j c #0000ff",
+"k c #ff00ff",
+"l c #00ffff",
+"m c #ffffff",
+/* pixels */
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaaaaaaaaaaaaaamjaa",
+"abmmbaaajjjjjjjjaaabmmba",
+"aabbaajjjmmmmmmjjjaabbaa",
+"aaaaajjmmmm`emmmmjjaaaaa",
+"aaaajmmmmmmm`mmmmmjjaaaa",
+"aaajmm`emmmmmmmme`mmjaaa",
+"aaajmmm`mmmjjmmm`mmmjaaa",
+"aajjmmmmmjbbbbjmmmmmjjaa",
+"aabmmmmmjbbbbbbjmmmmmbaa",
+"aabmmmmmbbmbmbbbmmmmmbaa",
+"aabmemmmbmbmbmbbmm``mbaa",
+"aabm``mmbbmbmbmbmmmembaa",
+"aabmmmmmbmbmbmbbmmmmmbaa",
+"aabmmmmmj`mbmb`jmmmmmbaa",
+"aabbmmmmmj`jj`jmmmmmbbaa",
+"aaabmmm`mmj``jmm`emmbaaa",
+"aaabbm`emmmmmmmmm`mmbaaa",
+"aaaabbmmmmmm`mmmmmbbaaaa",
+"aaaaa``mmmmm`emmm``aaaaa",
+"aamjaa```mmmmmmm``aamjaa",
+"abmmbaaa````````aaabmmba",
+"aabbaaaaaaaaaaaaaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa"
+};
diff --git a/components/onguard/images/TOGMAKEKEYS.bmp b/components/onguard/images/TOGMAKEKEYS.bmp
new file mode 100644
index 000000000..5f484e916
Binary files /dev/null and b/components/onguard/images/TOGMAKEKEYS.bmp differ
diff --git a/components/onguard/images/TOGMAKEKEYS.xpm b/components/onguard/images/TOGMAKEKEYS.xpm
new file mode 100644
index 000000000..e8c4065a0
--- /dev/null
+++ b/components/onguard/images/TOGMAKEKEYS.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static char *TOGMAKEKEYS_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 24 24 16 1",
+/* colors */
+"` c #000000",
+". c #800000",
+"# c #008000",
+"a c #808000",
+"b c #000080",
+"c c #800080",
+"d c #008080",
+"e c #808080",
+"f c #c0c0c0",
+"g c #ff0000",
+"h c #00ff00",
+"i c #ffff00",
+"j c #0000ff",
+"k c #ff00ff",
+"l c #00ffff",
+"m c #ffffff",
+/* pixels */
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaamiiaaaa",
+"aaaaaaaaaaaaaaaamiiiaaaa",
+"aaaaaaaaaaaaaaamiii`aaaa",
+"aaaaaaaaaaaaaamiii`aaaaa",
+"aaaaaaaaaaaaamiii`aaaaaa",
+"aaaaaaammaamiiii`aaaaaaa",
+"aaaaamiiiiiiiii`aaaaaaaa",
+"aaaamiiiiiiiii`aaaaaaaaa",
+"aaaaiiiiiiiii``aaaaaaaaa",
+"aaamiiiiiiiii`aaaaaaaaaa",
+"aaamiiiiiiiiiiaaaaaaaaaa",
+"aaamii`aiiiii`aaaaaaaaaa",
+"aaamii`aaiiiiiaaaaaaaaaa",
+"aaaaii`aamiii`aaaaaaaaaa",
+"aaaaaiimmiii`aaaaaaaaaaa",
+"aaaaaai```i`aaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa"
+};
diff --git a/components/onguard/images/TOGNETCODE.bmp b/components/onguard/images/TOGNETCODE.bmp
new file mode 100644
index 000000000..6a7bca914
Binary files /dev/null and b/components/onguard/images/TOGNETCODE.bmp differ
diff --git a/components/onguard/images/TOGNETCODE.xpm b/components/onguard/images/TOGNETCODE.xpm
new file mode 100644
index 000000000..1a3cb012d
--- /dev/null
+++ b/components/onguard/images/TOGNETCODE.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static char *TOGNETCODE_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 24 24 16 1",
+/* colors */
+"` c #000000",
+". c #800000",
+"# c #008000",
+"a c #808000",
+"b c #000080",
+"c c #800080",
+"d c #008080",
+"e c #808080",
+"f c #c0c0c0",
+"g c #ff0000",
+"h c #00ff00",
+"i c #ffff00",
+"j c #0000ff",
+"k c #ff00ff",
+"l c #00ffff",
+"m c #ffffff",
+/* pixels */
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaa`aaa`aa````a`````aaa",
+"aaaa``aa`aa`aaaaaa`aaaaa",
+"aaaa`a`a`aa```aaaa`aaaaa",
+"aaaa`aa``aa`aaaaaa`aaaaa",
+"aaaa`aaa`aa`aaaaaa`aaaaa",
+"aaaa`aaa`aa````aaa`aaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa"
+};
diff --git a/components/onguard/images/TOGPROTECTEXE.bmp b/components/onguard/images/TOGPROTECTEXE.bmp
new file mode 100644
index 000000000..83c53a9c0
Binary files /dev/null and b/components/onguard/images/TOGPROTECTEXE.bmp differ
diff --git a/components/onguard/images/TOGPROTECTEXE.xpm b/components/onguard/images/TOGPROTECTEXE.xpm
new file mode 100644
index 000000000..21c328b4f
--- /dev/null
+++ b/components/onguard/images/TOGPROTECTEXE.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static char *TOGPROTECTEXE_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 24 24 16 1",
+/* colors */
+"` c #000000",
+". c #800000",
+"# c #008000",
+"a c #808000",
+"b c #000080",
+"c c #800080",
+"d c #008080",
+"e c #808080",
+"f c #c0c0c0",
+"g c #ff0000",
+"h c #00ff00",
+"i c #ffff00",
+"j c #0000ff",
+"k c #ff00ff",
+"l c #00ffff",
+"m c #ffffff",
+/* pixels */
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"a```aa```aaa```aa`aaa`aa",
+"a`aa`a`aa`a`aaa`aa`a`aaa",
+"a`aa`a`aa`a`aaa`aaa`aaaa",
+"a```aa```aa`aaa`aaa`aaaa",
+"a`aaaa`aa`a`aaa`aa`a`aaa",
+"a`aaaa`aa`aa```aa`aaa`aa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa"
+};
diff --git a/components/onguard/images/TOGREGISTRATIONCODE.bmp b/components/onguard/images/TOGREGISTRATIONCODE.bmp
new file mode 100644
index 000000000..0121cf631
Binary files /dev/null and b/components/onguard/images/TOGREGISTRATIONCODE.bmp differ
diff --git a/components/onguard/images/TOGREGISTRATIONCODE.xpm b/components/onguard/images/TOGREGISTRATIONCODE.xpm
new file mode 100644
index 000000000..6be769ce9
--- /dev/null
+++ b/components/onguard/images/TOGREGISTRATIONCODE.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static char *TOGREGISTRATIONCODE_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 24 24 16 1",
+/* colors */
+"` c #000000",
+". c #800000",
+"# c #008000",
+"a c #808000",
+"b c #000080",
+"c c #800080",
+"d c #008080",
+"e c #808080",
+"f c #c0c0c0",
+"g c #ff0000",
+"h c #00ff00",
+"i c #ffff00",
+"j c #0000ff",
+"k c #ff00ff",
+"l c #00ffff",
+"m c #ffffff",
+/* pixels */
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaa````aa````aa```aaaaa",
+"aaaa`aa``a`aaaa`aaa`aaaa",
+"aaaa`aaa`a```aa`aaaaaaaa",
+"aaaa````aa`aaaa`aa``aaaa",
+"aaaa`aaa`a`aaaa`aaa`aaaa",
+"aaaa`aaa`a````aa````aaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa"
+};
diff --git a/components/onguard/images/TOGSERIALNUMBERCODE.bmp b/components/onguard/images/TOGSERIALNUMBERCODE.bmp
new file mode 100644
index 000000000..e908a59b9
Binary files /dev/null and b/components/onguard/images/TOGSERIALNUMBERCODE.bmp differ
diff --git a/components/onguard/images/TOGSERIALNUMBERCODE.xpm b/components/onguard/images/TOGSERIALNUMBERCODE.xpm
new file mode 100644
index 000000000..b9752308c
--- /dev/null
+++ b/components/onguard/images/TOGSERIALNUMBERCODE.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static char *TOGSERIALNUMBERCODE_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 24 24 16 1",
+/* colors */
+"` c #000000",
+". c #800000",
+"# c #008000",
+"a c #808000",
+"b c #000080",
+"c c #800080",
+"d c #008080",
+"e c #808080",
+"f c #c0c0c0",
+"g c #ff0000",
+"h c #00ff00",
+"i c #ffff00",
+"j c #0000ff",
+"k c #ff00ff",
+"l c #00ffff",
+"m c #ffffff",
+/* pixels */
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaa```aa`aaa`aaaaaaa",
+"aaaaaa`aaa`a``aa`aaaaaaa",
+"aaaaaaa``aaa`a`a`aaaaaaa",
+"aaaaaaaa``aa`a`a`aaaaaaa",
+"aaaaaa`aaa`a`aa``aaaaaaa",
+"aaaaaaa```aa`aaa`aaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa"
+};
diff --git a/components/onguard/images/TOGSPECIALCODE.bmp b/components/onguard/images/TOGSPECIALCODE.bmp
new file mode 100644
index 000000000..3129a705a
Binary files /dev/null and b/components/onguard/images/TOGSPECIALCODE.bmp differ
diff --git a/components/onguard/images/TOGSPECIALCODE.xpm b/components/onguard/images/TOGSPECIALCODE.xpm
new file mode 100644
index 000000000..a3e5a6bf6
--- /dev/null
+++ b/components/onguard/images/TOGSPECIALCODE.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static char *TOGSPECIALCODE_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 24 24 16 1",
+/* colors */
+"` c #000000",
+". c #800000",
+"# c #008000",
+"a c #808000",
+"b c #000080",
+"c c #800080",
+"d c #008080",
+"e c #808080",
+"f c #c0c0c0",
+"g c #ff0000",
+"h c #00ff00",
+"i c #ffff00",
+"j c #0000ff",
+"k c #ff00ff",
+"l c #00ffff",
+"m c #ffffff",
+/* pixels */
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaa``aa```aa````aa```aaa",
+"aa`aa`a`aa`a`aaaa`aaa`aa",
+"aa``aaa`aa`a```aa`aaaaaa",
+"aaaa``a```aa`aaaa`aaaaaa",
+"aa`aa`a`aaaa`aaaa`aaa`aa",
+"aaa``aa`aaaa````aa```aaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa"
+};
diff --git a/components/onguard/images/TOGUSAGECODE.bmp b/components/onguard/images/TOGUSAGECODE.bmp
new file mode 100644
index 000000000..d0d7cfc8e
Binary files /dev/null and b/components/onguard/images/TOGUSAGECODE.bmp differ
diff --git a/components/onguard/images/TOGUSAGECODE.xpm b/components/onguard/images/TOGUSAGECODE.xpm
new file mode 100644
index 000000000..d7caae3ae
--- /dev/null
+++ b/components/onguard/images/TOGUSAGECODE.xpm
@@ -0,0 +1,47 @@
+/* XPM */
+static char *TOGUSAGECODE_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 24 24 16 1",
+/* colors */
+"` c #000000",
+". c #800000",
+"# c #008000",
+"a c #808000",
+"b c #000080",
+"c c #800080",
+"d c #008080",
+"e c #808080",
+"f c #c0c0c0",
+"g c #ff0000",
+"h c #00ff00",
+"i c #ffff00",
+"j c #0000ff",
+"k c #ff00ff",
+"l c #00ffff",
+"m c #ffffff",
+/* pixels */
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaa`aaa`aa```aaa```aaaaa",
+"aaa`aaa`a`aaa`a`aaa`aaaa",
+"aaa`aaa`aa``aaa`aaaaaaaa",
+"aaa`aaa`aaa```a`aa``aaaa",
+"aaa`aaa`a`aaa`a`aaa`aaaa",
+"aaaa```aaa```aaa```aaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa",
+"aamjaaaamjaaaamjaaaamjaa",
+"abmmbaabmmbaabmmbaabmmba",
+"aabbaaaabbaaaabbaaaabbaa",
+"aaaaaaaaaaaaaaaaaaaaaaaa"
+};
diff --git a/components/onguard/images/ogreg.lrs b/components/onguard/images/ogreg.lrs
new file mode 100644
index 000000000..504c09967
--- /dev/null
+++ b/components/onguard/images/ogreg.lrs
@@ -0,0 +1,190 @@
+LazarusResources.Add('TOGUSAGECODE','XPM',[
+ '/* XPM */'#10'static char *TOGUSAGECODE_xpm[] = {'#10'/* width height num_co'
+ +'lors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* co'
+ +'lors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #'
+ +'808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c '
+ +'#808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c'
+ +' #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m '
+ +'c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaam'
+ +'jaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaa'
+ +'bbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10
+ +'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaa'
+ +'aaaaaaaaaaaaaa",'#10'"aaa`aaa`aa```aaa```aaaaa",'#10'"aaa`aaa`a`aaa`a`aaa`a'
+ +'aaa",'#10'"aaa`aaa`aa``aaa`aaaaaaaa",'#10'"aaa`aaa`aaa```a`aa``aaaa",'#10'"'
+ +'aaa`aaa`a`aaa`a`aaa`aaaa",'#10'"aaaa```aaa```aaa```aaaaa",'#10'"aaaaaaaaaaa'
+ +'aaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaa'
+ +'aa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"a'
+ +'amjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaa'
+ +'aabbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGSPECIALCODE','XPM',[
+ '/* XPM */'#10'static char *TOGSPECIALCODE_xpm[] = {'#10'/* width height num_'
+ +'colors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* '
+ +'colors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c'
+ +' #808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e '
+ +'c #808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i'
+ +' c #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"'
+ +'m c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaa'
+ +'amjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaa'
+ +'aabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10
+ +'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaa'
+ +'aaaaaaaaaaaaaa",'#10'"aaa``aa```aa````aa```aaa",'#10'"aa`aa`a`aa`a`aaaa`aaa'
+ +'`aa",'#10'"aa``aaa`aa`a```aa`aaaaaa",'#10'"aaaa``a```aa`aaaa`aaaaaa",'#10'"'
+ +'aa`aa`a`aaaa`aaaa`aaa`aa",'#10'"aaa``aa`aaaa````aa```aaa",'#10'"aaaaaaaaaaa'
+ +'aaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaa'
+ +'aa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"a'
+ +'amjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaa'
+ +'aabbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGSERIALNUMBERCODE','XPM',[
+ '/* XPM */'#10'static char *TOGSERIALNUMBERCODE_xpm[] = {'#10'/* width height'
+ +' num_colors chars_per_pixel */'#10'" 24 24 16 1",'#10
+ +'/* colors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"'
+ +'a c #808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10
+ +'"e c #808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10
+ +'"i c #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10
+ +'"m c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaa'
+ +'aamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabba'
+ +'aaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'
+ +#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaa'
+ +'aaaaaaaaaaaaaaaaa",'#10'"aaaaaaa```aa`aaa`aaaaaaa",'#10'"aaaaaa`aaa`a``aa`a'
+ +'aaaaaa",'#10'"aaaaaaa``aaa`a`a`aaaaaaa",'#10'"aaaaaaaa``aa`a`a`aaaaaaa",'#10
+ +'"aaaaaa`aaa`a`aa``aaaaaaa",'#10'"aaaaaaa```aa`aaa`aaaaaaa",'#10'"aaaaaaaaaa'
+ +'aaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaa'
+ +'aaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"'
+ +'aamjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabba'
+ +'aaabbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGREGISTRATIONCODE','XPM',[
+ '/* XPM */'#10'static char *TOGREGISTRATIONCODE_xpm[] = {'#10'/* width height'
+ +' num_colors chars_per_pixel */'#10'" 24 24 16 1",'#10
+ +'/* colors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"'
+ +'a c #808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10
+ +'"e c #808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10
+ +'"i c #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10
+ +'"m c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaa'
+ +'aamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabba'
+ +'aaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'
+ +#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaa'
+ +'aaaaaaaaaaaaaaaaa",'#10'"aaaa````aa````aa```aaaaa",'#10'"aaaa`aa``a`aaaa`aa'
+ +'a`aaaa",'#10'"aaaa`aaa`a```aa`aaaaaaaa",'#10'"aaaa````aa`aaaa`aa``aaaa",'#10
+ +'"aaaa`aaa`a`aaaa`aaa`aaaa",'#10'"aaaa`aaa`a````aa````aaaa",'#10'"aaaaaaaaaa'
+ +'aaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaa'
+ +'aaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"'
+ +'aamjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabba'
+ +'aaabbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGPROTECTEXE','XPM',[
+ '/* XPM */'#10'static char *TOGPROTECTEXE_xpm[] = {'#10'/* width height num_c'
+ +'olors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* c'
+ +'olors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c '
+ +'#808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c'
+ +' #808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i '
+ +'c #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m'
+ +' c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaa'
+ +'mjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaa'
+ +'abbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10
+ +'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaa'
+ +'aaaaaaaaaaaaaa",'#10'"a```aa```aaa```aa`aaa`aa",'#10'"a`aa`a`aa`a`aaa`aa`a`'
+ +'aaa",'#10'"a`aa`a`aa`a`aaa`aaa`aaaa",'#10'"a```aa```aa`aaa`aaa`aaaa",'#10'"'
+ +'a`aaaa`aa`a`aaa`aa`a`aaa",'#10'"a`aaaa`aa`aa```aa`aaa`aa",'#10'"aaaaaaaaaaa'
+ +'aaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaa'
+ +'aa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"a'
+ +'amjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaa'
+ +'aabbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGNETCODE','XPM',[
+ '/* XPM */'#10'static char *TOGNETCODE_xpm[] = {'#10'/* width height num_colo'
+ +'rs chars_per_pixel */'#10'" 24 24 16 1",'#10'/* colo'
+ +'rs */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #80'
+ +'8000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c #8'
+ +'08080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c #'
+ +'ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m c '
+ +'#ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaamja'
+ +'aaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaabb'
+ +'aa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"a'
+ +'aaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaa'
+ +'aaaaaaaaaaaa",'#10'"aaaa`aaa`aa````a`````aaa",'#10'"aaaa``aa`aa`aaaaaa`aaaa'
+ +'a",'#10'"aaaa`a`a`aa```aaaa`aaaaa",'#10'"aaaa`aa``aa`aaaaaa`aaaaa",'#10'"aa'
+ +'aa`aaa`aa`aaaaaa`aaaaa",'#10'"aaaa`aaa`aa````aaa`aaaaa",'#10'"aaaaaaaaaaaaa'
+ +'aaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa'
+ +'",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aam'
+ +'jaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaa'
+ +'bbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGMAKEKEYS','XPM',[
+ '/* XPM */'#10'static char *TOGMAKEKEYS_xpm[] = {'#10'/* width height num_col'
+ +'ors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* col'
+ +'ors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #8'
+ +'08000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c #'
+ +'808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c '
+ +'#ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m c'
+ +' #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaamj'
+ +'aaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaab'
+ +'baa",'#10'"aaaaaaaaaaaaaaaaamiiaaaa",'#10'"aaaaaaaaaaaaaaaamiiiaaaa",'#10'"'
+ +'aaaaaaaaaaaaaaamiii`aaaa",'#10'"aaaaaaaaaaaaaamiii`aaaaa",'#10'"aaaaaaaaaaa'
+ +'aamiii`aaaaaa",'#10'"aaaaaaammaamiiii`aaaaaaa",'#10'"aaaaamiiiiiiiii`aaaaaa'
+ +'aa",'#10'"aaaamiiiiiiiii`aaaaaaaaa",'#10'"aaaaiiiiiiiii``aaaaaaaaa",'#10'"a'
+ +'aamiiiiiiiii`aaaaaaaaaa",'#10'"aaamiiiiiiiiiiaaaaaaaaaa",'#10'"aaamii`aiiii'
+ +'i`aaaaaaaaaa",'#10'"aaamii`aaiiiiiaaaaaaaaaa",'#10'"aaaaii`aamiii`aaaaaaaaa'
+ +'a",'#10'"aaaaaiimmiii`aaaaaaaaaaa",'#10'"aaaaaai```i`aaaaaaaaaaaa",'#10'"aa'
+ +'aaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaa'
+ +'bmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaabbaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGMAKECODES','XPM',[
+ '/* XPM */'#10'static char *TOGMAKECODES_xpm[] = {'#10'/* width height num_co'
+ +'lors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* co'
+ +'lors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #'
+ +'808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c '
+ +'#808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c'
+ +' #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m '
+ +'c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaaa'
+ +'aaaaaaaaaaamjaa",'#10'"abmmbaaajjjjjjjjaaabmmba",'#10'"aabbaajjjmmmmmmjjjaa'
+ +'bbaa",'#10'"aaaaajjmmmm`emmmmjjaaaaa",'#10'"aaaajmmmmmmm`mmmmmjjaaaa",'#10
+ +'"aaajmm`emmmmmmmme`mmjaaa",'#10'"aaajmmm`mmmjjmmm`mmmjaaa",'#10'"aajjmmmmmj'
+ +'bbbbjmmmmmjjaa",'#10'"aabmmmmmjbbbbbbjmmmmmbaa",'#10'"aabmmmmmbbmbmbbbmmmmm'
+ +'baa",'#10'"aabmemmmbmbmbmbbmm``mbaa",'#10'"aabm``mmbbmbmbmbmmmembaa",'#10'"'
+ +'aabmmmmmbmbmbmbbmmmmmbaa",'#10'"aabmmmmmj`mbmb`jmmmmmbaa",'#10'"aabbmmmmmj`'
+ +'jj`jmmmmmbbaa",'#10'"aaabmmm`mmj``jmm`emmbaaa",'#10'"aaabbm`emmmmmmmmm`mmba'
+ +'aa",'#10'"aaaabbmmmmmm`mmmmmbbaaaa",'#10'"aaaaa``mmmmm`emmm``aaaaa",'#10'"a'
+ +'amjaa```mmmmmmm``aamjaa",'#10'"abmmbaaa````````aaabmmba",'#10'"aabbaaaaaaaa'
+ +'aaaaaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGDAYSCODE','XPM',[
+ '/* XPM */'#10'static char *TOGDAYSCODE_xpm[] = {'#10'/* width height num_col'
+ +'ors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* col'
+ +'ors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #8'
+ +'08000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c #'
+ +'808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c '
+ +'#ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m c'
+ +' #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaamj'
+ +'aaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaab'
+ +'baa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"'
+ +'aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaa'
+ +'aaaaaaaaaaaaa",'#10'"a```aaaa`aaa`aaa`a```aaa",'#10'"a`aa`aaa``aaa`a`aa`aa`'
+ +'aa",'#10'"a`aa`aa```aaa```aa``aaaa",'#10'"a`aa`aa`aa`aaa`aaaaa``aa",'#10'"a'
+ +'`aa`aa````aaa`aaa`aa`aa",'#10'"a```aa``aa``aa`aaa```aaa",'#10'"aaaaaaaaaaaa'
+ +'aaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaa'
+ +'a",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aa'
+ +'mjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaa'
+ +'abbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGDATECODE','XPM',[
+ '/* XPM */'#10'static char *TOGDATECODE_xpm[] = {'#10'/* width height num_col'
+ +'ors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* col'
+ +'ors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #8'
+ +'08000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c #'
+ +'808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c '
+ +'#ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m c'
+ +' #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaamj'
+ +'aaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaab'
+ +'baa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"'
+ +'aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaa'
+ +'aaaaaaaaaaaaa",'#10'"a```aaaaa`aa`````a````aa",'#10'"a`aa`aaa``aaaa`aaa`aaa'
+ +'aa",'#10'"a`aa`aa`aa`aaa`aaa````aa",'#10'"a`aa`aa````aaa`aaa`aaaaa",'#10'"a'
+ +'`aa`aa`aa`aaa`aaa`aaaaa",'#10'"a```aa``aa``aa`aaa````aa",'#10'"aaaaaaaaaaaa'
+ +'aaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaa'
+ +'a",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aa'
+ +'mjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaa'
+ +'abbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
diff --git a/components/onguard/packages/tponguard.lpk b/components/onguard/packages/tponguard.lpk
new file mode 100644
index 000000000..6df589cce
--- /dev/null
+++ b/components/onguard/packages/tponguard.lpk
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/onguard/packages/tponguard.pas b/components/onguard/packages/tponguard.pas
new file mode 100644
index 000000000..25b7f1930
--- /dev/null
+++ b/components/onguard/packages/tponguard.pas
@@ -0,0 +1,23 @@
+{ This file was automatically created by Lazarus. Do not edit!
+This source is only used to compile and install the package.
+ }
+
+unit tponguard;
+
+interface
+
+uses
+ ogfile, ognetwrk, ogproexe, ogreg, ogutil, qogabout0, qonguard1, qonguard2,
+ qonguard3, qonguard4, qonguard5, qonguard6, qonguard7, ogconst, onguard,
+ LazarusPackageIntf;
+
+implementation
+
+procedure Register;
+begin
+ RegisterUnit('ogreg', @ogreg.Register);
+end;
+
+initialization
+ RegisterPackage('tponguard', @Register);
+end.
diff --git a/components/onguard/readme.txt b/components/onguard/readme.txt
new file mode 100644
index 000000000..90fa791bc
--- /dev/null
+++ b/components/onguard/readme.txt
@@ -0,0 +1,59 @@
+TurboPower OnGuard Free Pascal/Lazarus version
+
+
+Table of contents
+
+1. Introduction
+2. Package names
+3. Installation
+4. Version history
+4.1 Release 1.13
+
+==============================================
+
+
+1. Introduction
+
+
+OnGuard is a library to create demo versions of your Borland Delphi &
+Kylix & Lazarus applications. Create demo versions that are time-limited,
+feature-limited, limited to a certain number of uses, or limited to a
+certain # of concurrent network users.
+
+This is a source-only release of TurboPower OnGuard ported to Lazarus. It includes
+package for Lazarus 0.9.16 official installer (and should run fine on later versions too)
+
+==============================================
+
+2. Installation
+
+
+To install TurboPower OnGuard into your IDE, take the following steps:
+
+ 1. Unzip the release files into a directory (the best it \components subdirectory of Lazarus tree).
+
+ 2. Start Lazarus.
+
+ 3. Open & install the package.This require Lazarus IDE rebuild.
+
+==============================================
+
+4. Version history
+
+
+4.2 October 31, 2008
+
+ Import into lazarus-ccr SVN repository.
+
+
+4.1 June 4 , 2006
+
+ Conversion to Free Pascal / Lazarus
+ -------------------------------------------------------------
+ Contributor : Boguslaw Brandys
+ Based on Kylix version by Andrew Haines
+
+
+TODO :
+ - compilation under Linux + fixes (implement LockFile functions)
+ - testing
\ No newline at end of file
diff --git a/components/onguard/source/code.bmp b/components/onguard/source/code.bmp
new file mode 100644
index 000000000..c04b3b0f7
Binary files /dev/null and b/components/onguard/source/code.bmp differ
diff --git a/components/onguard/source/copy.bmp b/components/onguard/source/copy.bmp
new file mode 100644
index 000000000..ca1506067
Binary files /dev/null and b/components/onguard/source/copy.bmp differ
diff --git a/components/onguard/source/key.bmp b/components/onguard/source/key.bmp
new file mode 100644
index 000000000..4ee020dc6
Binary files /dev/null and b/components/onguard/source/key.bmp differ
diff --git a/components/onguard/source/ogconst.inc b/components/onguard/source/ogconst.inc
new file mode 100644
index 000000000..1c5b8f7a0
--- /dev/null
+++ b/components/onguard/source/ogconst.inc
@@ -0,0 +1,35 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * ***** END LICENSE BLOCK ***** *)
+const
+ SCNoOnCheck = 0;
+ SCNoOnGetCode = 1;
+ SCNoOnGetKey = 2;
+ SCNoOnChangeCode = 3;
+ SCDeleteQuery = 4;
+ SCInvalidStartDate = 5;
+ SCInvalidEndDate = 6;
+ SCInvalidKeyOrModifier = 7;
+ SCInvalidExDate = 8;
+ SCNoOnGetFileName = 9; {!!.02}
\ No newline at end of file
diff --git a/components/onguard/source/ogconst.pas b/components/onguard/source/ogconst.pas
new file mode 100644
index 000000000..114b346a7
--- /dev/null
+++ b/components/onguard/source/ogconst.pas
@@ -0,0 +1,71 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* OGCONST.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I onguard.inc}
+
+
+
+unit ogconst;
+ {-Resource constants}
+
+interface
+
+resourcestring
+ SCNoOnCheck = '%s has no OnChecked event handler assigned';
+ SCNoOnGetCode = '%s has no OnGetCode event handler assigned';
+ SCNoOnGetKey = '%s has no OnGetKey event handler assigned';
+ SCNoOnChangeCode = '%s has no OnChangeCode event handler assigned';
+ SCDeleteQuery = 'Are you sure you want to delete this item?';
+ SCInvalidStartDate = 'Invalid start date';
+ SCInvalidEndDate = 'Invalid end date';
+ SCInvalidKeyOrModifier = 'Invalid key or modifier';
+ SCInvalidExDate = 'Invalid expiration date';
+ SCNoOnGetFileName = 'FileName is empty and OnGetFileName is not assigned';
+
+
+
+const
+ {ini file name used to store application keys}
+ OgKeyFile = 'ONGUARD.INI';
+ {name of section that stores application keys}
+ OgKeySection = 'Keys';
+
+
+
+
+
+
+implementation
+
+end.
diff --git a/components/onguard/source/ogconst.rst b/components/onguard/source/ogconst.rst
new file mode 100644
index 000000000..7d014ab31
--- /dev/null
+++ b/components/onguard/source/ogconst.rst
@@ -0,0 +1,41 @@
+
+# hash value = 144673572
+ogconst.scnooncheck='%s has no OnChecked event handler assigned'
+
+
+# hash value = 198007652
+ogconst.scnoongetcode='%s has no OnGetCode event handler assigned'
+
+
+# hash value = 70606420
+ogconst.scnoongetkey='%s has no OnGetKey event handler assigned'
+
+
+# hash value = 256936516
+ogconst.scnoonchangecode='%s has no OnChangeCode event handler assigned'
+
+
+# hash value = 126448559
+ogconst.scdeletequery='Are you sure you want to delete this item?'
+
+
+# hash value = 50645509
+ogconst.scinvalidstartdate='Invalid start date'
+
+
+# hash value = 206359333
+ogconst.scinvalidenddate='Invalid end date'
+
+
+# hash value = 209699650
+ogconst.scinvalidkeyormodifier='Invalid key or modifier'
+
+
+# hash value = 27791925
+ogconst.scinvalidexdate='Invalid expiration date'
+
+
+# hash value = 22975892
+ogconst.scnoongetfilename='FileName is empty and OnGetFileName is not ass'+
+'igned'
+
diff --git a/components/onguard/source/ogfile.pas b/components/onguard/source/ogfile.pas
new file mode 100644
index 000000000..2ab32c661
--- /dev/null
+++ b/components/onguard/source/ogfile.pas
@@ -0,0 +1,204 @@
+(****** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* OGFILE.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I ONGUARD.INC}
+
+
+unit ogfile; {AH.01}
+
+
+interface
+
+uses
+ {$IFDEF MSWINDOWS} Windows, {$ENDIF} {AH.01}
+ {$IFDEF LINUX} BaseUnix, {$ENDIF} {AH.01}
+ SysUtils,
+ ogutil; {AH.01}
+
+
+function GetFileSize(Handle : THandle) : Cardinal;
+
+{$IFNDEF Win32}
+function LockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD;
+ nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWORD): Boolean;
+function UnlockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD;
+ nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh: DWORD): Boolean;
+{
+function LockFile(Handle : THandle; FileOffsetLow, FileOffsetHigh,
+ LockCountLow, LockCountHigh : Word) : Boolean;
+function UnlockFile(Handle : THandle; FileOffsetLow, FileOffsetHigh,
+ UnLockCountLow, UnLockCountHigh : Word) : Boolean;
+}
+function FlushFileBuffers(Handle : THandle) : Boolean;
+{$ENDIF}
+
+
+
+implementation
+
+
+function GetFileSize(Handle : THandle) : Cardinal;
+{$IFDEF Win32}
+begin
+ Result := Windows.GetFileSize(Handle, nil);
+{$ELSE}
+var
+ Save : LongInt;
+begin
+ Save := FileSeek(Handle, 0, 0); {save current file position}
+ Result := FileSeek(Handle, 0, 2); {get file size}
+ FileSeek(Handle, Save, 0); {restore previous position}
+{$ENDIF}
+end;
+
+
+
+{$IFNDEF WIN32}
+
+
+{$ifdef FPC}
+const
+ F_RDLCK = 0;
+ F_WRLCK = 1;
+ F_UNLCK = 2;
+ F_EXLCK = 4;
+ F_SHLCK = 8;
+
+ LOCK_SH = 1;
+ LOCK_EX = 2;
+ LOCK_NB = 4;
+ LOCK_UN = 8;
+
+ LOCK_MAND = 32;
+ LOCK_READ = 64;
+ LOCK_WRITE = 128;
+ LOCK_RW = 192;
+
+ EACCES = ESysEACCES;
+ EAGAIN = ESysEAGAIN;
+{$endif}
+
+
+
+function GetLastError: Integer;
+begin
+ Result := FpGetErrno;
+end;
+
+procedure SetLastError(Value: Integer);
+begin
+ FpSetErrno(Value);
+end;
+
+function LockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD; nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWORD): Boolean;
+var
+ FLockInfo: {$ifdef FPC}BaseUnix.FLock{$else}TFLock{$endif};
+ FLastError: Cardinal;
+begin
+ Result := false;
+ FLockInfo.l_type := F_WRLCK;
+ FLockInfo.l_whence := SEEK_SET;
+ FLockInfo.l_start := dwFileOffsetLow;
+ FLockInfo.l_len := nNumberOfBytesToLockLow;
+ FLockInfo.l_pid := {$ifdef FPC}fpgetpid{$else}getpid{$endif}();
+ Result := {$ifdef FPC}fpfcntl{$else}fcntl{$endif}(hFile, F_SETLK, FLockInfo) <> -1;
+ if not Result then
+ begin
+ FLastError := GetLastError();
+ if (FLastError = EACCES) or (FLastError = EAGAIN) then
+ SetLastError(ESysEACCES)
+ else
+ Result := True; // If errno is ENOLCK or EINVAL
+ end;
+end;
+
+function UnlockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD; nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh: DWORD): Boolean;
+var
+ FLockInfo: {$ifdef FPC}BaseUnix.FLock{$else}TFLock{$endif};
+begin
+ FLockInfo.l_type := F_UNLCK;
+ FLockInfo.l_whence := SEEK_SET;
+ FLockInfo.l_start := dwFileOffsetLow;
+ FLockInfo.l_len := nNumberOfBytesToUnLockLow;
+ FLockInfo.l_pid := {$ifdef FPC}fpgetpid{$else}getpid{$endif}();
+ Result := {$ifdef FPC}fpfcntl{$else}fcntl{$endif}(hFile, F_SETLK, FLockInfo) <> -1;
+end;
+
+
+
+
+{
+function LockFile(Handle : THandle;
+ FileOffsetLow, FileOffsetHigh,
+ LockCountLow, LockCountHigh : Word) : Boolean;
+var
+ LockVar : TFlock;
+begin
+ LockVar.l_whence := SEEK_SET;
+ LockVar.l_start := FileOffSetHigh;
+ LockVar.l_start := (LockVar.l_start shl 16) + FileOffSetLow;
+ LockVar.l_len := LockCountHigh;
+ LockVar.l_len := (LockVar.l_len shl 16) + LockCountLow;
+ LockVar.l_type := F_WRLCK;
+
+ if fcntl(Handle, F_SETLK, LockVar) = 0 then Result := True else Result := False;
+end;
+
+function UnlockFile(Handle : THandle;
+ FileOffsetLow, FileOffsetHigh,
+ UnLockCountLow, UnLockCountHigh : Word) : Boolean;
+var
+ LockVar : TFlock;
+begin
+
+ LockVar.l_whence := SEEK_SET;
+ LockVar.l_start := FileOffSetHigh;
+ LockVar.l_start := (LockVar.l_start shl 16) + FileOffSetLow;
+ LockVar.l_len := UnLockCountHigh;
+ LockVar.l_len := (LockVar.l_len shl 16) + UnLockCountLow;
+ LockVar.l_type := F_UNLCK;
+
+ if fcntl(Handle, F_SETLK, LockVar) = 0 then Result := True else Result := False;
+end;
+}
+
+function FlushFileBuffers(Handle : THandle) : Boolean;
+begin
+ Result := True;
+end;
+{$ENDIF}
+
+
+
+end.
diff --git a/components/onguard/source/ogfirst.pas b/components/onguard/source/ogfirst.pas
new file mode 100644
index 000000000..77f1ebb60
--- /dev/null
+++ b/components/onguard/source/ogfirst.pas
@@ -0,0 +1,202 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * January 1, 2004 {AH.01}
+ * Boguslaw Brandys conversion to FPC
+ * June 14, 2006
+ *
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* OGFIRST.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I onguard.inc}
+
+
+unit ogfirst;
+ {-limit instance routines}
+
+interface
+
+uses
+{$IFDEF MSWINDOWS} {AH.01}
+ Windows, {AH.01}
+{$ENDIF} {AH.01}
+{$IFDEF LINUX} {AH.01}
+ BaseUnix,
+ Libc,//only because S_IRWXU was missing from baseunix under 0.9.16
+ //fix it later
+{$ENDIF} {AH.01}
+ Forms, SysUtils, Dialogs,LClProc;
+
+{detect/Activate instance routines}
+function IsFirstInstance: Boolean;
+procedure ActivateFirstInstance;
+{!!.04} {revised Win16 version}
+
+
+const
+ MAGIC = 'MAGIC'; {change this code to differentiate applications}
+
+implementation
+
+
+{$IFDEF Win32}
+var
+ FirstInstance : Boolean;
+ InstanceMutex : THandle;
+{$ENDIF}
+
+{$IFDEF LINUX}
+var
+ FirstInstance : Boolean;
+ server_name : String;
+ server_lock : Integer;
+
+{$ENDIF}
+
+{limit instances routines}
+function IsFirstInstance : Boolean;
+begin
+ {$IFDEF Win32}
+ Result := FirstInstance;
+ {$ELSE}
+ {$IFDEF LINUX}
+ Result := FirstInstance;
+ {$ELSE}
+ Result := HPrevInst = 0;
+ {$ENDIF}
+ {$ENDIF}
+end;
+
+{$IFDEF Win32}
+procedure ActivateFirstInstance;
+var
+ ClassBuf,
+ WindowBuf : array [0..255] of AnsiChar;
+ Wnd,
+ TopWnd : hWnd;
+ ThreadID : DWord; {!!.07}
+begin
+try
+ if IsFirstInstance then begin
+ if IsIconic(HWND(Application.MainForm.Handle)) then
+ ShowWindow(HWND(Application.MainForm.Handle), SW_RESTORE)// Application.Restore
+ else
+ Application.BringToFront;
+ end else begin
+ GetClassName(HWND(Application.MainForm.Handle), ClassBuf, SizeOf(ClassBuf));
+ GetWindowText(HWND(Application.MainForm.Handle), WindowBuf, SizeOf(WindowBuf));
+ Wnd := FindWindow(ClassBuf, WindowBuf);
+ if (Wnd <> 0) then begin
+ GetWindowThreadProcessId(Wnd, @ThreadID);
+ if (ThreadID = GetCurrentProcessId) then begin
+ Wnd := FindWindowEx(0, Wnd, ClassBuf, WindowBuf);
+ if (Wnd <> 0) then
+ if IsIconic(Wnd) then
+ ShowWindow(Wnd, SW_RESTORE)
+ else begin
+ SetForegroundWindow(Wnd); {!!.09}
+ TopWnd := GetLastActivePopup(Wnd);
+ if (TopWnd <> 0) and (TopWnd <> Wnd) and
+ IsWindowVisible(TopWnd) and IsWindowEnabled(TopWnd) then
+ BringWindowToTop(TopWnd)
+ else
+ BringWindowToTop(Wnd);
+ end;
+ end;
+ end;
+ end;
+except on E:Exception do
+ DebugLn('ActivateFirstInstance exception : ' + E.Message + '.Move IsFirstInstance after CreateForm for MainForm');
+end;
+end;
+{$ELSE}
+procedure ActivateFirstInstance;
+begin
+ //[to do] Find and Activate the first instance of the application
+
+ //look at the owner of the socket
+ //look at the running processes
+end;
+{$ENDIF}
+
+
+
+
+{$IFDEF Win32}
+function GetMutexName : string;
+var
+ WindowBuf : array [0..512] of AnsiChar;
+begin
+try
+ {GetWindowText(HWND(Application.MainForm.Handle), WindowBuf, SizeOf(WindowBuf));}
+ Result := 'PREVINST:' + ExtractFileName(ParamStr(0)) + MAGIC;
+except on E:Exception do
+ DebugLn('GetMutexName exception : ' + E.Message);
+end;
+end;
+
+
+initialization
+ InstanceMutex := CreateMutex(nil, True, PAnsiChar(GetMutexName));
+ if (InstanceMutex <> 0) and (GetLastError = 0) then
+ FirstInstance := True
+ else
+ FirstInstance := False;
+
+finalization
+ if (InstanceMutex <> 0) then
+ CloseHandle(InstanceMutex);
+{$ENDIF}
+
+{$IFDEF LINUX}
+initialization
+
+ server_name := ExtractFilePath(ParamStr(0)) + ExtractFileName(ParamStr(0)) + '.lck';
+ server_lock := fpopen(PChar(server_name), O_RDWR or O_CREAT or O_TRUNC or O_NOFOLLOW or O_EXCL, S_IRWXU);
+ if (server_lock = -1) then
+ begin
+ FirstInstance := False;
+ DebugLn('Failed to create lock file. (' + IntToHex(errno,4) + ')' + #10 + server_name);
+ end
+ else
+ begin
+ FirstInstance := True;
+ end;
+
+finalization
+ if (server_lock > -1) then
+ begin
+ FileClose(server_lock);
+ unlink(PChar(server_name));
+ end;
+
+{$ENDIF}
+
+end.
diff --git a/components/onguard/source/ogkeyini.inc b/components/onguard/source/ogkeyini.inc
new file mode 100644
index 000000000..abc982f3d
--- /dev/null
+++ b/components/onguard/source/ogkeyini.inc
@@ -0,0 +1,26 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * ***** END LICENSE BLOCK ***** *)
+
+
diff --git a/components/onguard/source/ognetwrk.pas b/components/onguard/source/ognetwrk.pas
new file mode 100644
index 000000000..d1bff251f
--- /dev/null
+++ b/components/onguard/source/ognetwrk.pas
@@ -0,0 +1,551 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* OGNETWRK.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I ONGUARD.INC}
+
+
+unit ognetwrk;
+ {-network file routines}
+
+interface
+
+uses
+{$IFDEF MSWINDOWS} {AH.01}
+ Windows, {AH.01}
+{$ENDIF} {AH.01}
+ Classes, SysUtils,
+ ogconst,
+ ogutil,
+ onguard;
+
+type
+ TNetAccess = packed record
+ Fh : Integer;
+ Key : TKey;
+ CheckValue : Word;
+ Index : Word;
+ end;
+
+ TNetAccessInfo = packed record
+ Total : Cardinal;
+ Locked : Cardinal;
+ Invalid : Cardinal;
+ end;
+
+type
+ TGetFileNameEvent = {!!.02}
+ procedure(Sender : TObject; var Value : string) {!!.02}
+ of object; {!!.02}
+
+ TOgNetCode = class(TOgCodeBase)
+ protected {private}
+ {property variables}
+ FFileName : string;
+
+ {event variables} {!!.02}
+ FOnGetFileName : TGetFileNameEvent; {!!.02}
+
+ {internal variables}
+ nacNetAccess : TNetAccess;
+ nacNetAccessInfo : TNetAccessInfo;
+
+ {property methods}
+ function GetActiveUsers : LongInt;
+ function GetInvalidUsers : LongInt;
+ function GetMaxUsers : LongInt;
+
+ protected
+ procedure Loaded;
+ override;
+
+ function DoOnGetFileName : string; {!!.02}
+ dynamic; {!!.02}
+
+ public
+ constructor Create(AOwner : TComponent); {!!.01}
+ override;
+ destructor Destroy;
+ override;
+
+ function CheckCode(Report : Boolean) : TCodeStatus;
+ override;
+ function CreateAccessFile : Boolean;
+ {-creates the net access file}
+ function IsRemoteDrive(const ExePath : string) : Boolean;
+ {-returns True if the application is running on a remote drive}
+ function ResetAccessFile : Boolean;
+ {-rewrites the net access file, returning True if successful}
+
+ property ActiveUsers : LongInt
+ read GetActiveUsers;
+
+ property InvalidUsers : LongInt
+ read GetInvalidUsers;
+
+ property MaxUsers : LongInt
+ read GetMaxUsers;
+
+ published
+ {properties}
+ property Code
+ stored FStoreCode;
+
+ property FileName : string
+ read FFileName
+ write FFileName;
+
+ property StoreCode
+ default DefStoreCode;
+
+ {events}
+ property OnGetFileName : TGetFileNameEvent {!!.02}
+ read FOnGetFileName {!!.02}
+ write FOnGetFileName; {!!.02}
+ end;
+
+{network user access/count routines}
+function CheckNetAccessFile(const NetAccess : TNetAccess) : Boolean;
+ {-verifies that the NetAccess record provides authorized use}
+function CreateNetAccessFile(const FileName : string; const Key : TKey; Count : Word) : Boolean;
+ {-creates the net access file as FileName using Key for encryption}
+function CreateNetAccessFileEx(const FileName : string; const Key : TKey;
+ const Code : TCode) : Boolean;
+ {-creates the net access file getting the user count from a previously encoded Code block}
+function DecodeNAFCountCode(const Key : TKey; const Code : TCode) : LongInt;
+ {-returns the user count from a previously encoded Code block}
+procedure EncodeNAFCountCode(const Key : TKey; Count : Cardinal; var Code : TCode);
+ {-creates an encoded Code block for Count users}
+function GetNetAccessFileInfo(const FileName : string; const Key : TKey;
+ var NetAccessInfo : TNetAccessInfo) : Boolean;
+ {-fills a TNetAccessInfo structure. returns Fasle on error}
+function IsAppOnNetwork(const ExePath : string) : Boolean;
+ {-returns True if the application is running on a netword drive}
+function LockNetAccessFile(const FileName : string; const Key : TKey; var NetAccess : TNetAccess) : Boolean;
+ {-locks a record in FileName and fills NetAccess. returns False on error}
+function ResetNetAccessFile(const FileName : string; const Key : TKey) : Boolean;
+ {-rewrites the net access file contents}
+function UnlockNetAccessFile(var NetAccess : TNetAccess) : Boolean;
+ {-unlocks the net access record defined by NetAccess. returns False on error}
+
+
+implementation
+
+
+{*** TOgNetCode ***}
+
+function TOgNetCode.CheckCode(Report : Boolean) : TCodeStatus;
+var
+ Key : TKey;
+begin
+ Result := ogValidCode;
+
+ DoOnGetKey(Key);
+ ApplyModifierToKeyPrim(DoOnGetModifier, Key, SizeOf(Key)); {!!.09}
+ if DecodeNAFCountCode(Key, DoOnGetCode) > 0 then begin {!!.09}
+ if (nacNetAccess.Fh = -1) then begin {!!.09}
+ if (FFileName = '') then {!!.09}
+ FFileName := DoOnGetFileName; {!!.09}
+ LockNetAccessFile(FFileName, Key, nacNetAccess); {!!.09}
+ end; {!!.09}
+ if not CheckNetAccessFile(nacNetAccess) then
+ Result := ogNetCountUsed;
+ end else
+ Result := ogInvalidCode;
+
+ if Report then
+ DoOnChecked(Result);
+end;
+
+{!!.01}
+constructor TOgNetCode.Create(AOwner : TComponent);
+begin
+ inherited Create(AOwner);
+
+ nacNetAccess.Fh := -1;
+end;
+
+function TOgNetCode.CreateAccessFile : Boolean;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ Result := CreateNetAccessFileEx(FFileName, Key, ACode);
+end;
+
+destructor TOgNetCode.Destroy;
+begin
+ UnlockNetAccessFile(nacNetAccess);
+
+ inherited Destroy;
+end;
+
+{!!.02}
+function TOgNetCode.DoOnGetFileName : string;
+begin
+ Result := '';
+ if not Assigned(FOnGetFileName) then
+ raise EOnGuardException.Create(SCNoOnGetFileName);
+
+ FOnGetFileName(Self, Result);
+end;
+
+function TOgNetCode.GetActiveUsers : LongInt;
+var
+ Key : TKey;
+ AModifier : LongInt;
+ NetAccessInfo : TNetAccessInfo;
+begin
+ DoOnGetKey(Key);
+ AModifier := DoOnGetModifier;
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ if GetNetAccessFileInfo(FileName, Key, NetAccessInfo) then
+ Result := NetAccessInfo.Locked
+ else
+ Result := -1;
+end;
+
+function TOgNetCode.GetInvalidUsers : LongInt;
+var
+ Key : TKey;
+ AModifier : LongInt;
+ {NetAccessInfo : TNetAccessInfo;} {!!.08}
+begin
+ DoOnGetKey(Key);
+ AModifier := DoOnGetModifier;
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ if GetNetAccessFileInfo(FFileName, Key, nacNetAccessInfo) then
+ Result := nacNetAccessInfo.Invalid {!!.08}
+ else
+ Result := -1;
+end;
+
+function TOgNetCode.GetMaxUsers : LongInt;
+var
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ DoOnGetKey(Key);
+ AModifier := DoOnGetModifier;
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ if GetNetAccessFileInfo(FFileName, Key, nacNetAccessInfo) then
+ Result := nacNetAccessInfo.Total
+ else
+ Result := -1;
+end;
+
+function TOgNetCode.IsRemoteDrive(const ExePath : string) : Boolean;
+begin
+ Result := IsAppOnNetwork(ExePath);
+end;
+
+procedure TOgNetCode.Loaded;
+var
+ Key : TKey;
+ ACode : TCode;
+ AModifier : LongInt;
+begin
+ if FAutoCheck and not (csDesigning in ComponentState) then begin {!!.08}
+ ACode := DoOnGetCode;
+ DoOnGetKey(Key);
+ AModifier := DoOnGetModifier;
+
+ {if no file name, fire event to get one} {!!.02}
+ if FFileName = '' then {!!.02}
+ FFilename := DoOnGetFileName; {!!.02}
+
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ if DecodeNAFCountCode(Key, ACode) > 0 then begin
+ try
+ if not GetNetAccessFileInfo(FFileName, Key, nacNetAccessInfo) then
+ CreateAccessFile; {wasn't there, try to create it}
+ LockNetAccessFile(FFileName, Key, nacNetAccess);
+ except
+ {ignore errors - CheckCode will report that record is not locked}
+ end;
+ end;
+ end;
+
+ inherited Loaded;
+end;
+
+function TOgNetCode.ResetAccessFile : Boolean;
+var
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ DoOnGetKey(Key);
+ AModifier := DoOnGetModifier;
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ Result := ResetNetAccessFile(FFileName, Key);
+end;
+
+
+{network user access/count routines}
+function CheckNetAccessFile(const NetAccess : TNetAccess) : Boolean;
+var
+ Code : TCode;
+begin
+ Result := False;
+
+ if (NetAccess.Fh > -1) then begin
+ FileSeek(NetAccess.Fh, NetAccess.Index * SizeOf(Code), 0);
+ if (FileRead(NetAccess.Fh, Code, SizeOf(Code)) = SizeOf(Code)) then begin
+ MixBlock(T128bit(NetAccess.Key), Code, False);
+ Result := (Code.CheckValue = NetAccess.CheckValue) and (Code.NetIndex = NetAccess.Index);
+ end;
+ end;
+end;
+
+function CreateNetAccessFile(const FileName : string; const Key : TKey; Count : Word) : Boolean;
+var
+ Fh : Integer;
+ I : LongInt;
+ Code : TCode;
+begin
+ Result := False;
+
+ Fh := FileCreate(FileName);
+ if (Fh > -1) then begin
+ for I := 0 to Count - 1 do begin
+ Code.CheckValue := NetCheckCode;
+ Code.Expiration := 0; {not used}
+ Code.NetIndex := I;
+ MixBlock(T128bit(Key), Code, True);
+ FileWrite(Fh, Code, SizeOf(Code));
+ end;
+
+ //FlushFileBuffers(Fh);
+ Result := ( GetFileSize(Fh) = (Count * SizeOf(Code)));
+ FileClose(Fh);
+ end;
+end;
+
+function CreateNetAccessFileEx(const FileName : string; const Key : TKey; const Code : TCode) : Boolean;
+var
+ L : LongInt;
+begin
+ L := DecodeNAFCountCode(Key, Code);
+ if L > 0 then
+ Result := CreateNetAccessFile(FileName, Key, L)
+ else
+ Result := False;
+end;
+
+function DecodeNAFCountCode(const Key : TKey; const Code : TCode) : LongInt;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ if (Work.CheckValue = NetCheckCode) then
+ Result := Work.NetIndex
+ else
+ Result := -1;
+end;
+
+procedure EncodeNAFCountCode(const Key : TKey; Count : Cardinal; var Code : TCode);
+begin
+ Code.CheckValue := NetCheckCode;
+ Code.Expiration := 0; {not used}
+ Code.NetIndex := Count;
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function GetNetAccessFileInfo(const FileName : string; const Key : TKey;
+ var NetAccessInfo : TNetAccessInfo) : Boolean;
+var
+ Fh : Integer;
+ I : LongInt;
+ Code : TCode;
+begin
+ Result := False;
+
+ Fh := FileOpen(FileName, fmOpenReadWrite or fmShareDenyNone);
+ if (Fh > -1) then
+ begin
+ NetAccessInfo.Total := GetFileSize(Fh) div SizeOf(Code);
+ NetAccessInfo.Locked := 0;
+ NetAccessInfo.Invalid := 0;
+
+ for I := 0 to NetAccessInfo.Total - 1 do
+ begin
+ if LockFile(Fh, I * SizeOf(Code), 0, SizeOf(Code), 0) then
+ begin
+ FileSeek(Fh, I * SizeOf(Code), 0);
+ FileRead(Fh, Code, SizeOf(Code));
+ MixBlock(T128bit(Key), Code, False);
+ if (Code.NetIndex <> I) or (Code.CheckValue <> NetCheckCode) then
+ Inc(NetAccessInfo.Invalid);
+ UnlockFile(Fh, I * SizeOf(Code), 0, SizeOf(Code), 0);
+ end else
+ Inc(NetAccessInfo.Locked);
+ end;
+
+ FlushFileBuffers(Fh);
+ FileClose(Fh);
+ Result := True;
+ end;
+end;
+
+{$IFDEF Win32}
+function IsAppOnNetwork(const ExePath : string) : Boolean;
+begin
+ Result := (GetDriveType(PAnsiChar(ExtractFileDrive(ExePath) + '\')) = DRIVE_REMOTE);
+end;
+{$ELSE}
+{$IFNDEF LINUX}
+function IsAppOnNetwork(const ExePath : string) : Boolean;
+var
+ D : Integer;
+begin
+ D := Ord(UpCase(ExePath[1])) - Ord('A'); {!!.07}
+ Result := GetDriveType(D) = DRIVE_REMOTE;
+end;
+{$ENDIF}
+{$IFDEF LINUX}
+function IsAppOnNetwork(const ExePath : string) : Boolean;
+begin
+ Result := False;
+end;
+{$ENDIF}
+{$ENDIF}
+
+function LockNetAccessFile(const FileName : string; const Key : TKey;
+ var NetAccess : TNetAccess) : Boolean;
+var
+ Fh : Integer;
+ Count : Cardinal;
+ I : LongInt;
+ Code : TCode;
+begin
+ Result := False;
+
+ FillChar(NetAccess, SizeOf(NetAccess), 0);
+ NetAccess.Fh := -1;
+
+ Fh := FileOpen(FileName, fmOpenReadWrite or fmShareDenyNone);
+ if (Fh > -1) then begin
+ Count := GetFileSize(Fh) div SizeOf(Code);
+ {find an unused record to use}
+ for I := 0 to Count - 1 do begin
+ if LockFile(Fh, I * SizeOf(Code), 0, SizeOf(Code), 0) then begin
+ FileSeek(Fh, I * SizeOf(Code), 0);
+ FileRead(Fh, Code, SizeOf(Code));
+ MixBlock(T128bit(Key), Code, False);
+ if (Code.NetIndex = I) and (Code.CheckValue = NetCheckCode) then begin
+ NetAccess.Fh := Fh;
+ NetAccess.Key := Key;
+ NetAccess.Index := I;
+ NetAccess.CheckValue := HiWord(GenerateUniqueModifierPrim);
+
+ Code.CheckValue := NetAccess.CheckValue;
+ Code.Expiration := 0; {not used}
+ Code.NetIndex := NetAccess.Index;
+ MixBlock(T128bit(Key), Code, True);
+
+ FileSeek(Fh, I * SizeOf(Code), 0);
+ FileWrite(Fh, Code, SizeOf(Code));
+ FlushFileBuffers(Fh);
+ Result := True;
+ Exit;
+ end else
+ UnlockFile(Fh, I * SizeOf(Code), 0, SizeOf(Code), 0);
+ end;
+ end;
+ FileClose(Fh);
+ end;
+end;
+
+function ResetNetAccessFile(const FileName : string; const Key : TKey) : Boolean;
+var
+ Fh : Integer;
+ Count : Cardinal;
+ I : LongInt;
+ Code : TCode;
+begin
+ Result := False;
+
+ Fh := FileOpen(FileName, fmOpenReadWrite or fmShareDenyNone);
+ if (Fh > -1) then begin
+ Count := GetFileSize(Fh) div SizeOf(Code);
+ for I := 0 to Count - 1 do
+ {attempt to lock this record. skip records that are locked}
+ if LockFile(Fh, I * SizeOf(Code), 0, SizeOf(Code), 0) then begin
+ try
+ Code.CheckValue := NetCheckCode;
+ Code.Expiration := 0; {not used}
+ Code.NetIndex := I;
+ MixBlock(T128bit(Key), Code, True);
+ FileSeek(Fh, I * SizeOf(Code), 0);
+ FileWrite(Fh, Code, SizeOf(Code));
+ finally
+ UnlockFile(Fh, I * SizeOf(Code), 0, SizeOf(Code), 0);
+ end;
+ end;
+ FlushFileBuffers(Fh);
+ FileClose(Fh);
+ Result := True;
+ end;
+end;
+
+function UnlockNetAccessFile(var NetAccess : TNetAccess) : Boolean;
+var
+ Code : TCode;
+begin
+ Result := False;
+
+ if CheckNetAccessFile(NetAccess) then begin
+ Code.CheckValue := NetCheckCode;
+ Code.Expiration := 0; {not used}
+ Code.NetIndex := NetAccess.Index;
+ MixBlock(T128bit(NetAccess.Key), Code, True);
+ FileSeek(NetAccess.Fh, NetAccess.Index * SizeOf(Code), 0);
+ FileWrite(NetAccess.Fh, Code, SizeOf(Code));
+
+ FlushFileBuffers(NetAccess.Fh);
+ FileClose(NetAccess.Fh);
+
+ FillChar(NetAccess, SizeOf(NetAccess), 0);
+ NetAccess.Fh := -1;
+
+ Result := True;
+ end;
+end;
+
+end.
diff --git a/components/onguard/source/ogproexe.pas b/components/onguard/source/ogproexe.pas
new file mode 100644
index 000000000..7a80cfa89
--- /dev/null
+++ b/components/onguard/source/ogproexe.pas
@@ -0,0 +1,730 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ *
+ * Boguslaw Brandys brandys@o2.pl
+ * conversion to Free Pascal
+ * June 04, 2006
+ *
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* OGPROEXE.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+
+
+{$B-} {Complete Boolean Evaluation}
+{$I+} {Input/Output-Checking}
+{$P+} {Open Parameters}
+{$T-} {Typed @ Operator}
+
+
+{$mode delphi}{$H+}
+{$ASMMODE INTEL}
+
+
+unit ogproexe; {AH.01}
+
+interface
+
+uses
+ {$IFDEF MSWINDOWS} Windows, {$ENDIF} {AH.01}
+ {$IFDEF LINUX} BaseUnix, {$ENDIF} {AH.01}
+ Classes,
+ {$IFDEF MSWINDOWS} MMSystem, {$ENDIF} {AH.01}
+ SysUtils,
+ ogutil; {AH.01}
+
+type
+ {exe signature record}
+ PSignatureRec = ^TSignatureRec;
+ TSignatureRec = packed record
+ Sig1 : DWord; {!!.07}
+ Sig2 : DWord; {!!.07}
+ Sig3 : DWord; {!!.07}
+ Offset : DWord; {!!.07}
+ Size : DWord; {!!.07}
+ CRC : DWord; {!!.07}
+ Sig4 : DWord; {!!.07}
+ Sig5 : DWord; {!!.07}
+ Sig6 : DWord; {!!.07}
+ end;
+
+ TExeStatus = (
+ exeSuccess, {no error}
+ exeSizeError, {the file size has changed}
+ exeIntegrityError, {CRC does not match}
+ exeNotStamped, {the exe has not been stamped}
+ exeAccessDenied {share violation} {!!.05}
+ );
+
+type
+ TCheckedExeEvent =
+ procedure(Sender : TObject; Status : TExeStatus)
+ of object;
+
+ TOgProtectExe = class(TComponent)
+ protected {private}
+ {property variables}
+ FAutoCheck : Boolean;
+ FCheckSize : Boolean;
+
+ {event variables}
+ FOnChecked : TCheckedExeEvent;
+
+ {property methods}
+ function GetAbout : string; {!!.08}
+ procedure SetAbout(const Value : string); {!!.08}
+
+ protected
+ procedure DoOnChecked(Status : TExeStatus);
+ dynamic;
+ procedure Loaded;
+ override;
+
+ public
+ constructor Create(AOwner : TComponent);
+ override;
+ function CheckExe(Report : Boolean) : TExeStatus;
+ {-test the exe file for tampering}
+ function StampExe(const FileName : string ; EraseMarker : Boolean) : Boolean;
+ {-stamp exe with crc and file size. optionally erase search markers}
+ function UnStampExe(const FileName : string) : Boolean;
+ {-writes uninitialized signature record. marker must not have been erased}
+
+ published
+ {properties}
+ property AutoCheck : Boolean
+ read FAutoCheck
+ write FAutoCheck
+ default DefAutoCheck;
+
+ property CheckSize : Boolean
+ read FCheckSize
+ write FCheckSize
+ default DefCheckSize;
+
+ property About : string {!!.08}
+ read GetAbout {!!.08}
+ write SetAbout {!!.08}
+ stored False;
+
+ {events}
+ property OnChecked : TCheckedExeEvent
+ read FOnChecked
+ write FOnChecked;
+ end;
+
+
+function IsExeTampered(CheckSize : Boolean) : TExeStatus;
+ {-return one of the possible TExeResult states}
+function ProtectExe(const FileName : string ; EraseMarker : Boolean) : Boolean;
+ {-stamp exe with crc and file size. optionally erase search markers}
+function UnprotectExe(const FileName : string) : Boolean;
+ {-writes uninitialized signature record. marker must not have been erased}
+
+{checksum/CRC routines}
+procedure UpdateChecksum(var Sum : LongInt; const Buf; BufSize : LongInt);
+{$IFDEF Win32}
+function FileCRC32(const FileName : string) : DWord; {!!.07}
+{$ELSE}
+function FileCRC32(const FileName : string) : DWord;//LongInt;
+{$ENDIF}
+procedure UpdateCRC32(var CRC : DWord; const Buf; BufSize : LongInt); {!!.07}
+
+
+implementation
+
+
+{signature = '!~~@CRC32@~~' used before and after}
+const
+ StoredSignature : TSignatureRec = (
+ Sig1:$407E7E21; Sig2:$33435243; Sig3:$7E7E4032;
+ Offset:1; Size:2; CRC:3;
+ Sig4:$407E7E21; Sig5:$33435243; Sig6:$7E7E4032);
+
+{CRC32 lookup table}
+const
+ CRC32Table: array[0..255] of DWord = ( {!!.07}
+ $00000000, $77073096, $ee0e612c, $990951ba, $076dc419, $706af48f, $e963a535, $9e6495a3,
+ $0edb8832, $79dcb8a4, $e0d5e91e, $97d2d988, $09b64c2b, $7eb17cbd, $e7b82d07, $90bf1d91,
+ $1db71064, $6ab020f2, $f3b97148, $84be41de, $1adad47d, $6ddde4eb, $f4d4b551, $83d385c7,
+ $136c9856, $646ba8c0, $fd62f97a, $8a65c9ec, $14015c4f, $63066cd9, $fa0f3d63, $8d080df5,
+ $3b6e20c8, $4c69105e, $d56041e4, $a2677172, $3c03e4d1, $4b04d447, $d20d85fd, $a50ab56b,
+ $35b5a8fa, $42b2986c, $dbbbc9d6, $acbcf940, $32d86ce3, $45df5c75, $dcd60dcf, $abd13d59,
+ $26d930ac, $51de003a, $c8d75180, $bfd06116, $21b4f4b5, $56b3c423, $cfba9599, $b8bda50f,
+ $2802b89e, $5f058808, $c60cd9b2, $b10be924, $2f6f7c87, $58684c11, $c1611dab, $b6662d3d,
+ $76dc4190, $01db7106, $98d220bc, $efd5102a, $71b18589, $06b6b51f, $9fbfe4a5, $e8b8d433,
+ $7807c9a2, $0f00f934, $9609a88e, $e10e9818, $7f6a0dbb, $086d3d2d, $91646c97, $e6635c01,
+ $6b6b51f4, $1c6c6162, $856530d8, $f262004e, $6c0695ed, $1b01a57b, $8208f4c1, $f50fc457,
+ $65b0d9c6, $12b7e950, $8bbeb8ea, $fcb9887c, $62dd1ddf, $15da2d49, $8cd37cf3, $fbd44c65,
+ $4db26158, $3ab551ce, $a3bc0074, $d4bb30e2, $4adfa541, $3dd895d7, $a4d1c46d, $d3d6f4fb,
+ $4369e96a, $346ed9fc, $ad678846, $da60b8d0, $44042d73, $33031de5, $aa0a4c5f, $dd0d7cc9,
+ $5005713c, $270241aa, $be0b1010, $c90c2086, $5768b525, $206f85b3, $b966d409, $ce61e49f,
+ $5edef90e, $29d9c998, $b0d09822, $c7d7a8b4, $59b33d17, $2eb40d81, $b7bd5c3b, $c0ba6cad,
+ $edb88320, $9abfb3b6, $03b6e20c, $74b1d29a, $ead54739, $9dd277af, $04db2615, $73dc1683,
+ $e3630b12, $94643b84, $0d6d6a3e, $7a6a5aa8, $e40ecf0b, $9309ff9d, $0a00ae27, $7d079eb1,
+ $f00f9344, $8708a3d2, $1e01f268, $6906c2fe, $f762575d, $806567cb, $196c3671, $6e6b06e7,
+ $fed41b76, $89d32be0, $10da7a5a, $67dd4acc, $f9b9df6f, $8ebeeff9, $17b7be43, $60b08ed5,
+ $d6d6a3e8, $a1d1937e, $38d8c2c4, $4fdff252, $d1bb67f1, $a6bc5767, $3fb506dd, $48b2364b,
+ $d80d2bda, $af0a1b4c, $36034af6, $41047a60, $df60efc3, $a867df55, $316e8eef, $4669be79,
+ $cb61b38c, $bc66831a, $256fd2a0, $5268e236, $cc0c7795, $bb0b4703, $220216b9, $5505262f,
+ $c5ba3bbe, $b2bd0b28, $2bb45a92, $5cb36a04, $c2d7ffa7, $b5d0cf31, $2cd99e8b, $5bdeae1d,
+ $9b64c2b0, $ec63f226, $756aa39c, $026d930a, $9c0906a9, $eb0e363f, $72076785, $05005713,
+ $95bf4a82, $e2b87a14, $7bb12bae, $0cb61b38, $92d28e9b, $e5d5be0d, $7cdcefb7, $0bdbdf21,
+ $86d3d2d4, $f1d4e242, $68ddb3f8, $1fda836e, $81be16cd, $f6b9265b, $6fb077e1, $18b74777,
+ $88085ae6, $ff0f6a70, $66063bca, $11010b5c, $8f659eff, $f862ae69, $616bffd3, $166ccf45,
+ $a00ae278, $d70dd2ee, $4e048354, $3903b3c2, $a7672661, $d06016f7, $4969474d, $3e6e77db,
+ $aed16a4a, $d9d65adc, $40df0b66, $37d83bf0, $a9bcae53, $debb9ec5, $47b2cf7f, $30b5ffe9,
+ $bdbdf21c, $cabac28a, $53b39330, $24b4a3a6, $bad03605, $cdd70693, $54de5729, $23d967bf,
+ $b3667a2e, $c4614ab8, $5d681b02, $2a6f2b94, $b40bbe37, $c30c8ea1, $5a05df1b, $2d02ef8d);
+
+
+{*** TOgProtectExe ***}
+
+constructor TOgProtectExe.Create(AOwner : TComponent);
+begin
+ inherited Create(AOwner);
+
+ FAutoCheck := DefAutoCheck;
+ FCheckSize := DefCheckSize;
+end;
+
+function TOgProtectExe.CheckExe(Report : Boolean) : TExeStatus;
+begin
+ Result := IsExeTampered(FCheckSize);
+
+ if Report then
+ DoOnChecked(Result);
+end;
+
+procedure TOgProtectExe.DoOnChecked(Status : TExeStatus);
+begin
+ if Assigned(FOnChecked) then
+ FOnChecked(Self, Status);
+end;
+
+function TOgProtectExe.GetAbout : string; {!!.08}
+begin
+ Result := OgVersionStr;
+end;
+
+procedure TOgProtectExe.Loaded;
+begin
+ inherited Loaded;
+
+ if FAutoCheck then
+ CheckExe(True);
+end;
+
+procedure TOgProtectExe.SetAbout(const Value : string); {!!.08}
+begin
+end;
+
+function TOgProtectExe.StampExe(const FileName : string ; EraseMarker : Boolean) : Boolean;
+begin
+ Result := ProtectExe(FileName, EraseMarker);
+end;
+
+function TOgProtectExe.UnStampExe(const FileName : string) : Boolean;
+begin
+ Result := UnprotectExe(FileName);
+end;
+
+
+{$IFDEF Win32}
+function IsExeTampered(CheckSize : Boolean) : TExeStatus;
+ {-return one of the possible TExeResult states}
+var
+ Fh : THandle;
+ FileMap : THandle;
+ Memory : PByteArray;
+ CRC : DWord; {!!.07}
+ Buf : array [0..MAX_PATH - 1] of AnsiChar;
+begin
+ Result := exeIntegrityError;
+
+ {check if exe has been stamped}
+ if (StoredSignature.Offset = 1) and (StoredSignature.Size = 2) and
+ (StoredSignature.CRC = 3) then begin
+ Result := exeNotStamped;
+ Exit;
+ end;
+
+ Windows.GetModuleFileName(HInstance, Buf, SizeOf(Buf));
+ Fh := CreateFile(Buf, GENERIC_READ, FILE_SHARE_READ or FILE_SHARE_WRITE,
+ nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+ if (Fh <> INVALID_HANDLE_VALUE) then begin {!!.07}
+ if CheckSize and (StoredSignature.Size <> Windows.GetFileSize(Fh, nil)) then
+ Result := exeSizeError
+ else begin
+ FileMap := CreateFileMapping(Fh, nil, PAGE_READONLY, 0, 0, nil);
+ if (FileMap <> 0) then begin
+ Memory := MapViewOfFile(FileMap, FILE_MAP_READ, 0, 0, 0);
+ if (Memory <> nil) then begin
+ CRC := $FFF00FFF; {special CRC init}
+ UpdateCRC32(CRC, Memory^, StoredSignature.Offset);
+ UpdateCRC32(CRC, Memory^[StoredSignature.Offset + SizeOf(TSignatureRec)],
+ StoredSignature.Size - (StoredSignature.Offset + SizeOf(TSignatureRec)));
+ if (StoredSignature.CRC = not CRC) then
+ Result := exeSuccess;
+ UnmapViewOfFile(Memory);
+ end;
+ CloseHandle(FileMap);
+ end;
+ end;
+ CloseHandle(Fh);
+ end else begin {!!.05}
+ if GetLastError = ERROR_ACCESS_DENIED then {!!.05}
+ Result := exeAccessDenied; {!!.05}
+ end; {!!.05}
+end;
+{$ELSE}
+function IsExeTampered(CheckSize : Boolean) : TExeStatus;
+ {-return one of the possible TExeResult states}
+const
+ BufSize = 4096;
+var
+ Fh : Integer;
+ TotalRead : LongInt;
+ BytesToRead : LongInt;
+ BytesRead : LongInt;
+ Size : LongInt;
+ Buf : PAnsiChar;
+ CRC : Dword;//LongInt;
+begin
+ Result := exeIntegrityError;
+
+ {check if exe has been stamped}
+ if (StoredSignature.Offset = 1) and (StoredSignature.Size = 2) and {!!.07}
+ (StoredSignature.CRC = 3) then begin {!!.07}
+ Result := exeNotStamped;
+ Exit;
+ end;
+
+ Buf := StrAlloc(BufSize);
+ try
+ //GetModuleFileName(HInstance, Buf, BufSize-1);
+ //Buf := ParamStr(0);
+ Fh := FileOpen(ParamStr(0), fmOpenRead or fmShareDenyWrite);
+ if (Fh >= 0 {HFILE_ERROR}) then begin
+ Size := FileSeek(Fh, 0, 2); {get file size}
+ FileSeek(Fh, 0, 0); {reset to beginning of file}
+ if CheckSize and (StoredSignature.Size <> Size) then
+ Result := exeSizeError
+ else begin
+ CRC := $FFF00FFF; {special CRC init}
+ TotalRead := 0;
+ {read and compute crc up to the signature record}
+ while (TotalRead < StoredSignature.Offset) do begin
+ if (TotalRead + BufSize <= StoredSignature.Offset) then
+ BytesToRead := BufSize
+ else
+ BytesToRead := (StoredSignature.Offset - TotalRead);
+ BytesRead := FileRead(Fh, Buf^, BytesToRead);
+ Inc(TotalRead, BytesRead);
+ UpdateCRC32(DWord(CRC), Buf^, BytesRead);
+ end;
+ {jump past signature record}
+ FileSeek(Fh, SizeOf(StoredSignature), 1);
+ repeat
+ BytesRead := FileRead(Fh, Buf^, BufSize);
+ Inc(TotalRead, BytesRead);
+ UpdateCRC32(DWord(CRC), Buf^, BytesRead);
+ until (BytesRead < BufSize);
+ if (StoredSignature.CRC = not CRC) then
+ Result := exeSuccess;
+ end;
+ FileClose(Fh);
+ end else begin {!!.05}
+ if Fh = -5 then {!!.05}
+ Result := exeAccessDenied; {!!.05}
+ end; {!!.05}
+
+ finally
+ StrDispose(Buf);
+ end;
+end;
+{$ENDIF}
+
+{$IFDEF Win32}
+function ProtectExe(const FileName : string; EraseMarker : Boolean) : Boolean;
+ {-stamp exe with crc and file size. optionally erase search markers}
+var
+ Fh : THandle;
+ FileMap : THandle;
+ Memory : PByteArray;
+ I, Size : LongInt;
+ Sig : PSignatureRec;
+begin
+ Result := False;
+
+ Fh := CreateFile(PAnsiChar(FileName), GENERIC_READ or GENERIC_WRITE, 0,
+ nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+ if (Fh <> INVALID_HANDLE_VALUE) then begin
+ Size := Windows.GetFileSize(Fh, nil);
+
+ FileMap := CreateFileMapping(Fh, nil, PAGE_READWRITE, 0, 0, nil);
+ if (FileMap <> 0) then begin
+ Memory := MapViewOfFile(FileMap, FILE_MAP_WRITE, 0, 0, 0);
+ if (Memory <> nil) then begin
+ for I := 0 to (Size - SizeOf(TSignatureRec)) - 1 do begin
+ if (PSignatureRec(@Memory[I]).Sig1 = $407E7E21) and
+ (PSignatureRec(@Memory[I]).Sig2 = $33435243) and
+ (PSignatureRec(@Memory[I]).Sig3 = $7E7E4032) and
+ (PSignatureRec(@Memory[I]).Sig4 = $407E7E21) and
+ (PSignatureRec(@Memory[I]).Sig5 = $33435243) and
+ (PSignatureRec(@Memory[I]).Sig6 = $7E7E4032) then begin
+
+ {found it}
+ Sig := @Memory^[I];
+
+ if EraseMarker then begin
+ Sig.Sig1 := Sig.Sig1 xor timeGetTime;
+ Sig.Sig2 := Sig.Sig2 xor timeGetTime;
+ Sig.Sig3 := Sig.Sig3 xor timeGetTime;
+ Sig.Sig4 := Sig.Sig4 xor timeGetTime;
+ Sig.Sig5 := Sig.Sig5 xor timeGetTime;
+ Sig.Sig6 := Sig.Sig6 xor timeGetTime;
+ end;
+
+ Sig.Offset := I;
+ Sig.Size := Size;
+ Sig.CRC := $FFF00FFF; {special CRC init}
+
+ {compute crc ignoring the signature record}
+ UpdateCRC32(Sig.CRC, Memory^, Sig.Offset);
+ UpdateCRC32(Sig.CRC, Memory^[Sig.Offset + SizeOf(TSignatureRec)],
+ Sig.Size - (Sig.Offset + SizeOf(TSignatureRec)));
+ Sig.CRC := not Sig.CRC;
+
+ Result := True;
+ Break;
+ end;
+ end;
+ UnmapViewOfFile(Memory);
+ end;
+ CloseHandle(FileMap);
+ end;
+ CloseHandle(Fh);
+ end;
+end;
+{$ELSE}
+function ProtectExe(const FileName : string; EraseMarker : Boolean) : Boolean;
+ {-stamp exe with crc and file size. optionally erase search markers}
+const
+ BufSize = 4096; {must be larger than the size of the signature record}
+var
+ Fh : THandle;
+ I, Size : LongInt;
+ Sig : TSignatureRec;
+ Buf : PAnsiChar;
+ CRC : Dword;//LongInt;
+ TotalRead : LongInt;
+ BytesRead : LongInt;
+begin
+ Result := False;
+
+ Buf := StrAlloc(BufSize);
+ try
+ Fh := FileOpen(FileName, fmOpenReadWrite or fmShareDenyWrite);
+ if (Fh >= 0 {HFILE_ERROR}) then begin
+ Size := FileSeek(Fh, 0, 2);
+ FileSeek(Fh, 0, 0); {reset to beginning of file}
+ CRC := $FFF00FFF; {special CRC init}
+ TotalRead := 0;
+ repeat
+ BytesRead := FileRead(Fh, Buf^, BufSize);
+
+ {search if not found}
+ if not Result then begin
+ for I := 0 to BytesRead - SizeOf(TSignatureRec) - 1 do begin
+ if (PSignatureRec(@Buf[I])^.Sig1 = $407E7E21) and
+ (PSignatureRec(@Buf[I])^.Sig2 = $33435243) and
+ (PSignatureRec(@Buf[I])^.Sig3 = $7E7E4032) and
+ (PSignatureRec(@Buf[I])^.Sig4 = $407E7E21) and
+ (PSignatureRec(@Buf[I])^.Sig5 = $33435243) and
+ (PSignatureRec(@Buf[I])^.Sig6 = $7E7E4032) then begin
+
+ Result := True; {found it}
+
+ Sig := PSignatureRec(@Buf[I])^;
+ if EraseMarker then begin
+ Sig.Sig1 := Sig.Sig1 xor timeGetTime;
+ Sig.Sig2 := Sig.Sig2 xor timeGetTime;
+ Sig.Sig3 := Sig.Sig3 xor timeGetTime;
+ Sig.Sig4 := Sig.Sig4 xor timeGetTime;
+ Sig.Sig5 := Sig.Sig5 xor timeGetTime;
+ Sig.Sig6 := Sig.Sig6 xor timeGetTime;
+ end;
+
+ Sig.Offset := TotalRead + I;
+ Sig.Size := Size;
+
+ {update crc up to the start of the signature record}
+ UpdateCRC32(DWord(CRC), Buf^, I);
+ {update crc for the remaing potion of the buffer (after the signature record)}
+ UpdateCRC32(DWord(CRC), Buf[I+SizeOf(TSignatureRec)],
+ BytesRead-(I+SizeOf(TSignatureRec)));
+ end;
+ end;
+ end;
+
+ if not Result then begin
+ UpdateCRC32(DWord(CRC), Buf^, BytesRead-SizeOf(TSignatureRec));
+ {back up by size of TSignatureRec to insure that split record is found}
+ FileSeek(Fh, -SizeOf(TSignatureRec), 1);
+ Inc(TotalRead, BytesRead-SizeOf(TSignatureRec));
+ end;
+ until (BytesRead < BufSize) or Result;
+
+ {scan remaining portion of file}
+ if Result then begin
+ repeat
+ BytesRead := FileRead(Fh, Buf^, BufSize);
+ UpdateCRC32(DWord(CRC), Buf^, BytesRead);
+ until (BytesRead < BufSize);
+ end;
+
+ {save signature record back to the exe file}
+ if Result then begin
+ Sig.CRC := not CRC;
+ FileSeek(Fh, Sig.Offset, 0);
+ FileWrite(Fh, Sig, SizeOf(TSignatureRec))
+ end;
+
+ FileClose(Fh);
+ end;
+ finally
+ StrDispose(Buf);
+ end;
+end;
+{$ENDIF}
+
+
+{$IFDEF Win32}
+function UnprotectExe(const FileName : string) : Boolean;
+ {-writes uninitialized signature record. marker must not have been erased}
+var
+ Fh : THandle;
+ FileMap : THandle;
+ Memory : PByteArray;
+ I, Size : LongInt;
+ Sig : PSignatureRec;
+begin
+ Result := False;
+
+ Fh := CreateFile(PAnsiChar(FileName), GENERIC_READ or GENERIC_WRITE, 0,
+ nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+ if (Fh <> INVALID_HANDLE_VALUE) then begin
+ Size := Windows.GetFileSize(Fh, nil);
+
+ FileMap := CreateFileMapping(Fh, nil, PAGE_READWRITE, 0, 0, nil);
+ if (FileMap <> 0) then begin
+ Memory := MapViewOfFile(FileMap, FILE_MAP_WRITE, 0, 0, 0);
+ if (Memory <> nil) then begin
+ for I := 0 to (Size - SizeOf(TSignatureRec)) - 1 do begin
+ if (PSignatureRec(@Memory[I]).Sig1 = $407E7E21) and
+ (PSignatureRec(@Memory[I]).Sig2 = $33435243) and
+ (PSignatureRec(@Memory[I]).Sig3 = $7E7E4032) and
+ (PSignatureRec(@Memory[I]).Sig4 = $407E7E21) and
+ (PSignatureRec(@Memory[I]).Sig5 = $33435243) and
+ (PSignatureRec(@Memory[I]).Sig6 = $7E7E4032) then begin
+
+ {found it}
+ Sig := @Memory^[I];
+
+ {restore to uninitialized state}
+ Sig^.Offset := 1; {!!.08}
+ Sig^.Size := 2; {!!.08}
+ Sig^.CRC := 3; {!!.08}
+
+ Result := True;
+ Break;
+ end;
+ end;
+ UnmapViewOfFile(Memory);
+ end;
+ CloseHandle(FileMap);
+ end;
+ CloseHandle(Fh);
+ end;
+end;
+{$ELSE}
+function UnprotectExe(const FileName : string) : Boolean;
+ {-writes uninitialized signature record. marker must not have been erased}
+const
+ BufSize = 4096; {must be larger than the size of the signature record}
+var
+ Fh : THandle;
+ I : LongInt;
+ Sig : TSignatureRec;
+ Buf : PAnsiChar;
+ Offset : LongInt;
+ BytesRead : LongInt;
+ TotalRead : LongInt;
+begin
+ Result := False;
+
+ Buf := StrAlloc(BufSize);
+ try
+ Fh := FileOpen(FileName, fmOpenReadWrite or fmShareDenyWrite);
+ if (Fh >= 0 {HFILE_ERROR}) then begin
+ FileSeek(Fh, 0, 0); {reset to beginning of file}
+ TotalRead := 0;
+ repeat
+ BytesRead := FileRead(Fh, Buf^, BufSize);
+
+ {search if not found}
+ if not Result then begin
+ for I := 0 to BytesRead - SizeOf(TSignatureRec) - 1 do begin
+ if (PSignatureRec(@Buf[I])^.Sig1 = $407E7E21) and
+ (PSignatureRec(@Buf[I])^.Sig2 = $33435243) and
+ (PSignatureRec(@Buf[I])^.Sig3 = $7E7E4032) and
+ (PSignatureRec(@Buf[I])^.Sig4 = $407E7E21) and
+ (PSignatureRec(@Buf[I])^.Sig5 = $33435243) and
+ (PSignatureRec(@Buf[I])^.Sig6 = $7E7E4032) then begin
+
+ {found it}
+ Sig := PSignatureRec(@Buf[I])^;
+
+ {save position in file}
+ Offset := TotalRead + I;
+ Result := True;
+ end;
+ end;
+ end;
+
+ if not Result then begin
+ {back up by size of TSignatureRec to insure that split record is found}
+ FileSeek(Fh, -SizeOf(TSignatureRec), 1);
+ Inc(TotalRead, BytesRead-SizeOf(TSignatureRec));
+ end;
+ until (BytesRead < BufSize) or Result;
+
+ {save signature record back to the exe file}
+ if Result then begin
+ {restore to uninitialized state}
+ Sig.Offset := 1; {!!.08}
+ Sig.Size := 2; {!!.08}
+ Sig.CRC := 3; {!!.08}
+
+ FileSeek(Fh, Offset, 0);
+ FileWrite(Fh, Sig, SizeOf(TSignatureRec))
+ end;
+
+ FileClose(Fh);
+ end;
+ finally
+ StrDispose(Buf);
+ end;
+end;
+{$ENDIF}
+
+
+{checksum/CRC routines}
+
+procedure UpdateChecksum(var Sum : LongInt; const Buf; BufSize : LongInt);
+var
+ Bytes : TByteArray absolute Buf;
+ I : LongInt;
+begin
+ for I := 0 to BufSize - 1 do
+ Sum := Sum + Bytes[I];
+end;
+
+{$IFDEF Win32}
+function FileCRC32(const FileName : string) : DWord; {!!.07}
+var
+ Fh : THandle;
+ FileMap : THandle;
+ Size : LongInt;
+ Memory : PByteArray;
+ Buf : array [0..MAX_PATH - 1] of AnsiChar;
+begin
+ Result := $FFFFFFFF; {!!.07}
+ StrPLCopy(Buf, FileName, SizeOf(Buf)-1);
+ Fh := CreateFile(Buf, GENERIC_READ, FILE_SHARE_READ or FILE_SHARE_WRITE,
+ nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+ if (Fh <> INVALID_HANDLE_VALUE) then begin {!!.07}
+ Size := Windows.GetFileSize(Fh, nil);
+ FileMap := CreateFileMapping(Fh, nil, PAGE_READONLY, 0, 0, nil);
+ if (FileMap <> 0) then begin
+ Memory := MapViewOfFile(FileMap, FILE_MAP_READ, 0, 0, 0);
+ if (Memory <> nil) then begin
+ Result := $FFF00FFF; {special CRC init}
+ UpdateCRC32(Result, Memory^, Size);
+ UnmapViewOfFile(Memory);
+ end;
+ CloseHandle(FileMap);
+ end;
+ CloseHandle(Fh);
+ end;
+end;
+{$ELSE}
+function FileCRC32(const FileName : string) : DWord;//LongInt;
+const
+ BufSize = 4096;
+var
+ Fh : Integer;
+ BytesRead : LongInt;
+ Buf : PAnsiChar;
+begin
+ Buf := StrAlloc(BufSize);
+ try
+ StrPLCopy(Buf, FileName, BufSize-1);
+ Fh := FileOpen(StrPas(Buf), fmOpenRead or fmShareDenyWrite);
+ if (Fh >= 0 {HFILE_ERROR}) then begin
+ Result := $FFF00FFF; {special CRC init}
+ repeat
+ BytesRead := FileRead(Fh, Buf^, BufSize);
+ UpdateCRC32(DWord(Result), Buf^, BytesRead);
+ until (BytesRead < BufSize);
+ FileClose(Fh);
+ end;
+ finally
+ StrDispose(Buf);
+ end;
+end;
+{$ENDIF}
+
+procedure UpdateCRC32(var CRC : DWord; const Buf; BufSize : LongInt); {!!.07}
+var
+ Bytes : TByteArray absolute Buf;
+ I : LongInt;
+ B : Byte;
+begin
+ for I := 0 to BufSize - 1 do begin
+ B := TLongIntRec(CRC).LoLo xor Bytes[I];
+ CRC := (CRC shr 8) xor CRC32Table[B];
+ end;
+end;
+
+end.
diff --git a/components/onguard/source/ogreg.lrs b/components/onguard/source/ogreg.lrs
new file mode 100644
index 000000000..504c09967
--- /dev/null
+++ b/components/onguard/source/ogreg.lrs
@@ -0,0 +1,190 @@
+LazarusResources.Add('TOGUSAGECODE','XPM',[
+ '/* XPM */'#10'static char *TOGUSAGECODE_xpm[] = {'#10'/* width height num_co'
+ +'lors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* co'
+ +'lors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #'
+ +'808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c '
+ +'#808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c'
+ +' #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m '
+ +'c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaam'
+ +'jaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaa'
+ +'bbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10
+ +'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaa'
+ +'aaaaaaaaaaaaaa",'#10'"aaa`aaa`aa```aaa```aaaaa",'#10'"aaa`aaa`a`aaa`a`aaa`a'
+ +'aaa",'#10'"aaa`aaa`aa``aaa`aaaaaaaa",'#10'"aaa`aaa`aaa```a`aa``aaaa",'#10'"'
+ +'aaa`aaa`a`aaa`a`aaa`aaaa",'#10'"aaaa```aaa```aaa```aaaaa",'#10'"aaaaaaaaaaa'
+ +'aaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaa'
+ +'aa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"a'
+ +'amjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaa'
+ +'aabbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGSPECIALCODE','XPM',[
+ '/* XPM */'#10'static char *TOGSPECIALCODE_xpm[] = {'#10'/* width height num_'
+ +'colors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* '
+ +'colors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c'
+ +' #808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e '
+ +'c #808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i'
+ +' c #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"'
+ +'m c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaa'
+ +'amjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaa'
+ +'aabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10
+ +'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaa'
+ +'aaaaaaaaaaaaaa",'#10'"aaa``aa```aa````aa```aaa",'#10'"aa`aa`a`aa`a`aaaa`aaa'
+ +'`aa",'#10'"aa``aaa`aa`a```aa`aaaaaa",'#10'"aaaa``a```aa`aaaa`aaaaaa",'#10'"'
+ +'aa`aa`a`aaaa`aaaa`aaa`aa",'#10'"aaa``aa`aaaa````aa```aaa",'#10'"aaaaaaaaaaa'
+ +'aaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaa'
+ +'aa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"a'
+ +'amjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaa'
+ +'aabbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGSERIALNUMBERCODE','XPM',[
+ '/* XPM */'#10'static char *TOGSERIALNUMBERCODE_xpm[] = {'#10'/* width height'
+ +' num_colors chars_per_pixel */'#10'" 24 24 16 1",'#10
+ +'/* colors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"'
+ +'a c #808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10
+ +'"e c #808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10
+ +'"i c #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10
+ +'"m c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaa'
+ +'aamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabba'
+ +'aaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'
+ +#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaa'
+ +'aaaaaaaaaaaaaaaaa",'#10'"aaaaaaa```aa`aaa`aaaaaaa",'#10'"aaaaaa`aaa`a``aa`a'
+ +'aaaaaa",'#10'"aaaaaaa``aaa`a`a`aaaaaaa",'#10'"aaaaaaaa``aa`a`a`aaaaaaa",'#10
+ +'"aaaaaa`aaa`a`aa``aaaaaaa",'#10'"aaaaaaa```aa`aaa`aaaaaaa",'#10'"aaaaaaaaaa'
+ +'aaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaa'
+ +'aaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"'
+ +'aamjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabba'
+ +'aaabbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGREGISTRATIONCODE','XPM',[
+ '/* XPM */'#10'static char *TOGREGISTRATIONCODE_xpm[] = {'#10'/* width height'
+ +' num_colors chars_per_pixel */'#10'" 24 24 16 1",'#10
+ +'/* colors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"'
+ +'a c #808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10
+ +'"e c #808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10
+ +'"i c #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10
+ +'"m c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaa'
+ +'aamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabba'
+ +'aaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'
+ +#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaa'
+ +'aaaaaaaaaaaaaaaaa",'#10'"aaaa````aa````aa```aaaaa",'#10'"aaaa`aa``a`aaaa`aa'
+ +'a`aaaa",'#10'"aaaa`aaa`a```aa`aaaaaaaa",'#10'"aaaa````aa`aaaa`aa``aaaa",'#10
+ +'"aaaa`aaa`a`aaaa`aaa`aaaa",'#10'"aaaa`aaa`a````aa````aaaa",'#10'"aaaaaaaaaa'
+ +'aaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaa'
+ +'aaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"'
+ +'aamjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabba'
+ +'aaabbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGPROTECTEXE','XPM',[
+ '/* XPM */'#10'static char *TOGPROTECTEXE_xpm[] = {'#10'/* width height num_c'
+ +'olors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* c'
+ +'olors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c '
+ +'#808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c'
+ +' #808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i '
+ +'c #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m'
+ +' c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaa'
+ +'mjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaa'
+ +'abbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10
+ +'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaa'
+ +'aaaaaaaaaaaaaa",'#10'"a```aa```aaa```aa`aaa`aa",'#10'"a`aa`a`aa`a`aaa`aa`a`'
+ +'aaa",'#10'"a`aa`a`aa`a`aaa`aaa`aaaa",'#10'"a```aa```aa`aaa`aaa`aaaa",'#10'"'
+ +'a`aaaa`aa`a`aaa`aa`a`aaa",'#10'"a`aaaa`aa`aa```aa`aaa`aa",'#10'"aaaaaaaaaaa'
+ +'aaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaa'
+ +'aa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"a'
+ +'amjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaa'
+ +'aabbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGNETCODE','XPM',[
+ '/* XPM */'#10'static char *TOGNETCODE_xpm[] = {'#10'/* width height num_colo'
+ +'rs chars_per_pixel */'#10'" 24 24 16 1",'#10'/* colo'
+ +'rs */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #80'
+ +'8000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c #8'
+ +'08080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c #'
+ +'ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m c '
+ +'#ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaamja'
+ +'aaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaabb'
+ +'aa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"a'
+ +'aaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaa'
+ +'aaaaaaaaaaaa",'#10'"aaaa`aaa`aa````a`````aaa",'#10'"aaaa``aa`aa`aaaaaa`aaaa'
+ +'a",'#10'"aaaa`a`a`aa```aaaa`aaaaa",'#10'"aaaa`aa``aa`aaaaaa`aaaaa",'#10'"aa'
+ +'aa`aaa`aa`aaaaaa`aaaaa",'#10'"aaaa`aaa`aa````aaa`aaaaa",'#10'"aaaaaaaaaaaaa'
+ +'aaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa'
+ +'",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aam'
+ +'jaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaa'
+ +'bbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGMAKEKEYS','XPM',[
+ '/* XPM */'#10'static char *TOGMAKEKEYS_xpm[] = {'#10'/* width height num_col'
+ +'ors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* col'
+ +'ors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #8'
+ +'08000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c #'
+ +'808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c '
+ +'#ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m c'
+ +' #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaamj'
+ +'aaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaab'
+ +'baa",'#10'"aaaaaaaaaaaaaaaaamiiaaaa",'#10'"aaaaaaaaaaaaaaaamiiiaaaa",'#10'"'
+ +'aaaaaaaaaaaaaaamiii`aaaa",'#10'"aaaaaaaaaaaaaamiii`aaaaa",'#10'"aaaaaaaaaaa'
+ +'aamiii`aaaaaa",'#10'"aaaaaaammaamiiii`aaaaaaa",'#10'"aaaaamiiiiiiiii`aaaaaa'
+ +'aa",'#10'"aaaamiiiiiiiii`aaaaaaaaa",'#10'"aaaaiiiiiiiii``aaaaaaaaa",'#10'"a'
+ +'aamiiiiiiiii`aaaaaaaaaa",'#10'"aaamiiiiiiiiiiaaaaaaaaaa",'#10'"aaamii`aiiii'
+ +'i`aaaaaaaaaa",'#10'"aaamii`aaiiiiiaaaaaaaaaa",'#10'"aaaaii`aamiii`aaaaaaaaa'
+ +'a",'#10'"aaaaaiimmiii`aaaaaaaaaaa",'#10'"aaaaaai```i`aaaaaaaaaaaa",'#10'"aa'
+ +'aaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaa'
+ +'bmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaabbaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGMAKECODES','XPM',[
+ '/* XPM */'#10'static char *TOGMAKECODES_xpm[] = {'#10'/* width height num_co'
+ +'lors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* co'
+ +'lors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #'
+ +'808000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c '
+ +'#808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c'
+ +' #ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m '
+ +'c #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaaa'
+ +'aaaaaaaaaaamjaa",'#10'"abmmbaaajjjjjjjjaaabmmba",'#10'"aabbaajjjmmmmmmjjjaa'
+ +'bbaa",'#10'"aaaaajjmmmm`emmmmjjaaaaa",'#10'"aaaajmmmmmmm`mmmmmjjaaaa",'#10
+ +'"aaajmm`emmmmmmmme`mmjaaa",'#10'"aaajmmm`mmmjjmmm`mmmjaaa",'#10'"aajjmmmmmj'
+ +'bbbbjmmmmmjjaa",'#10'"aabmmmmmjbbbbbbjmmmmmbaa",'#10'"aabmmmmmbbmbmbbbmmmmm'
+ +'baa",'#10'"aabmemmmbmbmbmbbmm``mbaa",'#10'"aabm``mmbbmbmbmbmmmembaa",'#10'"'
+ +'aabmmmmmbmbmbmbbmmmmmbaa",'#10'"aabmmmmmj`mbmb`jmmmmmbaa",'#10'"aabbmmmmmj`'
+ +'jj`jmmmmmbbaa",'#10'"aaabmmm`mmj``jmm`emmbaaa",'#10'"aaabbm`emmmmmmmmm`mmba'
+ +'aa",'#10'"aaaabbmmmmmm`mmmmmbbaaaa",'#10'"aaaaa``mmmmm`emmm``aaaaa",'#10'"a'
+ +'amjaa```mmmmmmm``aamjaa",'#10'"abmmbaaa````````aaabmmba",'#10'"aabbaaaaaaaa'
+ +'aaaaaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGDAYSCODE','XPM',[
+ '/* XPM */'#10'static char *TOGDAYSCODE_xpm[] = {'#10'/* width height num_col'
+ +'ors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* col'
+ +'ors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #8'
+ +'08000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c #'
+ +'808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c '
+ +'#ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m c'
+ +' #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaamj'
+ +'aaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaab'
+ +'baa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"'
+ +'aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaa'
+ +'aaaaaaaaaaaaa",'#10'"a```aaaa`aaa`aaa`a```aaa",'#10'"a`aa`aaa``aaa`a`aa`aa`'
+ +'aa",'#10'"a`aa`aa```aaa```aa``aaaa",'#10'"a`aa`aa`aa`aaa`aaaaa``aa",'#10'"a'
+ +'`aa`aa````aaa`aaa`aa`aa",'#10'"a```aa``aa``aa`aaa```aaa",'#10'"aaaaaaaaaaaa'
+ +'aaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaa'
+ +'a",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aa'
+ +'mjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaa'
+ +'abbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
+LazarusResources.Add('TOGDATECODE','XPM',[
+ '/* XPM */'#10'static char *TOGDATECODE_xpm[] = {'#10'/* width height num_col'
+ +'ors chars_per_pixel */'#10'" 24 24 16 1",'#10'/* col'
+ +'ors */'#10'"` c #000000",'#10'". c #800000",'#10'"# c #008000",'#10'"a c #8'
+ +'08000",'#10'"b c #000080",'#10'"c c #800080",'#10'"d c #008080",'#10'"e c #'
+ +'808080",'#10'"f c #c0c0c0",'#10'"g c #ff0000",'#10'"h c #00ff00",'#10'"i c '
+ +'#ffff00",'#10'"j c #0000ff",'#10'"k c #ff00ff",'#10'"l c #00ffff",'#10'"m c'
+ +' #ffffff",'#10'/* pixels */'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aamjaaaamj'
+ +'aaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaaabbaaaab'
+ +'baa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"'
+ +'aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaa'
+ +'aaaaaaaaaaaaa",'#10'"a```aaaaa`aa`````a````aa",'#10'"a`aa`aaa``aaaa`aaa`aaa'
+ +'aa",'#10'"a`aa`aa`aa`aaa`aaa````aa",'#10'"a`aa`aa````aaa`aaa`aaaaa",'#10'"a'
+ +'`aa`aa`aa`aaa`aaa`aaaaa",'#10'"a```aa``aa``aa`aaa````aa",'#10'"aaaaaaaaaaaa'
+ +'aaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaa'
+ +'a",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa",'#10'"aa'
+ +'mjaaaamjaaaamjaaaamjaa",'#10'"abmmbaabmmbaabmmbaabmmba",'#10'"aabbaaaabbaaa'
+ +'abbaaaabbaa",'#10'"aaaaaaaaaaaaaaaaaaaaaaaa"'#10'};'#10
+]);
diff --git a/components/onguard/source/ogreg.pas b/components/onguard/source/ogreg.pas
new file mode 100644
index 000000000..5bb85f2a2
--- /dev/null
+++ b/components/onguard/source/ogreg.pas
@@ -0,0 +1,177 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* OGREG.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I ONGUARD.INC}
+
+
+unit ogreg; {AH.01}
+
+
+interface
+
+procedure Register;
+
+implementation
+
+uses
+ Classes, Forms, {AH.01}
+ qogabout0, ogconst,ognetwrk, ogproexe, {AH.01}
+ onguard, {AH.01}
+ qonguard2, {AH.01}
+ qonguard3, {AH.01}
+ qonguard5, {AH.01}
+ qonguard6, {AH.01}
+ qonguard7, {AH.01}
+ ogutil, {!!.12}
+ ComponentEditors,
+ PropEdits,
+ LazarusPackageIntf,
+ LResources;
+
+type
+ {component editor for TogCodeBase components}
+ TOgCodeGenEditor = class({TDefaultEditor}TDefaultComponentEditor)
+ public
+ procedure ExecuteVerb(Index : Integer);
+ override;
+ function GetVerb(Index : Integer) : string;
+ override;
+ function GetVerbCount : Integer;
+ override;
+ end;
+
+
+{*** TOgCodeGenEditor ***}
+
+procedure TOgCodeGenEditor.ExecuteVerb(Index : Integer);
+begin
+ if Index = 0 then begin
+ with TCodeGenerateFrm.Create(Application) do
+ try
+ ShowHint := True;
+ KeyFileName := OgKeyFile;
+ if Component is TOgDateCode then
+ CodeType := ctDate
+ else if Component is TOgDaysCode then
+ CodeType := ctDays
+ else if Component is TOgNetCode then
+ CodeType := ctNetwork
+ else if Component is TOgRegistrationCode then
+ CodeType := ctRegistration
+ else if Component is TOgSerialNumberCode then
+ CodeType := ctSerialNumber
+ else if Component is TOgSpecialCode then
+ CodeType := ctSpecial
+ else if Component is TOgUsageCode then
+ CodeType := ctUsage;
+ ShowModal;
+ finally
+ Free;
+ end;
+ end else if Index = 1 then begin
+ with TKeyMaintFrm.Create(Application) do
+ try
+ ShowHint := True;
+ KeyFileName := 'ONGUARD.INI';
+ KeyType := ktRandom;
+ ShowModal;
+ finally
+ Free;
+ end;
+ end;
+end;
+
+function TOgCodeGenEditor.GetVerb(Index : Integer) : string;
+begin
+ case Index of
+ 0 : Result := 'Generate Code';
+ 1 : Result := 'Generate Key';
+ else
+ Result := '?';
+ end;
+end;
+
+function TOgCodeGenEditor.GetVerbCount : Integer;
+begin
+ Result := 2;
+end;
+
+
+{component registration}
+procedure Register;
+begin
+ RegisterComponentEditor(TOgCodeBase, TOgCodeGenEditor);
+
+ RegisterPropertyEditor(
+ TypeInfo(string), TOgMakeKeys, 'KeyFileName', TOgFileNameProperty);
+ RegisterPropertyEditor(
+ TypeInfo(string), TOgMakeCodes, 'KeyFileName', TOgFileNameProperty);
+{ RegisterPropertyEditor( } {!!.09}
+{ TypeInfo(string), TOgCodeBase, 'Expires', TOgExpiresProperty);} {!!.09}
+ RegisterPropertyEditor(
+ TypeInfo(string), TOgCodeBase, 'Code', TOgCodeProperty);
+ RegisterPropertyEditor(
+ TypeInfo(string), TOgCodeBase, 'Modifier', TOgModifierProperty);
+ RegisterPropertyEditor(
+ TypeInfo(string), TOgCodeBase, 'About', TOgAboutProperty); {!!.08}
+ RegisterPropertyEditor(
+ TypeInfo(string), TOgProtectExe, 'About', TOgAboutProperty); {!!.08}
+ RegisterPropertyEditor(
+ TypeInfo(string), TOgMakeCodes, 'About', TOgAboutProperty); {!!.08}
+ RegisterPropertyEditor(
+ TypeInfo(string), TOgMakeKeys, 'About', TOgAboutProperty); {!!.08}
+
+ RegisterComponents('OnGuard', [
+ TOgMakeKeys,
+ TOgMakeCodes,
+ TOgDateCode,
+ TOgDaysCode,
+ TOgNetCode,
+ TOgRegistrationCode,
+ TOgSerialNumberCode,
+ TOgSpecialCode,
+ TOgUsageCode,
+ TOgProtectExe]);
+end;
+
+
+
+{$IFDEF FPC}
+initialization
+{$I ogreg.lrs}
+{$ENDIF}
+
+end.
+
+end.
diff --git a/components/onguard/source/ogsrmgr.pas b/components/onguard/source/ogsrmgr.pas
new file mode 100644
index 000000000..dbdb661ce
--- /dev/null
+++ b/components/onguard/source/ogsrmgr.pas
@@ -0,0 +1,493 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* TurboPower String Resource Support: SRMGR.PAS 1.03 *}
+{* Copyright (c) TurboPower Software Co 1996-1998 *}
+{* All rights reserved. *}
+{*********************************************************}
+{* SRMGR: TurboPower string resource runtime manager *}
+{*********************************************************}
+
+{ --------------------------------------------------------------------
+Notes:
+ Loads string resources created by SRMC.EXE and BRCC[32]. See the
+ comments in SRMC.PAS for additional information.
+
+ Both Create() and ChangeResource take an instance (module) handle
+ and a resource name. The resource from the module is then loaded. If
+ the resource is not found an ETpsStringResourceError is raised.
+
+ If you wish to alter our products' string resources to translate the
+ strings into a different language then you have two choices. In an
+ application written in Delphi 1 or Delphi 2 or Delphi 3 without
+ packages then you can alter the .TXT files containing the strings,
+ recompile them with our 32-bit SRMC utility to create an STR file,
+ and then recompile the RC resource files (which 'include' the STR
+ file) with Delphi's BRCC[32] program. Relink your application and it
+ will then have strings in your language of preference. For an
+ application created with Delphi 3 using packages, then the product
+ packages cannot be recompiled and hence the string resources in
+ those packages cannot be changed. This is where the ChangeResource
+ method comes in. Create a whole new resource (it must have a
+ different name than the one we use) in the manner described above.
+ It will be linked into your application. Now in your application,
+ say before the Application.Run call in your project, call
+ ChangeResource for the string resource object you want to change and
+ pass it the HInstance value of the application and the name of your
+ new resource. From now on that string resource object will use your
+ string resource instead of the original.
+
+ GetWideChar(), available in 32-bit applications only, returns a
+ UNICODE string directly from the resource.
+
+ GetAsciiZ() converts the UNICODE (32-bit) or DBCS (16-bit) string
+ from the resource into a DBCS null-terminated string using the
+ default code page.
+
+ GetString(), or the default Strings[] array property, also converts
+ the string to a DBCS or SBCS string using the default code page.
+
+ When the ReportError property is true, requesting a string whose
+ identifier is not found causes an ETpsStringResourceError exception.
+ When ReportError is false, no exception is generated but an empty
+ string is returned.
+
+ Based on TPSRES.PAS by Lee Inman.
+ Written by Kim Kokkonen.
+ --------------------------------------------------------------------
+}
+
+{$IFDEF Win32}
+ {include the resource compiled using BRCC32.EXE and SRMC.EXE}
+ {$R OGSRMGR.R32}
+{$ELSE}
+{$IFNDEF LINUX}
+ {include the resource compiled using BRCC.EXE and SRMC.EXE}
+ {$R OGSRMGR.R16}
+{$ELSE}
+ {$R OGSRMGR.R32}
+{$ENDIF}
+{$ENDIF}
+
+{$R-,S-,I-}
+
+{$IFDEF Win32}
+ {$H+} {Long strings} {!!.02}
+{$ENDIF}
+
+{For BCB 3.0 package support.}
+{$IFDEF VER110}
+ {$ObjExportAll On}
+{$ENDIF}
+
+{$IFNDEF VER80} {Delphi 1}
+ {$IFNDEF VER90} {Delphi 2}
+ {$IFNDEF VER93} {BCB 1}
+ {$DEFINE VERSION3} { Delphi 3.0 or BCB 3.0 or higher }
+ {$ENDIF}
+ {$ENDIF}
+{$ENDIF}
+
+unit ogsrmgr;
+
+interface
+
+uses
+{$IFDEF MSWINDOWS} {AH.01}
+ Windows, {AH.01}
+{$ENDIF} {AH.01}
+{$IFDEF UsingCLX} {AH.01}
+ Types, {AH.01}
+{$ENDIF} {AH.01}
+{$IFDEF LINUX} {AH.01}
+ Libc, {AH.01}
+{$ENDIF} {AH.01}
+ Classes, SysUtils;
+
+const
+ DefReportError = False;
+
+ {id at start of binary resource; must match SRMC}
+ ResID : array[0..3] of char = 'STR0';
+
+type
+ ETpsStringResourceError = class(Exception);
+
+{$IFDEF Win32}
+ TInt32 = Integer;
+{$ELSE}
+ TInt32 = LongInt;
+{$ENDIF}
+
+ PIndexRec = ^TIndexRec;
+ TIndexRec = record
+ id : TInt32;
+ ofs: TInt32;
+ len: TInt32;
+ end;
+ TIndexArray = array[0..(MaxInt div SizeOf(TIndexRec))-2] of TIndexRec;
+
+ PResourceRec = ^TResourceRec;
+ TResourceRec = record
+ id : array[0..3] of char;
+ count : LongInt;
+ index : TIndexArray;
+ end;
+
+ TOgStringResource = class
+ private
+ {property variables}
+ FReportError : Boolean; {true to raise exception if string not found}
+
+ {internal variables}
+ srHandle : THandle; {handle for TPStrings resource}
+ srP : PResourceRec; {pointer to start of resource}
+
+ {internal methods}
+ procedure srCloseResource;
+ function srFindIdent(Ident : TInt32) : PIndexRec;
+ procedure srLock;
+ procedure srLoadResource(Instance : THandle; const ResourceName : string);
+ procedure srOpenResource(Instance : THandle; const ResourceName : string);
+ procedure srUnLock;
+
+ public
+ constructor Create(Instance : THandle; const ResourceName : string); virtual;
+ destructor Destroy; override;
+ procedure ChangeResource(Instance : THandle; const ResourceName : string);
+
+ function GetAsciiZ(Ident : TInt32; Buffer : PChar; BufChars : Integer) : PChar;
+
+ function GetString(Ident : TInt32) : string;
+ property Strings[Ident : TInt32] : string
+ read GetString; default;
+{$IFDEF Win32}
+ function GetWideChar(Ident : TInt32; Buffer : PWideChar; BufChars : Integer) : PWideChar;
+{$ENDIF}
+
+ property ReportError : Boolean
+ read FReportError
+ write FReportError;
+ end;
+
+var
+ TpsResStrings : TOgStringResource; {error strings for this unit}
+
+{====================================================================}
+
+implementation
+
+{*** TOgStringResource ***}
+
+procedure TOgStringResource.ChangeResource(Instance : THandle; const ResourceName : string);
+begin
+ srCloseResource;
+ if ResourceName <> '' then
+ srOpenResource(Instance, ResourceName);
+end;
+
+constructor TOgStringResource.Create(Instance : THandle; const ResourceName : string);
+begin
+ inherited Create;
+ FReportError := DefReportError;
+ ChangeResource(Instance, ResourceName);
+end;
+
+destructor TOgStringResource.Destroy;
+begin
+ srCloseResource;
+ inherited Destroy;
+end;
+
+{$IFDEF Win32}
+procedure WideCopy(Dest, Src : PWideChar; Len : Integer);
+begin
+ while Len > 0 do begin
+ Dest^ := Src^;
+ inc(Dest);
+ inc(Src);
+ dec(Len);
+ end;
+ Dest^ := #0;
+end;
+
+function TOgStringResource.GetWideChar(Ident : TInt32;
+ Buffer : PWideChar; BufChars : Integer) : PWideChar;
+var
+ OLen : Integer;
+ P : PIndexRec;
+begin
+ srLock;
+ try
+ P := srFindIdent(Ident);
+ if P = nil then
+ Buffer[0] := #0
+
+ else begin
+ OLen := P^.len;
+ if OLen >= BufChars then
+ OLen := BufChars-1;
+ WideCopy(Buffer, PWideChar(PChar(srP)+P^.ofs), OLen);
+ end;
+ finally
+ srUnLock;
+ end;
+
+ Result := Buffer;
+end;
+
+function TOgStringResource.GetAsciiZ(Ident : TInt32;
+ Buffer : PChar; BufChars : Integer) : PChar;
+var
+ P : PIndexRec;
+ Src : PWideChar;
+ Len, OLen : Integer;
+begin
+ srLock;
+ try
+ P := srFindIdent(Ident);
+ if P = nil then
+ OLen := 0
+
+ else begin
+ Src := PWideChar(PChar(srP)+P^.ofs);
+ Len := P^.len;
+
+ {see if entire string fits in Buffer}
+ OLen := WideCharToMultiByte(CP_ACP, 0, Src, Len, nil, 0, nil, nil);
+
+ while OLen >= BufChars do begin
+ {reduce length to get what will fit}
+ dec(Len);
+ OLen := WideCharToMultiByte(CP_ACP, 0, Src, Len, nil, 0, nil, nil);
+ end;
+
+ {copy to buffer}
+ OLen := WideCharToMultiByte(CP_ACP, 0, Src, Len, Buffer, BufChars, nil, nil)
+ end;
+ finally
+ srUnLock;
+ end;
+
+ {null terminate the result}
+ Buffer[OLen] := #0;
+ Result := Buffer;
+end;
+
+function TOgStringResource.GetString(Ident : TInt32) : string;
+var
+ P : PIndexRec;
+ Src : PWideChar;
+ Len, OLen : Integer;
+begin
+ srLock;
+ try
+ P := srFindIdent(Ident);
+ if P = nil then
+ Result := ''
+
+ else begin
+ Src := PWideChar(PChar(srP)+P^.ofs);
+ Len := P^.len;
+ OLen := WideCharToMultiByte(CP_ACP, 0, Src, Len, nil, 0, nil, nil);
+ SetLength(Result, OLen);
+ WideCharToMultiByte(CP_ACP, 0, Src, Len, PChar(Result), OLen, nil, nil);
+ end;
+ finally
+ srUnLock;
+ end;
+end;
+
+{$ELSE}
+
+function TOgStringResource.GetAsciiZ(Ident : TInt32;
+ Buffer : PChar; BufChars : Integer) : PChar;
+var
+ OLen : Integer;
+ P : PIndexRec;
+begin
+ srLock;
+ try
+ P := srFindIdent(Ident);
+ if P = nil then
+ Buffer[0] := #0
+ else begin
+ OLen := P^.len;
+ if OLen >= BufChars then
+ OLen := BufChars-1;
+ StrLCopy(Buffer, PChar(srP)+P^.ofs, OLen);
+ Buffer[OLen] := #0;
+ end;
+ finally
+ srUnLock;
+ end;
+
+ Result := Buffer;
+end;
+
+function TOgStringResource.GetString(Ident : TInt32) : string;
+var
+ OLen : Integer;
+ Src : PChar;
+ P : PIndexRec;
+begin
+ srLock;
+ try
+ P := srFindIdent(Ident);
+ if P = nil then
+ Result := ''
+ else begin
+ OLen := P^.len;
+ if OLen > 255 then
+ OLen := 255;
+{$IFDEF MSWINDOWS}
+ Result[0] := Char(OLen);
+ Src := PChar(srP)+P^.ofs;
+ move(Src^, Result[1], OLen);
+{$ELSE}
+ Result := Src;
+{$ENDIF}
+ end;
+ finally
+ srUnLock;
+ end;
+end;
+
+{$ENDIF}
+
+procedure TOgStringResource.srCloseResource;
+begin
+ while Assigned(srP) do
+ srUnLock;
+
+ if srHandle <> 0 then begin
+ FreeResource(srHandle);
+ srHandle := 0;
+ end;
+end;
+
+function TOgStringResource.srFindIdent(Ident : TInt32) : PIndexRec;
+var
+ L, R, M : TInt32;
+begin
+ {binary search to find matching index record}
+ L := 0;
+ R := srP^.count-1;
+ while L <= R do begin
+ M := (L+R) shr 1;
+ Result := @srP^.index[M];
+ if Ident = Result^.id then
+ exit;
+ if Ident > Result^.id then
+ L := M+1
+ else
+ R := M-1;
+ end;
+
+ {not found}
+ Result := nil;
+ if FReportError then
+ raise ETpsStringResourceError.CreateFmt(TpsResStrings[1], [Ident]);
+end;
+
+procedure TOgStringResource.srLock;
+begin
+ srP := LockResource(srHandle);
+ if not Assigned(srP) then
+ raise ETpsStringResourceError.Create(TpsResStrings[2]);
+end;
+
+procedure TOgStringResource.srLoadResource(Instance : THandle; const ResourceName : string);
+var
+ H : THandle;
+ Buf : array[0..255] of Char;
+begin
+
+ StrPLCopy(Buf, ResourceName, SizeOf(Buf)-1);
+ {$IFDEF VERSION3} { resource DLL mechanism started in D3 }
+ {if not ModuleIsPackage then } {!!.04}
+ Instance := FindResourceHInstance(Instance); { get loaded Resource DLL if any }
+ {$ENDIF}
+ H := FindResource(Instance, Buf, RT_RCDATA); { attempt to load resource }
+ if H = 0 then begin { not found }
+ {$IFDEF VERSION3} {!!.04}
+ Instance := HInstance; {!!.04}
+ H := FindResource(Instance, Buf, RT_RCDATA); { try to find it in the main binary } {!!.04}
+ if H = 0 then { still not found?}
+ {$ENDIF} {!!.04}
+ raise ETpsStringResourceError.CreateFmt(TpsResStrings[3], [ResourceName]); { whine }
+ end;
+ srHandle := LoadResource(Instance, H);
+ if srHandle = 0 then
+ raise ETpsStringResourceError.CreateFmt(TpsResStrings[4], [ResourceName]);
+
+end;
+
+procedure TOgStringResource.srOpenResource(Instance : THandle; const ResourceName : string);
+begin
+ {find and load the resource}
+ srLoadResource(Instance, ResourceName);
+
+ {confirm it's in the correct format}
+ srLock;
+ try
+ if srP^.id <> ResId then
+ raise ETpsStringResourceError.Create(TpsResStrings[5]);
+ finally
+ srUnLock;
+ end;
+end;
+
+procedure TOgStringResource.srUnLock;
+begin
+ if not UnLockResource(srHandle) then
+ srP := nil;
+end;
+
+procedure FreeTpsResStrings; far;
+begin
+ TpsResStrings.Free;
+end;
+
+
+initialization
+ TpsResStrings := TOgStringResource.Create(HInstance, 'OGSRMGR_STRINGS');{!!.01}
+
+{$IFDEF Win32}
+finalization
+ FreeTpsResStrings;
+{$ELSE}
+{$IFNDEF LINUX}
+ AddExitProc(FreeTpsResStrings);
+{$ELSE}
+ FreeTpsResStrings;
+{$ENDIF}
+{$ENDIF}
+
+end.
diff --git a/components/onguard/source/ogutil.pas b/components/onguard/source/ogutil.pas
new file mode 100644
index 000000000..8bad29fd0
--- /dev/null
+++ b/components/onguard/source/ogutil.pas
@@ -0,0 +1,1865 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * Andrew Haines andrew@haines.name {AH.02}
+ * added conditional define "IBO_CONSOLE" {AH.02}
+ * this is to allow for making console {AH.02}
+ * applications with Kylix and not require {AH.02}
+ * X11 being linked in. {AH.02}
+ * January 07, 2004 {AH.02}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* OGUTIL.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I onguard.inc}
+
+
+unit ogutil;
+ {-general constants, types, and utility routines}
+
+interface
+
+uses
+ LCLIntf
+{$IFDEF LINUX} {AH.01}
+ ,BaseUnix
+{$ENDIF} {AH.01}
+ ,SysUtils
+ {$IFNDEF IBO_CONSOLE},Dialogs{$ENDIF} {AH.02}
+ ; {!!.08}
+
+const
+ DefAutoCheck = True;
+ DefAutoDecrease = True;
+ DefCheckSize = True;
+ DefStoreCode = False;
+ DefStoreModifier = False;
+ DefStoreRegString = False;
+
+const
+ OgVersionStr = '1.13';
+
+
+
+const
+ {largest structure that can be created}
+ {$IFDEF Win32}
+ MaxStructSize = 1024 * 2000000; {2G}
+ {$ELSE}
+ MaxStructSize = 1024 * 64 - 1; {64K}
+ {$ENDIF}
+
+type
+
+ PLongIntArray = ^TLongIntArray;
+ TLongIntArray = array [0..MaxStructSize div SizeOf(LongInt) - 1] of LongInt;
+
+ TLongIntRec = record
+ case Byte of
+ 1: (Lo: Word;
+ Hi: Word);
+ 2: (LoLo: Byte;
+ LoHi: Byte;
+ HiLo: Byte;
+ HiHi: Byte);
+ end;
+
+
+(*
+ moved these here from onguard.pas since I needed them for console work
+*)
+{$IFDEF IBO_CONSOLE} {AH.02}
+const
+ {magic values}
+ DaysCheckCode = $649B;
+ DateCheckCode = $A4CB;
+ NetCheckCode = $9341;
+ RegCheckCode = $D9F6;
+ SerialCheckCode = $3C69;
+ UsageCheckCode = $F3D5;
+ SpecialCheckCode = $9C5B;
+
+type
+ {code tyes}
+ PCode = ^TCode;
+ TCode = packed record
+ CheckValue : Word; {magic value}
+ Expiration : Word; {expiration date or 0, if none}
+ case Byte of
+ 0 : (FirstDate : Word; {for date code}
+ EndDate : Word);
+ 1 : (Days : Word; {for days code}
+ LastAccess : Word);
+ 2 : (RegString : LongInt); {for reg code}
+ 3 : (SerialNumber : LongInt); {for serial number code}
+ 4 : (UsageCount : Word; {for usage count code} {!!.02}
+ LastChange : Word); {!!.02}
+ 5 : (Value : LongInt); {for specail codes}
+ 6 : (NetIndex : LongInt); {for net codes}
+ end;
+
+type
+ TCodeType = (ctDate, ctDays, ctRegistration, ctSerialNumber,
+ ctUsage, ctNetwork, ctSpecial, ctUnknown);
+ {order must match tab order for code generation notebook}
+
+type
+ TKey = array [0..15] of Byte;
+ TKeyType = (ktRandom, ktMessageDigest, ktMessageDigestCS);
+ {order must match order for key generation combobox string list}
+
+type
+ {contexts}
+ TTMDContext = array [0..279] of Byte;
+ TMD5Context = array [0..87] of Byte;
+ TMD5Digest = array [0..15] of Byte;
+
+ {bit mixing types}
+ T128Bit = array [0..3] of LongInt;
+ T256Bit = array [0..7] of LongInt;
+
+const
+ DefCodeType = ctDate;
+ DefKeyType = ktRandom;
+
+type
+ TEsMachineInfoSet = {!!.05}
+ set of (midUser, midSystem, midNetwork, midDrives); {!!.05}
+
+type
+ {result of code verification}
+ TCodeStatus = (ogValidCode, {code is valid but may still be expired}
+ ogInvalidCode, {code is invalid}
+ ogPastEndDate, {end date has been reached}
+ ogDayCountUsed, {number of days authorized have been used}
+ ogRunCountUsed, {number of runs authorized have been used}
+ ogNetCountUsed, {number of authorized users has been exceeded}
+ ogCodeExpired); {expiration date has been reached}
+
+
+function GetCodeType(const Key : TKey; const Code : TCode) : TCodeType;
+ {-return the type of code}
+function GetExpirationDate(const Key : TKey; const Code : TCode) : TDateTime;
+ {-return the date this code expires}
+
+procedure InitDateCode(const Key : TKey; StartDate, EndDate : TDateTime; var Code : TCode);
+function IsDateCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+function GetDateCodeValue(const Key : TKey; const Code : TCode) : TDateTime;
+function IsDateCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+
+procedure InitDaysCode(const Key : TKey; Days : Word; Expires : TDateTime; var Code : TCode);
+function IsDaysCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+procedure DecDaysCode(const Key : TKey; var Code : TCode);
+function GetDaysCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+function IsDaysCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+
+procedure InitRegCode(const Key : TKey; const RegStr : string; Expires : TDateTime; var Code : TCode);
+function IsRegCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+function IsRegCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+
+procedure InitSerialNumberCode(const Key : TKey; Serial : LongInt; Expires : TDateTime; var Code : TCode);
+function IsSerialNumberCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+function GetSerialNumberCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+function IsSerialNumberCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+
+procedure InitSpecialCode(const Key : TKey; Value : LongInt; Expires : TDateTime; var Code : TCode);
+function IsSpecialCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+function GetSpecialCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+function IsSpecialCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+
+procedure InitUsageCode(const Key : TKey; Count : Word; Expires : TDateTime; var Code : TCode);
+function IsUsageCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+procedure DecUsageCode(const Key : TKey; var Code : TCode);
+function GetUsageCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+function IsUsageCodeExpired(const Key : TKey; const Code: TCode) : Boolean;
+
+
+{generate key routines}
+procedure GenerateRandomKeyPrim(var Key; KeySize : Cardinal);
+procedure GenerateTMDKeyPrim(var Key; KeySize : Cardinal; const Str : string);
+procedure GenerateMD5KeyPrim(var Key: TKey; const Str : string);
+
+{modifier routines}
+function CreateMachineID(MachineInfo : TEsMachineInfoSet) : LongInt; {!!.05}
+function GenerateStringModifierPrim(const S : string) : LongInt;
+function GenerateUniqueModifierPrim : LongInt;
+function GenerateMachineModifierPrim : LongInt;
+function GenerateDateModifierPrim(D : TDateTime) : LongInt;
+procedure ApplyModifierToKeyPrim(Modifier : LongInt; var Key; KeySize : Cardinal);
+
+{hash routines}
+function StringHashElf(const Str : string) : LongInt;
+
+{mixing routines}
+procedure MixBlock(const Matrix : T128Bit; var Block; Encrypt : Boolean);
+
+{utility routines}
+function ExpandDate(D : Word) : TDateTime;
+function ShrinkDate(D : TDateTime) : Word;
+
+{compressed code routines}
+{
+procedure CompressCodes(const Codes : Pointer; CodesSize : Integer; var Buffer : Pointer; var BufSize : Integer);
+function CompressCodesStr(const CodeStr : String): String;
+procedure DecompressCodes(const Codes : Pointer; var Buffer : Pointer);
+function DecompressCodesStr(const CodeStr : String; const OutEst : Integer): String;
+}
+const
+ BaseDate : LongInt = 0;
+
+{$ENDIF}
+
+function BufferToHex(const Buf; BufSize : Cardinal) : string;
+function BufferToHexBytes(const Buf; BufSize : Cardinal) : string;
+{$IFNDEF Win32}
+function GetDiskSerialNumber(Drive : AnsiChar) : LongInt;
+function MyHashElf(const Buf; BufSize : LongInt) : LongInt;
+{$ENDIF}
+function HexStringIsZero(const Hex : string) : Boolean;
+function HexToBuffer(const Hex : string; var Buf; BufSize : Cardinal) : Boolean;
+function Max(A, B : LongInt): LongInt;
+function Min(A, B : LongInt) : LongInt;
+procedure XorMem(var Mem1; const Mem2; Count : Cardinal);
+function OgFormatDate(Value : TDateTime) : string; {!!.09}
+
+{file related routines}
+function GetFileSize(Handle : THandle) : Cardinal;
+{$IFNDEF Win32}
+function LockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD;
+ nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWORD): Boolean;
+function UnlockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD;
+ nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh: DWORD): Boolean;
+{
+function LockFile(Handle : THandle; FileOffsetLow, FileOffsetHigh,
+ LockCountLow, LockCountHigh : Word) : Boolean;
+function UnlockFile(Handle : THandle; FileOffsetLow, FileOffsetHigh,
+ UnLockCountLow, UnLockCountHigh : Word) : Boolean;
+}
+function FlushFileBuffers(Handle : THandle) : Boolean;
+{$ENDIF}
+{$IFDEF LINUX}
+function GetDriveType(drive:Integer): Integer;
+function HiWord(I: DWORD):Word;
+function CoCreateGuid(out guid: TGUID): HResult;
+function timeGetTime: DWord;
+{$ENDIF}
+
+
+
+implementation
+
+
+function BufferToHex(const Buf; BufSize : Cardinal) : string;
+var
+ Bytes : TByteArray absolute Buf;
+ I : LongInt;
+begin
+ Result := '';
+ for I := 0 to BufSize - 1 do
+ Result := Result + IntToHex(Bytes[I], 2);
+end;
+
+function BufferToHexBytes(const Buf; BufSize : Cardinal) : string;
+var
+ Bytes : TByteArray absolute Buf;
+ I : LongInt;
+ HexStr : string;
+begin
+ HexStr := '$';
+ Result := HexStr + IntToHex(Bytes[0], 2);
+ for I := 1 to BufSize - 1 do
+ Result := Result + ',' + HexStr + IntToHex(Bytes[I], 2);
+end;
+
+{$IFNDEF LINUX}
+{$IFNDEF Win32}
+type
+ PMediaIDRec = ^TMediaIDRec;
+ TMediaIDRec = packed record
+ InfoLevel : Word; {reserved for future use}
+ SerialNumber : LongInt; {disk serial number}
+ VolumeLabel : array[0..10] of AnsiChar; {disk volume label}
+ FileSystemID : array[0..7] of AnsiChar; {string for internal use by the OS}
+ end;
+
+type
+ DPMIRegisters = record
+ DI : LongInt;
+ SI : LongInt;
+ BP : LongInt;
+ Reserved : LongInt;
+ case integer of
+ 1 : ( BX : LongInt;
+ DX : LongInt;
+ CX : LongInt;
+ AX : LongInt;
+ Flags : Word;
+ ES : Word;
+ DS : Word;
+ FS : Word;
+ GS : Word;
+ IP : Word;
+ CS : Word;
+ SP : Word;
+ SS : Word );
+ 2 : ( BL, BH : Byte; EBXH : Word;
+ DL, DH : Byte; EDXH : Word;
+ CL, CH : Byte; ECXH : Word;
+ AL, AH : Byte; EAXH : Word );
+ end;
+
+ OS = record
+ O, S : Word;
+ end;
+
+function GetCPUFlags : Byte; assembler;
+asm
+ lahf
+ mov al,ah
+end;
+
+function SimulateRealModeInt(IntNo : Byte; var Regs : DPMIRegisters) : Word; assembler;
+asm
+ xor bx,bx
+ mov bl,IntNo
+ xor cx,cx {StackWords = 0}
+ les di,Regs
+ mov ax,0300h
+ int 31h
+ jc @@ExitPoint
+
+ xor ax,ax
+@@ExitPoint:
+end;
+
+function GetMediaID(Drive : Byte; var MediaIDRec : TMediaIDRec) : Boolean;
+type
+ DoubleWord = record LoWord, HiWord : Word; end;
+var
+ L : LongInt;
+ RP, PP : PMediaIDRec;
+ Regs : DPMIRegisters;
+begin
+ Result := False;
+ L := GlobalDosAlloc(SizeOf(TMediaIDRec));
+ if L = 0 then
+ Exit;
+ try
+ RP := Ptr(DoubleWord(L).HiWord, 0);
+ PP := Ptr(DoubleWord(L).LoWord, 0);
+ FillChar(Regs, SizeOf(Regs), 0);
+ with Regs do begin
+ DS := OS(RP).S;
+ DX := OS(RP).O;
+ AX := $440D;
+ BX := Drive;
+ CX := $0866;
+ Flags := GetCPUFlags;
+ end;
+ SimulateRealModeInt($21, Regs);
+ if not Odd(Regs.Flags) then begin
+ MediaIDRec := PP^;
+ Result := True;
+ end;
+ finally
+ GlobalDosFree(OS(PP).S);
+ end;
+end;
+
+function GetDiskSerialNumber(Drive : AnsiChar) : LongInt;
+var
+ MR : TMediaIDRec;
+begin
+ if GetMediaID(Ord(UpCase(Drive))-Ord('A')+1 ,MR) then
+ Result := MR.SerialNumber
+ else
+ Result := -1;
+end;
+{$ENDIF}
+{$ENDIF}
+
+{$IFDEF LINUX}
+function MyHashElf(const Buf; BufSize : LongInt) : LongInt;
+var
+ Bytes : TByteArray absolute Buf;
+ I, X : LongInt;
+begin
+ Result := 0;
+ for I := 0 to BufSize - 1 do begin
+ Result := (Result shl 4) + Bytes[I];
+ X := Result and $F0000000;
+ if (X <> 0) then
+ Result := Result xor (X shr 24);
+ Result := Result and (not X);
+ end;
+end;
+
+function GetDiskSerialNumber(Drive : AnsiChar) : LongInt;
+var
+ boot_partition : String;
+ drive_model : String;
+ iFileHandle : Integer;
+ Buffer : PChar;
+ iFileSize : Integer;
+begin
+ // read /proc/cmdline
+ iFileHandle := FileOpen('/proc/cmdline', fmOpenRead or fmShareDenyNone);
+ iFileSize := FileSeek(iFileHandle,0,2);
+ Buffer := PChar(AllocMem(iFileSize+1));
+ FileSeek(iFileHandle,0,0);
+ FileRead(iFileHandle, Buffer^, iFileSize);
+ boot_partition := StrPas(Buffer);
+ FileClose(iFileHandle);
+ FreeMem(Buffer);
+
+ // get root=/dev/? into boot_partition
+ if Pos('root=/dev/', boot_partition) > 0 then
+ begin
+ Delete(boot_partition, 1, Pos('root=/dev/', boot_partition)-1);
+ if (Pos(' ', boot_partition) > 0) then
+ begin
+ boot_partition := Trim(LeftStr(boot_partition, Pos(' ', boot_partition)));
+ Delete(boot_partition, 1, 10);
+ boot_partition := LeftStr(boot_partition,3);
+ end;
+ end
+ else
+ begin
+ boot_partition := 'hda';
+ end;
+
+ if boot_partition[1] = 'h' then boot_partition := '/ide/' + boot_partition;
+ if boot_partition[1] = 's' then boot_partition := '/scsi/' + boot_partition;
+
+ // read /proc/ide/boot_partition/model
+ iFileHandle := FileOpen('/proc' + boot_partition + '/model', fmOpenRead or fmShareDenyNone);
+ iFileSize := FileSeek(iFileHandle,0,2);
+ Buffer := PChar(AllocMem(iFileSize+1));
+ FileSeek(iFileHandle,0,0);
+ FileRead(iFileHandle, Buffer^, iFileSize);
+ drive_model := StrPas(Buffer);
+ FileClose(iFileHandle);
+ FreeMem(Buffer);
+
+ // create a hash value of the drive_model to return an integer
+ Result := MyHashElf(drive_model[1], Length(drive_model));
+end;
+{$ENDIF}
+
+function HexStringIsZero(const Hex : string) : Boolean;
+var
+ I : Integer;
+ Str : string;
+begin
+ Result := False;
+
+ Str := '';
+ for I := 1 to Length(Hex) do
+ if Upcase(Hex[I]) in ['0'..'9', 'A'..'F'] then
+ Str := Str + Hex[I];
+
+ for I := 1 to Length(Str) do
+ if Str[I] <> '0' then
+ Exit;
+
+ Result := True;
+end;
+
+function HexToBuffer(const Hex : string; var Buf; BufSize : Cardinal) : Boolean;
+var
+ Bytes : TByteArray absolute Buf;
+ I, C : Integer;
+ Str : string;
+begin
+ Result := False;
+
+ Str := '';
+ for I := 1 to Length(Hex) do
+ if Upcase(Hex[I]) in ['0'..'9', 'A'..'F'] then
+ Str := Str + Hex[I];
+
+ if (Cardinal(Length(Str) div 2) <> BufSize) then {!!.07}
+ Exit;
+
+ for I := 0 to BufSize - 1 do begin
+ Val('$' + Copy(Str, (I shl 1) + 1, 2), Bytes[I], C);
+ if (C <> 0) then
+ Exit;
+ end;
+
+ Result := True;
+end;
+
+function Max(A, B : LongInt) : LongInt;
+begin
+ if A > B then
+ Result := A
+ else
+ Result := B;
+end;
+
+
+function Min(A, B : LongInt) : LongInt;
+begin
+ if A < B then
+ Result := A
+ else
+ Result := B;
+end;
+
+{ Functions below were replaced by
+not fully compatible but easier pure pascal version
+to do it multiplatform}
+
+(*
+{$IFDEF Win32}
+procedure XorMem(var Mem1; const Mem2; Count : Cardinal); register;
+begin
+asm
+ push esi
+ push edi
+
+ mov esi, eax //esi = Mem1
+ mov edi, edx //edi = Mem2
+
+ push ecx //save byte count
+ shr ecx, 2 //convert to dwords
+ jz @Continue
+
+ cld
+@Loop1: //xor dwords at a time
+ mov eax, [edi]
+ xor [esi], eax
+ add esi, 4
+ add edi, 4
+ dec ecx
+ jnz @Loop1
+
+@Continue: //handle remaining bytes (3 or less)
+ pop ecx
+ and ecx, 3
+ jz @Done
+
+@Loop2: //xor remaining bytes
+ mov al, [edi]
+ xor [esi], al
+ inc esi
+ inc edi
+ dec ecx
+ jnz @Loop2
+
+@Done:
+ pop edi
+ pop esi
+end;
+end;
+{$ELSE}
+{!!.02} {revised}
+{$IFNDEF LINUX}
+procedure XorMem(var Mem1; const Mem2; Count : Cardinal); assembler;
+asm
+ push ds
+ push es
+ lds si, Mem2
+ les di, Mem1
+ mov cx, Count
+ jz @Done
+ cld
+@Loop1:
+ mov al, ds:[si]
+ xor es:[di], al
+ inc si
+ inc di
+ dec cx
+ jnz @Loop1
+@Done:
+ pop es
+ pop ds
+end;
+{$ENDIF}
+{$ENDIF}
+
+{$IFDEF LINUX}
+procedure XorMem(var Mem1; const Mem2; Count : Cardinal); register;
+begin
+asm
+ push esi
+ push edi
+
+ mov esi, eax //esi = Mem1
+ mov edi, edx //edi = Mem2
+
+ push ecx //save byte count
+ shr ecx, 2 //convert to dwords
+ jz @Continue
+
+ cld
+@Loop1: //xor dwords at a time
+ mov eax, [edi]
+ xor [esi], eax
+ add esi, 4
+ add edi, 4
+ dec ecx
+ jnz @Loop1
+
+@Continue: //handle remaining bytes (3 or less)
+ pop ecx
+ and ecx, 3
+ jz @Done
+
+@Loop2: //xor remaining bytes
+ mov al, [edi]
+ xor [esi], al
+ inc esi
+ inc edi
+ dec ecx
+ jnz @Loop2
+
+@Done:
+ pop edi
+ pop esi
+end;
+end;
+{$ENDIF}
+*)
+
+procedure XorMem(var Mem1; const Mem2; Count : Cardinal);
+var
+ pB1,pB2 : PByte;
+ B1,B2 : Byte;
+ i : Cardinal;
+begin
+if Count = 0 then Exit;
+i := 0;
+pB1 := PByte(@Mem1);//Mem1
+pB2 := PByte(@Mem2);//Mem2
+while i < Count do
+begin
+ B1 := pB1^;
+ B2 := pB2^;
+ pB1^ := B1 xor B2;
+ Inc(pB1);
+ Inc(pB2);
+ Inc(i);
+end;
+end;
+
+
+
+
+
+{!!.09}
+function OgFormatDate(Value : TDateTime) : string;
+ {convert date to string with 4-digit year and 2-digit month}
+var
+ S : string;
+begin
+ ShortDateFormat := 'yyyy-mm-dd';
+ {
+ S := ShortDateFormat;
+ if Pos('yyyy', S) = 0 then
+ Insert('yy', S, Pos('yy', S));
+ if Pos('MMM', S) > 0 then
+ Delete(S, Pos('MMM', S), 1);
+ }
+ Result := DateToStr(Value);//FormatDateTime(S, Value)
+end;
+
+
+{file related routines}
+function GetFileSize(Handle : THandle) : Cardinal;
+var
+ Save : LongInt;
+begin
+ Save := FileSeek(Handle, 0, 0); {save current file position}
+ Result := FileSeek(Handle, 0, 2); {get file size}
+ FileSeek(Handle, Save, 0); {restore previous position}
+end;
+
+{$IFDEF LINUX}
+
+{
+ these functions need to be fleshed out
+ probably find similar functions in Libc
+}
+
+
+
+
+
+
+
+(*
+const
+ SEEK_SET = 0; { Seek from beginning of file. }
+ SEEK_CUR = 1; { Seek from current position. }
+ SEEK_END = 2; { Seek from end of file. }
+
+{ Old BSD names for the same constants; just for compatibility. }
+ L_SET = SEEK_SET;
+ L_INCR = SEEK_CUR;
+ L_XTND = SEEK_END;
+*)
+
+
+{$ifdef FPC}
+const
+ F_RDLCK = 0;
+ F_WRLCK = 1;
+ F_UNLCK = 2;
+ F_EXLCK = 4;
+ F_SHLCK = 8;
+
+ LOCK_SH = 1;
+ LOCK_EX = 2;
+ LOCK_NB = 4;
+ LOCK_UN = 8;
+
+ LOCK_MAND = 32;
+ LOCK_READ = 64;
+ LOCK_WRITE = 128;
+ LOCK_RW = 192;
+
+ EACCES = ESysEACCES;
+ EAGAIN = ESysEAGAIN;
+{$endif}
+
+
+
+
+function GetLastError: Integer;
+begin
+ Result := FpGetErrno;
+end;
+
+procedure SetLastError(Value: Integer);
+begin
+ FpSetErrno(Value);
+end;
+
+function LockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD; nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWORD): Boolean;
+var
+ FLockInfo: {$ifdef FPC}BaseUnix.FLock{$else}TFLock{$endif};
+ FLastError: Cardinal;
+begin
+ Result := false;
+ FLockInfo.l_type := F_WRLCK;
+ FLockInfo.l_whence := SEEK_SET;
+ FLockInfo.l_start := dwFileOffsetLow;
+ FLockInfo.l_len := nNumberOfBytesToLockLow;
+ FLockInfo.l_pid := {$ifdef FPC}fpgetpid{$else}getpid{$endif}();
+ Result := {$ifdef FPC}fpfcntl{$else}fcntl{$endif}(hFile, F_SETLK, FLockInfo) <> -1;
+ if not Result then
+ begin
+ FLastError := GetLastError();
+ if (FLastError = EACCES) or (FLastError = EAGAIN) then
+ SetLastError(ESysEACCES)
+ else
+ Result := True; // If errno is ENOLCK or EINVAL
+ end;
+end;
+
+function UnlockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD; nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh: DWORD): Boolean;
+var
+ FLockInfo: {$ifdef FPC}BaseUnix.FLock{$else}TFLock{$endif};
+begin
+ FLockInfo.l_type := F_UNLCK;
+ FLockInfo.l_whence := SEEK_SET;
+ FLockInfo.l_start := dwFileOffsetLow;
+ FLockInfo.l_len := nNumberOfBytesToUnLockLow;
+ FLockInfo.l_pid := {$ifdef FPC}fpgetpid{$else}getpid{$endif}();
+ Result := {$ifdef FPC}fpfcntl{$else}fcntl{$endif}(hFile, F_SETLK, FLockInfo) <> -1;
+end;
+
+
+
+{
+function LockFile(Handle : THandle;
+ FileOffsetLow, FileOffsetHigh,
+ LockCountLow, LockCountHigh : Word) : Boolean;
+var
+ LockVar : TFlock;
+begin
+ LockVar.l_whence := SEEK_SET;
+ LockVar.l_start := FileOffSetHigh;
+ LockVar.l_start := (LockVar.l_start shr 16) + FileOffSetLow;
+ LockVar.l_len := LockCountHigh;
+ LockVar.l_len := (LockVar.l_len shr 16) + LockCountLow;
+ LockVar.l_type := F_WRLCK;
+
+ if fcntl(Handle, F_SETLK, LockVar) = 0 then Result := True else Result := False;
+end;
+
+function UnlockFile(Handle : THandle;
+ FileOffsetLow, FileOffsetHigh,
+ UnLockCountLow, UnLockCountHigh : Word) : Boolean;
+var
+ LockVar : TFlock;
+begin
+ LockVar.l_whence := SEEK_SET;
+ LockVar.l_start := FileOffSetHigh;
+ LockVar.l_start := (LockVar.l_start shr 16) + FileOffSetLow;
+ LockVar.l_len := UnLockCountHigh;
+ LockVar.l_len := (LockVar.l_len shr 16) + UnLockCountLow;
+ LockVar.l_type := F_UNLCK;
+
+ if fcntl(Handle, F_SETLK, LockVar) = 0 then Result := True else Result := False;
+end;
+}
+
+function FlushFileBuffers(Handle : THandle) : Boolean;
+begin
+ Result := True;
+end;
+{$ENDIF}
+
+
+(*
+{$IFDEF Win32}
+function RolByteX(I, C : Byte) : Byte; register;
+asm
+ mov cl, dl
+ rol al, cl
+end;
+{$ELSE}
+function RolByteX(I, C : Byte) : Byte; assembler;
+asm
+ mov al, I
+ mov cl, C
+ rol al, cl
+end;
+{$ENDIF}
+*)
+
+
+{$IFDEF LINUX}
+function GetDriveType(drive:Integer): Integer;
+const
+ DRIVE_UNKNOWN = 0;
+ DRIVE_NO_ROOT_DIR = 1;
+ DRIVE_REMOVABLE = 2;
+ DRIVE_FIXED = 3;
+ DRIVE_REMOTE = 4;
+ DRIVE_CDROM = 5;
+ DRIVE_RAMDISK = 6;
+var
+ f: TextFile;
+ fn : String;
+ media : String;
+begin
+ Result := DRIVE_UNKNOWN;
+ // drive = 1-25 (A-Z)
+
+ //assuming IDE drives
+ //assuming C: = hda
+ case drive of
+ 1: fn := '';
+ 2: fn := '';
+ 3: fn := 'hda';
+ 4: fn := 'hdb';
+ 5: fn := 'hdc';
+ 6: fn := 'hdd';
+ 7: fn := '';
+ 8..25: fn := '';
+ end;
+
+ if fn = '' then
+ begin
+ Result := DRIVE_UNKNOWN;
+ end
+ else
+ begin
+ {$I-}
+ if fn[1] = 'h' then AssignFile(f, '/proc/ide/' + fn + '/media');
+ Reset(f);
+ media := '';
+ if IoResult=0 then ReadLn(f, media)
+ else
+ Exit;
+ {$I+}
+
+ if media = 'disk' then Result := DRIVE_FIXED;
+ if media = 'cdrom' then Result := DRIVE_CDROM;
+ if media = 'floppy' then Result := DRIVE_REMOVABLE;
+
+ CloseFile(f);
+ end;
+end;
+
+
+
+function HiWord(I: DWORD):Word;
+begin
+ Result := I shl 16;
+ Result := I and $FFFF;
+end;
+
+function CoCreateGuid(out guid: TGUID): HResult;
+begin
+ Result := CreateGuid(Guid);
+end;
+
+
+function timeGetTime: DWord;
+begin
+ // returns the milliseconds since the machine was restarted
+ // will wrap around to 0 every 2^32 milliseconds (49.7 days)
+ Result := GetTickCount;
+end;
+{$ENDIF}
+
+
+{$IFDEF IBO_CONSOLE}
+{first 2048 bits of Pi in hexadecimal, low to high, without the leading "3"}
+const
+ Pi2048: array [0..255] of Byte = (
+ $24, $3F, $6A, $88, $85, $A3, $08, $D3, $13, $19, $8A, $2E, $03, $70, $73, $44,
+ $A4, $09, $38, $22, $29, $9F, $31, $D0, $08, $2E, $FA, $98, $EC, $4E, $6C, $89,
+ $45, $28, $21, $E6, $38, $D0, $13, $77, $BE, $54, $66, $CF, $34, $E9, $0C, $6C,
+ $C0, $AC, $29, $B7, $C9, $7C, $50, $DD, $3F, $84, $D5, $B5, $B5, $47, $09, $17,
+ $92, $16, $D5, $D9, $89, $79, $FB, $1B, $D1, $31, $0B, $A6, $98, $DF, $B5, $AC,
+ $2F, $FD, $72, $DB, $D0, $1A, $DF, $B7, $B8, $E1, $AF, $ED, $6A, $26, $7E, $96,
+ $BA, $7C, $90, $45, $F1, $2C, $7F, $99, $24, $A1, $99, $47, $B3, $91, $6C, $F7,
+ $08, $01, $F2, $E2, $85, $8E, $FC, $16, $63, $69, $20, $D8, $71, $57, $4E, $69,
+ $A4, $58, $FE, $A3, $F4, $93, $3D, $7E, $0D, $95, $74, $8F, $72, $8E, $B6, $58,
+ $71, $8B, $CD, $58, $82, $15, $4A, $EE, $7B, $54, $A4, $1D, $C2, $5A, $59, $B5,
+ $9C, $30, $D5, $39, $2A, $F2, $60, $13, $C5, $D1, $B0, $23, $28, $60, $85, $F0,
+ $CA, $41, $79, $18, $B8, $DB, $38, $EF, $8E, $79, $DC, $B0, $60, $3A, $18, $0E,
+ $6C, $9E, $0E, $8B, $B0, $1E, $8A, $3E, $D7, $15, $77, $C1, $BD, $31, $4B, $27,
+ $78, $AF, $2F, $DA, $55, $60, $5C, $60, $E6, $55, $25, $F3, $AA, $55, $AB, $94,
+ $57, $48, $98, $62, $63, $E8, $14, $40, $55, $CA, $39, $6A, $2A, $AB, $10, $B6,
+ $B4, $CC, $5C, $34, $11, $41, $E8, $CE, $A1, $54, $86, $AF, $7C, $72, $E9, $93);
+
+
+{mixing routines}
+procedure Mix128(var X : T128Bit);
+var
+ AA, BB, CC, DD : LongInt;
+begin
+ AA := X[0]; BB := X[1]; CC := X[2]; DD := X[3];
+
+ AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 7);
+ BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 13);
+ CC := CC + BB; BB := BB + CC; CC := CC xor (CC shr 17);
+ DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 9);
+ AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 3);
+ BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 7);
+ CC := CC + BB; BB := BB + CC; CC := CC xor (DD shr 15);
+ DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 11);
+
+ X[0] := AA; X[1] := BB; X[2] := CC; X[3] := DD;
+end;
+
+{quick (block) mixer routine}
+procedure MixBlock(const Matrix : T128bit; var Block; Encrypt : Boolean);
+const
+ CKeyBox : array [False..True, 0..3, 0..2] of LongInt =
+ (((0, 3, 1), (2, 1, 3), (1, 0, 2), (3, 2, 0)),
+ ((3, 2, 0), (1, 0, 2), (2, 1, 3), (0, 3, 1)));
+var
+ Blocks : array [0..1] of LongInt absolute Block;
+ Work : LongInt;
+ Right : LongInt;
+ Left : LongInt;
+ R : LongInt;
+ AA, BB : LongInt;
+ CC, DD : LongInt;
+begin
+ Right := Blocks[0];
+ Left := Blocks[1];
+
+ for R := 0 to 3 do begin
+ {transform the right side}
+ AA := Right;
+ BB := Matrix[CKeyBox[Encrypt, R, 0]];
+ CC := Matrix[CKeyBox[Encrypt, R, 1]];
+ DD := Matrix[CKeyBox[Encrypt, R, 2]];
+
+ {commented code does not affect results - removed for speed}
+ AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 7);
+ BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 13);
+ CC := CC + BB; BB := BB + CC; CC := CC xor (CC shr 17);
+ DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 9);
+ AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 3);
+ BB := BB + AA; {AA := AA + BB;} BB := BB xor (BB shl 7);
+ CC := CC + BB; {BB := BB + CC;} CC := CC xor (DD shr 15);
+ DD := DD + CC; {CC := CC + DD;} DD := DD xor (DD shl 11);
+
+ Work := Left xor DD;
+ Left := Right;
+ Right := Work;
+ end;
+
+ Blocks[0] := Left;
+ Blocks[1] := Right;
+end;
+
+function HashElf(const Buf; BufSize : LongInt) : LongInt;
+var
+ Bytes : TByteArray absolute Buf;
+ I, X : LongInt;
+begin
+ Result := 0;
+ for I := 0 to BufSize - 1 do begin
+ Result := (Result shl 4) + Bytes[I];
+ X := Result and $F0000000;
+ if (X <> 0) then
+ Result := Result xor (X shr 24);
+ Result := Result and (not X);
+ end;
+end;
+
+function StringHashElf(const Str : string) : LongInt;
+begin
+ Result := HashElf(Str[1], Length(Str));
+end;
+
+{internal routines for MD5}
+type
+ TMD5ContextEx = record
+ Count : array [0..1] of DWord; {number of bits handled mod 2^64}
+ State : array [0..3] of DWord; {scratch buffer}
+ Buf : array [0..63] of Byte; {input buffer}
+ end;
+
+
+
+{message digest routines}
+type
+ TMDContextEx = record
+ DigestIndex : LongInt;
+ Digest : array [0..255] of Byte;
+ KeyIndex : LongInt;
+ case Byte of
+ 0: (KeyInts : array [0..3] of LongInt);
+ 1: (Key : TKey);
+ end;
+ TBlock2048 = array [0..255] of Byte;
+
+procedure InitTMD(var Context : TTMDContext);
+var
+ ContextEx : TMDContextEx absolute Context;
+begin
+ ContextEx.DigestIndex := 0;
+ TBlock2048(ContextEx.Digest) := TBlock2048(Pi2048);
+
+ ContextEx.KeyIndex := 0;
+ ContextEx.KeyInts[0] := $55555555;
+ ContextEx.KeyInts[1] := $55555555;
+ ContextEx.KeyInts[2] := $55555555;
+ ContextEx.KeyInts[3] := $55555555;
+end;
+
+procedure UpdateTMD(var Context : TTMDContext; const Buf; BufSize : LongInt);
+var
+ ContextEx : TMDContextEx absolute Context;
+ BufBytes : TByteArray absolute Buf;
+ AA, BB : LongInt;
+ CC, DD : LongInt;
+ I, R : LongInt;
+begin
+ for I := 0 to BufSize - 1 do
+ with ContextEx do begin
+ {update Digest}
+ Digest[DigestIndex] := Digest[DigestIndex] xor BufBytes[I];
+ DigestIndex := DigestIndex + 1;
+ if (DigestIndex = SizeOf(Digest)) then
+ DigestIndex := 0;
+
+ {update BlockKey}
+ Key[KeyIndex] := Key[KeyIndex] xor BufBytes[I];
+ KeyIndex := KeyIndex + 1;
+ if (KeyIndex = SizeOf(Key) div 2) then begin
+ AA := KeyInts[3];
+ BB := KeyInts[2];
+ CC := KeyInts[1];
+ DD := KeyInts[0];
+
+ {mix all the bits around for 4 rounds}
+ {achieves avalanche and eliminates funnels}
+ for R := 0 to 3 do begin
+ AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 7);
+ BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 13);
+ CC := CC + BB; BB := BB + CC; CC := CC xor (CC shr 17);
+ DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 9);
+ AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 3);
+ BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 7);
+ CC := CC + BB; BB := BB + CC; CC := CC xor (DD shr 15);
+ DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 11);
+ end;
+
+ KeyInts[0] := AA;
+ KeyInts[1] := BB;
+ KeyInts[2] := CC;
+ KeyInts[3] := DD;
+
+ KeyIndex := 0;
+ end;
+ end;
+end;
+
+procedure FinalizeTMD(var Context : TTMDContext; var Digest; DigestSize : LongInt);
+const
+ Padding : array [0..7] of Byte = (1, 0, 0, 0, 0, 0, 0, 0);
+var
+ ContextEx : TMDContextEx absolute Context;
+ I : Integer;
+begin
+ {pad with "1", followed by as many "0"s as needed to fill the block}
+ UpdateTMD(Context, Padding, SizeOf(Padding) - ContextEx.KeyIndex);
+
+ {mix each block within Context with the key}
+ for I := 0 to (SizeOf(ContextEx.Digest) div SizeOf(TCode)) - 1 do
+ MixBlock(T128Bit(ContextEx.Key), PCode(@ContextEx.Digest[I * SizeOf(TCode)])^, True);
+
+ {return Digest of requested DigestSize}
+ {max digest is 2048-bit, although it could be greater if Pi2048 was larger}
+ Move(ContextEx.Digest, Digest, Min(SizeOf(ContextEx.Digest), DigestSize));
+end;
+
+{message digest hash}
+procedure HashTMD(var Digest; DigestSize : LongInt; const Buf; BufSize : LongInt);
+var
+ Context : TTMDContext;
+begin
+ InitTMD(Context);
+ UpdateTMD(Context, Buf, BufSize);
+ FinalizeTMD(Context, Digest, DigestSize);
+end;
+
+{$IFDEF Win32}
+{!!.05} {added}
+function CreateMachineID(MachineInfo : TEsMachineInfoSet) : LongInt;
+{ Obtains information from:
+ - Volume sizes (NOT free space)
+ - Volume serial numbers
+ - Registration name and company
+ - GetSystemInfo relevant info
+ - Network card ID (if available)
+}
+const
+ sCurVer = 'Software\Microsoft\Windows\CurrentVersion'; {!!.11}
+ sCurVerNT = 'Software\Microsoft\Windows NT\CurrentVersion'; {!!.11}
+ sRegOwner = 'RegisteredOwner'; {!!.11}
+ sRegOrg = 'RegisteredOrganization'; {!!.11}
+
+type {!!.11}
+ TUuidCreateSequential = function (lpGUID : Pointer): HResult; stdcall; {!!.11}
+
+var
+ hRPCTR4 : THandle; {!!.11}
+ UuidCreateSequential : TUuidCreateSequential; {!!.11}
+ I : DWord;
+ RegKey : HKEY;
+ GUID1 : TGUID;
+ GUID2 : TGUID;
+ Drive : AnsiChar;
+ SysInfo : TSystemInfo;
+ Context : TTMDContext;
+ UserInfoFound : Boolean; {!!.11}
+ Buf : array [0..1023] of Byte;
+begin
+ InitTMD(Context);
+
+ {include user specific information}
+ if midUser in MachineInfo then begin
+{!!.11}
+ UserInfoFound := False;
+ { first look for registered info in \Windows\CurrentVersion }
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, sCurVer, 0,
+ KEY_QUERY_VALUE, RegKey) = ERROR_SUCCESS) then begin
+ I := SizeOf(Buf);
+ if RegQueryValueEx(RegKey, sRegOwner, nil, nil, @Buf, @I) = ERROR_SUCCESS then begin
+ UserInfoFound := True;
+ UpdateTMD(Context, Buf, I);
+ I := SizeOf(Buf);
+ if RegQueryValueEx(RegKey, sRegOrg, nil, nil, @Buf, @I) = ERROR_SUCCESS then
+ UpdateTMD(Context, Buf, I);
+ end;
+ RegCloseKey(RegKey); {!!.13}
+ end;
+
+{!!.11}
+ { if not found, then look in \Windows NT\CurrentVersion }
+ if not UserInfoFound then
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, sCurVerNT, 0,
+ KEY_QUERY_VALUE, RegKey) = ERROR_SUCCESS) then begin
+ I := SizeOf(Buf);
+ if RegQueryValueEx(RegKey, sRegOwner, nil, nil, @Buf, @I) = ERROR_SUCCESS then begin
+ UpdateTMD(Context, Buf, I);
+ I := SizeOf(Buf);
+ if RegQueryValueEx(RegKey, sRegOrg, nil, nil, @Buf, @I) = ERROR_SUCCESS then
+ UpdateTMD(Context, Buf, I);
+ end;
+ RegCloseKey(RegKey); {!!.13}
+ end;
+ end;
+
+ if midSystem in MachineInfo then begin
+ {include system specific information}
+ GetSystemInfo(SysInfo);
+ PDWord(@Buf[0])^ := SysInfo.dwOemId;
+ PDWord(@Buf[4])^ := SysInfo.dwProcessorType;
+ UpdateTMD(Context, Buf, 8);
+ end;
+
+ if midNetwork in MachineInfo then begin
+ {include network ID}
+ CreateGuid(GUID1);
+ CreateGuid(GUID2);
+
+{!!.11}
+ { use UuidCreateSequential instead of CoCreateGuid if available }
+ hRPCTR4 := LoadLibrary('rpcrt4.dll');
+ if (hRPCTR4 <> 0) then begin
+ @UuidCreateSequential := GetProcAddress(hRPCTR4, 'UuidCreateSequential');
+ if Assigned(UuidCreateSequential) then begin
+ UuidCreateSequential(@GUID1);
+ UuidCreateSequential(@GUID2);
+ end;
+ FreeLibrary(hRPCTR4); {!!.13}
+ end;
+{!!.11}
+
+ {check to see if "network" ID is available}
+ if (GUID1.D4[2] = GUID2.D4[2]) and
+ (GUID1.D4[3] = GUID2.D4[3]) and
+ (GUID1.D4[4] = GUID2.D4[4]) and
+ (GUID1.D4[5] = GUID2.D4[5]) and
+ (GUID1.D4[6] = GUID2.D4[6]) and
+ (GUID1.D4[7] = GUID2.D4[7]) then
+ UpdateTMD(Context, GUID1.D4[2], 6);
+ end;
+
+ if midDrives in MachineInfo then begin
+ {include drive specific information}
+ for Drive := 'C' to 'Z' do begin
+
+ if (GetDriveType(PAnsiChar(Drive + ':\')) = DRIVE_FIXED) then begin
+ FillChar(Buf, Sizeof(Buf), 0);
+ Buf[0] := Byte(Drive);
+ {!!.16} {removed cluster information}
+ GetVolumeInformation(PAnsiChar(Drive + ':\'), nil, 0,
+ PDWord(@Buf[1]){serial number}, I{not used}, I{not used}, nil, 0);
+ UpdateTMD(Context, Buf, 5);
+ end;
+ end;
+ end;
+
+ FinalizeTMD(Context, Result, SizeOf(Result));
+end;
+{$ELSE}
+{$IFNDEF LINUX}
+function CreateMachineID(MachineInfo : TEsMachineInfoSet) : LongInt;
+var
+ I : DWord;
+ RegKey : DWord;
+ GUID1 : TGUID;
+ GUID2 : TGUID;
+ Drive : Integer;
+ Context : TTMDContext;
+ Buf : array [0..1023] of Byte;
+begin
+ InitTMD(Context);
+
+ {no user (midUser) information under Win16}
+
+ if midSystem in MachineInfo then begin
+ {include system specific information}
+ I := GetWindowsDirectory(@Buf, SizeOf(Buf));
+ UpdateTMD(Context, Buf, I);
+ I := GetSystemDirectory(@Buf, SizeOf(Buf));
+ UpdateTMD(Context, Buf, I);
+
+ PLongInt(@Buf[0])^ := GetWinFlags;
+ PLongInt(@Buf[4])^ := WinProcs.GetVersion;
+ UpdateTMD(Context, Buf, 8);
+ end;
+
+ if midNetwork in MachineInfo then begin
+ {include network ID}
+ CreateGuid(GUID1);
+ CreateGuid(GUID2);
+ {check to see if "network" ID is available}
+ if (GUID1.Data4[2] = GUID2.Data4[2]) and
+ (GUID1.Data4[3] = GUID2.Data4[3]) and
+ (GUID1.Data4[4] = GUID2.Data4[4]) and
+ (GUID1.Data4[5] = GUID2.Data4[5]) and
+ (GUID1.Data4[6] = GUID2.Data4[6]) and
+ (GUID1.Data4[7] = GUID2.Data4[7]) then
+ UpdateTMD(Context, GUID1.Data4[2], 6);
+ end;
+
+ if midDrives in MachineInfo then begin
+ {include drive specific information}
+ for Drive := 2 {C} to 25 {Z} do begin
+ if GetDriveType(Drive) = DRIVE_FIXED then begin
+ FillChar(Buf, Sizeof(Buf), 0);
+ Buf[0] := Drive;
+ {!!.06} {removed cluster information}
+ PLongInt(@Buf[1])^ := GetDiskSerialNumber(Chr(Drive+Ord('A')));{!!.06}
+ UpdateTMD(Context, Buf, 5);
+ end;
+ end;
+ end;
+
+ FinalizeTMD(Context, Result, SizeOf(Result));
+end;
+{$ELSE}
+function CreateMachineID(MachineInfo : TEsMachineInfoSet) : LongInt;
+var
+ I : DWord;
+ RegKey : DWord;
+ GUID1 : TGUID;
+ GUID2 : TGUID;
+ Drive : Integer;
+ Context : TTMDContext;
+ Buf : array [0..2047] of Byte;
+ iFileHandle : Integer;
+begin
+ InitTMD(Context);
+
+ {include user specific information}
+ if midUser in MachineInfo then
+ begin
+ //[to do] find some organization specific info
+ end;
+
+ if midSystem in MachineInfo then
+ begin
+ {include system specific information}
+ iFileHandle := FileOpen('/proc/cpuinfo', fmopenRead or fmShareDenyNone);
+ I := FileSeek(iFileHandle,0,2);
+ FileSeek(iFileHandle,0,0);
+ if I < 2047 then
+ begin
+ FileRead(iFileHandle, Buf, I);
+ UpdateTMD(Context, Buf, I);
+ end;
+ FileClose(iFileHandle);
+
+ iFileHandle := FileOpen('/proc/sys/kernel/version', fmopenRead or fmShareDenyNone);
+ I := FileSeek(iFileHandle,0,2);
+ FileSeek(iFileHandle,0,0);
+ if I < 2047 then
+ begin
+ FileRead(iFileHandle, Buf, I);
+ UpdateTMD(Context, Buf, I);
+ end;
+ FileClose(iFileHandle);
+
+ iFileHandle := FileOpen('/proc/sys/kernel/osrelease', fmopenRead or fmShareDenyNone);
+ I := FileSeek(iFileHandle,0,2);
+ FileSeek(iFileHandle,0,0);
+ if I < 2047 then
+ begin
+ FileRead(iFileHandle, Buf, I);
+ UpdateTMD(Context, Buf, I);
+ end;
+ FileClose(iFileHandle);
+
+ iFileHandle := FileOpen('/proc/sys/kernel/hostname', fmopenRead or fmShareDenyNone);
+ I := FileSeek(iFileHandle,0,2);
+ FileSeek(iFileHandle,0,0);
+ if I < 2047 then
+ begin
+ FileRead(iFileHandle, Buf, I);
+ UpdateTMD(Context, Buf, I);
+ end;
+ FileClose(iFileHandle);
+ end;
+
+ if midNetwork in MachineInfo then
+ begin
+ {include network ID}
+ CreateGuid(GUID1);
+ CreateGuid(GUID2);
+ {check to see if "network" ID is available}
+ if (GUID1.D4[2] = GUID2.D4[2]) and
+ (GUID1.D4[3] = GUID2.D4[3]) and
+ (GUID1.D4[4] = GUID2.D4[4]) and
+ (GUID1.D4[5] = GUID2.D4[5]) and
+ (GUID1.D4[6] = GUID2.D4[6]) and
+ (GUID1.D4[7] = GUID2.D4[7]) then
+ UpdateTMD(Context, GUID1.D4[2], 6);
+ end;
+
+ if midDrives in MachineInfo then
+ begin
+ {include drive specific information}
+ for Drive := 2 {C} to 25 {Z} do begin
+ if GetDriveType(Drive) = 3 {DRIVE_FIXED} then begin
+ FillChar(Buf, Sizeof(Buf), 0);
+ Buf[0] := Drive;
+ {!!.06} {removed cluster information}
+ PLongInt(@Buf[1])^ := GetDiskSerialNumber(Chr(Drive+Ord('A')));{!!.06}
+ UpdateTMD(Context, Buf, 5);
+ end;
+ end;
+ end;
+
+ FinalizeTMD(Context, Result, SizeOf(Result));
+end;
+{$ENDIF}
+{$ENDIF}
+
+{key generation routines }
+procedure GenerateRandomKeyPrim(var Key; KeySize: Cardinal);
+var
+ Bytes : TByteArray absolute Key;
+ I : Integer;
+begin
+ Randomize;
+ for I := 0 to KeySize - 1 do
+ Bytes[I] := Random(256);
+end;
+
+procedure GenerateTMDKeyPrim(var Key; KeySize: Cardinal; const Str: string);
+var
+ I : Integer;
+ S2 : string;
+begin
+ {strip accented characters from the string} {!!.06}
+ S2 := Str; {!!.06}
+ for I := Length(S2) downto 1 do {!!.06}
+ if Ord(S2[I]) > 127 then {!!.06}
+ Delete(S2, I, 1); {!!.06}
+
+ HashTMD(Key, KeySize, S2[1], Length(S2)); {!!.06}
+end;
+
+procedure GenerateMD5KeyPrim(var Key: TKey; const Str: string);
+var
+ D : TMD5Digest;
+ I : Integer;
+ S2 : string;
+begin
+ {strip accented characters from the string} {!!.06}
+ S2 := Str; {!!.06}
+ for I := Length(S2) downto 1 do {!!.06}
+ if Ord(S2[I]) > 127 then {!!.06}
+ Delete(S2, I, 1); {!!.06}
+
+ D := HashMD5(S2[1], Length(S2)); {!!.06}
+ Key := TKey(D);
+end;
+
+
+{modifier routines}
+function GenerateStringModifierPrim(const S : string) : LongInt;
+var
+ I : Integer; {!!.06}
+ Sig : array [0..4] of AnsiChar;
+ S2 : string; {!!.06}
+begin
+ FillChar(Sig, SizeOf(Sig), 0);
+
+ {strip accented characters from the string} {!!.06}
+ S2 := S; {!!.06}
+ for I := Length(S2) downto 1 do {!!.06}
+ if Ord(S2[I]) > 127 then {!!.06}
+ Delete(S2, I, 1); {!!.06}
+
+ StrPLCopy(Sig, AnsiUpperCase(S2), Min(4, Length(S2))); {!!.06}
+ Result := PLongInt(@Sig[0])^;
+end;
+
+function GenerateUniqueModifierPrim : LongInt;
+var
+ ID : TGUID;
+begin
+ CreateGuid(ID);
+ Mix128(T128Bit(ID));
+ Result := T128Bit(ID)[3];
+end;
+
+{!!.05} {revised}
+function GenerateMachineModifierPrim : LongInt;
+begin
+ Result := CreateMachineID([midUser, midSystem, {midNetwork,} midDrives]);
+end;
+
+function GenerateDateModifierPrim(D : TDateTime) : LongInt;
+begin
+ Result := Trunc(D);
+ TLongIntRec(Result).Hi := TLongIntRec(Result).Lo xor $AAAA;
+end;
+
+procedure ApplyModifierToKeyPrim(Modifier : LongInt; var Key; KeySize : Cardinal);
+begin
+ if Modifier <> 0 then
+ XorMem(Key, Modifier, Min(SizeOf(Modifier), KeySize));
+end;
+
+{*** general routines ***}
+function GetCodeType(const Key : TKey; const Code : TCode) : TCodeType;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ case Work.CheckValue of
+ DateCheckCode : Result := ctDate;
+ DaysCheckCode : Result := ctDays;
+ RegCheckCode : Result := ctRegistration;
+ SerialCheckCode : Result := ctSerialNumber;
+ UsageCheckCode : Result := ctUsage;
+ NetCheckCode : Result := ctNetwork;
+ SpecialCheckCode : Result := ctSpecial;
+ else
+ Result := ctUnknown;
+ end;
+end;
+
+function ExpandDate(D : Word) : TDateTime;
+begin
+ if D > 0 then
+ Result := LongInt(D) + BaseDate
+ else
+ Result := EncodeDate(9999, 1, 1);
+end;
+
+function ShrinkDate(D : TDateTime) : Word;
+begin
+ if (Trunc(D) = 0) or (Trunc(D) - BaseDate > High(Word)) then
+ Result := 0
+ else
+ Result := Trunc(D) - BaseDate;
+end;
+
+function GetExpirationDate(const Key : TKey; const Code : TCode) : TDateTime;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ case Work.CheckValue of
+ DateCheckCode : Result := ExpandDate(Work.EndDate);
+ DaysCheckCode : Result := ExpandDate(Work.Expiration);
+ RegCheckCode : Result := ExpandDate(Work.Expiration);
+ SerialCheckCode : Result := ExpandDate(Work.Expiration);
+ UsageCheckCode : Result := ExpandDate(Work.Expiration);
+ SpecialCheckCode : Result := ExpandDate(Work.Expiration);
+ else
+ Result := ExpandDate(0)
+ end;
+end;
+
+{*** date code ***}
+
+procedure InitDateCode(const Key : TKey;
+ StartDate, EndDate : TDateTime; var Code : TCode);
+begin
+ Code.CheckValue := DateCheckCode;
+ Code.Expiration := 0; {not used for date codes}
+ Code.FirstDate := ShrinkDate(StartDate);
+ Code.EndDate := ShrinkDate(EndDate);
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsDateCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = DateCheckCode) and
+ (ExpandDate(Work.FirstDate) <= Date);
+end;
+
+function GetDateCodeValue(const Key : TKey; const Code : TCode) : TDateTime;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ {return the end date}
+ if (Work.CheckValue = DateCheckCode) and
+ (ExpandDate(Work.FirstDate) <= Date) then
+ Result := ExpandDate(Work.EndDate)
+ else
+ Result := 0;
+end;
+
+function IsDateCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+begin
+ Result := (GetDateCodeValue(Key, Code) < Date);
+end;
+
+
+{*** days code ***}
+
+procedure InitDaysCode(const Key : TKey; Days : Word; Expires : TDateTime;
+ var Code : TCode);
+begin
+ Code.CheckValue := DaysCheckCode;
+ Code.Expiration := ShrinkDate(Expires);
+ Code.Days := Days;
+ Code.LastAccess := ShrinkDate(Date);
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsDaysCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = DaysCheckCode) and
+ (ExpandDate(Work.LastAccess) <= Date);
+end;
+
+procedure DecDaysCode(const Key : TKey; var Code : TCode);
+var
+ X : LongInt;
+begin
+ MixBlock(T128bit(Key), Code, False);
+ X := ShrinkDate(Date);
+ if (Code.LastAccess <> X) then begin
+ if Code.Days > 0 then {!!.02}
+ Code.Days := Max(0, Code.Days - 1); {!!.02}
+ Code.LastAccess := X;
+ end;
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function GetDaysCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ if (Work.CheckValue = DaysCheckCode) and
+ (ExpandDate(Work.LastAccess) <= Date) then
+ Result := Work.Days
+ else
+ Result := 0;
+end;
+
+function IsDaysCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.Days = 0) or (ExpandDate(Work.Expiration) < Date);
+end;
+
+
+{*** registration code ***}
+
+procedure InitRegCode(const Key : TKey; const RegStr : string; Expires : TDateTime; var Code : TCode);
+var
+ S : string; {!!.06}
+ I : Integer; {!!.06}
+begin
+ Code.CheckValue := RegCheckCode;
+ Code.Expiration := ShrinkDate(Expires);
+ {strip accented characters from the registration string} {!!.06}
+ S := RegStr; {!!.06}
+ for I := Length(S) downto 1 do {!!.06}
+ if Ord(S[I]) > 127 then {!!.06}
+ Delete(S, I, 1); {!!.06}
+ Code.RegString := StringHashElf(AnsiUpperCase(S)); {!!.06}
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsRegCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = RegCheckCode);
+end;
+
+function IsRegCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := ExpandDate(Work.Expiration) < Date;
+end;
+
+
+{*** serial number code ***}
+
+procedure InitSerialNumberCode(const Key : TKey; Serial : LongInt; Expires : TDateTime; var Code : TCode);
+begin
+ Code.CheckValue := SerialCheckCode;
+ Code.Expiration := ShrinkDate(Expires);
+ Code.SerialNumber := Serial;
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsSerialNumberCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = SerialCheckCode);
+end;
+
+function GetSerialNumberCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ if Work.CheckValue = SerialCheckCode then
+ Result := Work.SerialNumber
+ else
+ Result := 0;
+end;
+
+function IsSerialNumberCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := ExpandDate(Work.Expiration) < Date;
+end;
+
+
+{*** special code ***}
+
+procedure InitSpecialCode(const Key : TKey; Value : LongInt; Expires : TDateTime; var Code : TCode);
+begin
+ Code.CheckValue := SpecialCheckCode;
+ Code.Expiration := ShrinkDate(Expires);
+ Code.Value := Value;
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsSpecialCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = SpecialCheckCode);
+end;
+
+function GetSpecialCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ if Work.CheckValue = SpecialCheckCode then
+ Result := Work.Value
+ else
+ Result := 0;
+end;
+
+function IsSpecialCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := ExpandDate(Work.Expiration) < Date;
+end;
+
+
+{*** usage code ***}
+
+procedure InitUsageCode(const Key : TKey; Count : Word; Expires : TDateTime; var Code : TCode);
+begin
+ Code.CheckValue := UsageCheckCode;
+ Code.Expiration := ShrinkDate(Expires);
+ Code.UsageCount := Count;
+ Code.LastChange := ShrinkDate(Date); {!!.02}
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsUsageCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = UsageCheckCode) and {!!.02}
+ (ExpandDate(Work.LastChange) <= Date); {!!.02}
+end;
+
+procedure DecUsageCode(const Key : TKey; var Code : TCode);
+var {!!.02}
+ D : Word; {!!.02}
+begin
+ MixBlock(T128bit(Key), Code, False);
+ D := ShrinkDate(Date); {!!.02}
+ if Code.UsageCount > 0 then {!!.02}
+ Code.UsageCount := Max(0, Code.UsageCount - 1); {!!.02}
+ if (Code.LastChange < D) then {!!.02}
+ Code.LastChange := D; {!!.02}
+
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function GetUsageCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ if (Work.CheckValue = UsageCheckCode) and {!!.02}
+ (ExpandDate(Work.LastChange) <= Date) then {!!.02}
+ Result := Work.UsageCount {!!.02}
+ else
+ Result := 0;
+end;
+
+function IsUsageCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.UsageCount = 0) or (ExpandDate(Work.Expiration) < Date);
+end;
+
+
+{$ENDIF}
+
+initialization
+{$IFDEF IBO_CONSOLE} {AH.02}
+ {from onguard.pas}
+ {record our baseline date}
+ BaseDate := Trunc(EncodeDate(1996, 1, 1));
+{$ENDIF}
+
+
+
+end.
diff --git a/components/onguard/source/onguard.bmp b/components/onguard/source/onguard.bmp
new file mode 100644
index 000000000..4142c572b
Binary files /dev/null and b/components/onguard/source/onguard.bmp differ
diff --git a/components/onguard/source/onguard.inc b/components/onguard/source/onguard.inc
new file mode 100644
index 000000000..9504e8375
--- /dev/null
+++ b/components/onguard/source/onguard.inc
@@ -0,0 +1,76 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* ONGUARD.INC 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{Conditional defines that affect compilation}
+
+
+{$B-} {Complete Boolean Evaluation}
+{$I+} {Input/Output-Checking}
+{$P+} {Open Parameters}
+{$T-} {Typed @ Operator}
+
+
+
+(*
+Options below not needed ?
+Fixme.
+
+{$Q-} {Overflow Checking}
+{$R-} {Range-Checking}
+{$S-} {Stack-Overflow Checking}
+{$V-} {Var-String Checking}
+
+{$IFNDEF Win32}
+ {$F-} {Force Far Calls}
+ {$K-} {Smart Callbacks}
+{$ENDIF}
+*)
+
+{$IFDEF FPC}
+ {$MODE OBJFPC}{$H+}
+ {$ASMMODE INTEL}
+{$ENDIF}
+
+{====General defines=================================================}
+
+{!!.10}
+{Activate the following define to prevent the TOgMakeCodes Form being
+ compiled into the exe. }
+
+{.$DEFINE NoMakeCodesSupport}
+
+
+{!!.10}
+{Activate the following define to prevent the TOgMakeKeys Form being
+ compiled into the exe. }
+
+{.$DEFINE NoMakeKeysSupport}
+
+
diff --git a/components/onguard/source/onguard.pas b/components/onguard/source/onguard.pas
new file mode 100644
index 000000000..cd975d861
--- /dev/null
+++ b/components/onguard/source/onguard.pas
@@ -0,0 +1,2134 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* ONGUARD.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I onguard.inc}
+{$I-} { I/O checks disabled}
+{$Q-} {Integer overflow check disabled.
+Warning : at least one function (MixBlock) causes overflow}
+
+unit onguard;
+ {-code and key classes and routines}
+
+interface
+
+uses
+{$IFDEF MSWINDOWS} {AH.01}
+ Windows, {AH.01}
+{$ENDIF} {AH.01}
+{$IFDEF IBO_CONSOLE}
+ ConsoleStubs,
+{$ENDIF}
+{$IFDEF LINUX} {AH.01}
+ BaseUnix, {AH.01}
+{$ENDIF} {AH.01}
+ Classes, SysUtils,MD5,
+ ogconst,
+ ogutil
+{$IFNDEF IBO_CONSOLE}
+ ,Controls, Dialogs
+{$ENDIF}
+{$IFDEF UsingZLib}
+ ,ZLib
+{$ENDIF}
+ ;
+
+{$IFNDEF IBO_CONSOLE}
+const
+ {magic values}
+ DaysCheckCode = $649B;
+ DateCheckCode = $A4CB;
+ NetCheckCode = $9341;
+ RegCheckCode = $D9F6;
+ SerialCheckCode = $3C69;
+ UsageCheckCode = $F3D5;
+ SpecialCheckCode = $9C5B;
+
+type
+ {code tyes}
+ PCode = ^TCode;
+ TCode = packed record
+ CheckValue : Word; {magic value}
+ Expiration : Word; {expiration date or 0, if none}
+ case Byte of
+ 0 : (FirstDate : Word; {for date code}
+ EndDate : Word);
+ 1 : (Days : Word; {for days code}
+ LastAccess : Word);
+ 2 : (RegString : LongInt); {for reg code}
+ 3 : (SerialNumber : LongInt); {for serial number code}
+ 4 : (UsageCount : Word; {for usage count code} {!!.02}
+ LastChange : Word); {!!.02}
+ 5 : (Value : LongInt); {for specail codes}
+ 6 : (NetIndex : LongInt); {for net codes}
+ end;
+
+type
+ TCodeType = (ctDate, ctDays, ctRegistration, ctSerialNumber,
+ ctUsage, ctNetwork, ctSpecial, ctUnknown);
+ {order must match tab order for code generation notebook}
+
+type
+ TKey = array [0..15] of Byte;
+ TKeyType = (ktRandom, ktMessageDigest, ktMessageDigestCS);
+ {order must match order for key generation combobox string list}
+
+type
+ {contexts}
+ TTMDContext = array [0..279] of Byte;
+
+ {bit mixing types}
+ T128Bit = array [0..3] of LongInt;
+ T256Bit = array [0..7] of LongInt;
+
+const
+ DefCodeType = ctDate;
+ DefKeyType = ktRandom;
+
+type
+ TEsMachineInfoSet = {!!.05}
+ set of (midUser, midSystem, midNetwork, midDrives); {!!.05}
+
+type
+ {result of code verification}
+ TCodeStatus = (ogValidCode, {code is valid but may still be expired}
+ ogInvalidCode, {code is invalid}
+ ogPastEndDate, {end date has been reached}
+ ogDayCountUsed, {number of days authorized have been used}
+ ogRunCountUsed, {number of runs authorized have been used}
+ ogNetCountUsed, {number of authorized users has been exceeded}
+ ogCodeExpired); {expiration date has been reached}
+
+{$ENDIF}
+
+type
+ EOnGuardException = class(Exception);
+
+type
+ TChangeCodeEvent =
+ procedure(Sender : TObject; Code : TCode)
+ of object;
+ TCheckedCodeEvent =
+ procedure(Sender : TObject; Status : TCodeStatus)
+ of object;
+ TGetCodeEvent =
+ procedure(Sender : TObject; var Code : TCode)
+ of object;
+ TGetKeyEvent =
+ procedure(Sender : TObject; var Key : TKey)
+ of object;
+ TGetModifierEvent =
+ procedure(Sender : TObject; var Value : LongInt)
+ of object;
+ TGetRegStringEvent =
+ procedure(Sender : TObject; var Value : string)
+ of object;
+
+ {base regisration code component}
+ TOgCodeBase = class(TComponent)
+ protected {private}
+ {property variables}
+ FAutoCheck : Boolean; {true to test code when loaded}
+ FCode : TCode; {release code}
+ FModifier : LongInt; {key modifier}
+ FStoreCode : Boolean; {true to store release code on stream}
+ FStoreModifier : Boolean; {true to store key modifier on stream}
+
+ {event variables}
+ FOnChecked : TCheckedCodeEvent;{called after auto check is made}
+ FOnGetCode : TGetCodeEvent; {called to retrieve release code}
+ FOnGetKey : TGetKeyEvent; {called to retrieve key}
+ FOnGetModifier : TGetModifierEvent;{called to retrieve key modifier}
+
+ {property methods}
+ function GetCode : string;
+ function GetModifier : string;
+ function GetAbout : string; {!!.08}
+ procedure SetCode(const Value : string);
+ procedure SetModifier(const Value : string);
+ procedure SetAbout(const Value : string); {!!.08}
+
+ protected
+ procedure Loaded;
+ override;
+
+ procedure DoOnChecked(Value : TCodeStatus);
+ dynamic;
+ function DoOnGetCode : TCode;
+ dynamic;
+ procedure DoOnGetKey(var Key : TKey);
+ dynamic;
+ function DoOnGetModifier : LongInt;
+ dynamic;
+
+ {protected properties}
+ property Code : string
+ read GetCode
+ write SetCode;
+
+ property StoreCode : Boolean
+ read FStoreCode
+ write FStoreCode;
+
+ public
+ constructor Create(AOwner : TComponent);
+ override;
+
+ function CheckCode(Report : Boolean) : TCodeStatus;
+ virtual; abstract;
+ function IsCodeValid : Boolean;
+ {-return true if code is valid}
+
+ published
+ {properties}
+ property AutoCheck : Boolean
+ read FAutoCheck
+ write FAutoCheck
+ default DefAutoCheck;
+
+ property Modifier : string
+ read GetModifier
+ write SetModifier
+ stored FStoreModifier;
+
+ property StoreModifier : Boolean
+ read FStoreModifier
+ write FStoreModifier
+ default DefStoreModifier;
+
+ property About : string {!!.08}
+ read GetAbout {!!.08}
+ write SetAbout {!!.08}
+ stored False;
+
+ {events}
+ property OnChecked : TCheckedCodeEvent
+ read FOnChecked
+ write FOnChecked;
+
+ property OnGetKey : TGetKeyEvent
+ read FOnGetKey
+ write FOnGetKey;
+
+ property OnGetCode : TGetCodeEvent
+ read FOnGetCode
+ write FOnGetCode;
+
+ property OnGetModifier : TGetModifierEvent
+ read FOnGetModifier
+ write FOnGetModifier;
+ end;
+
+ TOgMakeCodes = class(TComponent)
+ protected {private}
+ {property variables}
+ FCode : TCode;
+ FCodeType : TCodeType;
+ FKey : TKey;
+ FKeyFileName : string;
+ FKeyType : TKeyType;
+ FShowHints : Boolean;
+
+ {property methods}
+ function GetAbout : string; {!!.08}
+ procedure SetAbout(const Value : string); {!!.08}
+
+ public
+ constructor Create(AOwner : TComponent);
+ override;
+ function Execute : Boolean;
+ procedure GetCode(var Value : TCode); {!!.08}
+ procedure SetCode(Value : TCode); {!!.08}
+ procedure GetKey(var Value : TKey); {!!.08}
+ procedure SetKey(Value : TKey); {!!.08}
+
+ property KeyType : TKeyType
+ read FKeyType
+ write FKeyType;
+
+ published
+
+ {properties}
+ property CodeType : TCodeType
+ read FCodeType
+ write FCodeType
+ default DefCodeType;
+
+ property KeyFileName : string
+ read FKeyFileName
+ write FKeyFileName;
+
+ property ShowHints : Boolean
+ read FShowHints
+ write FShowHints
+ default False;
+
+ property About : string {!!.08}
+ read GetAbout {!!.08}
+ write SetAbout {!!.08}
+ stored False;
+ end;
+
+type
+ TOgMakeKeys = class(TComponent)
+ protected {private}
+ {property variables}
+ FKeyFileName : string;
+ FKey : TKey;
+ FKeyType : TKeyType;
+ FShowHints : Boolean;
+
+ {property methods}
+ function GetAbout : string; {!!.08}
+ procedure SetAbout(const Value : string); {!!.08}
+
+ public
+ constructor Create(AOwner : TComponent);
+ override;
+ function Execute : Boolean;
+
+ procedure ApplyModifierToKey(Modifier : LongInt; var Key; KeySize : Cardinal);
+ {-signs the key with the modifier}
+ function GenerateDateModifier(D : TDateTime) : LongInt;
+ {-returns a modifier based on the current date}
+ function GenerateMachineModifier : LongInt;
+ {-returns a modifier based on hardware information}
+ procedure GenerateMDKey(var Key; KeySize : Cardinal; const Str : string);
+ {-generate a key based on the message digest of Str}
+ procedure GenerateRandomKey(var Key; KeySize : Cardinal);
+ {-generate a random key}
+ function GenerateStringModifier(const S : string) : LongInt;
+ {-returns a modifier based on S}
+ function GenerateUniqueModifier : LongInt;
+ {-returns a unique/random modifier}
+ procedure SetKey(Value : TKey); {!!.08}
+ procedure GetKey(var Value : TKey); {!!.08}
+
+ published
+
+ {properties}
+ property About : string {!!.08}
+ read GetAbout {!!.08}
+ write SetAbout {!!.08}
+ stored False;
+
+ property KeyFileName : string
+ read FKeyFileName
+ write FKeyFileName;
+
+ property KeyType : TKeyType
+ read FKeyType
+ write FKeyType
+ default DefKeyType;
+
+ property ShowHints : Boolean
+ read FShowHints
+ write FShowHints
+ default False;
+ end;
+
+ TOgDateCode = class(TOgCodeBase)
+ public
+ function CheckCode(Report : Boolean) : TCodeStatus;
+ override;
+ function GetValue : TDateTime;
+ {-return expiration date (0 for error)}
+
+ published
+ {properties}
+ property Code
+ stored FStoreCode;
+
+ property StoreCode
+ default DefStoreCode;
+ end;
+
+ TOgDaysCode = class(TOgCodeBase)
+ protected {private}
+ {property variables}
+ FAutoDecrease : Boolean;
+
+ {event variables}
+ FOnChangeCode : TChangeCodeEvent;
+
+ protected
+ procedure Loaded;
+ override;
+
+ procedure DoOnChangeCode(Value : TCode);
+ dynamic;
+
+ public
+ constructor Create(AOwner : TComponent);
+ override;
+ function CheckCode(Report : Boolean) : TCodeStatus;
+ override;
+ procedure Decrease;
+ {-reduce days and generate modified code}
+ function GetValue : LongInt;
+ {-return number of days remaining}
+
+ published
+ {properties}
+ property AutoDecrease : Boolean
+ read FAutoDecrease
+ write FAutoDecrease
+ default DefAutoDecrease;
+
+ {events}
+ property OnChangeCode : TChangeCodeEvent
+ read FOnChangeCode
+ write FOnChangeCode;
+ end;
+
+ TOgRegistrationCode = class(TOgCodeBase)
+ protected {private}
+ {property variables}
+ FRegString : string;
+ FStoreRegString : Boolean;
+
+ {event variables}
+ FOnGetRegString : TGetRegStringEvent;
+
+ protected
+ function DoOnGetRegString : string;
+ dynamic;
+
+ public
+ constructor Create(AOwner : TComponent);
+ override;
+
+ function CheckCode(Report : Boolean) : TCodeStatus;
+ override;
+
+ published
+ {properties}
+ property Code
+ stored FStoreCode;
+
+ property StoreCode
+ default DefStoreCode;
+
+ property RegString : string
+ read FRegString
+ write FRegString
+ stored FStoreRegString;
+
+ property StoreRegString : Boolean
+ read FStoreRegString
+ write FStoreRegString
+ default DefStoreRegString;
+
+ {events}
+ property OnGetRegString : TGetRegStringEvent
+ read FOnGetRegString
+ write FOnGetRegString;
+ end;
+
+ TOgSerialNumberCode = class(TOgCodeBase)
+ public
+ function CheckCode(Report : Boolean) : TCodeStatus;
+ override;
+ function GetValue : LongInt;
+ {-return serial number (0 for error)}
+
+ published
+ {properties}
+ property Code
+ stored FStoreCode;
+
+ property StoreCode
+ default DefStoreCode;
+
+ end;
+
+ TOgSpecialCode = class(TOgCodeBase)
+ function CheckCode(Report : Boolean) : TCodeStatus;
+ override;
+ function GetValue : LongInt;
+ {-return serial number (0 for error)}
+
+ published
+ {properties}
+ property Code
+ stored FStoreCode;
+
+ property StoreCode
+ default DefStoreCode;
+ end;
+
+ TOgUsageCode = class(TOgCodeBase)
+ protected {private}
+ {property variables}
+ FAutoDecrease : Boolean;
+
+ {event variables}
+ FOnChangeCode : TChangeCodeEvent;
+
+ protected
+ procedure Loaded;
+ override;
+
+ procedure DoOnChangeCode(Value : TCode);
+ dynamic;
+
+ public
+ constructor Create(AOwner : TComponent);
+ override;
+ function CheckCode(Report : Boolean) : TCodeStatus;
+ override;
+ procedure Decrease;
+ {-reduce number of uses and generate code}
+ function GetValue : LongInt;
+ {-return number of uses remaining}
+
+ published
+ {properties}
+ property AutoDecrease : Boolean
+ read FAutoDecrease
+ write FAutoDecrease
+ default DefAutoDecrease;
+
+ {events}
+ property OnChangeCode : TChangeCodeEvent
+ read FOnChangeCode
+ write FOnChangeCode;
+ end;
+
+{$IFNDEF IBO_CONSOLE}
+function GetCodeType(const Key : TKey; const Code : TCode) : TCodeType;
+ {-return the type of code}
+function GetExpirationDate(const Key : TKey; const Code : TCode) : TDateTime;
+ {-return the date this code expires}
+
+procedure InitDateCode(const Key : TKey; StartDate, EndDate : TDateTime; var Code : TCode);
+function IsDateCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+function GetDateCodeValue(const Key : TKey; const Code : TCode) : TDateTime;
+function IsDateCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+
+procedure InitDaysCode(const Key : TKey; Days : Word; Expires : TDateTime; var Code : TCode);
+function IsDaysCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+procedure DecDaysCode(const Key : TKey; var Code : TCode);
+function GetDaysCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+function IsDaysCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+
+procedure InitRegCode(const Key : TKey; const RegStr : string; Expires : TDateTime; var Code : TCode);
+function IsRegCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+function IsRegCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+
+procedure InitSerialNumberCode(const Key : TKey; Serial : LongInt; Expires : TDateTime; var Code : TCode);
+function IsSerialNumberCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+function GetSerialNumberCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+function IsSerialNumberCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+
+procedure InitSpecialCode(const Key : TKey; Value : LongInt; Expires : TDateTime; var Code : TCode);
+function IsSpecialCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+function GetSpecialCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+function IsSpecialCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+
+procedure InitUsageCode(const Key : TKey; Count : Word; Expires : TDateTime; var Code : TCode);
+function IsUsageCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+procedure DecUsageCode(const Key : TKey; var Code : TCode);
+function GetUsageCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+function IsUsageCodeExpired(const Key : TKey; const Code: TCode) : Boolean;
+
+
+{generate key routines}
+procedure GenerateRandomKeyPrim(var Key; KeySize : Cardinal);
+procedure GenerateTMDKeyPrim(var Key; KeySize : Cardinal; const Str : string);
+procedure GenerateMD5KeyPrim(var Key: TKey; const Str : string);
+
+{modifier routines}
+function CreateMachineID(MachineInfo : TEsMachineInfoSet) : LongInt; {!!.05}
+function GenerateStringModifierPrim(const S : string) : LongInt;
+function GenerateUniqueModifierPrim : LongInt;
+function GenerateMachineModifierPrim : LongInt;
+function GenerateDateModifierPrim(D : TDateTime) : LongInt;
+procedure ApplyModifierToKeyPrim(Modifier : LongInt; var Key; KeySize : Cardinal);
+
+{hash routines}
+function StringHashElf(const Str : string) : LongInt;
+
+{mixing routines}
+procedure MixBlock(const Matrix : T128Bit; var Block; Encrypt : Boolean);
+
+{utility routines}
+function ExpandDate(D : Word) : TDateTime;
+function ShrinkDate(D : TDateTime) : Word;
+
+const
+ BaseDate : LongInt = 0;
+{$ENDIF}
+
+implementation
+{$IFNDEF IBO_CONSOLE}
+uses
+//{$IFDEF MSWINDOWS}
+// {$IFDEF VERSION3} ActiveX {$ELSE} OLE2 {$ENDIF} {!!.06}
+//{$ENDIF}
+ {$IFNDEF NoMakeCodesSupport} qonguard2 {$ENDIF} {!!.10} {!!.10}
+ {$IFNDEF NoMakeKeysSupport} , qonguard3 {$ENDIF} {!!.10} {!!.10}
+ ;
+{$ENDIF}
+{$IFNDEF IBO_CONSOLE}
+{first 2048 bits of Pi in hexadecimal, low to high, without the leading "3"}
+const
+ Pi2048: array [0..255] of Byte = (
+ $24, $3F, $6A, $88, $85, $A3, $08, $D3, $13, $19, $8A, $2E, $03, $70, $73, $44,
+ $A4, $09, $38, $22, $29, $9F, $31, $D0, $08, $2E, $FA, $98, $EC, $4E, $6C, $89,
+ $45, $28, $21, $E6, $38, $D0, $13, $77, $BE, $54, $66, $CF, $34, $E9, $0C, $6C,
+ $C0, $AC, $29, $B7, $C9, $7C, $50, $DD, $3F, $84, $D5, $B5, $B5, $47, $09, $17,
+ $92, $16, $D5, $D9, $89, $79, $FB, $1B, $D1, $31, $0B, $A6, $98, $DF, $B5, $AC,
+ $2F, $FD, $72, $DB, $D0, $1A, $DF, $B7, $B8, $E1, $AF, $ED, $6A, $26, $7E, $96,
+ $BA, $7C, $90, $45, $F1, $2C, $7F, $99, $24, $A1, $99, $47, $B3, $91, $6C, $F7,
+ $08, $01, $F2, $E2, $85, $8E, $FC, $16, $63, $69, $20, $D8, $71, $57, $4E, $69,
+ $A4, $58, $FE, $A3, $F4, $93, $3D, $7E, $0D, $95, $74, $8F, $72, $8E, $B6, $58,
+ $71, $8B, $CD, $58, $82, $15, $4A, $EE, $7B, $54, $A4, $1D, $C2, $5A, $59, $B5,
+ $9C, $30, $D5, $39, $2A, $F2, $60, $13, $C5, $D1, $B0, $23, $28, $60, $85, $F0,
+ $CA, $41, $79, $18, $B8, $DB, $38, $EF, $8E, $79, $DC, $B0, $60, $3A, $18, $0E,
+ $6C, $9E, $0E, $8B, $B0, $1E, $8A, $3E, $D7, $15, $77, $C1, $BD, $31, $4B, $27,
+ $78, $AF, $2F, $DA, $55, $60, $5C, $60, $E6, $55, $25, $F3, $AA, $55, $AB, $94,
+ $57, $48, $98, $62, $63, $E8, $14, $40, $55, $CA, $39, $6A, $2A, $AB, $10, $B6,
+ $B4, $CC, $5C, $34, $11, $41, $E8, $CE, $A1, $54, $86, $AF, $7C, $72, $E9, $93);
+
+
+{mixing routines}
+procedure Mix128(var X : T128Bit);
+var
+ AA, BB, CC, DD : LongInt;
+begin
+ AA := X[0]; BB := X[1]; CC := X[2]; DD := X[3];
+
+ AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 7);
+ BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 13);
+ CC := CC + BB; BB := BB + CC; CC := CC xor (CC shr 17);
+ DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 9);
+ AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 3);
+ BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 7);
+ CC := CC + BB; BB := BB + CC; CC := CC xor (DD shr 15);
+ DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 11);
+
+ X[0] := AA; X[1] := BB; X[2] := CC; X[3] := DD;
+end;
+
+{quick (block) mixer routine}
+procedure MixBlock(const Matrix : T128bit; var Block; Encrypt : Boolean);
+const
+ CKeyBox : array [False..True, 0..3, 0..2] of LongInt =
+ (((0, 3, 1), (2, 1, 3), (1, 0, 2), (3, 2, 0)),
+ ((3, 2, 0), (1, 0, 2), (2, 1, 3), (0, 3, 1)));
+var
+ Blocks : array [0..1] of LongInt absolute Block;
+ Work : LongInt;
+ Right : LongInt;
+ Left : LongInt;
+ R : LongInt;
+ AA, BB : LongInt;
+ CC, DD : LongInt;
+begin
+ Right := Blocks[0];
+ Left := Blocks[1];
+
+ for R := 0 to 3 do begin
+ {transform the right side}
+ AA := Right;
+ BB := Matrix[CKeyBox[Encrypt, R, 0]];
+ CC := Matrix[CKeyBox[Encrypt, R, 1]];
+ DD := Matrix[CKeyBox[Encrypt, R, 2]];
+
+ {commented code does not affect results - removed for speed}
+ AA := AA + DD;DD := DD + AA;AA := AA xor (AA shr 7);
+ BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 13);
+ CC := CC + BB; BB := BB + CC; CC := CC xor (CC shr 17);
+ DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 9);
+ AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 3);
+ BB := BB + AA; {AA := AA + BB;} BB := BB xor (BB shl 7);
+ CC := CC + BB; {BB := BB + CC;} CC := CC xor (DD shr 15);
+ DD := DD + CC; {CC := CC + DD;} DD := DD xor (DD shl 11);
+
+ Work := Left xor DD;
+ Left := Right;
+ Right := Work;
+ end;
+
+ Blocks[0] := Left;
+ Blocks[1] := Right;
+end;
+
+function HashElf(const Buf; BufSize : LongInt) : LongInt;
+var
+ Bytes : TByteArray absolute Buf;
+ I, X : LongInt;
+begin
+ Result := 0;
+ for I := 0 to BufSize - 1 do begin
+ Result := (Result shl 4) + Bytes[I];
+ X := Result and $F0000000;
+ if (X <> 0) then
+ Result := Result xor (X shr 24);
+ Result := Result and (not X);
+ end;
+end;
+
+function StringHashElf(const Str : string) : LongInt;
+begin
+ Result := HashElf(Str[1], Length(Str));
+end;
+
+
+{message digest routines}
+type
+ TMDContextEx = record
+ DigestIndex : LongInt;
+ Digest : array [0..255] of Byte;
+ KeyIndex : LongInt;
+ case Byte of
+ 0: (KeyInts : array [0..3] of LongInt);
+ 1: (Key : TKey);
+ end;
+ TBlock2048 = array [0..255] of Byte;
+
+procedure InitTMD(var Context : TTMDContext);
+var
+ ContextEx : TMDContextEx absolute Context;
+begin
+ ContextEx.DigestIndex := 0;
+ TBlock2048(ContextEx.Digest) := TBlock2048(Pi2048);
+
+ ContextEx.KeyIndex := 0;
+ ContextEx.KeyInts[0] := $55555555;
+ ContextEx.KeyInts[1] := $55555555;
+ ContextEx.KeyInts[2] := $55555555;
+ ContextEx.KeyInts[3] := $55555555;
+end;
+
+procedure UpdateTMD(var Context : TTMDContext; const Buf; BufSize : LongInt);
+var
+ ContextEx : TMDContextEx absolute Context;
+ BufBytes : TByteArray absolute Buf;
+ AA, BB : LongInt;
+ CC, DD : LongInt;
+ I, R : LongInt;
+begin
+ for I := 0 to BufSize - 1 do
+ with ContextEx do begin
+ {update Digest}
+ Digest[DigestIndex] := Digest[DigestIndex] xor BufBytes[I];
+ DigestIndex := DigestIndex + 1;
+ if (DigestIndex = SizeOf(Digest)) then
+ DigestIndex := 0;
+
+ {update BlockKey}
+ Key[KeyIndex] := Key[KeyIndex] xor BufBytes[I];
+ KeyIndex := KeyIndex + 1;
+ if (KeyIndex = SizeOf(Key) div 2) then begin
+ AA := KeyInts[3];
+ BB := KeyInts[2];
+ CC := KeyInts[1];
+ DD := KeyInts[0];
+
+ {mix all the bits around for 4 rounds}
+ {achieves avalanche and eliminates funnels}
+ for R := 0 to 3 do begin
+ AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 7);
+ BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 13);
+ CC := CC + BB; BB := BB + CC; CC := CC xor (CC shr 17);
+ DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 9);
+ AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 3);
+ BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 7);
+ CC := CC + BB; BB := BB + CC; CC := CC xor (DD shr 15);
+ DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 11);
+ end;
+
+ KeyInts[0] := AA;
+ KeyInts[1] := BB;
+ KeyInts[2] := CC;
+ KeyInts[3] := DD;
+
+ KeyIndex := 0;
+ end;
+ end;
+end;
+
+procedure FinalizeTMD(var Context : TTMDContext; var Digest; DigestSize : LongInt);
+const
+ Padding : array [0..7] of Byte = (1, 0, 0, 0, 0, 0, 0, 0);
+var
+ ContextEx : TMDContextEx absolute Context;
+ I : Integer;
+begin
+ {pad with "1", followed by as many "0"s as needed to fill the block}
+ UpdateTMD(Context, Padding, SizeOf(Padding) - ContextEx.KeyIndex);
+
+ {mix each block within Context with the key}
+ for I := 0 to (SizeOf(ContextEx.Digest) div SizeOf(TCode)) - 1 do
+ MixBlock(T128Bit(ContextEx.Key), PCode(@ContextEx.Digest[I * SizeOf(TCode)])^, True);
+
+ {return Digest of requested DigestSize}
+ {max digest is 2048-bit, although it could be greater if Pi2048 was larger}
+ Move(ContextEx.Digest, Digest, Min(SizeOf(ContextEx.Digest), DigestSize));
+end;
+
+{message digest hash}
+procedure HashTMD(var Digest; DigestSize : LongInt; const Buf; BufSize : LongInt);
+var
+ Context : TTMDContext;
+begin
+ InitTMD(Context);
+ UpdateTMD(Context, Buf, BufSize);
+ FinalizeTMD(Context, Digest, DigestSize);
+end;
+
+{$IFDEF Win32}
+{!!.05} {added}
+
+
+
+function CreateMachineID(MachineInfo : TEsMachineInfoSet) : LongInt;
+{ Obtains information from:
+ - Volume sizes (NOT free space)
+ - Volume serial numbers
+ - Registration name and company
+ - GetSystemInfo relevant info
+ - Network card ID (if available)
+}
+const
+ sCurVer = 'Software\Microsoft\Windows\CurrentVersion'; {!!.11}
+ sCurVerNT = 'Software\Microsoft\Windows NT\CurrentVersion'; {!!.11}
+ sRegOwner = 'RegisteredOwner'; {!!.11}
+ sRegOrg = 'RegisteredOrganization'; {!!.11}
+
+type {!!.11}
+ TUuidCreateSequential = function (lpGUID : Pointer): HResult; stdcall; {!!.11}
+
+
+var
+ hRPCTR4 : THandle; {!!.11}
+ UuidCreateSequential : TUuidCreateSequential; {!!.11}
+ I : DWord;
+ RegKey : HKEY;
+ GUID1 : TGUID;
+ GUID2 : TGUID;
+ Drive : AnsiChar;
+ SysInfo : TSystemInfo;
+ Context : TTMDContext;
+ UserInfoFound : Boolean; {!!.11}
+ Buf : array [0..1023] of Byte;
+begin
+ InitTMD(Context);
+
+ {include user specific information}
+ if midUser in MachineInfo then begin
+{!!.11}
+ UserInfoFound := False;
+ { first look for registered info in \Windows\CurrentVersion }
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, sCurVer, 0,
+ KEY_QUERY_VALUE, RegKey) = ERROR_SUCCESS) then begin
+ I := SizeOf(Buf);
+ if RegQueryValueEx(RegKey, sRegOwner, nil, nil, @Buf, @I) = ERROR_SUCCESS then begin
+ UserInfoFound := True;
+ UpdateTMD(Context, Buf, I);
+ I := SizeOf(Buf);
+ if RegQueryValueEx(RegKey, sRegOrg, nil, nil, @Buf, @I) = ERROR_SUCCESS then
+ UpdateTMD(Context, Buf, I);
+ end;
+ RegCloseKey(RegKey); {!!.13}
+ end;
+
+{!!.11}
+ { if not found, then look in \Windows NT\CurrentVersion }
+ if not UserInfoFound then
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, sCurVerNT, 0,
+ KEY_QUERY_VALUE, RegKey) = ERROR_SUCCESS) then begin
+ I := SizeOf(Buf);
+ if RegQueryValueEx(RegKey, sRegOwner, nil, nil, @Buf, @I) = ERROR_SUCCESS then begin
+ UpdateTMD(Context, Buf, I);
+ I := SizeOf(Buf);
+ if RegQueryValueEx(RegKey, sRegOrg, nil, nil, @Buf, @I) = ERROR_SUCCESS then
+ UpdateTMD(Context, Buf, I);
+ end;
+ RegCloseKey(RegKey); {!!.13}
+ end;
+ end;
+
+ if midSystem in MachineInfo then begin
+ {include system specific information}
+ GetSystemInfo(SysInfo);
+ PDWord(@Buf[0])^ := SysInfo.dwOemId;
+ PDWord(@Buf[4])^ := SysInfo.dwProcessorType;
+ UpdateTMD(Context, Buf, 8);
+ end;
+
+ if midNetwork in MachineInfo then begin
+ {include network ID}
+
+ CreateGuid(GUID1); //CoCreateGuid(GUID1);
+ CreateGuid(GUID2); //CoCreateGuid(GUID2);
+
+
+{!!.11}
+ { use UuidCreateSequential instead of CoCreateGuid if available }
+ hRPCTR4 := LoadLibrary('rpcrt4.dll');
+ if (hRPCTR4 <> 0) then begin
+ UuidCreateSequential := TUuidCreateSequential(GetProcAddress(hRPCTR4, 'UuidCreateSequential'));
+ if Assigned(UuidCreateSequential) then begin
+ UuidCreateSequential(@GUID1);
+ UuidCreateSequential(@GUID2);
+ end;
+ FreeLibrary(hRPCTR4); {!!.13}
+ end;
+{!!.11}
+
+
+
+ {check to see if "network" ID is available}
+ if (GUID1.D4[2] = GUID2.D4[2]) and
+ (GUID1.D4[3] = GUID2.D4[3]) and
+ (GUID1.D4[4] = GUID2.D4[4]) and
+ (GUID1.D4[5] = GUID2.D4[5]) and
+ (GUID1.D4[6] = GUID2.D4[6]) and
+ (GUID1.D4[7] = GUID2.D4[7]) then
+ UpdateTMD(Context, GUID1.D4[2], 6);//brandys
+ end;
+
+ if midDrives in MachineInfo then begin
+ {include drive specific information}
+ for Drive := 'C' to 'Z' do begin
+
+ if (GetDriveType(PAnsiChar(AnsiString(Drive + ':\'))) = DRIVE_FIXED) then begin
+ FillChar(Buf, Sizeof(Buf), 0);
+ Buf[0] := Byte(Drive);
+ {!!.16} {removed cluster information}
+ GetVolumeInformation(PAnsiChar(AnsiString(Drive + ':\')), nil, 0,
+ PDWord(@Buf[1]){serial number}, I{not used}, I{not used}, nil, 0);
+ UpdateTMD(Context, Buf, 5);
+ end;
+ end;
+ end;
+
+ FinalizeTMD(Context, Result, SizeOf(Result));
+end;
+{$ELSE}
+{$IFNDEF LINUX}
+function CreateMachineID(MachineInfo : TEsMachineInfoSet) : LongInt;
+var
+ I : DWord;
+ RegKey : DWord;
+ GUID1 : TGUID;
+ GUID2 : TGUID;
+ Drive : Integer;
+ Context : TTMDContext;
+ Buf : array [0..1023] of Byte;
+begin
+ InitTMD(Context);
+
+ {no user (midUser) information under Win16}
+
+ if midSystem in MachineInfo then begin
+ {include system specific information}
+ I := GetWindowsDirectory(@Buf, SizeOf(Buf));
+ UpdateTMD(Context, Buf, I);
+ I := GetSystemDirectory(@Buf, SizeOf(Buf));
+ UpdateTMD(Context, Buf, I);
+
+ PLongInt(@Buf[0])^ := GetWinFlags;
+ PLongInt(@Buf[4])^ := WinProcs.GetVersion;
+ UpdateTMD(Context, Buf, 8);
+ end;
+
+ if midNetwork in MachineInfo then begin
+ {include network ID}
+ CreateGuid(GUID1);
+ CreateGuid(GUID2);
+ {check to see if "network" ID is available}
+ if (GUID1.Data4[2] = GUID2.Data4[2]) and
+ (GUID1.Data4[3] = GUID2.Data4[3]) and
+ (GUID1.Data4[4] = GUID2.Data4[4]) and
+ (GUID1.Data4[5] = GUID2.Data4[5]) and
+ (GUID1.Data4[6] = GUID2.Data4[6]) and
+ (GUID1.Data4[7] = GUID2.Data4[7]) then
+ UpdateTMD(Context, GUID1.Data4[2], 6);
+ end;
+
+ if midDrives in MachineInfo then begin
+ {include drive specific information}
+ for Drive := 2 {C} to 25 {Z} do begin
+ if GetDriveType(Drive) = DRIVE_FIXED then begin
+ FillChar(Buf, Sizeof(Buf), 0);
+ Buf[0] := Drive;
+ {!!.06} {removed cluster information}
+ PLongInt(@Buf[1])^ := GetDiskSerialNumber(Chr(Drive+Ord('A')));{!!.06}
+ UpdateTMD(Context, Buf, 5);
+ end;
+ end;
+ end;
+
+ FinalizeTMD(Context, Result, SizeOf(Result));
+end;
+{$ELSE}
+function CreateMachineID(MachineInfo : TEsMachineInfoSet) : LongInt;
+var
+ I : LongInt;
+ RegKey : DWord;
+ GUID1 : TGUID;
+ GUID2 : TGUID;
+ Drive : Integer;
+ Context : TTMDContext;
+ Buf : array [0..2047] of Byte;
+ iFileHandle : LongInt;
+begin
+ InitTMD(Context);
+
+ {include user specific information}
+ if midUser in MachineInfo then
+ begin
+ //[to do] find some organization specific info
+ end;
+
+ if midSystem in MachineInfo then
+ begin
+ {include system specific information}
+ iFileHandle := FileOpen('/proc/cpuinfo', fmopenRead or fmShareDenyNone);
+ I := FileRead(iFileHandle, Buf,2048);
+ if I > 0 then UpdateTMD(Context, Buf, I-1);
+ FileClose(iFileHandle);
+
+
+ iFileHandle := FileOpen('/proc/sys/kernel/version', fmopenRead or fmShareDenyNone);
+ I := FileRead(iFileHandle, Buf, 2048);
+ if I > 0 then UpdateTMD(Context, Buf, I-1);
+ FileClose(iFileHandle);
+
+
+
+ iFileHandle := FileOpen('/proc/sys/kernel/osrelease', fmopenRead or fmShareDenyNone);
+ I := FileRead(iFileHandle, Buf, 2048);
+ if I > 0 then UpdateTMD(Context, Buf, I-1);
+ FileClose(iFileHandle);
+
+
+ iFileHandle := FileOpen('/proc/sys/kernel/hostname', fmopenRead or fmShareDenyNone);
+ I := FileRead(iFileHandle, Buf, 2048);
+ if I > 0 then UpdateTMD(Context, Buf, I-1);
+ FileClose(iFileHandle);
+ end;
+
+ if midNetwork in MachineInfo then
+ begin
+ {include network ID}
+ CreateGuid(GUID1);
+ CreateGuid(GUID2);
+ {check to see if "network" ID is available}
+ if (GUID1.D4[2] = GUID2.D4[2]) and
+ (GUID1.D4[3] = GUID2.D4[3]) and
+ (GUID1.D4[4] = GUID2.D4[4]) and
+ (GUID1.D4[5] = GUID2.D4[5]) and
+ (GUID1.D4[6] = GUID2.D4[6]) and
+ (GUID1.D4[7] = GUID2.D4[7]) then
+ UpdateTMD(Context, GUID1.D4[2], 6);
+ end;
+
+ if midDrives in MachineInfo then
+ begin
+ {include drive specific information}
+ for Drive := 2 {C} to 25 {Z} do begin
+ if GetDriveType(Drive) = 3 {DRIVE_FIXED} then begin
+ FillChar(Buf, Sizeof(Buf), 0);
+ Buf[0] := Drive;
+ {!!.06} {removed cluster information}
+ PLongInt(@Buf[1])^ := GetDiskSerialNumber(Chr(Drive+Ord('A')));{!!.06}
+ UpdateTMD(Context, Buf, 5);
+ end;
+ end;
+ end;
+
+ FinalizeTMD(Context, Result, SizeOf(Result));
+end;
+{$ENDIF}
+{$ENDIF}
+
+{key generation routines }
+procedure GenerateRandomKeyPrim(var Key; KeySize: Cardinal);
+var
+ Bytes : TByteArray absolute Key;
+ I : Integer;
+begin
+ Randomize;
+ for I := 0 to KeySize - 1 do
+ Bytes[I] := Random(256);
+end;
+
+procedure GenerateTMDKeyPrim(var Key; KeySize: Cardinal; const Str: string);
+var
+ I : Integer;
+ S2 : string;
+begin
+ {strip accented characters from the string} {!!.06}
+ S2 := Str; {!!.06}
+ for I := Length(S2) downto 1 do {!!.06}
+ if Ord(S2[I]) > 127 then {!!.06}
+ Delete(S2, I, 1); {!!.06}
+
+ HashTMD(Key, KeySize, S2[1], Length(S2)); {!!.06}
+end;
+
+procedure GenerateMD5KeyPrim(var Key: TKey; const Str: string);
+var
+ D : TMD5Digest;
+ I : Integer;
+ S2 : string;
+begin
+ {strip accented characters from the string} {!!.06}
+ S2 := Str; {!!.06}
+ for I := Length(S2) downto 1 do {!!.06}
+ if Ord(S2[I]) > 127 then {!!.06}
+ Delete(S2, I, 1); {!!.06}
+
+ D := MD5String(S2); {!!.06}
+ Key := TKey(D);
+end;
+
+
+{modifier routines}
+function GenerateStringModifierPrim(const S : string) : LongInt;
+var
+ I : Integer; {!!.06}
+ Sig : array [0..4] of AnsiChar;
+ S2 : string; {!!.06}
+begin
+ FillChar(Sig, SizeOf(Sig), 0);
+
+ {strip accented characters from the string} {!!.06}
+ S2 := S; {!!.06}
+ for I := Length(S2) downto 1 do {!!.06}
+ if Ord(S2[I]) > 127 then {!!.06}
+ Delete(S2, I, 1); {!!.06}
+
+ StrPLCopy(Sig, AnsiUpperCase(S2), Min(4, Length(S2))); {!!.06}
+ Result := PLongInt(@Sig[0])^;
+end;
+
+function GenerateUniqueModifierPrim : LongInt;
+var
+ ID : TGUID;
+begin
+ CreateGuid(ID);
+ Mix128(T128Bit(ID));
+ Result := T128Bit(ID)[3];
+end;
+
+{!!.05} {revised}
+function GenerateMachineModifierPrim : LongInt;
+begin
+ Result := CreateMachineID([midUser, midSystem, {midNetwork,} midDrives]);
+end;
+
+function GenerateDateModifierPrim(D : TDateTime) : LongInt;
+begin
+ Result := Trunc(D);
+ TLongIntRec(Result).Hi := TLongIntRec(Result).Lo xor $AAAA;
+end;
+
+procedure ApplyModifierToKeyPrim(Modifier : LongInt; var Key; KeySize : Cardinal);
+begin
+ if Modifier <> 0 then
+ XorMem(Key, Modifier, Min(SizeOf(Modifier), KeySize));
+end;
+{$ENDIF}
+
+{*** TogCodeBase ***}
+
+constructor TOgCodeBase.Create(AOwner : TComponent);
+begin
+ inherited Create(AOwner);
+
+ FAutoCheck := DefAutoCheck;
+ FStoreCode := DefStoreCode;
+ FStoreModifier := DefStoreModifier;
+
+end;
+
+procedure TOgCodeBase.DoOnChecked(Value : TCodeStatus);
+begin
+ if Assigned(FOnChecked) then
+ FOnChecked(Self, Value)
+ else if FAutoCheck then
+ raise EOnGuardException.CreateFmt(SCNoOnCheck, [Self.ClassName]);
+end;
+
+function TOgCodeBase.DoOnGetCode : TCode;
+begin
+ FillChar(Result, SizeOf(Result), 0);
+ if FStoreCode then
+ Result := FCode
+ else begin
+ if Assigned(FOnGetCode) then
+ FOnGetCode(Self, Result)
+ else
+ raise EOnGuardException.CreateFmt(SCNoOnGetCode, [Self.ClassName]);
+ end;
+
+ {store code for easy access using the Code property} {!!.02}
+ FCode := Result; {!!.02}
+end;
+
+procedure TOgCodeBase.DoOnGetKey(var Key : TKey);
+begin
+ FillChar(Key, SizeOf(TKey), 0);
+ if Assigned(FOnGetKey) then
+ FOnGetKey(Self, Key)
+ else
+ raise EOnGuardException.CreateFmt(SCNoOnGetKey, [Self.ClassName]);
+end;
+
+{!!.02} {revised}
+function TOgCodeBase.DoOnGetModifier : LongInt;
+var
+ L : LongInt;
+begin
+ Result := 0;
+ if FStoreModifier then
+ Result := FModifier
+ else if Assigned(FOnGetModifier) then begin
+ FOnGetModifier(Self, L);
+ if FStoreModifier then begin
+ {byte and word swap the modifier}
+ TLongIntRec(Result).HiHi := TLongIntRec(L).LoLo;
+ TLongIntRec(Result).HiLo := TLongIntRec(L).LoHi;
+ TLongIntRec(Result).LoHi := TLongIntRec(L).HiLo;
+ TLongIntRec(Result).LoLo := TLongIntRec(L).HiHi;
+ end else
+ Result := L;
+ end;
+
+ {store modifier for easy access using the Modifier property} {!!.02}
+ FModifier := Result; {!!.02}
+end;
+
+function TOgCodeBase.GetCode : string;
+var
+ Work : TCode;
+begin
+ Result := '$' + BufferToHex(FCode, SizeOf(FCode));
+ if not HexToBuffer(Result, Work, SizeOf(Work)) then
+ Result := '';
+
+ if HexStringIsZero(Result) then
+ Result := '';
+end;
+
+function TOgCodeBase.GetModifier : string;
+var
+ Work : LongInt;
+begin
+ Result := '$' + BufferToHex(FModifier, SizeOf(FModifier));
+ if not HexToBuffer(Result, Work, SizeOf(Work)) then
+ Result := '';
+
+ if HexStringIsZero(Result) then
+ Result := '';
+end;
+
+function TOgCodeBase.GetAbout : string; {!!.08}
+begin
+ Result := OgVersionStr;
+end;
+
+function TOgCodeBase.IsCodeValid : Boolean;
+begin
+ Result := (CheckCode(False) = ogValidCode);
+end;
+
+procedure TOgCodeBase.Loaded;
+begin
+ inherited Loaded;
+
+ if FAutoCheck and not (csDesigning in ComponentState) then
+ CheckCode(True);
+end;
+
+procedure TOgCodeBase.SetCode(const Value : string);
+begin
+ if not HexToBuffer(Value, FCode, SizeOf(FCode)) then
+ FillChar(FCode, SizeOf(FCode), 0);
+end;
+
+procedure TOgCodeBase.SetModifier(const Value : string);
+begin
+ if not HexToBuffer(Value, FModifier, SizeOf(FModifier)) then
+ FModifier := 0;
+end;
+
+procedure TOgCodeBase.SetAbout(const Value : string); {!!.08}
+begin
+end;
+
+
+{*** TOgDateCode ***}
+
+function TOgDateCode.CheckCode(Report : Boolean) : TCodeStatus;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ Result := ogValidCode;
+
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ if IsDateCodeValid(Key, ACode) then begin
+ if IsDateCodeExpired(Key, ACode) then
+ Result := ogPastEndDate;
+ end else
+ Result := ogInvalidCode;
+
+ if Report then
+ DoOnChecked(Result);
+end;
+
+function TOgDateCode.GetValue : TDateTime;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ Result := GetDateCodeValue(Key, ACode);
+end;
+
+
+{*** TOgDaysCode ***}
+
+function TOgDaysCode.CheckCode(Report : Boolean) : TCodeStatus;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ Result := ogValidCode;
+
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ if IsDaysCodeValid(Key, ACode) then begin
+ if IsDaysCodeExpired(Key, ACode) then begin
+ Result := ogDayCountUsed;
+ if GetExpirationDate(Key, ACode) < Date then
+ Result := ogCodeExpired;
+ end;
+ end else
+ Result := ogInvalidCode;
+
+ if Report then
+ DoOnChecked(Result);
+end;
+
+constructor TOgDaysCode.Create(AOwner : TComponent);
+begin
+ inherited Create(AOwner);
+
+ FAutoDecrease := DefAutoDecrease;
+end;
+
+procedure TOgDaysCode.Decrease;
+var
+ ACode : TCode;
+ Work : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ Work := ACode;
+ AModifier := DoOnGetModifier;
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+
+ {code is only decreased once per day - no matter how many times called}
+ DecDaysCode(Key, Work);
+
+ {save code if it was changed}
+ if (Work.CheckValue <> ACode.CheckValue) or (Work.Days <> ACode.Days) then
+ DoOnChangeCode(Work);
+end;
+
+procedure TOgDaysCode.DoOnChangeCode(Value : TCode);
+begin
+ if Assigned(FOnChangeCode) then
+ FOnChangeCode(Self, Value)
+ else
+ raise EOnGuardException.CreateFmt(SCNoOnChangeCode, [Self.ClassName]);
+end;
+
+function TOgDaysCode.GetValue : LongInt;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ Result := GetDaysCodeValue(Key, ACode);
+end;
+
+procedure TOgDaysCode.Loaded;
+begin
+ inherited Loaded;
+
+ if FAutoDecrease and not (csDesigning in ComponentState) then
+ Decrease;
+end;
+
+
+{*** TOgMakeCodes ***}
+
+constructor TOgMakeCodes.Create(AOwner : TComponent);
+begin
+ inherited Create(AOwner);
+
+ FCodeType := DefCodeType;
+ FShowHints := False;
+end;
+
+function TOgMakeCodes.Execute : Boolean;
+{$IFNDEF NoMakeCodesSupport} {!!.10}
+var
+ F : TCodeGenerateFrm;
+{$ENDIF} {!!.10}
+begin
+{$IFNDEF NoMakeCodesSupport} {!!.10}
+ F := TCodeGenerateFrm.Create(Owner);
+ try
+ F.CodeType := FCodeType;
+ F.SetKey(FKey); {!!.08}
+ F.KeyType := FKeyType;
+ F.KeyFileName := FKeyFileName;
+ F.ShowHint := FShowHints;
+ Result := F.ShowModal = mrOK;
+ if Result then begin
+ FCode := F.Code;
+ F.GetKey(FKey); {!!.08}
+ FKeyType := F.KeyType;
+ FKeyFileName := F.KeyFileName;
+ end;
+ finally
+ F.Free;
+ end;
+{$ELSE} {!!.10}
+ Result := False; {!!.10}
+{$ENDIF} {!!.10}
+end;
+
+function TOgMakeCodes.GetAbout : string; {!!.08}
+begin
+ Result := OgVersionStr;
+end;
+
+procedure TOgMakeCodes.SetAbout(const Value : string); {!!.08}
+begin
+end;
+
+procedure TOgMakeCodes.GetCode(var Value : TCode); {!!.08}
+begin
+ Value := FCode;
+end;
+
+procedure TOgMakeCodes.SetCode(Value : TCode); {!!.08}
+begin
+ FCode := Value;
+end;
+
+procedure TOgMakeCodes.GetKey(var Value : TKey); {!!.08}
+begin
+ Value := FKey;
+end;
+
+procedure TOgMakeCodes.SetKey(Value : TKey); {!!.08}
+begin
+ FKey := Value;
+end;
+
+
+{*** TOgMakeKeys ***}
+
+constructor TOgMakeKeys.Create(AOwner : TComponent);
+begin
+ inherited Create(AOwner);
+
+ FKeyType := DefKeyType;
+ FShowHints := False;
+end;
+
+function TOgMakeKeys.Execute : Boolean;
+{$IFNDEF NoMakeCodesSupport} {!!.10}
+var
+ F : TKeyMaintFrm;
+{$ENDIF} {!!.10}
+begin
+{$IFNDEF NoMakeCodesSupport} {!!.10}
+ F := TKeyMaintFrm.Create(Owner);
+ try
+ F.SetKey(FKey); {!!.08}
+ F.KeyType := FKeyType;
+ F.KeyFileName := FKeyFileName;
+ F.ShowHint := FShowHints;
+ Result := F.ShowModal = mrOK;
+ if Result then begin
+ F.GetKey(FKey); {!!.08}
+ FKeyType := F.KeyType;
+ FKeyFileName := F.KeyFileName;
+ end;
+ finally
+ F.Free;
+ end;
+{$ELSE} {!!.10}
+ Result := False; {!!.10}
+{$ENDIF} {!!.10}
+end;
+
+procedure TOgMakeKeys.ApplyModifierToKey(Modifier : LongInt; var Key; KeySize : Cardinal);
+begin
+ ApplyModifierToKeyPrim(Modifier, Key, KeySize);
+end;
+
+function TOgMakeKeys.GenerateDateModifier(D : TDateTime) : LongInt;
+begin
+ Result := GenerateDateModifierPrim(D);
+end;
+
+function TOgMakeKeys.GenerateMachineModifier : LongInt;
+begin
+ Result := GenerateMachineModifierPrim;
+end;
+
+procedure TOgMakeKeys.GenerateMDKey(var Key; KeySize : Cardinal; const Str : string);
+begin
+ GenerateTMDKeyPrim(Key, KeySize, Str);
+end;
+
+procedure TOgMakeKeys.GenerateRandomKey(var Key; KeySize : Cardinal);
+begin
+ GenerateRandomKeyPrim(Key, KeySize);
+end;
+
+function TOgMakeKeys.GenerateUniqueModifier : LongInt;
+begin
+ Result := GenerateUniqueModifierPrim;
+end;
+
+function TOgMakeKeys.GenerateStringModifier(const S : string) : LongInt;
+begin
+ Result := GenerateStringModifierPrim(S);
+end;
+
+function TOgMakeKeys.GetAbout : string; {!!.08}
+begin
+ Result := OgVersionStr;
+end;
+
+procedure TOgMakeKeys.SetAbout(const Value : string); {!!.08}
+begin
+end;
+
+procedure TOgMakeKeys.GetKey(var Value : TKey); {!!.08}
+begin
+ Value := FKey;
+end;
+
+procedure TOgMakeKeys.SetKey(Value : TKey); {!!.08}
+begin
+ FKey := Value;
+end;
+
+
+{*** TOgRegistrationCode ***}
+
+function TOgRegistrationCode.CheckCode(Report : Boolean) : TCodeStatus;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+ {RegStr : string;} {!!.02}
+begin
+ Result := ogValidCode;
+
+ FRegString := DoOnGetRegString; {!!.02}
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ if not IsRegCodeValid(Key, ACode) then
+ Result := ogInvalidCode
+ else if GetExpirationDate(Key, ACode) < Date then
+ Result := ogCodeExpired;
+
+ if Report then
+ DoOnChecked(Result);
+end;
+
+constructor TOgRegistrationCode.Create(AOwner : TComponent);
+begin
+ inherited Create(AOwner);
+
+ FRegString := '';
+ FStoreRegString := DefStoreRegString;
+end;
+
+function TOgRegistrationCode.DoOnGetRegString : string;
+begin
+ Result := '';
+ if FStoreRegString then
+ Result := FRegString
+ else if Assigned(FOnGetRegString) then
+ FOnGetRegString(Self, Result)
+end;
+
+
+{*** TOgSerialNumberCode ***}
+
+function TOgSerialNumberCode.CheckCode(Report : Boolean) : TCodeStatus;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ Result := ogValidCode;
+
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ if not IsSerialNumberCodeValid(Key, ACode) then
+ Result := ogInvalidCode
+ else if GetExpirationDate(Key, ACode) < Date then
+ Result := ogCodeExpired;
+
+ if Report then
+ DoOnChecked(Result);
+end;
+
+function TOgSerialNumberCode.GetValue : LongInt;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ Result := GetSerialNumberCodeValue(Key, ACode);
+end;
+
+
+{*** TOgSpecialCode ***}
+
+function TOgSpecialCode.CheckCode(Report : Boolean) : TCodeStatus;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ Result := ogValidCode;
+
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ if not IsSpecialCodeValid(Key, ACode) then
+ Result := ogInvalidCode
+ else if GetExpirationDate(Key, ACode) < Date then
+ Result := ogCodeExpired;
+
+ if Report then
+ DoOnChecked(Result);
+end;
+
+function TOgSpecialCode.GetValue : LongInt;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ Result := GetSpecialCodeValue(Key, ACode);
+end;
+
+
+{*** TOgUsageCode ***}
+
+function TOgUsageCode.CheckCode(Report : Boolean) : TCodeStatus;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ Result := ogValidCode;
+
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+
+ if IsUsageCodeValid(Key, ACode) then begin
+ if IsUsageCodeExpired(Key, ACode) then begin
+ Result := ogRunCountUsed;
+ if GetExpirationDate(Key, ACode) < Date then
+ Result := ogCodeExpired;
+ end;
+ end else
+ Result := ogInvalidCode;
+
+ if Report then
+ DoOnChecked(Result);
+end;
+
+constructor TOgUsageCode.Create(AOwner : TComponent);
+begin
+ inherited Create(AOwner);
+
+ FAutoDecrease := DefAutoDecrease;
+end;
+
+procedure TOgUsageCode.Decrease;
+var
+ ACode : TCode;
+ Work : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ Work := ACode;
+ AModifier := DoOnGetModifier;
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+
+ {code is decreased each time this routine is called}
+ DecUsageCode(Key, Work);
+ {save the changed code}
+ DoOnChangeCode(Work);
+end;
+
+procedure TOgUsageCode.DoOnChangeCode(Value : TCode);
+begin
+ if Assigned(FOnChangeCode) then
+ FOnChangeCode(Self, Value)
+ else
+ raise EOnGuardException.CreateFmt(SCNoOnChangeCode, [Self.ClassName]);
+end;
+
+function TOgUsageCode.GetValue : LongInt;
+var
+ ACode : TCode;
+ Key : TKey;
+ AModifier : LongInt;
+begin
+ DoOnGetKey(Key);
+ ACode := DoOnGetCode;
+ AModifier := DoOnGetModifier;
+
+ ApplyModifierToKeyPrim(AModifier, Key, SizeOf(Key));
+ Result := GetUsageCodeValue(Key, ACode);
+end;
+
+procedure TOgUsageCode.Loaded;
+begin
+ inherited Loaded;
+
+ if FAutoDecrease and not (csDesigning in ComponentState) then
+ Decrease;
+end;
+
+{$IFNDEF IBO_CONSOLE}
+{*** general routines ***}
+function GetCodeType(const Key : TKey; const Code : TCode) : TCodeType;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ case Work.CheckValue of
+ DateCheckCode : Result := ctDate;
+ DaysCheckCode : Result := ctDays;
+ RegCheckCode : Result := ctRegistration;
+ SerialCheckCode : Result := ctSerialNumber;
+ UsageCheckCode : Result := ctUsage;
+ NetCheckCode : Result := ctNetwork;
+ SpecialCheckCode : Result := ctSpecial;
+ else
+ Result := ctUnknown;
+ end;
+end;
+
+function ExpandDate(D : Word) : TDateTime;
+begin
+ if D > 0 then
+ Result := LongInt(D) + BaseDate
+ else
+ Result := EncodeDate(9999, 1, 1);
+end;
+
+function ShrinkDate(D : TDateTime) : Word;
+begin
+ if (Trunc(D) = 0) or (Trunc(D) - BaseDate > High(Word)) then
+ Result := 0
+ else
+ Result := Trunc(D) - BaseDate;
+end;
+
+function GetExpirationDate(const Key : TKey; const Code : TCode) : TDateTime;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ case Work.CheckValue of
+ DateCheckCode : Result := ExpandDate(Work.EndDate);
+ DaysCheckCode : Result := ExpandDate(Work.Expiration);
+ RegCheckCode : Result := ExpandDate(Work.Expiration);
+ SerialCheckCode : Result := ExpandDate(Work.Expiration);
+ UsageCheckCode : Result := ExpandDate(Work.Expiration);
+ SpecialCheckCode : Result := ExpandDate(Work.Expiration);
+ else
+ Result := ExpandDate(0)
+ end;
+end;
+
+{*** date code ***}
+
+procedure InitDateCode(const Key : TKey;
+ StartDate, EndDate : TDateTime; var Code : TCode);
+begin
+ Code.CheckValue := DateCheckCode;
+ Code.Expiration := 0; {not used for date codes}
+ Code.FirstDate := ShrinkDate(StartDate);
+ Code.EndDate := ShrinkDate(EndDate);
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsDateCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = DateCheckCode) and
+ (ExpandDate(Work.FirstDate) <= Date);
+end;
+
+function GetDateCodeValue(const Key : TKey; const Code : TCode) : TDateTime;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ {return the end date}
+ if (Work.CheckValue = DateCheckCode) and
+ (ExpandDate(Work.FirstDate) <= Date) then
+ Result := ExpandDate(Work.EndDate)
+ else
+ Result := 0;
+end;
+
+function IsDateCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+begin
+ Result := (GetDateCodeValue(Key, Code) < Date);
+end;
+
+
+{*** days code ***}
+
+procedure InitDaysCode(const Key : TKey; Days : Word; Expires : TDateTime;
+ var Code : TCode);
+begin
+ Code.CheckValue := DaysCheckCode;
+ Code.Expiration := ShrinkDate(Expires);
+ Code.Days := Days;
+ Code.LastAccess := ShrinkDate(Date);
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsDaysCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = DaysCheckCode) and
+ (ExpandDate(Work.LastAccess) <= Date);
+end;
+
+procedure DecDaysCode(const Key : TKey; var Code : TCode);
+var
+ X : LongInt;
+begin
+ MixBlock(T128bit(Key), Code, False);
+ X := ShrinkDate(Date);
+ if (Code.LastAccess <> X) then begin
+ if Code.Days > 0 then {!!.02}
+ Code.Days := Max(0, Code.Days - 1); {!!.02}
+ Code.LastAccess := X;
+ end;
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function GetDaysCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ if (Work.CheckValue = DaysCheckCode) and
+ (ExpandDate(Work.LastAccess) <= Date) then
+ Result := Work.Days
+ else
+ Result := 0;
+end;
+
+function IsDaysCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.Days = 0) or (ExpandDate(Work.Expiration) < Date);
+end;
+
+
+{*** registration code ***}
+
+procedure InitRegCode(const Key : TKey; const RegStr : string; Expires : TDateTime; var Code : TCode);
+var
+ S : string; {!!.06}
+ I : Integer; {!!.06}
+begin
+ Code.CheckValue := RegCheckCode;
+ Code.Expiration := ShrinkDate(Expires);
+ {strip accented characters from the registration string} {!!.06}
+ S := RegStr; {!!.06}
+ for I := Length(S) downto 1 do {!!.06}
+ if Ord(S[I]) > 127 then {!!.06}
+ Delete(S, I, 1); {!!.06}
+ Code.RegString := StringHashElf(AnsiUpperCase(S)); {!!.06}
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsRegCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = RegCheckCode);
+end;
+
+function IsRegCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := ExpandDate(Work.Expiration) < Date;
+end;
+
+
+{*** serial number code ***}
+
+procedure InitSerialNumberCode(const Key : TKey; Serial : LongInt; Expires : TDateTime; var Code : TCode);
+begin
+ Code.CheckValue := SerialCheckCode;
+ Code.Expiration := ShrinkDate(Expires);
+ Code.SerialNumber := Serial;
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsSerialNumberCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = SerialCheckCode);
+end;
+
+function GetSerialNumberCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ if Work.CheckValue = SerialCheckCode then
+ Result := Work.SerialNumber
+ else
+ Result := 0;
+end;
+
+function IsSerialNumberCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := ExpandDate(Work.Expiration) < Date;
+end;
+
+
+{*** special code ***}
+
+procedure InitSpecialCode(const Key : TKey; Value : LongInt; Expires : TDateTime; var Code : TCode);
+begin
+ Code.CheckValue := SpecialCheckCode;
+ Code.Expiration := ShrinkDate(Expires);
+ Code.Value := Value;
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsSpecialCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = SpecialCheckCode);
+end;
+
+function GetSpecialCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ if Work.CheckValue = SpecialCheckCode then
+ Result := Work.Value
+ else
+ Result := 0;
+end;
+
+function IsSpecialCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := ExpandDate(Work.Expiration) < Date;
+end;
+
+
+{*** usage code ***}
+
+procedure InitUsageCode(const Key : TKey; Count : Word; Expires : TDateTime; var Code : TCode);
+begin
+ Code.CheckValue := UsageCheckCode;
+ Code.Expiration := ShrinkDate(Expires);
+ Code.UsageCount := Count;
+ Code.LastChange := ShrinkDate(Date); {!!.02}
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function IsUsageCodeValid(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.CheckValue = UsageCheckCode) and {!!.02}
+ (ExpandDate(Work.LastChange) <= Date); {!!.02}
+end;
+
+procedure DecUsageCode(const Key : TKey; var Code : TCode);
+var {!!.02}
+ D : Word; {!!.02}
+begin
+ MixBlock(T128bit(Key), Code, False);
+ D := ShrinkDate(Date); {!!.02}
+ if Code.UsageCount > 0 then {!!.02}
+ Code.UsageCount := Max(0, Code.UsageCount - 1); {!!.02}
+ if (Code.LastChange < D) then {!!.02}
+ Code.LastChange := D; {!!.02}
+
+ MixBlock(T128bit(Key), Code, True);
+end;
+
+function GetUsageCodeValue(const Key : TKey; const Code : TCode) : LongInt;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ if (Work.CheckValue = UsageCheckCode) and {!!.02}
+ (ExpandDate(Work.LastChange) <= Date) then {!!.02}
+ Result := Work.UsageCount {!!.02}
+ else
+ Result := 0;
+end;
+
+function IsUsageCodeExpired(const Key : TKey; const Code : TCode) : Boolean;
+var
+ Work : TCode;
+begin
+ Work := Code;
+ MixBlock(T128bit(Key), Work, False);
+ Result := (Work.UsageCount = 0) or (ExpandDate(Work.Expiration) < Date);
+end;
+{$ENDIF}
+
+
+
+
+initialization
+ {record our baseline date}
+ BaseDate := Trunc(EncodeDate(1996, 1, 1));
+
+end.
+
+
+
diff --git a/components/onguard/source/open.bmp b/components/onguard/source/open.bmp
new file mode 100644
index 000000000..ec88288d3
Binary files /dev/null and b/components/onguard/source/open.bmp differ
diff --git a/components/onguard/source/paste.bmp b/components/onguard/source/paste.bmp
new file mode 100644
index 000000000..b297e37e2
Binary files /dev/null and b/components/onguard/source/paste.bmp differ
diff --git a/components/onguard/source/qogabout0.lfm b/components/onguard/source/qogabout0.lfm
new file mode 100644
index 000000000..f7293575b
--- /dev/null
+++ b/components/onguard/source/qogabout0.lfm
@@ -0,0 +1,1303 @@
+object OgAboutForm: TOgAboutForm
+ ActiveControl = btnOK
+ BorderIcons = [biSystemMenu, biMinimize]
+ Caption = 'About TurboPower OnGuard'
+ ClientHeight = 271
+ ClientWidth = 365
+ Color = clForm
+ Font.Color = clText
+ Font.Height = 11
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ OnCreate = FormCreate
+ OnMouseMove = FormMouseMove
+ PixelsPerInch = 83
+ Position = poScreenCenter
+ TextHeight = 13
+ HorzScrollBar.Page = 364
+ HorzScrollBar.Range = 277
+ VertScrollBar.Page = 270
+ VertScrollBar.Range = 222
+ Left = 526
+ Height = 271
+ Top = 236
+ Width = 365
+ object TBevel
+ Height = 13
+ Left = 4
+ Shape = bsTopLine
+ Top = 191
+ Width = 301
+ Left = 4
+ Height = 13
+ Top = 191
+ Width = 301
+ end
+ object TLabel
+ Caption = 'OnGuard'
+ Color = clNone
+ Font.Color = clText
+ Font.Height = 9
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ Font.Style = [fsBold]
+ ParentColor = False
+ Left = 110
+ Height = 10
+ Top = 6
+ Width = 42
+ end
+ object lblVersion: TLabel
+ Caption = 'Version 1.00'
+ Color = clNone
+ Font.Color = clText
+ Font.Height = 8
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ ParentColor = False
+ Left = 110
+ Height = 10
+ Top = 24
+ Width = 49
+ end
+ object TLabel
+ Caption = 'OnGuard home page:'
+ Color = clNone
+ ParentColor = False
+ Left = 111
+ Height = 13
+ Top = 46
+ Width = 121
+ end
+ object WebLbl: TLabel
+ Caption = 'http://sourceforge.net/projects/tponguard'
+ Color = clNone
+ Font.Color = clNavy
+ Font.Height = 8
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ ParentColor = False
+ OnClick = WebLblClick
+ OnMouseMove = WebLblMouseMove
+ Left = 116
+ Height = 10
+ Top = 66
+ Width = 154
+ end
+ object TLabel
+ Caption = 'Released under the Mozilla License 1.1'
+ Color = clNone
+ ParentColor = False
+ Left = 111
+ Height = 13
+ Top = 91
+ Width = 223
+ end
+ object TLabel
+ Caption = '(MPL 1.1)'
+ Color = clNone
+ ParentColor = False
+ Left = 116
+ Height = 13
+ Top = 110
+ Width = 56
+ end
+ object TLabel
+ Caption = 'Copyright (C) 1997-2002, TurboPower Software Company.'
+ Color = clNone
+ ParentColor = False
+ Left = 5
+ Height = 13
+ Top = 197
+ Width = 328
+ end
+ object TLabel
+ Caption = 'All rights reserved.'
+ Color = clNone
+ ParentColor = False
+ Left = 5
+ Height = 13
+ Top = 217
+ Width = 106
+ end
+ object TLabel
+ Caption = 'Online newsgroups'
+ Color = clNone
+ ParentColor = False
+ Left = 111
+ Height = 13
+ Top = 135
+ Width = 109
+ end
+ object NewsLbl: TLabel
+ Caption = 'https://sourceforge.net/forum/?group_id=71010'
+ Color = clNone
+ Font.Color = clNavy
+ Font.Height = 8
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ ParentColor = False
+ OnClick = NewsLblClick
+ OnMouseMove = NewsLblMouseMove
+ Left = 116
+ Height = 10
+ Top = 162
+ Width = 178
+ end
+ object Panel1: TPanel
+ BevelOuter = bvLowered
+ ClientHeight = 182
+ ClientWidth = 101
+ TabOrder = 0
+ Left = 4
+ Height = 182
+ Top = 4
+ Width = 101
+ object Image1: TImage
+ Align = alClient
+ Picture.Data = {
+ 07544269746D6170628C0000424D628C00000000000036040000280000008900
+ 0000F900000001000800000000002C8800000000000000000000000100000001
+ 0000000000000000800000800000008080008000000080008000808000008080
+ 8000C0DCC000F0CAA600AA3F2A00FF3F2A00005F2A00555F2A00AA5F2A00FF5F
+ 2A00007F2A00557F2A00AA7F2A00FF7F2A00009F2A00559F2A00AA9F2A00FF9F
+ 2A0000BF2A0055BF2A00AABF2A00FFBF2A0000DF2A0055DF2A00AADF2A00FFDF
+ 2A0000FF2A0055FF2A00AAFF2A00FFFF2A000000550055005500AA005500FF00
+ 5500001F5500551F5500AA1F5500FF1F5500003F5500553F5500AA3F5500FF3F
+ 5500005F5500555F5500AA5F5500FF5F5500007F5500557F5500AA7F5500FF7F
+ 5500009F5500559F5500AA9F5500FF9F550000BF550055BF5500AABF5500FFBF
+ 550000DF550055DF5500AADF5500FFDF550000FF550055FF5500AAFF5500FFFF
+ 550000007F0055007F00AA007F00FF007F00001F7F00551F7F00AA1F7F00FF1F
+ 7F00003F7F00553F7F00AA3F7F00FF3F7F00005F7F00555F7F00AA5F7F00FF5F
+ 7F00007F7F00557F7F00AA7F7F00FF7F7F00009F7F00559F7F00AA9F7F00FF9F
+ 7F0000BF7F0055BF7F00AABF7F00FFBF7F0000DF7F0055DF7F00AADF7F00FFDF
+ 7F0000FF7F0055FF7F00AAFF7F00FFFF7F000000AA005500AA00AA00AA00FF00
+ AA00001FAA00551FAA00AA1FAA00FF1FAA00003FAA00553FAA00AA3FAA00FF3F
+ AA00005FAA00555FAA00AA5FAA00FF5FAA00007FAA00557FAA00AA7FAA00FF7F
+ AA00009FAA00559FAA00AA9FAA00FF9FAA0000BFAA0055BFAA00AABFAA00FFBF
+ AA0000DFAA0055DFAA00AADFAA00FFDFAA0000FFAA0055FFAA00AAFFAA00FFFF
+ AA000000D4005500D400AA00D400FF00D400001FD400551FD400AA1FD400FF1F
+ D400003FD400553FD400AA3FD400FF3FD400005FD400555FD400AA5FD400FF5F
+ D400007FD400557FD400AA7FD400FF7FD400009FD400559FD400AA9FD400FF9F
+ D40000BFD40055BFD400AABFD400FFBFD40000DFD40055DFD400AADFD400FFDF
+ D40000FFD40055FFD400AAFFD400FFFFD4005500FF00AA00FF00001FFF00551F
+ FF00AA1FFF00FF1FFF00003FFF00553FFF00AA3FFF00FF3FFF00005FFF00555F
+ FF00AA5FFF00FF5FFF00007FFF00557FFF00AA7FFF00FF7FFF00009FFF00559F
+ FF00AA9FFF00FF9FFF0000BFFF0055BFFF00AABFFF00FFBFFF0000DFFF0055DF
+ FF00AADFFF00FFDFFF0055FFFF00AAFFFF00FFCCCC00FFCCFF00FFFF3300FFFF
+ 6600FFFF9900FFFFCC00007F0000557F0000AA7F0000FF7F0000009F0000559F
+ 0000AA9F0000FF9F000000BF000055BF0000AABF0000FFBF000000DF000055DF
+ 0000AADF0000FFDF000055FF0000AAFF000000002A0055002A00AA002A00FF00
+ 2A00001F2A00551F2A00AA1F2A00FF1F2A00003F2A00553F2A00F0FBFF00A4A0
+ A000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF
+ FF0029F129F1F12929292929292D29292A2D292D2D052D512D4D522D2D055152
+ 522E5152515251522D5251522D524D52052E52515252515252512E4D524D2E51
+ 052E4D2D2E2D4D2D2E29292929292929F129F129F129EDF029F125F029F129F1
+ 2829F124F1F128F129F125F129F0F128EDF1F1F1F0EDF1F1F0F1EDF0F100F1F0
+ EDF0F1F1ECF0F1ECF100F14D504FF128F12929F1292929292929292D29292D05
+ 2951292E4D2E2D4D522D4E2D51512E512E512E51522D524D522E512E5152512E
+ 4D2E51522D4E512E4D2E4D2E4D2D4E2D054D2E05292D2A292929F129ED2929F1
+ 25F12929ED29F129F125F125F1F129F1F129F1F125F0F129F1ED29F129F1F0ED
+ F1F0EDF0EDF1F0F1ECF1EDF0F1F1EDF0F1EDF1F0EDF1EC4E4F5029F129F129F1
+ 29F129F1292929292D292D29292A5129524D522D4E512D524E2D524D5251522D
+ 05512E51514D52514E2D4E51524D2E4D522D4E512E512E4D2E4D2D2A2D29292D
+ 05292929292929F129F1ED29F129F129F129F129F128F1F129EDF129F0F125F1
+ F129F1EC29F1F1ED29F1F1F0F1EDF1F1F0EDF1F1F1ECF1EDF0EDF0EDF0F100ED
+ F0F0F14D4C4CF12929292929F129292929292929292929292D4D29522D2D2952
+ 2D4D4E512D524D2E512A5152515229522E522D522D52512E515251522D4D2E2D
+ 522D522D522D52294D2E4D2E2D292929292929F1292929F129ED29F129EC29ED
+ 29F129F129F029F12529F1F025F129F1F1F029F0F1EDF0EDF1F0F1ECF1F0F1EC
+ F1F1F0F1F1F0F1F0F1ECF1F0EDF100504F4F2929F129F1292929292D29292929
+ 2929292929292E29294D52294D2E2D2D524D2E4D52512E4D2E29525251515251
+ 52512E4D522D4E512A5251052D052D052D052E4D2E512A4D052D29292929F129
+ 2929F1292929F125F129F129F129ED28F1F129F1F1F1F129F1F0F129F125F1ED
+ 2929F1F1F0EDF0F1F1F1ECF1F1F0EDF1ECF1EDF0EDF1F0EDF1F0EDD0D0D0F1F1
+ 29F12929F129292929292D2929292D2952295129522D29512E4D524E512D522D
+ 4D2E4D2E4D5229512E5229522D5251522D522D522D4D2E51522D524D2E4D2D29
+ 294E2D2D2929292929292929F12929F129F129F129F129F129F129F1ED29EDF1
+ 29F029ED29F125F1F0F129F1F1EDF0EDF1F1F1F1ECF1F1F0EDF1F0F1F1F0F1F1
+ F1ECF1F100EDF0CBCBCBF12829F129292D2929292D29292E29292929292D2A4D
+ 29522D4E2D292D4D2E052D522D5251522D52522D0551525152522D52524D2E4D
+ 522D4E2D5229512E512E4D524D2D0529292E292929292929292929292929ED29
+ F125F129EC29F12929F12929F1ED29F0F129F129ED29F12829F1F1F0EDF0EDF0
+ F1ECF1F1F0F1EDF0EDF1ECF1ECF1ECF1F0F1F1C9C9C929F1F129F0292929292D
+ 29292D292D2D292929292D2D2E2D052D4D524D2E51512E4D52295229524D2D4E
+ 522D2E4D2E4D52512A5152512E4D522D05522D052D052D2E295229512A4D2929
+ 292929F12929F129F12929F129F129F129F125F1F029F1EC2929F1F129ECF1F1
+ 29F1F0EDF129F1F1F1F1F1F1F1F1F1ECF1EDF0F1F1F0F1F0F1F1F0F1EDF0ECC4
+ C4C42DF12929F129F1292929292D29292952292D2D2929052D052D4D2A2D292D
+ 052E4D512A512E51522D522D2D05515251522D5251522D5229522D4D522D524D
+ 2E4D2E4D4D292A292929292929292929292929292929F129F12925F129F129F1
+ 29EDF129F1F1F125F129F129F0ED29F129F1F0EDF1F0F1EDF0F1ECF1F1F0F1F1
+ ECF1F1EDF1ECF1EDF0EDF1BEBFBF552DF1F129F12929F1292929292D29292E29
+ 4E2D29292D29522D4D524D522951522E515152295229524D52292E512E515229
+ 522D052D525129522D052D2E4D2D4E292E5129522929292A2929292929F129F1
+ 29F129ED2929F125F125F0F129F129F129F129F0F1F125F1F129F125F125F1F0
+ F1EDF0F1EDF1F1F0EDF1ECF1F1EDF0F1F0F1F1F0F1F1F0B8B8B931562D29F129
+ F12929292D2929292D29292D2D2952512929292E29292D295229294D2E052E51
+ 512E4D2E515229524D2E51522D4E2D4E2D522E514E2D05512A4D2D4D294E2929
+ 522929292929292929292929292929F129F129F129F12925F128F125F025F129
+ 29F1F029EDF0F1F128F1F1F1F0F1F1F0F1F0F1F1F0F1F1F0F1F1EDF0EDF0EDF1
+ ECF1F1B4B4B456072D2929F12929F12929292929292D2929052D2D522D522D51
+ 2952514E2D52512E512D4D2E524D2D4D2E4D522D52512A514E2D52512E4D512E
+ 512E512E4D2D2A4D2E29292D29295229292929F129F129F129F12929F125F029
+ F129F1F129ED29F129F1F1F1ED29F1F1F129F129F129F1F1F1EDF0EDF1EDF1EC
+ F1EDF0EDF0F1F0F1F1F1F1F0F1F1ECCECECE5555312DF12929F12929F1292929
+ 2929292D292D4E2D4E512E4D522D5251525152522D4E525105512E522D522D29
+ 522952512E514E2D4E512E052D052D052D522951294D2D2A2929292929292929
+ 292929292929F129F129F129ED29ED29F1F129F129F129F029F1ED2928ED29ED
+ 29EDF1ECF1F0F1F1F0F1F0F1F1F0F1F1F1EDF1EDF0EDF0EDF1ECF1CCCCCC3156
+ 07562D29F129F12D2929F129292929292929292D5152512E4D2D4E2D512A2D4D
+ 522D29522D2E4D4D2E4D4D522D522D524D2E512E512A512D522D522D052D522D
+ 2A2D05514D2E292929292929F12929F129F12925F129ED29F129F029F129F129
+ EC29ED29F128F1F1F1F129F1F02929F1F1EDF0F1F1F1EDF0F1F1EDF0F1F0F1F0
+ F1F1F1F0F1F1F0C7C7C75531555556F529292929292929292929292929292929
+ 292D2E512E51295229514E2D4D5229524D512E29512E2E4D4E2D052D52514E51
+ 4E512E05512A4D2E512E05524D2D292A29292A292929292929F129292929F129
+ 2929F12929F129ED29F0ED29F1F129F1EDF129ED29F1F029F1F1F1F0F1F1EDF0
+ EDF0F1F1ECF1F1F1EDF1F1F1ECF1F0EDF0EDF1C5C5C53156553255552DF129F1
+ 292D292D292929292929292E2D052D4D522D522D4D2E2D4D2E2D512E292E4D52
+ 294D512E2D52515229522D522D2E51292E512D0551052D292E29522D29292D29
+ 292929F1292929F129F129F129F129EDF125F129F12929F129F1F0292929F1F0
+ 29ED29F129ED29F1F1F0F1F1F1F1EDF0F1F1ECF1F0F1ECF1F1F1EDF1F1F1F0C0
+ C0C0555532555556312D292929292929292D292D292D292D052D2D522D524D52
+ 2E514D2E4D052E4D514E2D29522D2E4D052D2A2D52512A514E514E2E4D522952
+ 2D2E2D52294D29052D2A29292929292929292929292929292929F1292929F129
+ F125F1F129ED29EDF1F1ED29F1F1F125F129F1ECF1EDF1F1F0EDF0F1EDF0F1F1
+ F1F1F1F0EDF0F1F0F1ECF1BABBBB32315532555556072DF129F1292D29292929
+ 29292929292D052D29512E5129522E4D2E51292E292D4D522D054D2E2D525105
+ 2D52512E512E514D2E515229524D4D29292E292D294D2929292929F1292929F1
+ 29F129F129ED2929F1F029ED29F1F124F129F1F129F029F1F124F129F1F029F1
+ F0F1F0EDF1F1F1F0F1F1F1F0EDF0EDF1F1F1F1EDF1F1F0B8B8B9555132555632
+ 555655292929292929292D292D29292929292D2A51294D2E5129522D4D2E514D
+ 52522D052E512D05512A29524D2E4D5229522E2D522E4D522D2E29524D4D2E05
+ 2D292E2929292929292929292929F129F129F1F12529F129F128F129F129F128
+ ED29F129F129F12829F1F1F1F1F1F1F1F0F1EDF1ECF1EDF1F1F1F0F1ECF1F0F1
+ F0F1F1D2D2D2313255553155075556312D29F1292D29292929292D292D292929
+ 292E2D2D2A512D4E2D4D2E2E4D2D2E51512A2D522951522D4D522D522D4D4D05
+ 2D052D2E4D052D292E2D4D2D292A292929292929F12929292929292529F12925
+ F129F125F1F129ED29F125F1F129F1EC29F1F1EDF129F1ECF1ECF1F0EDF1F0F1
+ F1F1F0F1F0F1F1F1F1F1F1F1F1F129CECECE555531325556315655562D292929
+ 292929292D2929292A29292D295129052D2D052D2D2A514D2D4E51052E2D5205
+ 2D4E294D2E2D052D05522E2D5229524D52292D4E2D052E29052D29292929F129
+ 292929F12929F129F12929F1F129F129F125F129F0F129F129F1F129F1ED2929
+ F129F1F1F1F1F1F1F1F0F1F1F0F1F1F1F1F1F1F129F1F1F1292A2DC8C8C83132
+ 5155325556315607562D29F129F12929292929292D292929292A2D2D05292D2E
+ 4D2D292E4D2D2E2D054D2D512E2D522E4D522D5251294D524D2E4D2E2D4E292D
+ 052D29292D2929292929292929292929F129F12929EDF12925F124F129F129F1
+ F129F1F0ED2928EDF129F0F129F1F1F1F1F1F1F1F1F1F1F1F1F1F129F1F129F1
+ F129F12D292D52C3C3C35531325531555507550755562D292929292929292D29
+ 292D292E292D052D292E05512A4D52292E05512E2D2E052D055129522D052E4D
+ 2E522D2A51292D052D29522D4D2A2D05292A29292929F12929292929292929F1
+ 292929F1F129F129F124F12529F12529F1F1F129F1F129F1F1292D2D2D2D2D29
+ F129F1F129F129F12929F12929F52D2A2D5256C1C1C131513155325532555655
+ 5607552DF129F12D29F12929292929292929292929292D292D2D292D4D2D2A4D
+ 51052D52295229512A514D2E4D294E51294E2E512A4D29052D292D292D292929
+ 2929292929292929F1292929F129F12928F129F129F129F1F129F1F129ED29F1
+ 25F029ED29295252522D2E2D2D2A29292E292E292A2D292D2929052D2E5156BC
+ BCBC5532315631565532550756555A5529292929292929292929292929292D29
+ 2E294D2A29052D4E292E4D2D2A2D522952295229524D2E4D2D522D29522D4D29
+ 4D292E2D2A2D052D052D2929292929292A2929292929F12929F125F1ED29F125
+ F129F12924F1F129F128F1F129F1F129F12D5656565252512E2D2D2E292D512E
+ 2D292E052E2E2D2E512E56B6B7B72D31552D553155555631075655562D2D2929
+ 2929292929292929292D0529292D292D2D29292D4D2929522D0529512A512952
+ 292D4E2D5205522D052952292E2D05514D29292929292929292929292929F129
+ 292929F129F1292929F129F125F125F1F129EC29EDF129ECF1F125F129527E56
+ 7A56565652522E2D522E2E512E2E2D2D2D2D2E512E522DB2B2F6315131563156
+ 3132555655555607522D2929F12D2929292D292929292D29292A2905292E4D29
+ 2E4D292951292E4D2D52294D2E512D4E2D2D4D2A51292E4D294D292E2D295229
+ 292A2929292929292929292929F129292929F129F129F129F128F129F129F1F1
+ 2929F129F129F1F129567E7E5A7A56525256512E2D522D522D522E5252512E2E
+ 515252ADADAD31322D31552D5555325507560755072D2D292929292D2929292D
+ 292929292D4D2D2D2929292E4D2D2E4D2A2D052D2A4D2E2951052E5152052E51
+ 29524D2952295251052E2929292D292929292E2929292929F12929F129F129ED
+ 29F12429F129F129ED29F129F1F1ED29F1F029F1297E7E7E7A7E565607525256
+ 5256522E522D522D2E2E51522E2D52A8A8A8315131552D565532555631565556
+ 07522D292929F12929292D29292E292E292929052D2A51292929052D294D2D52
+ 4D2D4D522952294E292D51295229292E4D2E4D2A294D29292E29052D2A292929
+ 29292929292929292929F129F129F1F129F125F128F129ECF12928F1F129EDF1
+ 51565A56565656565656515232512E51522E512E52512E2E2D522EA6A6A62D31
+ 2D32553131553156552D075607552E2D292D292929292929292929292D2A2D29
+ 4D2D2A4D2E4D292D2A2D4E292E4E2D295229512D52052E4E2D4E514D2E4D2D29
+ 2D292E4D29292929292D2A292929292929292929F12929F129F12929EC29F129
+ F1F129F125F1F1F125F129F1567E7A567A565656525256525252522E512E2E51
+ 2E2E5152522D2EA1A1A1312D552D31562D563155320755555607552D2929292D
+ 292929292D292929292D4D2E2D292D29292E2D052D4D2D4D2D4D522D4D2E0551
+ 2D514D2D4E2D2E515252524D294E4D2E2929292929292929292929292929F129
+ 29F12929F125F129F1F129F129EDF129F129ED29F129F129567E5A7A56565656
+ 565652565156515252512E52512E2E2D2A2D299B9B9B315132312D3155315532
+ 555532565556562D2D29F12929292D2929292D292A292929052D052D29294D29
+ 4D2E292E4D2E29052E51292E052E2D522D51052E5129292A2D292D2929292929
+ 2D2A292929292929292929292929ED2929F129F12925F129F129F0F129F029F1
+ F124F12D7E7E7E7E56567A5656565652565252325252522D2E2E292EF1292996
+ 96962D2D315131552E3156315532555507070755292D2929F1292929292D2929
+ 292D2A2D292D294D2E4D2E292E2951052D295229514D2E4D512D52052D052E51
+ 2A29522D4D292A512A292E29052D2929292A29292929F129F129F129ED29F125
+ F1F128F125F12925F129ED2929F1F15282A27E7E7E7E56565656565656525651
+ 522E2D2A2D2929292929F190919131312D312E31315531513255320756555607
+ 2E292929292929F12929292D292929292E292E2D292D294D294D2A512A512952
+ 292E4D2D2E052D512E2D4D52512E4D292E4D2D292929292D2929292929292929
+ 29292929292929F129F129F12929F129F129F1F1F129F1F0EDF1297EA7088382
+ 7E7E7E7E7A5A7A56565652522E292E29292929292929290808AF2D2D312D552D
+ 2D3255325531553155325556552D2D2D292929292929292929292D292D2D052D
+ 2A4D2E2D2E2D2951292A5129522D2E054D2E4D2E05522D2A4D512A51292A2952
+ 2929294D2E2929292D29292929292929F1292929F129F128F129ED29F0F12929
+ F1F129F129F12982ABAAA7A6837E827E7E7A565652512E2929294D2E29292929
+ 292929A9A9A9312D2D312D3156312D5531565532555607075651292929F12929
+ 292929292D292A2929052D2951292D052D052E2952292D4E2D052D512E515229
+ 512952512E29512A512951294D2D4E2E29292A292A292929292929292929F1ED
+ 29F12529F129F1F129EDF1F02925F129F12929ABD5ABA6A782A67F7E7E5A5652
+ 2D2E29292E2D2A2D29292929292929A4A4A42D2D312D3251312D553231553255
+ 5655555655322D292D2929292D29292929292D292D2D292D2A2D4E2D2A2D2D4D
+ 2D4D52292D524D2E524D29522952292D4E29522952292E292E2929292929292D
+ 29292929292929F129F1292929F129F125F12929F129F125F1F1F129EDF12DAA
+ D4AAABA70883827E7E522E292A29292E29292929292929292929F1A2A2A2312D
+ 2D312D312D313131523155315532073156555229292929F12929292929292929
+ 2A4D2E2951292D292D054D2E292E29524D2D524D2D522E512E51525229512E4D
+ 292D052D052D2E2D2D295229292D292A292929292929F129F129F129F129F1EC
+ 29F129F129F128F1F1F052D4D5ABAAAAA7A67A56522D29292D52522929292929
+ 29292929F129F19D9D9D2D312D312D312D562D3131553255325556550707312D
+ 29F1292929F129292929292D292D292E2D2A2952292D2E4D2D4D2E2D52292D52
+ 295129522952295152295229522D292A2D052905292D052D2A29292929292929
+ 29F129ED29F125F129ED29F129EDF029F129ED29F12951D4ABABABA77E562E2E
+ 2929F1292929292929292929F129F129F1F1299B9B9B2D2D2D2D312D312D3152
+ 2D32553155315532555656512D292929F1292929292929292929292D052D2D29
+ 2D052D2E4D2E4D2D052D522952292E512E2D52294D29512A2D052D4D29522D2D
+ 29522D2929292929292929F129292929F1292929F1F029F1F12929F1EDF129F1
+ 29F156ABAAABA67E522DF129F12929292929F129292929F129F129F129292996
+ 96962D312D312D2D3151313131552D32555656555655072D2929F12929292929
+ 29292D292D2A2D292D29052D2A2D294D2D292D4E2D522952512E4D2E51052D52
+ 2E51522D052D2E2D4E2D29052D2A292A292929292929292929F129F12925F0F1
+ 2929F12529F1F1F12928F1F1F1ED56AAA77E562E292929292929F12929F12929
+ 29F1F12929292929292929B0B1B12D2D2D2D2D312D312E552D32552D55315531
+ 563156072D2929F1292929F1292929292929292A292D29292D4D2E292E4D2E51
+ 2E2951292E512D052E512A294D2E052D052D05292D05292D4E2D292D29292929
+ 2929F129F129ED2929F12929EDF129F1F128ED29F1F12924F1295AA77E562929
+ F1F12929F129F129F129F129F12929292929292D2929F10808D42D312D312D2D
+ 312D312D552D32553255325555565556552D292929F1292929292929292D292D
+ 2D2A29512A294D292D2D052D4D522E51055229514D2E515229512A51292E512E
+ 2D2929522D05292929292A2929292929292929F1F129F12929F129F125F129F1
+ 29F1F1F1F1297A562E29F1F1292929F129ED2929F129F1F1292D29F129292929
+ 2929F1A5A5A52D2D2D2D2D312D2D312D313151313155315631553255072E29F1
+ 292929292929292D29292929052D2D292D2D2E2D052E2952292D4D2E2D2D522E
+ 2D4D2E4D2E5129295251052D052E52512A2D2D2A2D292929292929292929F129
+ 25F129F1F1EDF128F1F1F128F125F129EDF12D2929F12929F129F029F129F1F0
+ F1F1F1292929292929F1292929F1F1A0A0A02D312D2D312D31312D2E552D3131
+ 523156315556555556552D292929F1292929292929292E292D29292A2D052D05
+ 2D4D2D512E51522951052E514D2E4D2D4E2952295229294E2951292D052D0529
+ 052D2929292929F129F12929F12925F128292929F12929ED29F129F1F12929F1
+ 292929F129F1ED29F1F0F1F1F12929F129292929F1F1ECF1F1F1299E9E9E2D2D
+ 2D312D2D2D2D31312D315231315131563155325655073229F12929F129292929
+ 2D2929292D2A2D2D292D292D292E292A4D2E29522D2E4D2D2E4D2E512D522952
+ 29522D29512E4E292D292D2D29292929292929292929ED29F129F129F1F1F1F1
+ 25F1F129F1F1F029F0F1F129F129F129F1F129F1F1EDF129292929F1F1292929
+ 29F1F1F0F129F19999992D2D2D2D2D312D2D2D2D312D31513231552D56315555
+ 3255075529F129292929F129292D292D052D052D2E4D2E4D2A51512D2E4D2E4D
+ 52512E052D4D2E052D052D4D2E4D2A512A51294E295205292D2E292929292929
+ F12929F125F129ED292925F1F128F1F129ED29F1ED29F129F125F1F125F1F1F1
+ F029F1ED29F1292925F129F1F129F1F1F129299797972D2D2D2D312D2D312D31
+ 2D312D313151325531555631555655562D29F129F129292929292929292D2929
+ 4D2D29292D292A294D2D4D2D2E052D512A51292D522D522D52292D4D2E4D2E2D
+ 2D29292D05292929292929292929F1292929F029F1F1F129F1F12529F029F1F1
+ 29F129F129F129F1F0F1F0ED29F1F128F12929F1F1F0F12929F1F129292929B2
+ B2B22D2D312D2D2D2D2D312D2D312D562D31312D5556315656315655562929F1
+ 292929292929292D29292D292E2929522D4E2D512D2E2D2E4D2D4D2E4D2E4D52
+ 2952052D052D4D2A51292952052E2929292D29292929292929F12929F1F1F129
+ F12929F125F129F1F1F1F025F129F1F0F1F0F1F1F1F1F129F12929F1F1F1F1F1
+ F129F1F1F02929F1F1F1F1ACADAD2D2D2D2D312D312D2D2D312D312D31523156
+ 313151315555565507312929F12929F1292929292D2A292D29522D29292D292E
+ 052D052D4D2E2E4D2D512E2D2A5129522D2E52512952292951292E294D2A2929
+ 29292929292929F1292529F129ECF129F029F1F125F129F1F1F0F125F1F1F1ED
+ F0ED29F029F1F1F1ECF1F12929F1F129F1292929F1F1F1AAAAAB2D2DF52D2D2D
+ 2D312D312D2D2D312D312D3152313255323155563255562D29F1292929292929
+ 292D292929292E512A51292D512E4D2E2D4D2D2E052D055129522D05294D292A
+ 512E4D2E29294D2E2929292929292929F1292925F1F129ED2929F1F129F129F0
+ F129F129F129F1F1F1F1F0F129F1F1F1F1F0EDF129F1F0F12929F1F1F1F129F1
+ 2929F1A5A5A52D2D2D2D2D2D2D2D2D2D2D312D2D312D315131552D3155563155
+ 5556552D2929F129F12929292D29292E292D4D2D2D292E4D2A4D292D4E2D2E4D
+ 2D2E512A2D4D2E512E512E4D294D2E4D2E4D2E2929292929292929F12929F1F1
+ 2929F129F1F129ED29F1ED29F1F124F1F1EDF0F1F0F1F129F129F125F1F1F1F1
+ F1F1F129F1292929F129F1F1292929A0A0A02D2D2D2D2D312D2D312D312D2D31
+ 2D552E31312E5555563155563255562D2D2D29F12929292929292D2929292E4D
+ 2E4D2D29512E2D522951052D524D2A2D4D2E4D29052D052D522E4D292929294D
+ 292E29292929292929F1292925F12929F125F128F1F129F12929F1F1F0F1F1ED
+ 29F1EDF0F1F1F0F1F0F1F0F1515229F1F1F1292929F1F1292929F19A9A9A2D2D
+ 2D2D2D2D2D2D2D2D2D2D312D312D312D552D323131513255555655562D292D29
+ F129F129292929292D29292D292E4D2E29294D29522D5229292D522D2E4D2D52
+ 2D2E4D2E4D29522D4E2D2E2929292E29292929F1292929F1F129ECF129F129F1
+ F129F1F0EDF1F129F1F128F1F1F129F1F1EDF1F1F1F1F1F12929F129F129F129
+ F12929F1F0F1299595952DF52D2D2DF52D312D2D312D2D2D2D312D312D552D52
+ 31325532553156552D2D292D29292929F1292929292D2A2D4D2D29512E2D2D2E
+ 29292D522D052D05512E052D0551294D2E4D29292D0529292929292929292929
+ 29F12929F12929F129F129ED29F02529F129F1F0EDF1F1F1F0F1F1F128F1F0F1
+ F12929F129F1292E29F1F1F1292D29F129F1299393932D2D2D2D2D2D2D2D2D2D
+ 2D2D312D312D312D322D313151313155315655562D2D29292D29F12929292929
+ 292929292E292D2929052D052D522929522D522D2E05512E2D522D52292E2D4E
+ 2929292D2A292929292929292929F12529F129F125F0F129F1F1F1F129F124F1
+ F1F1F1ECF1F1F0F1F1F1F1F1295629F1F1F1295129F129F129292929F1F1F1AE
+ AEAE2D2D2D2D2D2D2D2D2D2D312D2D2D2D2D2D312D5531513156513156553156
+ 2D2929F12D2D2929F129F1292929292D292D2E4D2E2D2D4D2E295152292D052D
+ 4D2D2D52052D052E5129052D4D292E4D29292929292929F129F129F1F129ED29
+ F129F129F125F129ECF1F1F1F128F1F1F1F1ED29F1F1F0F12929292D29F129F1
+ 295129F129F0F1292929F1A8A9A92D2D2DF52D2D2D2D2D2D2D2D2D2D312D312D
+ 312D2D322D3132552D325555312D292929292D2929292929292929292D052D29
+ 294D2A2D29512E29515229522D52052D512E4D4D2D5229292E29292929292929
+ 292929292929F12925F129F129F125F129F029F129F1F1F0EDF129F1F0F1F0F1
+ F1522E29F1F1297E7A29F1F1295251F1F1F1292929F129A6A6A7F52D2D2D2D2D
+ 2DF5312D2D2D312D2D2D2D2D2D312D552D552D3156315631522D29F129292D29
+ 2D29F129F12929292929292E2D2D2952292E4D2E2951522D052D5229522D2E29
+ 2A4D2E4D29292D2A2929292929292929ED2929F129F129F029F129F1F129F1F1
+ F129F1F1F1F1F0F1F129F1F12982A62929F1297A562929F1292929F129F1F1F1
+ F1292DA1A1A12D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D312D312D312D31312E55
+ 2D553155552D2929F129F12D292929292929F12929292D29052D292D2D4D2951
+ 2A2D29522D522D522D05515251294D2D2A2D052D29292929292929F129F12929
+ F125F125F1F1F128EDF129F025F1F0F1F0F1EDF129F1F1F1295552292D29F129
+ F12D5629F1F1F1295129F129F129299C9C9C2DF52DF52DF52D2D2D2D2D312D2D
+ 312D2D2D2D312D312E51313155322D56312E29F1292929292D2D2D2929292929
+ 292D29292D295229052E2D2E514D522D052D052D052D2E2929292E4D29292929
+ 052D2929292929292929F1ED29F12929F12925F12929EDF1F1F1F125F1F1F1F0
+ ED2D5229F129F1527E2DF1F1F14D7A29F1F1292929F129F1F1F1F09A9A9A2D2D
+ 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D312D2D2D2D313151322D31552D55312929
+ F129F1292929292D2D29292929292D2A2D29292D2D2D054D2E2D2A512E522D52
+ 512A514D2E4D292A51292A292929292929F12929F1F12929F128F1F125F0F1F1
+ F1F0F129F1F0F1F1F1F0F1F1F052AA52F1F1292D7E29F129F1F129F12929F1F1
+ F129522929F1F19595952DF52D2D2D2D2D2DF52D2DF52D2D2D312D2D312D312D
+ 2D2D315131523156312D2D29F12929F129292D29292D2D2929292929292E2D05
+ 29292D2D052D5129512952294D2D2A2D4D2E2D4D2A4D2D4D2D2929292929F129
+ 2529F129F12529F1F12929F125F1F1F0F1EDF1F0F1F129F1F12951292D29F129
+ F1295651F1F1F029522D29F1F1292929F1F1F18B8B8B2D2D2DF52D2D2D2D2D2D
+ 2D2D2D2D2D2D2D2D2D2D2D2D312D312D3131312D55562DF129F1292929F12929
+ 2D292D292929292D2929292D292E4D2E2D4D2A512E512D522D2E4D512A2D052D
+ 2D292A292A292929292929F129F129ED29F1F129F1EDF129F1F125F1F1F1F0F1
+ F1295652F1F1F1297E7AF1F1F1295651F12929F12929F12929F0EDF1292D2986
+ 86862D2D2D2D2DF52DF52D2D2D2D2D2D2D2D2D312D2D312D2D312D312E512D56
+ 312D2D29F129F129F129292929F1292D2E29292929292D292D4D292D052E512E
+ 4D2952292E4D512A2D052D2E29052D292D29292929F129ED29F129F129F125F0
+ 29F128F129F0F1F128F129EDF129827E29F1F1295251F129F12929F1292DF1F1
+ F1F15152F1F1F1F12951F18081812D2DF52D2D2D2D2D2D2DF52D2D2DF52D2D2D
+ 2D2D2D312D2D2D2D3131312D32552D2929F029F12929F12929292D292D2D2929
+ 2D29292A29295229512951292E5129524D2E292D052D054D29292D0529292929
+ 29292929F129ED29F129F1F12529F1F1ED29F1F1EDF1F1F0F1F14D2D4D2D29F1
+ F1F0527E29F1F1F12D5229F1F129292929F129F1F1F1297E7E7FF52D2DF52DF5
+ 2D2D2D2D2D2D2D2D2D2D2D2D312D2D2D312D312D2D2D552D312E312DF129F129
+ F12929F12929292929292D292929292D292D292E292E295229522D292E4D2E4D
+ 2D2A2D2E2D052D29292929292929F12929F129F128ED29F1F1F125F0F1F1F0F1
+ F0F1F1F129F1F0ED07A72DF1F1F1517A29F129F12929F1292929F1F1F15229F1
+ 28F1F17979792D2D2D2D2D2D2D2DF52D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D31
+ 2D312E315131512D29F1F128F129F12929F1292D292D292D292D292929292929
+ 512951292D4D2E514D2D4D2E294D51052D2929292929292929F129F12929F125
+ F1F1F12429F1F1F129F1EDF129F1EC29F1F1F1F1295129292929F1F1295129F1
+ F1F1295651F1F12929512D29F1F1297474742DF52DF52D2DF52D2D2DF52D2DF5
+ 2D2D2D2D2D2D312D2D2D312D2D312D312D312D2D29F129F129F12929F1292929
+ 292929292929292D292D2A2D292E2D2E4D2E2D4D2E2D2E294D2D2A2D2E4D292A
+ 29292929F1292929F125F129F12929F1F1F025F1ECF1F1F1F0F1F1F1F1EDF0F1
+ F1F129AA56F1F129297A51F1F1F1292929F129F1F1F1ED295229F17272722D2D
+ 2D2D2D2D2DF52D2D2D2D2D2DF52D2DF52D2D2D2D312D2D312D2D312D312E552D
+ F129F029F129F1292929F129F5292D292D29292929292929292D052D2D052D52
+ 2D0551292E052D0529292D2929292929292929F12929F129F1F0ED2929F1F129
+ F129F0F1EDF1F1F128F129F1ECF1297A5129F1F1F129F1292929F1EDF1515229
+ F1F1F1515629F18D8D8DF52DF52DF52D2D2D2DF52DF52D2D2D2D2D2D2D2D2D2D
+ 2D2D2D2D312D2D2D312D312D29F125F129F029F1F12929292929292D292D2929
+ 292D292D2A2D2D05292D052D52292E4D2D2D4D292D2A29292929292929F12929
+ F129F1F12529F1F1F125F0F1F1EDF129F0F1F0EDF1F1EDF1F1F1F1F1F1515229
+ F1F1F1515629F129F1295129F129F12929F12909098B2D2D2D2D2D2DF52D2D2D
+ 2D2D2D2DF52D2D2D2D2DF52D2D2D2D2D2D2D312D2D312D5529F129F1F029F129
+ 2929F1292929292929292929292929292929052D2D2A2D29292D4D2D4E292E2D
+ 052D2929292929F1292929F129F12825F1F12924F1F1F129EDF0F1F1F1ED29F1
+ F1F1F0F1F1F0EDF1F0567E29F129F12929F129F129F1F1F14D2D29F1F1295186
+ 86862DF52DF52DF52D2DF52D2D2DF52D2D2D2DF52D2D2D2D2D2D312D2D312D2D
+ 312D312E2D29F0F125F129F129F12929F12D292D292D292929292D292D292D2D
+ 052D292E2D4E2D2A292D29052D2929292929292929F1292929ED29F1F129F1F1
+ F129ECF1F0F1F124F1F1F0F1F0ED29F125F1F1F1F129F1F129F1F1F1EC29522D
+ F1F1F129512929F1F129298081812D2D2D2D2D2D2D2D2D2DF52D2D2D2D2D2D2D
+ 2D2D2D2D2D2D2D2D2D2D2D312D2D2D552DF1F128F1F129F02929F129292929F1
+ 29292D2929292929292D052929292D052D2951292D05292929292A2929292929
+ 292929F129F129F128F1F125F1F1F1F1ED29F1F1F1F129F1F1F1F1F0F1F129F0
+ EDF1F0295229EC29F12951292929F12929F1292929F1F17A7A7BF52DF52DF52D
+ F52DF52D2D2DF52D2DF52DF52D2D2D2D2D2D2D2D2D2D2D2D312D312D2D29F1F1
+ 28EDF129F12929F129F12D292D29292D29292929292D29292D2A292D4D2E292E
+ 052D295229292929292929292929F129F129ED29F125F1F029ECF1F1F1ECF125
+ F1F0F1EDF0F129F1F0F1F129F1F125F129F1F1F1F1F0F1ED2D5129F1F1F12951
+ F129F17575752D2D2D2D2D2D2D2D2D2DF52D2D2D2D2D2D2D2D2DF52D2DF52D2D
+ 2D312D2D2D2D2D312D2929F1F129F0F129F129292929292929292D292D292929
+ 2D29292D2929512A292D4D2D2D292929292929292929292929F1292929F02929
+ F1F129F1F1F1F1F1F0F1F1F0F129EDF129F1EDF1ED29F1F1F0F1F1F0F1F12929
+ F1ED29F12D7AF1F129F12929F1F1F17070702DF52DF52DF52DF52DF52D2DF52D
+ F52DF52DF52D2D2D2D2D2D2D2D2D2D312D2D312D312DF1F029F029F129F02929
+ F129F12D292D2929292929F129292D2A2D29292D512A2929052D2A2929292929
+ 29292929292929F1EDF129EDF129F0EDF1F0ED28F1F125F1EDF1F029F1F1F0F1
+ F1F1ECF12929F1F1F1EC2929F1F0F1F129F1F129F1F1F0EDF14D296E6E6E2D2D
+ 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2DF52D2D2D2D312D2D2D
+ 312D29F1EDF1ED29F129F1292929292929292D292D29292929292929292D292A
+ 292D2A51292929292929292929292929F129F1292929F1F029ED29F1EDF1F1F1
+ EDF1F029F0F1F1F1ECF1F129F0F1F1F1F1F1EDF029F1F1F1F1F1F1F0F1ED2951
+ 29F1F129292D29898989F52DF52DF52D2DF52DF52DF52DF52DF52D2DF52D2DF5
+ 2D2D2D2D2D2D2D2D2D2D312D2D2DF128F128F128F1F129F129F1292DF1292929
+ 292D29292D292D292D2A2D29292929292E2929292D29292929292929292929F1
+ F1ED2929F1F1F0F1F0F1F1F1F0F1F1EDF129ECF1F129F1F1EDF1F1ECF129F1F1
+ F1F1F025F12929EDF129F12929F1F1F1F0EDF18787872D2D2D2D2D2DF52D2D2D
+ 2D2D2D2D2D2D2DF52D2D2D2D2DF52D2D2D2D2D2D2D2D2D2D312D29F1F1F1F1F1
+ 29F1F029F12929F1292D292D2929292D292D29292929292D292E292929292929
+ 2A29292929292929292929292529F1F129EDF1F1F1F1ECF1F125F0F1F1F1F1F1
+ F1F0EDF129F029F1F1ECF129ECF1F1F1F0F1F1F1F0F1F1F1F12951F1F129F182
+ 82822DF52DF52DF52D2D2DF52DF52D2DF52DF52D2D2DF52D2D2D2DF52DF52D2D
+ 2D2D2D2D312D2DF1F025F029F02929F129F129292929F12929F529292D2A2929
+ 292D2929292929292929292929292929292929292929F129F1F0F125F1F0F1F0
+ EDF029F1F0F1F1F124F1EDF025F1F1F0F1F1F1F0F1F1F1F129F1F1F1F1ED29F1
+ 29EDF1F1282929F1F1F1F07C7D7D2D2D2D2D2D2D2DF52D2D2D2DF52D2D2D2D2D
+ F52D2D2DF52D2D2D2D2D2D2DF52D312D2D312D29F1F1F1EDF1F1F129F12929F1
+ 292D292D292929292D2D2D2929292D292E2929292929292929292929292929F1
+ 29F129F129ED29F0F1F1EDF1F1F1EDF1F1EDF0F1F129F1F1F1F029F125F1F125
+ F1F128F1F1F129ECF1F0F129F1F1F0EDF1F1F1F129F1F17A7A7BF52D2DF52DF5
+ 2D2DF52DF52D2DF52DF52D2D2DF52D2D2D2DF52D2D2D2D2D2D2D2D2D2D2D2DF1
+ 28F129F029F129F029F12929F12929292D292DF1292D292929292929292D2929
+ 292D292929292929292929292929F129F129F1EDF0F1F0F1F0F1F1F0F1F1F1ED
+ F0F1EC29F1EDF1F0F1F1F0F129EDF1F124F1F1F1F1F1F1F1F029F1F1F1F029F1
+ 4D29F17575752D2DF52D2D2D2DF52D2D2DF52D2D2D2D2DF52D2D2DF52DF52D2D
+ F52D2D2D2D2D2D2D2D312D2DF1F1ECF1F129F0F129F129F12929F12929292929
+ 2929292D29292929292929292929292929292929F129292929292929F129F0F1
+ F1F1F1EDF1F1F1F125F0F1F1F1F129F1F0F129F1EDF129F1F1F0F1F1F1F1F029
+ 29EDF0F125F12929F0EDF1F129F1F17070702DF52D2D2DF52D2D2D2DF52D2D2D
+ F52DF52D2DF52D2D2D2D2D2D2D2DF52D2D2D2D2D2D2D2D2DF1F029F129F0F129
+ F12929F129F1292D292D292929F12D292929292D292929292A2D292929292929
+ 292929F12929F129F1EDF1F1F1ECF1F0F1ECF1F0F1F1ED28F1EDF0EDF1F1EDF1
+ F0F1EDF029F129EDF0F1ED29F1F1F1F1F1F1F0F1F1F1F1F0F1F1298A8A8A2D2D
+ 2DF52D2DF52DF52D2D2DF52D2D2D2DF52D2DF52DF52DF52DF52D2DF52D2D2DF5
+ 2D2D312DF1F1F1F0F1F129F1F129F02929292929F129F1292929292DF12D2929
+ 2D29292D292929292929292929F1292929292929F1F0EDF0F1F1F1F1F1F1EDF1
+ EDF0F1EDF029F1F129F128F129F1F1F1ED29F1F1F1F1F1F1F0F129F1F0F1F1F1
+ 2929F1EDF1F129858585F52D2D2DF52D2D2D2DF52D2D2DF52DF52D2DF52D2D2D
+ 2D2D2D2D2D2D2D2D2DF52D2D2D2D2D2D2928F1ED28F1F029F0F129F1F1F0F129
+ 29292929F129F1292929F129292929292D2A2D29292929292929292929292929
+ F1F1F1EDF0F1F0EDF0F1F0F1F1F1F1F1F1EDF0F1ECF1F1F1EDF128F1F1F1F029
+ 2929F0ED29F12529F1ECF1F1ED29F0F1F0EDF18383832D2DF52D2D2DF52D2D2D
+ 2DF52D2D2D2D2DF52D2DF52DF52DF52D2DF52D2D2D2D2D2D2D2D2D312DF1F1F0
+ F1F129F129F1F129292929F129F129F12929292D2929292D2929292929292929
+ 292929F1292929F1292929F1ECF1F0F1F1F1EDF1F1F1F1F128EDF029F0F1F129
+ F1F1EDF1F029ED29F0EDF1F1EDF1F1F1F1F1F0F1F1F129F1F0F1F129F1F1F107
+ 7E7E2DF52D2D2DF52DF52D2DF52D2D2DF52DF52D2DF52D2D2D2D2D2DF52D2DF5
+ 2D2DF52D2D2D2D2D2DF5F0F128EDF0F1F029F029F1F1F12929292929F129F129
+ 29F1292929292D29292D292929F129292929292929F1F1ECF1F1EDF1F1ECF1F0
+ F1ECF1ECF1F1F1F1ED29F1EDF0F128F129F1F1F1F1F1F129F029F1F1F0F1F1F1
+ 2929F1ECF1F125F129F1F07879792D2D2DF52D2D2D2DF52D2D2DF52D2D2D2D2D
+ F52DF52DF52DF52D2D2D2D2D2D2D2D2DF52D2D2D2D2DF1EDF1F1F129F129F1F1
+ 292929F129F129F129292929292D29292D29292D292929292929292929F129F1
+ 29F1F0F1292929F0F1F1F1EDF1F1F1F1F129ECF1F1ECF129F1EDF1F1EDF1F0ED
+ 29F1ECF1F1EC292929EDF029EDF1F1F1F1F1F1F1F0F1F1767677F52D2D2D2DF5
+ 2D2D2DF52D2D2DF52DF52D2D2D2D2D2D2D2D2DF52D2DF52DF52D2D2D2D2D2D2D
+ 2D2D28F1F025F0F1F1F029F1F0F129F12929F128F129F12DF129F129292D2929
+ 2D292929292929F12929292929EDF1F1562DF1EDF1F0F1F0F1ECF1F1ECF1F1F0
+ F129F0F1F129F1F0F129F129F129F1F1F1F1F1EDF1F1F1F1F1F029F129F0F129
+ ED29297171712D2DF52DF52DF52DF52D2DF52D2D2D2D2DF52DF52DF52DF52D2D
+ 2DF52D2D2D2DF52D2DF52D2D2D2D2DF1F1F0F129ECF1F129F129F029F1F129F1
+ 29F12929292929292D292D292929292D2929292929F129F0EDF0F129562D2A2D
+ 29F1EDF1F129F1ECF1F1ED29EDF1EDF1F0F125F1F1ECF1F1ECF1F124F129F1F0
+ F129F1F0F1F1ED2929EDF1F0F1F1F18C8C8C2DF52D2D2D2D2D2D2D2DF52D2D2D
+ F52DF52D2D2DF52D2D2D2D2DF52D2D2DF52D2D2D2D2D2D2D2D2D2DF1F0EDF1F0
+ F1F129F029F1F129F129F029F1292929F12D292D29292929F12D292929F12929
+ F129F1F1F1F1292D2E297E2DF129F1F0EDF0EDF1F128F1F0F1F029F125F1F0F1
+ 29F1F129F1F129F1F1ECF1F129ED29F1EDF0F1F1F0F1F1F1F1F1F18A8A8A2D2D
+ F52DF52DF52DF52D2D2DF52D2D2D2DF52DF52D2DF52DF52D2D2DF52D2D2DF52D
+ F52D2D2DF52DF529F129F0F125F0F1F1F029F129F12929F12929F1F129292929
+ 2D292D29292929292929F12929F129F1ECF12956522D7E5229F1F1F1F1F1F0F1
+ F1EDF1F1F1EDF1F0F1F1F1F128F1EDF1F0F1F1F129F1F1EDF1F1F029F129F1F1
+ F1292929EDF0F18585852DF52D2D2D2D2D2D2DF52D2D2DF52D2DF52D2D2D2DF5
+ 2D2D2D2DF52D2DF52D2D2D2D2D2D2D2D2D292D29F0F1EDF0F1F1ECF1F1F128F1
+ F0F1F129F129292929F52929F129292D292D2929292929F129F1F0EDF1F0F151
+ 5256562D292929F1F1F1EDF1F0F1F0ED29F0F1EDF029EDF1EDF128F1F125F0ED
+ F02929F1F0F1EDF129F1F0EDF1F0EDF1F129F17F7F7F2D2D2DF52DF52DF52D2D
+ 2DF52D2D2DF52D2DF52DF52D2DF52DF52D2DF52D2DF52DF52DF52D2D2DF5F0F5
+ 29F1F0F1ED28F129ECF1F1F129F129F1F1F0F129F12929292D292D292929F129
+ 29F12929F129EDF1F0EDF1522D567E2DF12D29F129F1F1F0EDF1F1F1F1F125F1
+ F1F1F029F1F1F125F1F1F129F1F1F1F0EDF1F1F0F1EDF129F1F1F1F029F1F107
+ 7A7A2D2DF52D2D2D2D2D2DF52D2D2D2DF52D2DF52D2D2D2DF52D2D2DF52D2DF5
+ 2D2D2D2D2D2D2DF52D2DF1292DF0F1EDF0F1F1ECF129EC29F029F1F0292929F0
+ 2929F12D29292929F1292929F12929F1F1F1F1F0EDF1F12D2D2E5629F1562929
+ 292929F1F1F1ECF1ECF1F1F0F125F1F1F0ED29F129F0F1F1EDF1ED29F129F0F1
+ F12929F1F1F029F12529F0747575F52D2D2DF52DF52DF52DF52DF52D2DF52D2D
+ F52DF52D2DF52DF52DF52D2D2DF52D2DF52D2D2D2D2D29F1F1F1F1F0F1EDF0F1
+ EDF0F1EDF1F0F129F1F1F129F1292929F129F1292929F1292929F129ED28EDF1
+ F1F0ED2D2E51562E5152292D51292E2929F1F1F1F1ECF129F1F0F1ED29F1F1F0
+ F1ED29F0F128F1F129F129ED29F1F0F129EDF1F1F1EDF17272732DF52D2D2D2D
+ 2D2D2D2D2D2D2DF52D2DF52D2D2D2DF52D2D2D2D2D2DF52D2D2DF52D2D2DF52D
+ F52DF528F129ECF1F0F1EDF0F1EDF029F1F129F02929F129F129F1F129292929
+ F12929F129F129F1F1F1F1ECF1F1F029562D56515656F12D2E292D52F129F129
+ F1F1F1ECF1F1F1F1F0F1ED29F129F125F1F129F0F1EDF1F1F0EDF1F0F129F1F1
+ F0F1296D05052D2D2DF52DF52DF52DF52DF52D2D2DF52D2DF52DF52D2DF52DF5
+ 2DF52D2DF52D2D2DF52D2D2D2D2D2DF1F1F0F129F1F1F0F1F1F0F1EDF029ECF1
+ F1F029F129F12929F129F129F129F129F1F124F128F1F0F1F1ECF1F1522D562D
+ 5652292E29F12D82512929F1F1F1F1F1F1EC29F025F1F0F1F1F0F1F1F1EDF1F1
+ F128F129F1F129F125F129ECF1F1F16464642D2DF52D2D2D2D2D2D2D2D2D2DF5
+ 2D2D2DF52D2D2D2DF52D2D2D2D2DF52D2D2D2DF52D2D2DF52D2D2DF528F1F1F0
+ EDF029ED28F1EDF029EDF1F12929F1F1292929F129F129F12929F125F129F1F1
+ EDF125F129F1F129562D5652562D295629F15156F1F12D292D29F1F1F1F1F1F1
+ F1F1F1ED29ED29F12829F1EC29F1ED28F1F1ECF1F1F0F1F1F1F1F0626262F52D
+ 2D2D2DF52DF52DF52DF52D2DF52DF52DF52DF52D2D2DF52DF52D2DF52DF52D2D
+ 2DF52D2D2DF52D2DF1F0F1F0F1F1F0F1EDF0F1F1F0F128F1ECF12929F0F1F129
+ F129F129F0F129F1F0F1F1F128F1F129F129F1F12D52562D512E2D56F1F1522E
+ 29297E522929292929F1F1F1F1F029F1F0F1F1EDF1F129F1F1F1F1ED29F129F1
+ F1F129292929F15D5D5D2DF52DF52D2D2D2D2D2DF52D2DF52D2D2D2D2D2C2DF5
+ 2D2D2D2D2DF52D2D2D2DF52D2D2DF52D2D2D2DF52D29F1EDF0EDF1F0F1EDF029
+ F1F1F129F1F1F1F129F128F129F128ED29F1F129F1ED28EDF129F12929292D29
+ 2E51562E2D522D5629295629F156562DF1F129F12D29F129F1F1F1F1F1F128F1
+ F1EDF025F129F0F129F129F124F1F1F129F1F15B5B5B2D2D2D2DF52DF52DF52D
+ 2D2DF52DF52DF52DF52DF52D2DF52D2DF52D2DF52DF52D2DF52D2D2DF52D2D2D
+ 2DF1F0F1F1F0F1EDF0F129EDF029F1F0F128F128F129F129F129F1F1F128EDF0
+ F129F1F129F12929F1292D2D2D562D5651562D562D2D562DF1525529F12D7E2E
+ 29292D292A29F1F1F1F1F1F128F129F1F1F0EDF1F1F1ECF1F1F1F1F0ED292956
+ 56562D2DF52D2D2D2D2D2D2D2DF52D2D2D2D2DF52D2D2D2DF52D2DF52D2DF52D
+ 2D2D2DF52D2D2DF52D2D2DF52D2DF5F1F0F1EDF0F1F0EDF0F1F0ED29F1F1EDF1
+ F1F1F1ECF1F0EDF029EDF129EDF0F129F129F1F1F0295232292E51522E552A56
+ 522D562DF15656F12D7E7E2DF12D52522D2929292929F1F1F1F1F1F129F129F1
+ 24F1F12929F0EDF1F129ED505151F52D2DF52DF52DF52DF52D2D2DF52DF52D2D
+ 2DF52DF52D2DF52D2DF52DF52DF52D2D2DF52D2D2DF52D2D2D2D2D2DF1F1F0F1
+ EDF0F1F1ED29F0F129F029F025F029F129F129F1F0F1F0F1F125F1F0F1F0F1F1
+ F1F12D512E2D2E562D522D51562E5652295552F129562EF129522D2D522E5156
+ 522D2D29F129F1F1EDF1F1F1F1F129F1F129F129F0F1F14A4A4B2DF52D2D2D2D
+ 2D2D2D2DF52D2D2D2D2DF52DF52D2D2DF52D2DF52D2D2D2D2D2DF52D2D2DF52D
+ 2D2D2D2DF52D2D2D2D2DF1F0F1EDF0F1F0F1EDF0F1EDF1F1F1EDF0EDF0EDF0F1
+ EDF1EDF1F0F1F1EDF1F1F0F1F1F12E2D292D515651562E2D562D56522D565629
+ F52D29292D5652562D2D565652522E52562D292D2D2929F1F1F1F129F1F1F1F1
+ F129F16565652D2D2DF52DF52DF52DF52D2DF52DF52D2D2D2DF52DF52DF52D2D
+ 2DF52DF52DF52D2DF52D2D2DF52DF52D2D2DF52D2D2D2DF1F0F1F1ECF1EDF0F1
+ EDF0F1ECF1F0F1F1F1F1F1ECF1F0F1ECF1EDF0F1F0EDF1F1F1292D522D2E2D2E
+ 512E512D562D52312A56522D2952F1F12D562E2D52565607522D522D5656522E
+ 7EA67E2E2D2929F1F1F1F1F1F1F1F06060602D2DF52D2D2D2D2DF52D2DF52D2D
+ 2D2DF52DF52D2D2D2D2D2D2DF52D2D2D2D2D2DF52D2D2DF52D2D2D2D2D2D2D2D
+ F52D2D2DF1F1ECF1F1F0F1EDF0F1ECF1F1F1ECF1ECF1ECF1F1EDECF1F1F0F1ED
+ EDF0F1F12D51562D2E2D522D2E522D2E562D5256292D2E2D295629F1F1F1292D
+ 52565656565656565652567E567E837E565656292E29292929F1F15E5E5EF52D
+ 2D2DF52DF52D2D2DF52DF52DF52D2D2D2DF52DF52DF52DF52DF52DF52DF52D2D
+ 2DF52D2D2D2DF52DF52D2D2D2D2D2D2DF1ECF100ECF1ECF0EDF1F1F0EDECF1EC
+ F100F10000F0F1ECF1EDF0F1F0F1F129525A7E2D29292D522D2D522D56512D52
+ 2D2A552E29562D29F1F0F1F12929295256567E827E7E82D17E2D7E7E7E7E525A
+ 7A56562D5652525959592DF52D2D2D2D2DF52D2D2D2D2D2D2DF52DF52D2D2D2D
+ 2D2D2D2D2D2D2D2D2D2DF52D2D2DF52DF52D2D2D2D2DF52D2D2DF5F1EDF000F1
+ 0000F100F000ED00F0F100F100F1F0EDF1ECF1F1F0F1EDF0EDF0F12D07F7F72E
+ 2D292D2D522D522D562E2D56512D522DF1562E29F1F1F1F129F1F1292D567E7E
+ 527EAB82522E56A6A656297E7E7E82565682835757572D2D2DF52DF52D2D2DF5
+ 2DF52DF52D2D2D2DF52DF52DF52DF52DF52DF52DF52D2D2DF52D2D2D2D2DF52D
+ 2D2D2D2D2D29F1ECF100F100ECF100F100ED00F10000ED00F000ED00F0EDF1EC
+ F1F1F0F1F1F129555A7E562D29F12E2D522D522D52512D562E2D2E5229512E2D
+ F1F129F1F1F1F1F1F12E2E56A6ABAA292E512EAFAB2D2E56AFAB7A2D2A56A652
+ 52522D2DF52D2D2D2D2DF52D2D2D2D2D2DF52DF52D2D2D2D2D2D2D2D2DF52D2D
+ 2D2D2DF52D2D2DF52DF52D2DF52D2D2DF1F1F0F100EC0000F10000EC00F000F0
+ 00F1F000EDF0F1ECF1F1F0F1F1F0EDF1F1292D560707552DF1292D2E2D2D2E2D
+ 2D562D2E512D5255F12E5229F1F1F12929F1F12D29292D295A8252F151522DA6
+ 562D2E51AAA72D2E2D56AA4C4D4DF52D2D2DF52DF52D2D2D2DF52DF52D2D2D2D
+ 2DF52DF52DF52DF52D2D2DF52DF52D2D2DF52D2D2D2D2D2D2D2DF52DF0F10000
+ F100EDF000ECF100F100F100F1EC00F1F000EDF0EDF0EDF100F1F0F1292D3156
+ 7E072E2929F12D2D2E292D2E2D522D522E2D2E522D29522DF1ECF1F12DF12929
+ 2DF12A2D52562DF12E522E52F1292E2A562D292D527AD46A6A6B2DF52D2D2D2D
+ 2DF52DF52D2D2D2DF52DF52D2D2D2D2D2D2D2D2DF52D2D2D2D2D2DF52D2DF52D
+ F52D2DF52D2D29F1F100F1EC00F000F1000000F100F000ED00F10000F1EDF0ED
+ F0F1F0F1EDECF1292D2E510707562D2DF1F1292D2D2E292D29562D2D52292D2E
+ 2DF1552929F1F1F12929F5F129292D292E5552F12D562D522D292D2D5256292A
+ 2D2E7A6565652D2D2DF52DF52D2D2D2D2DF52DF52D2D2D2DF52DF52DF52DF52D
+ 2D2DF52DF52DF52D2DF52D2D2D2D2D2D2DF1F1F100F10000F100ED00EDF0F100
+ ED00F100F000F0EDF0ECF1F0ED00F100F0F1F12D2D51075A07512E2DF1F1292D
+ 2E2D2D522D562D2E2D292E512E29522EF1F1F0F129F129292E29F12E29525629
+ 2D522E5629292E522D56292D522D566060602D2DF52D2D2DF52DF52DF52D2D2D
+ 2DF52DF52D2D2D2D2D2D2D2D2DF52D2D2D2D2D2DF52D2D2DF52D2DF529F1F000
+ EC0000F1EC00F000F0000000F00000F100ED00F1ECF1ED00F1F0F1ECF1292D52
+ 2D325607072D2D2D29F1292D2D2E29562D2E2D2D52292D562D292D2929F1F1F1
+ F1F129F1F12D29292D2E562D2952562D56F12E2D2E56292E2D29565A5A5AF52D
+ 2D2DF52D2D2D2D2D2DF52DF52D2D2D2D2DF52DF52DF52DF52D2DF52DF52DF52D
+ 2D2DF52D2DF52D2DF0F100F100F1F00000ED00F100EDF0F100F1EC00EDF0F100
+ F100F0F100F1ECF1F12D312D31510707562E513229F1F12E292D2D2D2E512E29
+ 2D2D292E2D292E2D29F1F1F1F1F1292D29F1F12E292E7A2DF152565256292D52
+ 2956292D522E565555552DF52D2D2DF52DF52DF52D2D2D2DF52DF52DF52D2D2D
+ 2D2D2D2DF52D2D2D2D2D2DF52D2D2D2D2D2D2DF1F1F1F00000EC00EDF000F000
+ F0000000EC00F100F000EDECF1F100EDF0EDF0F12D2E51322D560707552D2D55
+ 29F1F12D2D2E2D522D2E2D292E2EF1512EF12D2E2929F0F129F1F1F1292D2929
+ 2D2D5656292D522D2EF1292E2D562E292E512E5353532D2D2DF52D2D2D2D2D2D
+ 2DF52DF52D2D2D2D2D2DF52DF52DF52D2D2DF52DF52DF52D2DF52DF52D2DF0F1
+ F000ED00ED00F10000ED00ED00F1F0ED00F100ECF1ECF0F10000F0F1EC00F129
+ 31552D2D51555A072E2D2E522DF1F129292D2D2E512D2E292D2D2D2E2D292D2E
+ 29F1F1F1F129F129F12A292D2E2D5656F12E522D52292D292E2D2D292D2E2D05
+ 4E4E2DF52D2D2D2DF52DF52DF52D2D2D2DF52DF52DF52D2D2D2D2D2D2DF52D2D
+ 2D2D2D2D2D2D2D2D2DF1F1F100EC00F000F00000F1F000F0ED000000F100F0F1
+ 00F1F100F1ECF10000F1F12D2E2D2E5532560707512D51312DF1F1292D2D2A2D
+ 2E2D522D2D2E292D2E29F1522DF1F1F029F12929F12D2D2A2D2A5207292D5232
+ 51F1292E525156F12E522D0149492D2DF52DF52D2D2D2D2D2DF52DF52D2D2D2D
+ 2D2D2DF52DF52DF52D2D2DF52DF52DF52D2DF52DF0F1EC00F100F100ED00F1F0
+ 0000F10000ECF1EC00F100ECF100F0EDF0F100F1F0F1292D3151312D2D555A07
+ 2D2E2D562D29F1F129292D292D2D2D292E2DF1292D2D292D2929F1F1F129F1F1
+ 2929292D292D5256F1295255522DF12D522E56292D522D6666672D2D2D2D2DF5
+ 2DF52DF52D2D2D2DF52DF52DF52DF52D2D2D2D2DF52D2D2D2D2D2D2DF52D2D2D
+ F1F1F100EC000000F00000EDEC00ECF1000000F100ECF1F100F1EDF000F1EDEC
+ F1F12D2D2D2D2E552E5507562D2D2D562DF1F0F12DF12D2D2E2D2E2D2D2E292D
+ 5229F12E2D29F1F129F129F1F1F12A2D2A2D2D562D295256565629292D2D52F5
+ 052D2E6161612DF52DF52D2D2D2D2D2D2DF52DF52D2D2D2D2D2D2D2DF52DF52D
+ 2D2DF52DF52DF52D2D2DF1F1F10000F000F100ED00F100F000F10000ECF100F0
+ 00F10000F1EC00F1ED00F0F1F12D2D2D522D552D2D075A072D2D2D2D2D29F1F1
+ 29292EF1512D292D292E2D2D2D2EF12D2929F1F1F129F129F129F5292D292E56
+ 2DF12D562E51292E2D2A56292D2E515C5C5C2D2D2D2D2D2DF52DF52DF52D2D2D
+ 2DF52DF52DF52DF52D2D2D2DF52D2D2D2D2D2D2D2DF52CF1F000ED00F1EC00F0
+ 00EC0000F10000F0F100ECED00F1ECEDF000F100F000F1F1292D2D2D312D2D2E
+ 3156552D2929292929F1F1F0F12D2D292E2D2D2E292D29292E29F12D2EF1F1F1
+ 29F1F1F1F12929F12D2A2D522D292E525156F1292E29562D292E2E5A5A5A2D2D
+ F52DF52D2D2D2D2D2D2DF52DF52D2D2D2D2D2D2DF52DF52D2D2DF52DF52DF52D
+ F529F100EDF000F00000ED00F100F1EC00ECF10000F100F0ED00F1F000EDF000
+ EDF0F1F12D2D2D2D2E2D2D2D2D55562DF1F129F129F1F1F12929F12D292E292D
+ 2D2E2D292D29F1292D2929F1F129F1F1F129F129F12D295656F12D2D2E562929
+ 2D2D2E2D292D2D555555F52D2D2D2DF52DF52DF52DF52D2D2DF52DF52DF52D2D
+ 2D2D2D2DF52D2D2D2D2D2D2D2DF1F1F00000F100ED00F000EC0000F1000000ED
+ EC00F100F0F100F1F100F100ECF1F1292D2D2D2D2D2D2E2D2D2E312DF1F1F1F1
+ F1F1F1F0F12D292DF12D292E292D2EF12D2D292D2DF1F1F0F1F1F1F0F1F129F1
+ 292E2D5156F1292E51562DF1292E5156292E524F4F4F2D2DF52DF52D2D2D2D2D
+ 2D2D2DF52D2D2D2D2D2D2DF52DF52DF52D2DF52DF52DF52DF1F0F100ED0000F0
+ 00F000ED00F10000F0F100F000F100F1ED00F1EC00F1ECF0F1F1292D2D2D2D2D
+ 2D2D2D2D2D2D2D29F1F0F1EDF0F1F0EDF12D292E292DF12D29292D292D2A29F1
+ 2E2929F1F129ECF12929F12D29F5295256F1292D565229F129522D56F1292D05
+ 054A2D2D2D2D2D2DF52DF52DF52DF52D2D2DF52DF52DF52D2D2D2D2D2DF52D2D
+ 2D2D2D2DF0ED0000F000ED00ED00F100F000F000ED00EC00F100ECF000F00000
+ F10000F1F1F52D2D2D2D2E2D2D2D2D2D292D2DF1ECF1EDF0F1F1F1F1F129F12D
+ F12D292E2DF12E29F12D29F15129F1F1F1F0F1F1F1F1F129292A2D2E5629F12E
+ 562D2D292D2D2E56292D2E6465652DF52D2DF52D2D2D2D2D2D2D2D2DF52D2D2D
+ 2D2D2DF52DF52DF52D2D2DF52DF52DF1F1F000ED00F00000F000EC00ED00EDF0
+ 0000F1EC00F1F100F100F1EC00F1F0F1292D2D2D2D2D2D2D2D2D2DF1F1F129F1
+ F1F1F0F1EDF0EDF0F12D292D292E2D292D292DF1292D29F12EF129F1F1F1F1F0
+ 29F12929F5292D2D522DF1292E5256F1292E295629292E6262632D2DF52D2DF5
+ 2DF52DF52DF52D2D2D2DF52DF52D2D2D2D2D2D2DF52D2D2D2D2DF1F0F10000F0
+ 00ED00F100F10000F0000000F10000F100EC00F1ECF100F100ECF1F1F1292D2D
+ 2D2D2D2E2D2DF5F1ECF1F1F0EDF0EDF0F1EDF0EDF12D2D29F129F12D2EF12D29
+ F12E2DF12D2DF129F1F1F1EDF1F1F12D29F12E290752F12D512E2DF1292D2956
+ 2EF1295D5D5D2D2D2D2D2D2D2D2D2D2D2D2D2DF52DF52D2D2D2DF52DF52DF52D
+ 2D2DF52DF529F1F100ECF100ED00F0000000F0F100ED00F100ECF100F1F1F100
+ F100F1EC00F1F1292D2D2D2D2D2D2D2D2D2929F1ECF1F1EDF1ECF1F1ECF0F1F0
+ F1F1292D2D2D2D292D29F12D29F529F1292929F1F0F1F1F0F1F129F1292E292D
+ 5255F1292E555229F1292E2D2D292D5858582DF52DF52D2DF52DF52DF52DF52D
+ 2D2D2D2DF52D2D2D2D2D2D2D2DF52D2D2DF1F000F1000000F00000EDF0ED0000
+ 00F000EC00F100F0F000EC00F0F10000F1F0292DF52D2D2D2D2D2D2D2D2DF1F1
+ F0F1F0F1F0F1F100F1F1F1EDF0EDF12D2E2929F12D29F12929F129F1F12DF1F1
+ F1F1ECF1F1F1F1292D2929F15256F1292D522E2DF1F1292D52F1295656562D2D
+ 2D2DF52D2D2D2D2D2D2D2D2DF52DF52D2DF52DF52DF52DF52D2D2DF5F1F0F1EC
+ 00F100ED00F1F0000000ED00F100F100F100F100ED00F100ED00F1ECF1F1F52D
+ 2D2D2D2D2D2D2D2D2D312D2900F1EDF0EDF0ECF1F1ECF1F0F1F0F1292D2D2DF1
+ 2E29F12EF12D2929292DF129F1F1F1F0F1F129F129F1292E2D56F1F12E2D522D
+ F1292D2E2DF1295151512DF52D2D2DF52DF52DF52DF52D2D2D2D2DF52D2D2D2D
+ 2D2D2D2D2DF52D28F1F100F100EC00F0000000EDF000F000EC00EC00ECF000F1
+ 00F000EDF00000F0F129F1292D2D2D2D2D2D2DF1292D5A31EDF0F1F1F1EDF1EC
+ F1F0F1EDF1EDF0F1F12D52F5292DF12D29F12DF1F129F1F1F1F0F1EDF0F1F129
+ F12D2D292D52292929562D29F1F1292D56F1294F4F4F2D2D2DF52D2D2D2D2D2D
+ 2D2D2DF52DF52D2D2DF52DF52DF52DF52D2D2DF1F1F0F100F000F100ED00F100
+ 00ED00F100F100F100F1ED00F100F10000F1ECF1F1F12D2D2D2D2D2D2D2D29F1
+ F02D0751F1F1ECF1ECF1F0F0F1EDF1F0F1F0F1EDF0293152292D292DF1F1292D
+ F12D29F129F1F1F0F129F1F129292A292D2E2DF1292D2E2D29F1292D2E29F16A
+ 6A6A2DF52D2D2DF52D2DF52DF52DF52D2D2D2D2DF52D2D2D2D2D2D2DF52DF1F1
+ F0ED000000ED0000F000EC00EDF000EC0000F000ED00F000F1EC00F0ED00F1F1
+ 292D2D2D2D2D2D2D2D2DF1F0F1F12D2DF1ECF1F0F1ECEDF1EDF0ECF1F1F1EDF0
+ F1F1292D2D2DF129F1F129F12929F5F1F1F1ECF1F1F1F129F1292D2D29522DF1
+ 292E2D29F1F1292E5129F16465652D2D2DF52D2D2D2D2D2D2D2D2D2DF52DF52D
+ 2D2DF52D2D2DF52D2D2DF1F0F1EC00ED00F000ED00F100F00000F100ED00F1EC
+ F100F1F00000F100F0F0F1F1F1292D2D2D2D2D2D29F129F1ECF12DF1F1F1EDF0
+ EDF0F1ECF0F1F1EDF0F1F0F1ECF1F1F12D522D29F1F12929F1F12929F1F1F1F1
+ F1F129F129F1F52A2D2D52F1292D522D29F129292E2DF15E5E5F2D2D2D2D2D2D
+ F52DF52DF52DF52D2D2D2D2DF52D2D2DF52D2DF52D2CF1F100F100ECF10000F0
+ 0000ED00F10000ECF00000F100F000EDF000ECF100EDF029F1F1F52D2D2D2D2D
+ 2DF1F1F100F12DF1F0F1F0F1F1ECF1F1EDF0EDF0EDF1F1F1F1F0EDF0F12D2D29
+ 2D29F1F529F12DF129F0F1ECF1F0F1F1F129292D2A2D2DF1292D2E2DF1F1F12D
+ 2D51F15907072DF52DF52DF52D2D2D2D2D2D2D2DF52DF52D2D2D2DF52D2D2D2D
+ 2DF1F1F0ED00F00000ECF100F100F00000F0F10000F1ED00F0ED00EC00F10000
+ ECF1F1F1F1292D2D2D2D2DF1292D2DF1F1F0F129F1F1ED00F1F1F0EDF0EDF0F1
+ F1F0EDF1F1F1F1F1F1F1292D522D2929F1292D29F1F1F1F1F1F1F1F129F1F129
+ 2D2D5629F129512E29F1F12D2A2DF15454542D2D2D2D2D2D2DF52DF52DF52DF5
+ 2D2D2D2D2DF52D2D2D2DF52DF1F1ECF100F10000F1000000EC0000ED00ED0000
+ F100F000F100F100F10000F1F1F1F0F1F12D2D2D2D2DF129F12D072DF1ECF1F1
+ 2DF100F0EDF0EDF0F1F1F1EDF0EDF1F0F1F1ECF1ECF1F12D2D522DF129F129F1
+ F1F1F1F1F0F1F129F1F1292D2E2952F1F1F12E2D29F129292D2DF15252522D2D
+ 2D2DF52D2D2D2D2D2D2D2D2D2D2D2DF52D2D2DF52D2D2D2DF0F1F100EC00EC00
+ 00F1ECF100F100F000F000EDF000EDF100F000F000EDF0EDF0F1F1F12D2D2D2D
+ 2D2D2DF1F12D072D00F12955F1F0ECF1ECF1F1F1ECF0EDF0F1F0F1F1F1F1F1F1
+ F1ECF1F1F12D292D2D292DF129F1F0F1EDF129F1F129F1292D2E2D2DF1292D2E
+ F1F0F129292E294D4D4DF52DF52D2DF52D2DF52D2D2DF52D2DF52D2D2D2D2D2D
+ 2DF52D2DF1F0F1F100F100F1EC000000F000ED00ED00EC00F100F000F100ED00
+ F000EDF0F1ECF1F12D2D2D2D2D2D29F1F12D2D29F0F12E2D29F1F100F100F0ED
+ F1F1F0EDF1EDF0F1ECF128F1F1F1F0EDF0F129292D2D29F529F1EDF0F1F0F129
+ F1292DF12D512E2929F1292D29F1F1F12D2DF1D7D7D72D2D2D2D2D2D2D2D2D2D
+ F52D2D2DF52D2D2D2DF52D2D2D2D2DF1F1F1EC00F00000EC00F100ED0000F000
+ F000F100ECF100F10000F000ED00F0EDF1F1F12D2D2D2D2D2D2DF100F1F12DF1
+ F12D552DF12D2DF1ECF1EDF0F1ECF1F0F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1
+ 2929F5292929F1F1F1F1F1F1F129F129292E2D2DF1F1292D2EF1F1292D2A2942
+ 42422D2DF52D2D2DF52DF52D2D2DF52D2D2D2DF52D2D2DF52DF52DF0F0ECF100
+ F100F100F000EC00F0ED00F100ED00F0F100F1EC00ED00F100F1F1F1F0F12DF5
+ 2D2D2D2D2D55F1F0EDF12DF1F1552DF1F02D2DF100F1F0F1ECF1F1F1EDF0F1F1
+ F1F0F1F1F029F1F0F1F0F1F1F1F129292DF1F1F0EDF0F129F1F129F12D2D2D2A
+ F1F129292D29F1F1292D2D3C3D3D2D2D2D2DF52D2D2D2D2D2D2D2D2D2DF52D2D
+ F52D2D2D2D2DF1F1F1F10000000000ED00F100F10000EC0000F000F100EC00F1
+ 00F00000F000EDF0F1292D2D2D2D2D2D2D322900F1ECF1292D2DF1F1F1F129F1
+ ECF0EDF1F1F0EDF0F1F1F0F1F1F1F129F1F1F129F1F1F1F0F1F1F1F1292DF1F1
+ F1F1F1F1F1F1F129292E2D2DF1F1F12E29F1F1F12D2A2D3A3A3B2DF52D2D2D2D
+ F52D2DF52DF52D2D2D2D2D2D2D2D2DF52D2D2CF1F0EDF1F0ED0000F00000F000
+ ED00F100F100EDECF1F1F100ED00F100EDF0F1F1F1F52D29F52D2D2D2D55F1EC
+ F0F1F12D2DF1F0F1F1F12DF1F100F1F0EDF1F1F1F0EDF129F129F1F1F1F1F1F1
+ 2929F1F1F1F029F1F12929F1F1F1F0F1F129F1F12D2D522D29F1F12D2D29F0F1
+ 29F5293535072D2D2D2DF52D2D2D2D2D2D2D2DF52D2DF52D2DF52D2D2D2DF1F1
+ F1F0000000F0ED00F10000F0000000F000F000F10000F000F000EC00F1ECF1F0
+ F12D2D2D2D2D2D2D31072DF1F1F12D312DF1F1F1F12D31F1ECF1F0EDF1F0F1F1
+ F1F1F0F1F1F1F129F129F1F1F1F1F129F1F1F1F129F1F1F1F0F1F1F129F1F129
+ F1292D52F1F1F029F129F1F1292D293030302D2DF52D2D2D2D2DF52D2D2D2D2D
+ 2D2D2D2D2D2D2D2D2DF5F1F0F1F0ED00F10000EC0000ED00F1F0ED00ED00F100
+ F0ED00ED00F100F1ECF1F1F1F12D2D2D2D2D2DF52D562D29F5292D2DF1F129F1
+ 292D29F1F1F0EDF1F0F1F1ECF1F1F1EDF0292929F1F1F129F1F129F1F129F1F1
+ F1F1F1F0F1F1F129F1F1292DF12D2E2D29F1F1292D2DF1F1F129F12A2A2A2D2D
+ 2D2D2DF52D2D2D2DF52DF52D2DF52DF52D2DF52D2DF52D2DF1EC00000000F100
+ F100F00000000000F0F100F100EC00F00000F100F1F1F0F1292D2DF52D2D2D29
+ 2D31312DF12D2D29F12DF12D2D2DF1F1ECF1F0EDF1ECF1F1F0F1F0F1F1F0F1F1
+ 2929F1F1F1F1F129F1F129F129F1F1F1F1F1F1F1F129F129F129292E2DF1F1F1
+ 522DF1F1292D2D2525252D2D2DF52D2DF52DF52D2D2D2D2D2D2D2D2D2D2D2D2D
+ 2D28F52DF1F1F000F1EC00F000ED00F1EC00F10000ECF100F100F100EDF000EC
+ F1F0F129F52D292D2DF12D2DF12D2D2D292DF1F0F5F1292D2DF1F0F1F1EDF1F0
+ F1F1ECF1F1EDF1F1F1F1F1F1F129F12929F1F1F129F1F12DF129F1F1F129F129
+ F129F1F1292D2D51072E2DF1292DF1F1F12E294343432DF52D2D2D2D2D2D2D2D
+ F52D2DF52D2D2DF52D2D2DF52DF52D2DF10000F10000F10000F0000000F100EC
+ F1F100F000F000000000F1F1ECF129F12D2DF52DF12D2D292D292D2DF1F100F1
+ 29292D2D2DECF1F1F0F1F0F1EDF0F1F0F1F1F0F1ECF1F129F1F129F1F1F129F1
+ F1F129F1F12D29F1F1F1F1F1F1F129F12DF12E2D2E5655562D2D522D29292D3E
+ 3E3E2D2D2D2D2DF52D2DF52D2D2D2D2D2DF52D2D2DF52D2D2DF12D2DF1F0ED00
+ 00EC0000ED00F1ECF100F000F1EC00ED00ED00F1F0EDF000F1F1F1F029F5292D
+ 2D2DF12DF52D2DF129F0EDF1F1F1312DEDF129F1F1F1EDF1F0F1F129F1F1F1F1
+ F1F1F0F1F129F0292929F1F1F129F1F129F1F129F12D29292D2929F1292A2D2D
+ 2D29292E512E555655322D3839392D2D2DF52D2D2D2D2D2DF52DF52D2D2DF52D
+ 2D2D2D2DF52D31312900F000F100F100F0000000000000F100F1F00000F00000
+ 0000EDF1F0F1F1F12D2D2D29F5292D2929F12D2DF1EDF000F1292DF0F1F1F1F1
+ ECF1F0F1ECF1F1F1F1F1F1F0F1F1F129F1F1F1F1F1F1292929F129F1F129F1F1
+ 29292D2D2E2D2E2D2D2D512E2D2E2D2D2D2D2E2D52512E363637F52D2D2D2D2D
+ F52D2D2D2D2D2DF52D2D2D2DF52D2D2D29F52D31F1F1000000F000ED00F1F0F1
+ 00EDF000F100F1F100F100EDF000F0EDF1F0F12D2D2DF52D2DF12DF1F1F1292D
+ 2DF100EDF0F1F1F1F029F1F1F1F1F1F1F1ECF1F1F1F0F129F129F1F1F1F129F1
+ F1F1F1F129F1F129F12929F1F129F1292D2D552E512D2E5132512D2E31522D2D
+ 322D2D3131312D2D2D2DF52D2D2D2D2D2D2D2D2D2DF52D2D2D2D2D2DF52D312D
+ F1F0ED00F10000F00000000000EC00F1F0ED00F00000EC0000F100F1F0F12D2D
+ F12D292DF12DF1F1ECF1F52D31F1ECF100EDF0F129F1F1F0F1F1F1F0F1F1F1F1
+ F0EDF1F1F1F1F0F1F1F1F1F12DF1F1F1F1292929F1F1F129F129F129F52E2D2E
+ 2D2E55562D2D2E552E512E55522D522C2C2C2D2DF52D2D2D2D2DF52D2DF52DF5
+ 2D2D2D2D2DF52DF529F5312DF100F000EC00F100ED00ED00F100F0ED00F1ECED
+ 00F100F1ECF1F0F1F1F1F1F12D2D2DF52DF129F1F0F1292D552DEDF0F1F0F1F1
+ F1F1F129F1F0F1F1F1F1F0EDF1F1F1F0F1F1F1F129F0F12929F129F1F1F1F1F1
+ 29292929F529F5292929F12D2D2D2E2D56565556553255563155562A2A2A2D2D
+ 2D2D2DF52D2D2DF52D2D2D2D2D2D2D2D2D2D2D2DF52D2D31F1F000F100EC0000
+ 00F000F000F100F1ECF100F00000F0000000EDF0F129F1F12D2DF12929F12DF1
+ F129F12D5631F1F129F1F1F129F1F1F129F1F1EDF0F129F1F0F1F0EDF129F1F1
+ F1F129F12D2D29F129F1F1F1F1F1F1F129F1292DF12D29292A2D2D2D2D2D2E55
+ 56555656565207454545F52D2DF52D2DF52D2D2D2DF52D2DF52D2DF52DF52D2D
+ F12D3131F1EDEC00F100F1F0F100ED00EC00EDF0F100F100ED0000F1ECF1F1EC
+ F1F0F12D2D2D2DF1F12DF1F0F1F129F52D552DF1F12D2DF1F129F0F1F1F1F1F1
+ F1F1F1F1F1EDF1F0F1F1F0F1F1F1F1F1F129F1F12D2929F129F129F129F12929
+ 292D2DF52D292E2D2E512E2D522D2D5155312E3F3F3F2D2D2D2D2D2D2D2DF52D
+ 2D2D2DF52D2DF52D2D2D2D2D28F53131F1F0F10000EC00000000F000F100F0ED
+ F0F1EC0000F0ED0000F000F1F0F1F12D2D2DF529F529F0F129F529F1292D312D
+ 2DF1F129F1F1F1F1F129F0F1F0F1F1F1F1F0F1F1F1F1F1F12929F12929F5292D
+ 2DF12D07562D2D2D292DF1F1F129F129292D2D2D2D2D2D2D2D2E51322E2D513A
+ 3A3A2D2DF52D2D2D2D2D2D2D2DF52D2D2D2D2D2D2D2D2DF5F52D2D312DED0000
+ F0F100ED00ED00F10000F100F100F100F1000000F1EDF1F1EDF12DF1F12D2DF1
+ 29F1F129F529F12DF12D29F129F129F1F129F129F1F1F1F129F1F0F129F1F1F1
+ F0F129F129F529F1F529F129F12D5A7E07292D2D562E2D2D2929F129F129F12D
+ 2E2D2E2D2E2D2E2D2D512E2A551F2D2D2D0D2D2D2DF52D2D2D2D2D2D2DF52D2D
+ 2DF52D2D29F531312DF0ECF1000000F000F00000ECF1ECF1F0F10000ECF100F1
+ 00F0ECF1F0F12DF0292D2D2DF1F0F1F129F129F12DF1F12DF129F129F1F1F1F1
+ F0F1F1F1F1F1F1F1F1F1F1F129F1F0F1F129F12929F1F1F1515A072DF1F1F1F1
+ 2D555651322D2D2D2D292DF129F12D292D2D2D2E2D2E2D551F552D2D2D2D2DF5
+ 2D2D2DF52D2D2DF52D2D2DF52D2D2D2DF5292D312DF10000ED00F100ED00F100
+ 0000F100F1ECF1000000F000ECF1F1ECF1F1F1F12D2D2D29F0F1F529F1F129F1
+ F12929F1F1F1F1F1F129F129F1F1F0F1F1ECF1F129F1F0F1F1F1F1F129F1F1F1
+ F129292D070729F1F1EC00ECF1F12D2D5156562D562D562D51292D2929F12929
+ 2D292DC001862DF52D2D2D2D2D2D2D2D2D2DF52D2D2D2D2D2D2D2D2D2DF53131
+ 31F1F0ED00F00000F000EC00EDF000F1ECF100F100ED0000F1F100F1F0F1EDF1
+ 312DF1F1F1F129F1F529F1F129F1F1F129F1F129F129F1F1F1F129F1F1F1F1F0
+ F1F129F1F0F1F1F1F1F129F12DF1F1077E2D00F100F1F1F100F0F1F12D2D3152
+ 555655560707562D2D512D2D29292D0002F32D2D2D2D2D2D2DF52D2DF52D2D2D
+ 2DF52D2DF52D2D2DF5F52D3131F1EC00F100ECED00F100F1F000F1ECF1F1EC00
+ F000F0ED0000F0F1F1F1F02D2D29F1F12DF129F12929F128F1F1F129F129F0F1
+ F1F1F1F1F1F1F1F1F1F0F1F1F129F1F1F1F1F129F1292DF129F129075AF1EDF0
+ ECF1ECECF1ED00EDF12D523156075A075A5655565556075607075640045F2D2D
+ F52D2DF52D2D2D2D2D2D2D0D2D2DF52D2D2D2D312D29312D312DF10000F100F0
+ 0000EC0000F100F1F0F100F100F10000F1F0EDF1F0F1F12D2DF1F12D2D2DF1F1
+ F1F1F1F1F1F129F1F1F129F1F1F129F1F0F1F129F129F1F1F1F129F129F1292D
+ 29F12D29F1F12D072DF000F1F1F0F1F1ECF0F1F0F1292D56075A555655075607
+ 560756070756078005CB2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D
+ 2DF12D31312DF0F1EC00F100ED00F1EC0000F1ECF1F1F00000ECF10000EDF0F1
+ EDF0F12DF1F12D312D2D29F12DF129F129F1F129F129F129F1F1F1F129F1F0F1
+ F1F1F1F029F1F129F1F1F1F1F1F1F129F1295607F1EDECF1F1F129F1F1ED00F1
+ F0F12D5655560756560707070707077E075A07C007382D2D2D2D2D2D2DF52D2D
+ 2DF52D2D2D2D2DF5312DF52D31F52D313131F1F000F10000F0000000F1EC00F1
+ F0F1ECED00000000EDF0F1F1F0F129F1F1292D292D2D2DF129F1F1F1F1F0F1F1
+ F1F1F1F1F129F1F1F1F1F129F129F1EDF1F129F1F129F129F1F1292DF12D0732
+ F1F0F1ECF12E2D2DF1F0F1ECF1292D3156555A07075A7E077E077E0707075A00
+ 08A42D2DF52D2DF52D2D2DF52D2D2D2D2D2D2D2D2D2D2D312D2DF131312D2900
+ ED00F0ED00F1ECF10000F1F0EDF1F1F000F100EDF0F1F1ECF1F1F1F0F12DF1F1
+ 2D2D312DF1F1F1F1F129F1F129F1F1F129F1F1F0F129F1F1F1F1F1F0F1F1F1F1
+ 29F129F1F1292D2DF12D0729F0ED00F12D2D2D0729F100F1F129315656555A07
+ 075A075A5A5A5A07567E07400A102D312D2D312D2D2D2D2D2D2D2D2D07072D2D
+ 2D2D2D2D312DF12D3131F5F000F100EC00000000F1EC00F1F02929250000F000
+ 00F1ECF1F12929F1F12DF1F02D2D2D2D294DF1F1F1F1F1F1F129F1F1F1F129F1
+ F1F1F1F12929F1F1F1F129F1F129F5F129F1292D295207F100F1F0F12D2D5607
+ F100EDF0F12D560707560707565556070707550707075A800B7C2D2D2D2D2D2D
+ 2D2DF52D2D2D08FFFFFFF6822D2D2D2D2DF7FFFF07312DF1EC07FFFF31EDF000
+ 00F0ED6EFDFDFDFDFDFD4AF0ED00F192FDFDFD6E2D05FD932D2D51FDFDFDFD72
+ F1FDFD05F14EFDFD4DF1F129F12905FDFDFD93294DFDFD2DF1F129F129F129F1
+ 2D072DECF1ECF1F1F1290756ECF1ECF129513156070756560756555655565607
+ 560707C00CE92DF52D2D2D2DF52D2D2D2DAFF6FFFFFFFFFFAF2D2D2D3182FFFF
+ 07312DF1F05AFFFF2D0000F10025FDFDFDFDFDFDFDFDFD0000F092FDFDFDFDFD
+ 9293FD922D29FDFDFD9393FD92FDFD29F16EFDFD29F1F1F1F105FDFDFDFDFDFD
+ 05FDFD29F129F529F129F5F12D56F1F100F1F1292931562DF100F1F12D075607
+ 565507070707072D562D552E555655000E552D2D2D312D2D2D2D2D2D08FFFF08
+ 070708FFFF082D2D2D86FFFF5531312DEC07FFFF2DECF1EC29FDFDFD92052929
+ 6EFDFD00ED29FDFDFD05296EFDFDFD97F16EFDFD4E2D2D05FDFDFD4DF105FDFD
+ 05F1F1F129FDFDFD29294DFDFDFDFDF129F5292D292D29F15655F100F0EDF12D
+ 2D5655F1ECF1F0F12D56555655565A5A07560756070756552D5607400FC12D2D
+ 2D2D2DF52D2D2D07FFFF082D2D2D2D08FFFF072D3182FFFF2D2D312DF107FFFF
+ 3100000093FDFD6EF1F0F12905FDFDF00005FDFD4AF0F12D72FDFD92F193FD93
+ 2D2D2DF593FDFD29F105FDFD29F129F14EFDFD05F1F1F14EFDFDFDF1292D29F1
+ 2DF1292D5A2DECF1EDF0292D2D562DF100ECF12D56315655320755555655075A
+ 5556555656075680112E312D2DF52D2D2D2D2D86FFF6312D2DF52D55F6FF862D
+ 2D82FFFF31F12D2DF107FFFF2DEDF005FDFD6EEDF0F1F12D05FDFD00F16EFDFD
+ 29F12D2DEDFDFD93F0FDFD922D2D292D72FDFD05F14EFDFD05F1F1F192FDFD29
+ 29F1F1F1FDFDFDF129F12929F12D295507F100ECF1F1F1F12D51F1F0EDF0F12E
+ 55565556555656315632555655560707070707C0129A2D2D2D312D2D2DF52DF6
+ FFAF2D2D312D2D2DAFF6F62D2D86FFFF2D00F5312D07FFFF2DF00092FDFDEDF0
+ ECF1F0F105FDFD000092FDFDF0292DF1F0FDFD92F1FDFD92F1F12DF172FDFD29
+ F16EFDFD29F1F0F1FDFD92F1F1F129F192FDFDF1F1F1F5F1292D2D2E2DECF1F0
+ F1292D2D5631F100F0F1295507560707565555525555565556070756075A0700
+ 14062D2D2D2D2D312D2D55FFFF822D2D2D2D2D3186FFFF072D82FFFF2DF1F12D
+ 31F7FFFF2D00EDFDFD92F100F1F1F12D05FDFD00F16EFDFDF1F1F1F0F1FDFD92
+ F172FDFDF12929F16EFDFD4DF172FDFD25F1F129FDFD6EF1F129F52992FDFDF1
+ 292D29292D2E2D55F1F100F1EDF555290756ECF1EDF1F12D5607075655325607
+ 0756565556075A070707076E02D3312D312D2D2D2D2D07FFFF072D2D2DF52D2D
+ 07FFFF072DF7FFFF2D00ECF131F7FFFF2DF125FDFD0500F0EDF0F1F172FDFDF0
+ 0092FDFDF0F1EDF0F1FDFD6EF105FDFD6EF1F52D72FDFD2A2D72FDFD29F1F105
+ FDFD72F12DF129F192FDFDF1F1292D2D2DF12D2E2D00F1ECF0F1F1F1552DF100
+ F0F12907072E2D5556510756070707560707077E0756073A0A272D2D2D2D312D
+ 2D2D82FFFF352D2D312D2D2D07FFFFF73182FFFF3100F100F5F7FFFF310005FD
+ FD25F100F1ECF0F172FDFD00ED6EFDFDF1ECF0F12DFDFD92F12D6EFDFD9605F1
+ 72FDFD055576FDFD4DF1F14DFDFD05F129F1F1F193FDFD29F1F1F1F12D292D2D
+ 29ECF1F100EDECF1F1F100F1ECF12D565551325655075607560707070756075A
+ 07070706117B2D312D312D2D312D08FFFF2D2D2D2D2D2D2D31FFFFAA2D82FFFF
+ 31ED00F0ED07FFFF2DED6EFDFD2500F000F1F1F172FDFD00F092FDFD0000F1F1
+ 2DFDFD922D2DF14AFDFDFDFDFDFDFD4E316EFDFD05F1F129FDFD4E2929F129F1
+ 92FDFDF12D29F1292D2D2D2E2DF1EC00F1F0F10000F0F1ECF1F1563156325555
+ 565607070756075607070707075A7ED218CE2D2D2D2D2D2D2D2D08FFFF2D312D
+ 2D2D2D312DFFFFD42D82FFFF550000ED00F7FFFF31F092FDFDF1F0ED00050505
+ 96FDFDF00093FDFDF0F1F1F1F0FDFD932DF1F1F0296E93FDFDFDFD512D05FDFD
+ 29F1F125FDFD6EF1F1F1F1F192FDFDF1F1F129F1292DF12D2DF1F1F1ECED00F1
+ F1ED00F1F12D3155565507560707070756070707075607077E07079F20222D2D
+ 2DF5312D312D08F6FF2D2D2D31F52D2D2DFFFF082D82FFFF55F1F0000007FFFF
+ 2DED6EFDFD00EDF0ED92FDFDFDFDFDF1006EFDFD00EDF0F1EDFDFD92F100ECF1
+ F12DF1F005FDFD52F105FDFD05F1F0F1FDFD92F1F0F1F1F192FDFDF12D29F1F1
+ F1292D2E2D2D29F1F1F0F1ECECF0F1F12D522D562D5656075607560707077E5A
+ 07077E5A075A076B27762D2D312D2D2D2D2DD4FFFF2D312D2D2D312D2DFFFF08
+ 3182FFF6F7F100F1ECF7FFFF31F192FDFDF1ECF1F06E6E926E92922DF192FDFD
+ F0F100F000FDFD96F1EDF0F12D2D00F16EFDFD05F005FDFD92F1F1F192FDFDF1
+ F1F1F1F1FDFDFD29F12D2D2D2D292D2D292D292D29F1F1F1F1F1292D55075251
+ 2D2D5107070707075607070756070707560707372EC92D312D2D2D2D312D08FF
+ FF2D2D2D2D2D2D2D2DFFFFD42DF7FFFFAF29F00000AFFFFFF1F092FDFDEDF0ED
+ F0EDF1F1F0F12D2DF16EFDFDED00ED00F1FDFD9300F0F1F12D29F1F06EFDFDF1
+ 0072FDFDFD05F1F105FDFD4EF129F105FDFDFDF1F129292DF1F12D292D2E2D2D
+ 292D2E2D292D5656562D3156315607562D565532070707560707560707070703
+ 361D2D2D2D2D312D2D2D08FFFF2D2D312D312D2D31FFFF082D82FFF6FF08F1EC
+ F7FFFFAAF1F105FDFDF0ECF1F1F1F0EC00F1F12D2D92FDFDF000F000F1FDFD92
+ EDF12929F5F00029FDFD9700F16EFDFDFDFD4E4929FDFDFD4DF129FDFDFDFD29
+ F129F12D29F1292D2D072D2D562D2D5531562D552D2D565556075A5552315655
+ 52075655560707077E075ACF3D71312D312D2D2D312DF7FFFF312DF52D2D2D2D
+ 07FFFFF72DF7FFAF08FFFFFFFFFFFF0700F14EFDFD25F1ECF1F0F1F1EDECF0F1
+ 2D92FDFD00F100F1ECFDFD92F0F172FD6E056EFDFDFD0500F172FDFD4AFDFDFD
+ 294EFDFDFDFDFDFD93FDFDF1F1F1F1F129F12D29560729F12D56512E56315631
+ 5655563156555607077A07560707075607075A075A07079B44C52D2D2D312D2D
+ 2D2DF7FFFF072D2D2D2D312D07FFFF8231F7FFD43108FFFFFFFF5EF0F10025FD
+ FD0500F100F1ECF0F1F100F12D97FDFD0000EDF0F1FDFD6EF1F172FDFDFDFDFD
+ FD6EECF0F105FD93F06EFDFD252905FDFDFDFD4E92FDFD29F1F1F1AAF1568282
+ 82822DF0F12D2D552D5655562D56555655565556070707077E0707077E07077E
+ 075607674C182D312D2D2D312D3107FFFF5E2D2D2D312D2DF7FFFF072D550755
+ 2D315507F7F5EC000000F1FDFD92F100EDECF1EDF0ECF1ECF1295129ED0000F1
+ 00252525F1292DF1254A6E4E29F100F1F14D5225EDF1296E29F1F125050529F1
+ 92FDFDF1292D2908F12D7E087E0731EDF12D56552E2D56315656315607565556
+ 07560707560756075A07560707070733536C2D2D2D2D312D2D2D31FFFFAA2D2D
+ 312D2D2D08FFFF312D312D2D312D2DF5F1F00000F1ECF06EFDFDEDECF1F0F1F0
+ 00F1F1F0EDF12D2D00F0ED00F100F0F1F02D2DF0EDF02D07F1ECF1F1F155F1ED
+ F0F1F1F1F1F1F1F0F1F1F1F093FDFDF1F1F1F108292908ABF707EDF0F12D322D
+ 513251565555555655075607070707560707070707070707075607FF5AC0312D
+ 312D2D2D312D2D86FFFF312D2D2D2D55FFF6AF2D2D2D312D312D312DF0F1EC00
+ 00000025FDFD6EF00000F100EDF000EDF0F1F12D29F1F000F000EDF100F1F100
+ F1F12D2DF100F1F1F1F1F0F0F1F1F129F1F1F1EDF1F1F1F192FDFDF129F12DAB
+ F12D0882075AF0ED2D2D5156312D2D5556325607560707070756070756070756
+ 077E075A070707CB62132D2D2D2D312D2D312D07FFFF862D2D2D2D86FFFF0731
+ 2D2D2D2D2D312D2D2DF1F1F100F100006EFDFD6EF100EDF0EDF0EDF0EDF0F129
+ F52DF100ED00F0F1F100ECF0F12D2DF1F0ECF12D2DF1EDF0F129312DF0ECF1F0
+ F1F1F1F192FDFDF0F1F12908F12DAF552D08EDF12D2D315255562D3255550756
+ 0756075607075607075A07075A075A075A07079769672D312D312D2D312D2D2D
+ 08FFFFF7313182FFFFF62D2D2D31312D312D312D2DF5F0EC00EC00F1ECFDFDFD
+ 924DF1ECF125F100F0EDF0F12D2D2DF100F0ED00F0ED00F1F12DF1F000F1F12D
+ 2DF1ECF1F12D07ED00F1F1F129F12DF193FDFDF1F1F12DAF5556F6F1F1F6F0F1
+ 2D2E512D32562D5556565507565556070756075A07077E070707077E07075A3F
+ 7980312D2D2D2D312D2D312D31AFFFFFFFFFFFFFFF072D2D312D2D2D2D312D31
+ 2DF129F1F000F100002992FDFDFDFDFDFDFD25F0EDF100F1F02D2D2DF1ED00F0
+ ED00F0F1F129F100F1F1F155F1ECF1F1F155F1F0EDF1F1F12D29F1F192FDFDF1
+ F1F1552D56075600F02DF1292D2D2D32552D3156553156565556070756070707
+ 7E075A07077E075A077E073370C02D312D312D2D312D2D2D2D3108FFFFFFFFAF
+ 072D2D312D2D312D312D312D2DF5F0F1F100EC00ED00ED05FDFDFDFDFDFD72ED
+ F000F129F529F52D2D2DF10000EDF1EDF000EDF0F1292D2DF1ECF1F1292D00ED
+ F0F1F1312DF000F192FDFD29F129F1F12D07F1EDF0EDF12D56312E5551562D56
+ 315631070707560707070756075A077E5A077E070707072768002D2D2D2D312D
+ 2D312D312D312D55F7F707312D312D2D312D2D312D2D31312D2DF528F1F100F0
+ 00F000F100250505052500F1EDF0ECF52D2D2D2D552D2DF100F0F1F100F100EC
+ F1F52DF1F1F0F12D31F1F1ECF1F12907F1F1ECF192FDFD2DF1F1F1F1555500F1
+ 00F0F12D2D55552E312D565556515607560707560756070707070707F707077E
+ 075A071B5F402D312D312D2D312D2D2D2D2D2D312D312D2D2D2D312D2D2D312D
+ 2D312D2D2DF52DF1F1F0F100ED000000F000F100F100F000F0EDF1F02D312D2D
+ 2D31552DF1F0EDF0F100ECF1F0292DF1ECF1F13156F100F0F1F12D2DF100F0F1
+ F1555A29F0F1292D5A29F1ECF1F1F1292D56322D555231565507075655560707
+ 070707567E075A07077E07075A07070F5680312D2D2D2D312D2D2D312D312D2D
+ 2D2D2D312D312D2D2D312D2D2D312D312D2D2DF1F0F1F1F000ECF100ED00EC00
+ 00F000F1F1EDF0EDF12D312D313131563129F100EC00F1F1EDF1F000F1F12D55
+ 2D00F1F1292D56F1F0EDF1F129072D00F1F1292D55F1F000F1F1292D322D2D51
+ 56315655320756555607075607075607075A07077E075A07077E2D034DC02D31
+ 2D312D2D2D31312D2D2D312D312D312D312D312D312D2D312D2D312D2DF52DF5
+ 29F1F0F1F00000F00000F100F100EDF0F1F0F1F0EDF12D2D31565531553129F1
+ F100F1F0F100F1ECF1F13156F0EDF0F1F1552D00EDF0F1F1562DF0EDF0F12932
+ 2DF100F1F0F1292D552D2D3255562D0755565556070756555607070707077E07
+ 5A07075A5A55F1F745002D2D312D312D2D2D2D312D2D2D2D2D312D2D2D2D2D31
+ 2D2D312D31312D312D2DF52DF529F1F1F1F1EC00F1000000EC0000ED00F1ECF1
+ F0EDF12D313107315631312DF1ECF1F100F100ECF1292DF1F100F129F1072DF1
+ 00F1292D07F1F100F1F1F155F100EDECF1F12D07562D2D562D2D513251325556
+ 0707075607077E5A7E07077E077E070707F1ECEB3C40312D312D2D312D312D2D
+ 312D2D312D2D312D312D312D2D312D2D2D2D31312D2D2DF02DF1F0F1F0F1F100
+ 00F0ED00F100F100F000F100F1F0EDF02931550731550707312DF1F1EC00F1F0
+ F1F1F1EC00F029F12D2DF100F02D290755F100ECF1F12D32EC00F0F1F12D7E55
+ F1295631552E3151325507555607560707560707075A7E07075A077E55F1F1DF
+ 33802D2D2D2D312D312D2D312D312D2D2D312D312D312D312D2D31312D31312D
+ 2D2DF52DF52DF1F1F1F1F0ECED0000F000EC00F100ED00F0F100F1F1F0F12D31
+ 0707565532552DF1F1F0ECF1F100F000F1F1F12D312900F1F12DF15A2DF1ECF1
+ 292D55F1F0F1EDF1290707F1EDF02D2D56512D56075156075607070756070707
+ 7E0707077E07075A2DF100D32AC0312D312D2D312D2D312D2D2D312D312D2D31
+ 2D2D2D2D312D2D2D312D2D312D2DF5F529F0F528F1F0F1F1F0F10000F100EC00
+ F00000ED00EDF0F1F1F0F129313107310755563129F1F1F1ECF100F10029F129
+ 07F0EDF0F1292931F100F1F1F12D56F1EC00F0292D5AF100F0F12D562D07562D
+ 560707560755560707077E0707560756075AF7072DEDF0C722002D312D312D31
+ 2D312D312D2D2D2D2D312D2D312D312D2D312D312D312D312D2D292DF529F1F5
+ F1F1F0F1EDF0F10000F100F100EDF000F000EDF0F1F1F1F0F12D550707310755
+ 31292DF1F1ECF1ECF129F1F12DF100F12D2D552DF100ECF5295131F1F1ECF1F1
+ 5531EDF1EDF12D555607F1F02D56075556077E07075607560707070707075A07
+ 29F1EDBB1940312D2D2D312D2D312D2D312D2D312D2D312D2D312D2D312D312D
+ 312D2D31312D2DF529F529F128F1F1F1F0F1ECED0000F00000F000F100F100F1
+ 00F100F1EDF0F12D5507072DF1F1F12D2DF1F0002D2DF1F0ED00ECF12D2D07F1
+ ECF1F12DF1312DEC00F1F12D56F1F000F0F12D5607F1F0EDF12D0756077E0707
+ 5A070707075A7EF75A077E55F1F0F0AE10802D2D31312D2D312D2D312D2D312D
+ 2D312D2D312D2D312D2D2D312D2D312D2D2DF5F528F1F4F1F5F1F1F0F1ECF1F1
+ F0ED0000ED00ED00EC00EC00ED00EDF1F0F1F1EDF12D5507F1F12D0755313229
+ F129F1EC00F0F12DF12931F100F029F12956F100EDF0F12D55F100F1F1292D07
+ 55ED00F1F0555A07072DF1F15507075AF70707070707F707EDF1EDA207C02D31
+ 2D2D2D312D2D312D2D312D2D312D2D312D312D2D312D312D2D312D31312D2D2D
+ F5F129F128F1F0F1F1F1F0ECF100F100F000F000F100F100F000F000ED00F0F1
+ F0F1F12D552D2955322D553229F1F1F1F100F12DF1F1F1F1ECF12D2D2D2DF0ED
+ F0F1F1562DF0F100F12D56072900F1ECF13251075600F1F0F1567E070729F12D
+ F75A0707F1F0001CBA44312D312D312D31312D312D2D312D2D2D312D2D312D31
+ 2D312D2D312D312D312D2DF12DF0F1F1F1F129F1F0F1F1F100F1ECF100F100EC
+ 00F000ED00F100F000F100EDF1F0EDF1F12D2D5555563155312D292DF1ECF12D
+ ECF100F000F129F12DF1F100F1292D072900EDF0F129075AF0F1ECF1F1555607
+ 2DF100ED29070707F1F100F155F75A2DF1F1EC18BCD72D312D312D2D2D2D312D
+ 31312D312D312D312D2D312D2D2D2D312D2D2D312D312D2DF529F5F0F1F0F1F0
+ F1F1F0F1F0EDF1F0ED0000F100F100F000F0ED00F100F0F1F0EDF0F1F1F0F1F1
+ 2D5555322D2DF12D2E2DF1F1F1F0ECF1ED2DF12931EC00F1EC2D562DF100F0ED
+ 292D0751F100F1ECF12E0707EDF0EDF0F1077E2DF100EDEC2E070729F100F114
+ BF6A312D312D31312D312D312D2D2D2D2D2D2D2D2D312D2D312D312D2D31312D
+ 312D2DF529F429F1F1F1F1F1F0F1F1ECF1ECF0EDF1F0ED00000000ED00F100F0
+ 00F100ED00F100ED00F1F1F1F1F12D2D55562D2D2D2D2DF1F129F100F02DEDF0
+ F1F1F100F12D55F100F1ECF12D2D56F1ECF100F12D55072DF1F100F0F1070729
+ 00F1F0F1318207F1F0EDF010C1FD2D2D312D2D2D312D312D2D312D312D2D2D31
+ 2D2D31312D2D2D31312D2D312D312D2DF5F1F1F128F1F0F1F1F0F1F1F0F1F1F0
+ 00F1ECF1F0ED00F00000ED00ED00F0EC00F1F0F1EDF0ECF1ECEDF1F12D2D5531
+ 2D2D2D29F1F529F1F1F1F0F100EC00F0F1F155F1EDF0F1F1292E07F100F1F0F1
+ 2D5607F100F0EDF1F15607F1F1F0EDF1555A0729F100F10CC490312D312D312D
+ 2D2D2D312D2D312D2D312D2D312D2D2D31312D2D2D312D2D312D312D292DF0F1
+ F1F1F1F0F1F1F0F1F1F0EDF1F1F0F1F0EDF0F100EDF000F100F100F100EC00F0
+ 00F1F1F0F1F0F1F1F1F1F1292D552D2DF129F12929F1F1F1F1F1ECF1F1EDF1F1
+ F000F12D2D2D31F1F000F1F1560707F1ED00F0F155072DF100EDF0ED55F755F1
+ F1EDF008C7232D2D2D312D312D312D312D312D2D312D2D2D2D312D312D2D2D31
+ 2D2D312D312D312DF5F12DF1F0F1F0F1F1F0F1F1F0F1F1F0ECF1ED00F1F1ECF0
+ 0000F100F000EC00F100F100F10000ED00F1ECF0EDF0F1F1F1F1292D2D2D2DF1
+ F1F1F0F129F0F100F1F0F1EC00EDF129F1072900F1ECECF1553156ECF0F1ECF1
+ 560729ECEDF0F1F1077E2DF1F0ECF104C9B6312D312D312D312D312D2D312D31
+ 2D2D2D312D2D312D2D2D312D31312D312D312D312D2DF02DF1F1F1F1F0F1EDF0
+ EDF1ECF1F1F1F0F1F1ECF1F1F1F1EC0000F100F100F000ED00F0EDF000F100F1
+ 00F1F1EC00F1F1F1F12929292D29F1F1F1F1EDF0EDF1F1F1F1F0F1F1F12DF0ED
+ 00F1F12D56562DF1ED00F1F10707F1F0F1F0F1F107F72DED00F1F100CC492D31
+ 2D2D312D2D2D2D312D2D2D312D312D2D312D2D312D312D2D2D2D312D2D312D31
+ 2DF5F1F1F1F0F1F0F1F1F0F1F1F0F1F0F1ECF1EDF0F1F1ECF1ECF1F1ECF00000
+ F100EDF0F100F000F1EC00F1F00000F1F100F1ECF1F1F1F1F129F12929F1F0F1
+ ECF1292D29F1F0EDF1F1F1ECF100F12955552D00F0F1F1290756F1ED00F1F12D
+ 5A072DF1F100F185D6582D2D312D2D312D312D2D31312D2D2D2D312D2D312D2D
+ 2D2D312D312D2D312D312D312D2D2DF0F129F1F1F0F1F1F0EDF1F0F1F1F1F0F0
+ EDF0F1F1F0F1ECF1F1EDF1ECECF1000000ED00F100F1F000EDEDF000EDEC00F1
+ 00EDF0F1F0F1F1F1F1F129F1F0F1F0F129F1F1F0ECF1F1F0F1ECF1F1F129F1F1
+ 00F0ED2D0731F1F0EDF0ED2D070729ECEDF0F1714AC6312D2D312D2D312D312D
+ 2D2D312D31312D2D312D312D31312D2D2D312D312D312D312D312DF1F1F0F1F0
+ F1EDF0F1F0F1EDF0ECF1EDF1F1F1ECF100F1F1F1F0F1F0F1F1ECEDF0EDF0F100
+ F0ED00F1F000F100F0F1F1ECF100F100F1EDF1F0F1F1F1F1F129F1F1F129F1F1
+ F1F1F0F1F1EDF0EDF1F1F1ECF1EDF12D562DECF100F1F1557E07F1F1F000F15C
+ BF342D2D312D2D312D2D2D2D2D312D2D2D2D2D312D2D2D312D2D2D31312D2D2D
+ 312D312D312D2DF5F0F1F1F1F1F0F1F0EDF1F0F1F1F1F0F1F0ECF1F0F1EDF0F0
+ EDF1F1F1F0F1F0F1ECECEC00F100F0ED00F0EDF0ED00F1F100F1F0ED00F0ECF1
+ ECED00F1F1F1F1F129292D292DF1F1F1F1F1F0F1F0F1F0F1ECF0ECF1F0F1F1EC
+ F100F12D0707F1EC00F1F14833A22D312D312D2D2D31312D312D312D312D312D
+ 312D312D2D312D2D2D31312D2D312D312D312D2DF129F0F1F0F1ECF1F1F0F1ED
+ F0ECF1ECF1F1F1EDF0F1EDF1F0F1ECF1EDF1F1F1F1F1F1ECF0ED00F000EDF000
+ F1F000F0EDF0EDF0F1F1F100F1F0F1EC00EDF0EDF1F1F129F12929292D2D29F1
+ F1F1F1F1F1F1F1F1F1F0F1F1ECF1ECF1F1F1F0F1EDF0ED33A810312D2D2D3131
+ 2D2D2D2D2D2D2D312D312D2D2D2D2D312D2D312D2D2D2D312D2D312D312D312D
+ F5F1F1F1F1F1F0F1ECF1F0F1F1F1F0F1ECF1F0F0F1F0F1F1EDF1F1F0F1F0EDF0
+ F1F1F1F1F1F0F1ECF100EDF000EDF100F1ECF1F100F0F129F1EDF0F1F1F0EDF0
+ 00F100F1ECF1F1F1F1F1F12D29292929F529F1F1F1F1F1F1F1F0F1F0F1ECF1F0
+ F1ECF01F1C7E2D2D312D2D2D312D312D312D312D2D2D312D312D312D312D2D2D
+ 312D312D312D2D312D312D2D2DF1F0F1F0F1EDF1F0F1EDF0F0EDF100F1F0EDF1
+ EDF1F0F1F0F1F0F1F1F1F1F1F1F0EDF1F1F1F1F1F0F1F0F0EDF000F100F100F0
+ ED00F1F0F1F1F12DECF1F0EDF1F0ED00F100F100F1EDF0EDF1F1F1F129292929
+ 2929292929F129F129F1F1F1F1F1F10A90EC2D312D312D312D312D2D2D2D2D31
+ 2D312D312D2D2D2D2D312D0D2D2D2D312D312D312D2D31312D2DF1F1F1F0F1F0
+ F1EDF0EDF1F1F0F1F100F1ECF1F0EDF0F1F1EDF1F1F0F1F1F0F1F1F0F1F1F129
+ F1F1F1F1F1F0F1ECF000ECED00F100F100F1F0F1F1F100F1F0F1EDF0EDF0ECF0
+ EDF000F1F1F0EDF1EDF1F1F1F1F1F1F1F1F1F129F1F129F129F12947F5C5312D
+ 2D2D312D2D2D312D312D312D2D312D2D2D312D312D2D2D2D2D312D2D312D312D
+ 2D312D2D312DF1F0F1F0F1ECF1F0F1F0F1ECF1EDF0F1F1F000F1F100EDF0F1F0
+ F1EDF0EDF1F1F1F129F0F1F1F129F12929F529F1F1F1F1F0F1ECEC00F000EDF1
+ 00ECF100EDF0F0EDF0F1F1F1F0EDF1F0EDF12D2D2D2D2D2929F1F1F1F1F1F1F1
+ EDF1F1EDF0F1F13D7EC42D312D2D2D31312D2D2D2D312D312D2D312D312D2D2D
+ 312D312D2D2D312D2D312D31312D312D2D312DF1F1F1F1F1ECF100F1F0F1ECF0
+ EDF0EDF1EDF0EDF1F0F1EDF1F0F1F1F0F1F0F1F0F1F1F1F1F1F1F1F1F129F12D
+ F12D29F1F1F1F1F1EDF000ECF100ECF100EDF1F0EDF1F1F1F1F0EDF0F12D07F7
+ F707F70707075556512D512D2DF1F1F0EDF0EC3307C32D2D312D312D2D312D31
+ 2D312D2D2D312D312D312D312D2D2D2D312D2D31312D2D2D2D312D31312D2D2D
+ F0F1F0F1F1F0EDF100F1F1F1F0F1F0F1F0F1F0F1EDF0F1F0EDF0F1F1F1F1F1F1
+ F1F1F0F1F128F129F1F12D2929F12D292DF5292DF129F1F1F1F1F100F1F12D52
+ 2D2D2D29F1F1F1F1F1295A07F7F707F707F7F7F707F707F7070751F1F1F1F128
+ 90C22D312D2D2D2D312D2D2D2D2D2D31312D2D2D312D2D2D312D2D312D2D312D
+ 2D2D312D312D2D312D2D312DF5F1F1F1F0EDF0F0EDF1F000F100F1ECF1F1EDF1
+ F0F1ECF1F1F1F1F0F1F0F1EDF0F1F129F1F1F1F1F129F1F1F5F129F529292D2D
+ 2D2E2D2D2D2D29292D2D2D5531565555325152512D2D2D2D5231560756070707
+ F75AF707F707F72DF1F12D1E19C12D2D2D2D312D2D312D2D312D312D2D2D312D
+ 2D312D312D312D2D2D312D2D31312D312D31312D2D312D2D2DF1F0F1F1F0EDF1
+ F000F1F1ECEDF0F1ECF0F1ECF1F1F1F0EDF0EDF1EDF1F0F1F1F1F1F1F1F129F1
+ 2DF1F129292DF1292DF5292D2D2D2D2D2E2D56312E5132560707075651070707
+ 5659560755563155552E5156550707560707562D29F1F513A2C0312D2D2D2D31
+ 2D2D312D2D312D312D2D2D312D2D312D2D2D312D312D312D2D2D2D312D2D312D
+ 312D312D312DF1F0F1EDF0EDF1EDF0F1F1F100F1F1EDF0F100F0EDF1F0F1F1F0
+ F1F1F1F1F0F1F0F1F1F1F1F1F129F1F1F5292DF12929F529F52D292D2D2D2D55
+ 31513155560707075A07075A55565556075556560707075A5A070707075A5556
+ 555651092BBF2D2D312D312D2D312D2D2D2D2D2D312D312D312D2D31312D2D2D
+ 2D2D2D312D312D2D312D2D312D2D2D2D2D2D2DF1F1F0F1F0F1F0F1ECF100F1F0
+ EDF0F1F1EDF1F1F0EDF1F0F1F1F0F1ECF1F1F1F1F128F1F129F129F129F1F129
+ F5292D292D292D2D2D2D2E2D2E312E553156560707075A07F77E07075A7E0755
+ 2E55565555565556075607075A5A07DADADA2D312D2D2D2D312D312D2D312D31
+ 2D2D2D2D2D2D312D2D2D2D312D2D312D312D2D2D312D312D312D312D2D31312D
+ F0F1F0F1ECF1ECF1F0F1F0EDF0F1EDF0F0F1ECF1F1F0EDF1F0F1F1F1F1F1F1F0
+ F1F1F129F1F1F129F12D29F529F12DF12DF52D2D2E2D2D2D2D2D513156315507
+ 560707075A07077E0707077E070707075655522D2D2D552E2D2D559899982D2D
+ 2D312D312D2D2D312D2D2D2D312D31F5312D312D31312D2D312D2D2D2D312D31
+ 2D2D2D2D2D2D2D2D2D2D2D2D2DF1ECF1F1F1F1F0EDF1ECF1EDF0F1F1EDF0F1F0
+ EDF1F0F1F1F1F0F1F1F0F1F1F1F1F1F1F129F1F129F1F1292DF1292D292D292D
+ 2D2D2D2D2D2E2D2E51322D5655565507075AF707077E07077E077E5A07070707
+ 56555631552E2D7A7D94312D2D2D2D2D312D2D2D312D2D312D2D2D2D2D2D2D2D
+ 2D2D312D2D2D312D312D2D2D312D2D312D312D312D312D312DF5F100ECF0F1F1
+ F0F1F1F0F1F0EDF0F1F1EDF1F0F1F1ECF1F1EDF0F1F1F1F0F1F128F1F1F129F1
+ F129F1F129F529F12D292D2D292D2D2E2D2D2D312D553231563156560707077E
+ 07075A07070707F707F75A0707565556555556878B952D2D312D312D312D312D
+ 2D2D2D312D312D2D312D312D312D2D2D312D2D2D2D312D312D2D2D2D2D2D2D2D
+ 2D2DF52D2D312DF1F1F1ECF1EDF0ED00F1EDF0F1ECF1F0F1EDF0EDF1F1F0F1F1
+ F1F0F1F1F129F1F129F1F1F129F1F129F129F12D29F529F52D2D2D292D2D2D2E
+ 2D2D51513255553156075607077E075A7E077E077E0707F75A0707560756558D
+ 8C942D312D2D2D2D2D2D2D312D312D2D2D2D2D312D2D2D312D2D2D312D2D312D
+ 312D2D2D2D312D2D312D312D312D2D31312D2D2DF0ECF1F1F0F1F0F1F1F0F100
+ F1F0EDF1F0F1F0F1F0EDF1F0EDF1F1F1F1F0F1F1F129F129F5292DF1F12DF129
+ F1292D2929F5292D2D2E2D2D2D2E553231553256550755075A07F707070707F7
+ 5AF77EF707F707070707569292872D2D312D2D312D312D2DF52D2D312D312D2D
+ 2D312D2D312D312D312D2D2D2D2D312D312D312D2D2D2D2D2D2D2D2D2D312DF5
+ 2DF1F000F100EDF1ECF1EDF0F1ECF100F1F1ECF1F1F0F1F1F0F1F0F1F1F1F129
+ F1F129F129F1F12D29F12D29F12D29F52D292D292D2D2D2D2D2D2D2D512E5531
+ 56315607070707077E077E0707070707F7077E5A075A07484848312D2D2D312D
+ 2D2D312D2D2D2D2D2D2D312D2D2D312D2D2D2D2D2D31312D312D2D2D2D312D31
+ 312D312D2D312D2D2DF52D2D2DF5F1F0F1F0F1F0F1F0F1EDF1F1F0F1ECF1F1EC
+ F1F1ECF1F1EDF1F1F0F1F1F1F0F1F129F129F1F12DF1F12D29F52D292D2D2D2D
+ 2D2D2D2E2D2D2E2D31512E552D56555655560756075AF7077E077E077E0707F7
+ 0707073535352D312D2D2D2D312D2D2D312D312D312D2D2D312DF52D312D312D
+ 312D2D2D2D2D312D2D2D2D2D2D312D2D2D2D2D2D312D312D2D2D2DF1ECED00F1
+ 00F1ECF1F000F1EDF1ECF1F1F1ECF1F1F0F1F0F1F129F0F1F129F129F1F129F1
+ 292D2929F52D292D2D2D2D2E2D2D2D2D2D2D2D2D2D2E312D56312E3132553255
+ 0707077E07F70707075A7E07077E073030302D2D2D2D2D312D2D2D312D2DF52D
+ 2D312D312D2D2D2D2D2D2D2D2D2D2D312D312D2D312D312D312D2D312D312D31
+ 2D2D2D2D2D2D2DF5F0F1F0EDF0F1F1F0EDF1F1F0F0F1F0F1ECF1F1F0F1F1F1F1
+ F1F1F1F129F1F1F1F129F529F5F129F529292D2D2D2D2D2D2D3152312D325131
+ 523151563151555552555651560756075A077E077E07075A7E075A3030302D31
+ 2D2DF52D2D312D2D2D2D2D312D2D2D2D2D2D312DF52D2D312D2D2D2D2D2D2DF5
+ 2D2D2D2D2D312D2D2D2D2D2D2D312D2D2D2D2D2DF5F1ECF100F100F1F0F1ECF1
+ EDF1EDF0F1F1ECF1ECF1F0EDF0F129F1F1F129F129F129F12929F529F52DF12D
+ 292E2D2D2E2D2D2E51312E5631555631560756070707070707070707075A075A
+ 07077E070707073535352D2D312D2D2D2D2D2D2D312D2D2D2D2D312D2D2D2D2D
+ 2D312D2D2D312D2D312D2D2D312D312D2D2D312D312D2D312D2D2D312D2D2D2D
+ 2D2DF1F0EDF0F100EDF0F1F0F1F0F1EDF0F1F1F1F1F1F1F1F1F1F0F1F1F0F1F1
+ F129F12DF1292D29292D292D2D2D2D2D2D2D2D552E5531315231315655075607
+ 075A077E07F7077E077E07075A0707075607074862662DF52D2D312D312D312D
+ 2D312D312D312D2D2DF52D2D312D2D2D2D2DF52D2D2D312D2D2D2D2D312D2D2D
+ 2D2D312D2D312D2D2D2DF52D2D2DF529F0ED00F0EDF0EDF100F1ECF1F1ECF1F0
+ F1ECF1F0F1F1F1F129F1F12929F1F129F12DF129F529F5292D292D2D2E2D562D
+ 312D562D56555655325507077E077E075A07075A0707077E077E075607070730
+ 35232D2D2D312D2D2D2D2D2D312D2D2D2D2D2D2D2D2D2D312D2D2DF52D2D2D2D
+ 312D2D2D2DF52D2D2D2D2D2D31F52D2D2D2D2D312D2D2D2D312D2DF5F1F1ECF1
+ F100F1F0EDF0F1F1F0F1F0EDF1F1F1F1F1F1F1F1F1F129F1F1F129F12DF129F5
+ 292D2D2DF52D2D2D2D2D2D2D2D562D55553156315607075A07070707075A7E07
+ 077E075A070707070707566662482D2D312D2D2D312D312D2D2D2DF5312D31F5
+ 2D2DF52D2D2D312D2D312D2D2D2D312D2D312D312D2D312D2D2D2D2D2D312D2D
+ 2D2D2D2D2D2D2D2DF5F0F1F0ECF100EDF0F100F100EDF1F1F0F1F0F1F0F1F0F1
+ 29F1F129F129F1F129F12D292DF1292D292D2D2E2D2D2D325131523132563155
+ 55560707077E5A077E07077E0707F707077E5A070707073530352D2D2D2D2DF5
+ 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2DF52D2D2D2D2D312D2DF52D2D2D2D2D2D
+ 312D2D2D312D2D31F52D2D2D312D2D2D312D2D2D2D2DF1F1F0EDF0F100F1ECF1
+ F1F0EDF0EDF1EDF1F1F1F1F1F0F1F1F1F1F129F52929F12DF12DF12D2D2D292D
+ 2D2E2D512E2D3151315156325507075A07070707075A07077E07077E07070707
+ 5656079E08802D2D2D2D2D2D2D312D31F52D2D2D2DF52D312D2D2D2D2D312D31
+ 2D2D2D2D2D2D2D2D2D312D2D2D2D2D312D2D312D2D2D312D2D2D312D2D2D312D
+ 2DF52DF1F1F1ECF1F0EDF100F0EDF1F1F0F1F0F1ECF1F1F1F1F129F029F1F129
+ F1F529F1292D292DF12D2D2D2D2D2D2D31512E315631315507565507077E077E
+ 07077E0707077E075A7E07560755077482E42D2D312D312D2D2D2D2D2D312D2D
+ 312D2D2D2DF52D2D2D2D2D2D2D2D2D2D312D2D31F52D2D312D2D312D2D2D2D2D
+ 2D2D2D2D312D2D2D312D2D2D2D2D2D2DF1F0F1F1ECF1ECF1F1F1ECF0EDF0EDF1
+ F1F1F0F1F1F1F1F1F1F129F1F129F129F529F5292D2D2D292D2D2D2E2D2E3155
+ 2D5655565607560756070707075A0707F75A0707F707070707075625B69C2DF5
+ 2D2DF52D2D2D312D2D2D312D2D2D2D2D312D2D2DF52D2D2DF52D312D2D2D2D2D
+ 2D2D2D2D2D2DF52D2D2DF52D2D2D31F52D2D2DF52D2D2D2D2D2D2DF52DF1F0F1
+ F1F0F1F1ECF0F1F1F1F1F0F1F0F1EDF0F1F0F1F129F1F1F129F12DF12D292D29
+ F5292D2D2D2E2D2D2D31522D562D3255550707070707075AF707077E0707F707
+ 077E5A07075655500000312D2D2D2D2DF52D2D2DF52D2DF5312D312D2D2D2D2D
+ 2D2DF52D2D2D2D2DF52D312D2DF52D2D2D2D2D2D2D2D2D2DF52D2D2D2D312D2D
+ 2D312D2D2D312D2D2D2DF1F0F1EDF0F1F1F1ECF1F0EDF1EDF1F0F1F1F1F1F1F1
+ F1F0F129F129F129F1F12D292DF5292D2D2D2D2D2D51312D2D552D5656555607
+ 075A0707075A0707F75A077E07070707560756A000002D2D2D312D2D2D2D2D31
+ 2D2D2D2D2D2D2D2D2D2DF52D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2DF52D2D2D
+ 2DF52D2D2D2D2D2D2D2D2D2D2D2D2D2D312D2D2DF52DF529F1F0F1ECF1ECF1F0
+ EDF1F0F1F0EDF0F1ECF1F0F1F1F129F1F1F129F5292D29F529292D2D2D2D2D2E
+ 2D2E2D52313255313156555607075AF77E07F77E07820707F77E075A07075545
+ 42752D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D
+ 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D
+ 2D2D2DF12DF1F1F1F0F1F1F1F1F0F1F1F1F1F1F1F1F1F1F1F1F1F1F1F129F129
+ F129F5292D2D2D2D2D2D2D2D2D2D2D2D31513255565507070707070707070707
+ 070707F707070707070756314664
+ }
+ Transparent = True
+ Left = 1
+ Height = 180
+ Top = 1
+ Width = 99
+ end
+ end
+ object btnOK: TButton
+ BorderSpacing.InnerBorder = 4
+ Cancel = True
+ Caption = 'OK'
+ ModalResult = 2
+ OnClick = btnOKClick
+ TabOrder = 1
+ Left = 225
+ Height = 18
+ Top = 240
+ Width = 64
+ end
+end
diff --git a/components/onguard/source/qogabout0.lrs b/components/onguard/source/qogabout0.lrs
new file mode 100644
index 000000000..7cfc1d7be
--- /dev/null
+++ b/components/onguard/source/qogabout0.lrs
@@ -0,0 +1,1220 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TOgAboutForm','FORMDATA',[
+ 'TPF0'#12'TOgAboutForm'#11'OgAboutForm'#13'ActiveControl'#7#5'btnOK'#11'Borde'
+ +'rIcons'#11#12'biSystemMenu'#10'biMinimize'#0#7'Caption'#6#24'About TurboPow'
+ +'er OnGuard'#12'ClientHeight'#3#15#1#11'ClientWidth'#3'm'#1#5'Color'#7#6'clF'
+ +'orm'#10'Font.Color'#7#6'clText'#11'Font.Height'#2#11#9'Font.Name'#6#13'MS S'
+ +'ans Serif'#10'Font.Pitch'#7#10'fpVariable'#8'OnCreate'#7#10'FormCreate'#11
+ +'OnMouseMove'#7#13'FormMouseMove'#13'PixelsPerInch'#2'S'#8'Position'#7#14'po'
+ +'ScreenCenter'#10'TextHeight'#2#13#18'HorzScrollBar.Page'#3'l'#1#19'HorzScro'
+ +'llBar.Range'#3#21#1#18'VertScrollBar.Page'#3#14#1#19'VertScrollBar.Range'#3
+ +#222#0#4'Left'#3#14#2#6'Height'#3#15#1#3'Top'#3#236#0#5'Width'#3'm'#1#0#6'TB'
+ +'evel'#0#6'Height'#2#13#4'Left'#2#4#5'Shape'#7#9'bsTopLine'#3'Top'#3#191#0#5
+ +'Width'#3'-'#1#4'Left'#2#4#6'Height'#2#13#3'Top'#3#191#0#5'Width'#3'-'#1#0#0
+ +#6'TLabel'#0#7'Caption'#6#7'OnGuard'#5'Color'#7#6'clNone'#10'Font.Color'#7#6
+ +'clText'#11'Font.Height'#2#9#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Pitch'
+ +#7#10'fpVariable'#10'Font.Style'#11#6'fsBold'#0#11'ParentColor'#8#4'Left'#2
+ +'n'#6'Height'#2#10#3'Top'#2#6#5'Width'#2'*'#0#0#6'TLabel'#10'lblVersion'#7'C'
+ +'aption'#6#12'Version 1.00'#5'Color'#7#6'clNone'#10'Font.Color'#7#6'clText'
+ +#11'Font.Height'#2#8#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Pitch'#7#10'fp'
+ +'Variable'#11'ParentColor'#8#4'Left'#2'n'#6'Height'#2#10#3'Top'#2#24#5'Width'
+ +#2'1'#0#0#6'TLabel'#0#7'Caption'#6#18'OnGuard home page:'#5'Color'#7#6'clNon'
+ +'e'#11'ParentColor'#8#4'Left'#2'o'#6'Height'#2#13#3'Top'#2'.'#5'Width'#2'y'#0
+ +#0#6'TLabel'#6'WebLbl'#7'Caption'#6')http://sourceforge.net/projects/tpongua'
+ +'rd'#5'Color'#7#6'clNone'#10'Font.Color'#7#6'clNavy'#11'Font.Height'#2#8#9'F'
+ +'ont.Name'#6#13'MS Sans Serif'#10'Font.Pitch'#7#10'fpVariable'#11'ParentColo'
+ +'r'#8#7'OnClick'#7#11'WebLblClick'#11'OnMouseMove'#7#15'WebLblMouseMove'#4'L'
+ +'eft'#2't'#6'Height'#2#10#3'Top'#2'B'#5'Width'#3#154#0#0#0#6'TLabel'#0#7'Cap'
+ +'tion'#6'&Released under the Mozilla License 1.1'#5'Color'#7#6'clNone'#11'Pa'
+ +'rentColor'#8#4'Left'#2'o'#6'Height'#2#13#3'Top'#2'['#5'Width'#3#223#0#0#0#6
+ +'TLabel'#0#7'Caption'#6#9'(MPL 1.1)'#5'Color'#7#6'clNone'#11'ParentColor'#8#4
+ +'Left'#2't'#6'Height'#2#13#3'Top'#2'n'#5'Width'#2'8'#0#0#6'TLabel'#0#7'Capti'
+ +'on'#6'5Copyright (C) 1997-2002, TurboPower Software Company.'#5'Color'#7#6
+ +'clNone'#11'ParentColor'#8#4'Left'#2#5#6'Height'#2#13#3'Top'#3#197#0#5'Width'
+ +#3'H'#1#0#0#6'TLabel'#0#7'Caption'#6#20'All rights reserved.'#5'Color'#7#6'c'
+ +'lNone'#11'ParentColor'#8#4'Left'#2#5#6'Height'#2#13#3'Top'#3#217#0#5'Width'
+ +#2'j'#0#0#6'TLabel'#0#7'Caption'#6#17'Online newsgroups'#5'Color'#7#6'clNone'
+ +#11'ParentColor'#8#4'Left'#2'o'#6'Height'#2#13#3'Top'#3#135#0#5'Width'#2'm'#0
+ +#0#6'TLabel'#7'NewsLbl'#7'Caption'#6'-https://sourceforge.net/forum/?group_i'
+ +'d=71010'#5'Color'#7#6'clNone'#10'Font.Color'#7#6'clNavy'#11'Font.Height'#2#8
+ +#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Pitch'#7#10'fpVariable'#11'ParentC'
+ +'olor'#8#7'OnClick'#7#12'NewsLblClick'#11'OnMouseMove'#7#16'NewsLblMouseMove'
+ +#4'Left'#2't'#6'Height'#2#10#3'Top'#3#162#0#5'Width'#3#178#0#0#0#6'TPanel'#6
+ +'Panel1'#10'BevelOuter'#7#9'bvLowered'#12'ClientHeight'#3#182#0#11'ClientWid'
+ +'th'#2'e'#8'TabOrder'#2#0#4'Left'#2#4#6'Height'#3#182#0#3'Top'#2#4#5'Width'#2
+ +'e'#0#6'TImage'#6'Image1'#5'Align'#7#8'alClient'#12'Picture.Data'#10'n'#140#0
+ +#0#7'TBitmapb'#140#0#0'BMb'#140#0#0#0#0#0#0'6'#4#0#0'('#0#0#0#137#0#0#0#249#0
+ +#0#0#1#0#8#0#0#0#0#0','#136#0#0#0#0#0#0#0#0#0#0#0#1#0#0#0#1#0#0#0#0#0#0#0#0
+ +#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#128#128#128#0
+ +#192#220#192#0#240#202#166#0#170'?*'#0#255'?*'#0#0'_*'#0'U_*'#0#170'_*'#0#255
+ +'_*'#0#0'*'#0'U*'#0#170'*'#0#255'*'#0#0#159'*'#0'U'#159'*'#0#170#159'*'#0
+ +#255#159'*'#0#0#191'*'#0'U'#191'*'#0#170#191'*'#0#255#191'*'#0#0#223'*'#0'U'
+ +#223'*'#0#170#223'*'#0#255#223'*'#0#0#255'*'#0'U'#255'*'#0#170#255'*'#0#255
+ +#255'*'#0#0#0'U'#0'U'#0'U'#0#170#0'U'#0#255#0'U'#0#0#31'U'#0'U'#31'U'#0#170
+ +#31'U'#0#255#31'U'#0#0'?U'#0'U?U'#0#170'?U'#0#255'?U'#0#0'_U'#0'U_U'#0#170'_'
+ +'U'#0#255'_U'#0#0'U'#0'UU'#0#170'U'#0#255'U'#0#0#159'U'#0'U'#159'U'#0#170
+ +#159'U'#0#255#159'U'#0#0#191'U'#0'U'#191'U'#0#170#191'U'#0#255#191'U'#0#0#223
+ +'U'#0'U'#223'U'#0#170#223'U'#0#255#223'U'#0#0#255'U'#0'U'#255'U'#0#170#255'U'
+ +#0#255#255'U'#0#0#0''#0'U'#0''#0#170#0''#0#255#0''#0#0#31''#0'U'#31''#0
+ +#170#31''#0#255#31''#0#0'?'#0'U?'#0#170'?'#0#255'?'#0#0'_'#0'U_'#0
+ +#170'_'#0#255'_'#0#0''#0'U'#0#170''#0#255''#0#0#159''#0'U'#159''
+ +#0#170#159''#0#255#159''#0#0#191''#0'U'#191''#0#170#191''#0#255#191''#0
+ +#0#223''#0'U'#223''#0#170#223''#0#255#223''#0#0#255''#0'U'#255''#0#170
+ +#255''#0#255#255''#0#0#0#170#0'U'#0#170#0#170#0#170#0#255#0#170#0#0#31#170
+ +#0'U'#31#170#0#170#31#170#0#255#31#170#0#0'?'#170#0'U?'#170#0#170'?'#170#0
+ +#255'?'#170#0#0'_'#170#0'U_'#170#0#170'_'#170#0#255'_'#170#0#0''#170#0'U'
+ +#170#0#170''#170#0#255''#170#0#0#159#170#0'U'#159#170#0#170#159#170#0#255
+ ,#159#170#0#0#191#170#0'U'#191#170#0#170#191#170#0#255#191#170#0#0#223#170#0
+ +'U'#223#170#0#170#223#170#0#255#223#170#0#0#255#170#0'U'#255#170#0#170#255
+ +#170#0#255#255#170#0#0#0#212#0'U'#0#212#0#170#0#212#0#255#0#212#0#0#31#212#0
+ +'U'#31#212#0#170#31#212#0#255#31#212#0#0'?'#212#0'U?'#212#0#170'?'#212#0#255
+ +'?'#212#0#0'_'#212#0'U_'#212#0#170'_'#212#0#255'_'#212#0#0''#212#0'U'#212#0
+ +#170''#212#0#255''#212#0#0#159#212#0'U'#159#212#0#170#159#212#0#255#159#212
+ +#0#0#191#212#0'U'#191#212#0#170#191#212#0#255#191#212#0#0#223#212#0'U'#223
+ +#212#0#170#223#212#0#255#223#212#0#0#255#212#0'U'#255#212#0#170#255#212#0#255
+ +#255#212#0'U'#0#255#0#170#0#255#0#0#31#255#0'U'#31#255#0#170#31#255#0#255#31
+ +#255#0#0'?'#255#0'U?'#255#0#170'?'#255#0#255'?'#255#0#0'_'#255#0'U_'#255#0
+ +#170'_'#255#0#255'_'#255#0#0''#255#0'U'#255#0#170''#255#0#255''#255#0#0
+ +#159#255#0'U'#159#255#0#170#159#255#0#255#159#255#0#0#191#255#0'U'#191#255#0
+ +#170#191#255#0#255#191#255#0#0#223#255#0'U'#223#255#0#170#223#255#0#255#223
+ +#255#0'U'#255#255#0#170#255#255#0#255#204#204#0#255#204#255#0#255#255'3'#0
+ +#255#255'f'#0#255#255#153#0#255#255#204#0#0''#0#0'U'#0#0#170''#0#0#255''
+ +#0#0#0#159#0#0'U'#159#0#0#170#159#0#0#255#159#0#0#0#191#0#0'U'#191#0#0#170
+ +#191#0#0#255#191#0#0#0#223#0#0'U'#223#0#0#170#223#0#0#255#223#0#0'U'#255#0#0
+ +#170#255#0#0#0#0'*'#0'U'#0'*'#0#170#0'*'#0#255#0'*'#0#0#31'*'#0'U'#31'*'#0
+ +#170#31'*'#0#255#31'*'#0#0'?*'#0'U?*'#0#240#251#255#0#164#160#160#0#128#128
+ +#128#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255#0#255#255#0#0#255
+ +#255#255#0')'#241')'#241#241'))))))-))*-)--'#5'-Q-MR--'#5'QRR.QRQRQR-RQR-RMR'
+ +#5'.RQRRQRRQ.MRM.Q'#5'.M-.-M-.)))))))'#241')'#241')'#241')'#237#240')'#241'%'
+ +#240')'#241')'#241'()'#241'$'#241#241'('#241')'#241'%'#241')'#240#241'('#237
+ +#241#241#241#240#237#241#241#240#241#237#240#241#0#241#240#237#240#241#241
+ +#236#240#241#236#241#0#241'MPO'#241'('#241'))'#241')))))))-))-'#5')Q).M.-MR-'
+ +'N-QQ.Q.Q.QR-RMR.Q.QRQ.M.QR-NQ.M.M.M-N-'#5'M.'#5')-*)))'#241')'#237'))'#241
+ +'%'#241'))'#237')'#241')'#241'%'#241'%'#241#241')'#241#241')'#241#241'%'#240
+ +#241')'#241#237')'#241')'#241#240#237#241#240#237#240#237#241#240#241#236#241
+ +#237#240#241#241#237#240#241#237#241#240#237#241#236'NOP)'#241')'#241')'#241
+ +')'#241')'#241'))))-)-))*Q)RMR-NQ-RN-RMRQR-'#5'Q.QQMRQN-NQRM.MR-NQ.Q.M.M-*-)'
+ +')-'#5'))))))'#241')'#241#237')'#241')'#241')'#241')'#241')'#241'('#241#241
+ +')'#237#241')'#240#241'%'#241#241')'#241#236')'#241#241#237')'#241#241#240
+ +#241#237#241#241#240#237#241#241#241#236#241#237#240#237#240#237#240#241#0
+ +#237#240#240#241'MLL'#241')))))'#241')))))))))))-M)R--)R-MNQ-RM.Q*QRQR)R.R-R'
+ +'-RQ.QRQR-M.-R-R-R-R)M.M.-))))))'#241')))'#241')'#237')'#241')'#236')'#237')'
+ +#241')'#241')'#240')'#241'%)'#241#240'%'#241')'#241#241#240')'#240#241#237
+ +#240#237#241#240#241#236#241#240#241#236#241#241#240#241#241#240#241#240#241
+ +#236#241#240#237#241#0'POO))'#241')'#241'))))-)))))))))).))MR)M.--RM.MRQ.M.)'
+ +'RRQQRQRQ.MR-NQ*RQ'#5'-'#5'-'#5'-'#5'.M.Q*M'#5'-))))'#241')))'#241')))'#241
+ +'%'#241')'#241')'#241')'#237'('#241#241')'#241#241#241#241')'#241#240#241')'
+ +#241'%'#241#237'))'#241#241#240#237#240#241#241#241#236#241#241#240#237#241
+ +#236#241#237#240#237#241#240#237#241#240#237#208#208#208#241#241')'#241'))'
+ +#241')))))-)))-)R)Q)R-)Q.MRNQ-R-M.M.MR)Q.R)R-RQR-R-R-M.QR-RM.M-))N--))))))))'
+ +#241'))'#241')'#241')'#241')'#241')'#241')'#241')'#241#237')'#237#241')'#240
+ +')'#237')'#241'%'#241#240#241')'#241#241#237#240#237#241#241#241#241#236#241
+ +#241#240#237#241#240#241#241#240#241#241#241#236#241#241#0#237#240#203#203
+ +#203#241'()'#241'))-)))-)).)))))-*M)R-N-)-M.'#5'-R-RQR-RR-'#5'QRQRR-RRM.MR-N'
+ +'-R)Q.Q.MRM-'#5')).))))))))))))'#237')'#241'%'#241')'#236')'#241'))'#241'))'
+ +#241#237')'#240#241')'#241')'#237')'#241'()'#241#241#240#237#240#237#240#241
+ +#236#241#241#240#241#237#240#237#241#236#241#236#241#236#241#240#241#241#201
+ +#201#201')'#241#241')'#240'))))-))-)--))))--.-'#5'-MRM.QQ.MR)R)RM-NR-.M.MRQ*'
+ +'QRQ.MR-'#5'R-'#5'-'#5'-.)R)Q*M)))))'#241'))'#241')'#241'))'#241')'#241')'
+ +#241')'#241'%'#241#240')'#241#236'))'#241#241')'#236#241#241')'#241#240#237
+ +#241')'#241#241#241#241#241#241#241#241#241#236#241#237#240#241#241#240#241
+ +#240#241#241#240#241#237#240#236#196#196#196'-'#241'))'#241')'#241'))))-)))R'
+ +')--))'#5'-'#5'-M*-)-'#5'.MQ*Q.QR-R--'#5'QRQR-RQR-R)R-MR-RM.M.MM)*))))))))))'
+ +')))))'#241')'#241')%'#241')'#241')'#241')'#237#241')'#241#241#241'%'#241')'
+ +#241')'#240#237')'#241')'#241#240#237#241#240#241#237#240#241#236#241#241#240
+ +#241#241#236#241#241#237#241#236#241#237#240#237#241#190#191#191'U-'#241#241
+ +')'#241'))'#241'))))-)).)N-))-)R-MRMR)QR.QQR)R)RMR).Q.QR)R-'#5'-RQ)R-'#5'-.M'
+ +'-N).Q)R)))*)))))'#241')'#241')'#241')'#237'))'#241'%'#241'%'#240#241')'#241
+ +')'#241')'#241')'#240#241#241'%'#241#241')'#241'%'#241'%'#241#240#241#237#240
+ +#241#237#241#241#240#237#241#236#241#241#237#240#241#240#241#241#240#241#241
+ +#240#184#184#185'1V-)'#241')'#241')))-)))-))--)RQ))).))-)R))M.'#5'.QQ.M.QR)R'
+ ,'M.QR-N-N-R.QN-'#5'Q*M-M)N))R))))))))))))))'#241')'#241')'#241')'#241')%'#241
+ +'('#241'%'#240'%'#241'))'#241#240')'#237#240#241#241'('#241#241#241#240#241
+ +#241#240#241#240#241#241#240#241#241#240#241#241#237#240#237#240#237#241#236
+ +#241#241#180#180#180'V'#7'-))'#241'))'#241'))))))-))'#5'--R-R-Q)RQN-RQ.Q-M.R'
+ +'M-M.MR-RQ*QN-RQ.MQ.Q.Q.M-*M.))-))R))))'#241')'#241')'#241')'#241'))'#241'%'
+ +#240')'#241')'#241#241')'#237')'#241')'#241#241#241#237')'#241#241#241')'#241
+ +')'#241')'#241#241#241#237#240#237#241#237#241#236#241#237#240#237#240#241
+ +#240#241#241#241#241#240#241#241#236#206#206#206'UU1-'#241'))'#241'))'#241')'
+ +')))))-)-N-NQ.MR-RQRQRR-NRQ'#5'Q.R-R-)R)RQ.QN-NQ.'#5'-'#5'-'#5'-R)Q)M-*)))))'
+ +')))))))))'#241')'#241')'#241')'#237')'#237')'#241#241')'#241')'#241')'#240
+ +')'#241#237')('#237')'#237')'#237#241#236#241#240#241#241#240#241#240#241#241
+ +#240#241#241#241#237#241#237#240#237#240#237#241#236#241#204#204#204'1V'#7'V'
+ +'-)'#241')'#241'-))'#241'))))))))-QRQ.M-N-Q*-MR-)R-.MM.MMR-R-RM.Q.Q*Q-R-R-'#5
+ +'-R-*-'#5'QM.))))))'#241'))'#241')'#241')%'#241')'#237')'#241')'#240')'#241
+ +')'#241')'#236')'#237')'#241'('#241#241#241#241')'#241#240'))'#241#241#237
+ +#240#241#241#241#237#240#241#241#237#240#241#240#241#240#241#241#241#240#241
+ +#241#240#199#199#199'U1UUV'#245')))))))))))))))))-.Q.Q)R)QN-MR)RMQ.)Q..MN-'#5
+ +'-RQNQNQ.'#5'Q*M.Q.'#5'RM-)*))*))))))'#241'))))'#241')))'#241'))'#241')'#237
+ +')'#240#237')'#241#241')'#241#237#241')'#237')'#241#240')'#241#241#241#240
+ +#241#241#237#240#237#240#241#241#236#241#241#241#237#241#241#241#236#241#240
+ +#237#240#237#241#197#197#197'1VU2UU-'#241')'#241')-)-))))))).-'#5'-MR-R-M.-M'
+ +'.-Q.).MR)MQ.-RQR)R-R-.Q).Q-'#5'Q'#5'-).)R-))-))))'#241')))'#241')'#241')'
+ +#241')'#241')'#237#241'%'#241')'#241'))'#241')'#241#240')))'#241#240')'#237
+ +')'#241')'#237')'#241#241#240#241#241#241#241#237#240#241#241#236#241#240#241
+ +#236#241#241#241#237#241#241#241#240#192#192#192'UU2UUV1-)))))))-)-)-)-'#5'-'
+ +'-R-RMR.QM.M'#5'.MQN-)R-.M'#5'-*-RQ*QNQN.MR)R-.-R)M)'#5'-*))))))))))))))))'
+ +#241')))'#241')'#241'%'#241#241')'#237')'#237#241#241#237')'#241#241#241'%'
+ +#241')'#241#236#241#237#241#241#240#237#240#241#237#240#241#241#241#241#241
+ +#240#237#240#241#240#241#236#241#186#187#187'21U2UUV'#7'-'#241')'#241')-))))'
+ +')))))-'#5'-)Q.Q)R.M.Q).)-MR-'#5'M.-RQ'#5'-RQ.Q.QM.QR)RMM)).)-)M)))))'#241')'
+ +'))'#241')'#241')'#241')'#237'))'#241#240')'#237')'#241#241'$'#241')'#241#241
+ +')'#240')'#241#241'$'#241')'#241#240')'#241#240#241#240#237#241#241#241#240
+ +#241#241#241#240#237#240#237#241#241#241#241#237#241#241#240#184#184#185'UQ2'
+ +'UV2UVU)))))))-)-)))))-*Q)M.Q)R-M.QMRR-'#5'.Q-'#5'Q*)RM.MR)R.-R.MR-.)RMM.'#5
+ +'-).)))))))))))'#241')'#241')'#241#241'%)'#241')'#241'('#241')'#241')'#241'('
+ +#237')'#241')'#241')'#241'()'#241#241#241#241#241#241#241#240#241#237#241#236
+ +#241#237#241#241#241#240#241#236#241#240#241#240#241#241#210#210#210'12UU1U'
+ +#7'UV1-)'#241')-)))))-)-)))).--*Q-N-M..M-.QQ*-R)QR-MR-R-MM'#5'-'#5'-.M'#5'-)'
+ +'.-M-)*))))))'#241'))))))%)'#241')%'#241')'#241'%'#241#241')'#237')'#241'%'
+ +#241#241')'#241#236')'#241#241#237#241')'#241#236#241#236#241#240#237#241#240
+ +#241#241#241#240#241#240#241#241#241#241#241#241#241#241#241')'#206#206#206
+ +'UU12UV1VUV-)))))))-)))*))-)Q)'#5'--'#5'--*QM-NQ'#5'.-R'#5'-N)M.-'#5'-'#5'R.'
+ +'-R)RMR)-N-'#5'.)'#5'-))))'#241'))))'#241'))'#241')'#241'))'#241#241')'#241
+ +')'#241'%'#241')'#240#241')'#241')'#241#241')'#241#237'))'#241')'#241#241#241
+ +#241#241#241#241#240#241#241#240#241#241#241#241#241#241#241')'#241#241#241
+ +')*-'#200#200#200'12QU2UV1V'#7'V-)'#241')'#241'))))))-))))*--'#5')-.M-).M-.-'
+ +#5'M-Q.-R.MR-RQ)MRM.M.-N)-'#5'-))-)))))))))))'#241')'#241'))'#237#241')%'#241
+ +'$'#241')'#241')'#241#241')'#241#240#237')('#237#241')'#240#241')'#241#241
+ +#241#241#241#241#241#241#241#241#241#241#241#241')'#241#241')'#241#241')'#241
+ +'-)-R'#195#195#195'U12U1UU'#7'U'#7'UV-)))))))-))-).)-'#5'-).'#5'Q*MR).'#5'Q.'
+ +'-.'#5'-'#5'Q)R-'#5'.M.R-*Q)-'#5'-)R-M*-'#5')*))))'#241'))))))))'#241')))'
+ +#241#241')'#241')'#241'$'#241'%)'#241'%)'#241#241#241')'#241#241')'#241#241
+ +')-----)'#241')'#241#241')'#241')'#241'))'#241'))'#245'-*-RV'#193#193#193'1Q'
+ +'1U2U2UVUV'#7'U-'#241')'#241'-)'#241'))))))))))))-)--)-M-*MQ'#5'-R)R)Q*QM.M)'
+ +'NQ)N.Q*M)'#5'-)-)-)))))))))))'#241')))'#241')'#241')('#241')'#241')'#241')'
+ +#241#241')'#241#241')'#237')'#241'%'#240')'#237'))RRR-.--*)).).)*-)-))'#5'-.'
+ +'QV'#188#188#188'U21V1VU2U'#7'VUZU))))))))))))))-).)M*)'#5'-N).M-*-R)R)R)RM.'
+ +'M-R-)R-M)M).-*-'#5'-'#5'-))))))*)))))'#241'))'#241'%'#241#237')'#241'%'#241
+ +')'#241')$'#241#241')'#241'('#241#241')'#241#241')'#241'-VVVRRQ.--.)-Q.-).'#5
+ +'..-.Q.V'#182#183#183'-1U-U1UUV1'#7'VUV--)))))))))))-'#5'))-)--))-M))R-'#5')'
+ +'Q*Q)R)-N-R'#5'R-'#5')R).-'#5'QM)))))))))))))'#241'))))'#241')'#241')))'#241
+ +')'#241'%'#241'%'#241#241')'#236')'#237#241')'#236#241#241'%'#241')R~VzVVVRR'
+ +'.-R..Q..----.Q.R-'#178#178#246'1Q1V1V12UVUUV'#7'R-))'#241'-)))-))))-))*)'#5
+ +').M).M))Q).M-R)M.Q-N--M*Q).M)M).-)R))*)))))))))))'#241'))))'#241')'#241')'
+ ,#241')'#241'('#241')'#241')'#241#241'))'#241')'#241')'#241#241')V~~ZzVRRVQ.-'
+ +'R-R-R.RRQ..QRR'#173#173#173'12-1U-UU2U'#7'V'#7'U'#7'--))))-)))-))))-M--))).'
+ +'M-.M*-'#5'-*M.)Q'#5'.QR'#5'.Q)RM)R)RQ'#5'.)))-)))).)))))'#241'))'#241')'#241
+ +')'#237')'#241'$)'#241')'#241')'#237')'#241')'#241#241#237')'#241#240')'#241
+ +')~~~z~VV'#7'RRVRVR.R-R-..QR.-R'#168#168#168'1Q1U-VU2UV1VUV'#7'R-)))'#241'))'
+ +')-)).).)))'#5'-*Q)))'#5'-)M-RM-MR)R)N)-Q)R)).M.M*)M)).)'#5'-*)))))))))))))'
+ +#241')'#241')'#241#241')'#241'%'#241'('#241')'#236#241')('#241#241')'#237#241
+ +'QVZVVVVVVVQR2Q.QR.Q.RQ..-R.'#166#166#166'-1-2U11U1VU-'#7'V'#7'U.-)-))))))))'
+ +'))-*-)M-*M.M)-*-N).N-)R)Q-R'#5'.N-NQM.M-)-).M)))))-*)))))))))'#241'))'#241
+ +')'#241'))'#236')'#241')'#241#241')'#241'%'#241#241#241'%'#241')'#241'V~zVzV'
+ +'VVRRVRRRR.Q..Q..QRR-.'#161#161#161'1-U-1V-V1U2'#7'UUV'#7'U-)))-))))-))))-M.'
+ +'-)-)).-'#5'-M-M-MR-M.'#5'Q-QM-N-.QRRRM)NM.))))))))))))))'#241'))'#241'))'
+ +#241'%'#241')'#241#241')'#241')'#237#241')'#241')'#237')'#241')'#241')V~ZzVV'
+ +'VVVVRVQVQRRQ.RQ..-*-)'#155#155#155'1Q21-1U1U2UU2VUVV--)'#241')))-)))-)*)))'
+ +#5'-'#5'-))M)M.).M.)'#5'.Q).'#5'.-R-Q'#5'.Q))*-)-)))))-*))))))))))))'#237'))'
+ +#241')'#241')%'#241')'#241')'#240#241')'#240')'#241#241'$'#241'-~~~~VVzVVVVR'
+ +'VRR2RRR-..).'#241'))'#150#150#150'--1Q1U.1V1U2UU'#7#7#7'U)-))'#241'))))-)))'
+ +'-*-)-)M.M.).)Q'#5'-)R)QM.MQ-R'#5'-'#5'.Q*)R-M)*Q*).)'#5'-)))*))))'#241')'
+ +#241')'#241')'#237')'#241'%'#241#241'('#241'%'#241')%'#241')'#237'))'#241#241
+ +'R'#130#162'~~~~VVVVVVVRVQR.-*-)))))'#241#144#145#145'11-1.11U1Q2U2'#7'VUV'#7
+ +'.))))))'#241')))-)))).).-)-)M)M*Q*Q)R).M-.'#5'-Q.-MRQ.M).M-))))-)))))))))))'
+ +'))))'#241')'#241')'#241'))'#241')'#241')'#241#241#241')'#241#240#237#241')~'
+ +#167#8#131#130'~~~~zZzVVVRR.).))))))))'#8#8#175'--1-U--2U2U1U1U2UVU---))))))'
+ +'))))-)--'#5'-*M.-.-)Q)*Q)R-.'#5'M.M.'#5'R-*MQ*Q)*)R)))M.)))-)))))))'#241'))'
+ +')'#241')'#241'('#241')'#237')'#240#241'))'#241#241')'#241')'#241')'#130#171
+ +#170#167#166#131'~'#130'~~zVVRQ.)))M.)))))))'#169#169#169'1--1-1V1-U1VU2UV'#7
+ +#7'VQ)))'#241'))))))-)*))'#5'-)Q)-'#5'-'#5'.)R)-N-'#5'-Q.QR)Q)RQ.)Q*Q)Q)M-N.'
+ +'))*)*)))))))))'#241#237')'#241'%)'#241')'#241#241')'#237#241#240')%'#241')'
+ +#241'))'#171#213#171#166#167#130#166'~~ZVR-.)).-*-)))))))'#164#164#164'--1-'
+ +'2Q1-U21U2UVUUVU2-)-)))-)))))-)--)-*-N-*--M-MR)-RM.RM)R)R)-N)R)R).).))))))-)'
+ +'))))))'#241')'#241')))'#241')'#241'%'#241'))'#241')'#241'%'#241#241#241')'
+ +#237#241'-'#170#212#170#171#167#8#131#130'~~R.)*)).))))))))))'#241#162#162
+ +#162'1--1-1-111R1U1U2'#7'1VUR))))'#241'))))))))*M.)Q)-)-'#5'M.).)RM-RM-R.Q.Q'
+ +'RR)Q.M)-'#5'-'#5'-.--)R))-)*))))))'#241')'#241')'#241')'#241')'#241#236')'
+ +#241')'#241')'#241'('#241#241#240'R'#212#213#171#170#170#167#166'zVR-))-RR))'
+ +')))))))'#241')'#241#157#157#157'-1-1-1-V-11U2U2UVU'#7#7'1-)'#241')))'#241')'
+ +'))))-)-).-*)R)-.M-M.-R)-R)Q)R)R)QR)R)R-)*-'#5')'#5')-'#5'-*))))))))'#241')'
+ +#237')'#241'%'#241')'#237')'#241')'#237#240')'#241')'#237')'#241')Q'#212#171
+ +#171#171#167'~V..))'#241')))))))))'#241')'#241')'#241#241')'#155#155#155'---'
+ +'-1-1-1R-2U1U1U2UVVQ-)))'#241'))))))))))-'#5'--)-'#5'-.M.M-'#5'-R)R).Q.-R)M)'
+ +'Q*-'#5'-M)R--)R-))))))))'#241'))))'#241')))'#241#240')'#241#241'))'#241#237
+ +#241')'#241')'#241'V'#171#170#171#166'~R-'#241')'#241')))))'#241'))))'#241')'
+ +#241')'#241')))'#150#150#150'-1-1--1Q111U-2UVVUVU'#7'-))'#241')))))))-)-*-)-'
+ +')'#5'-*-)M-)-N-R)RQ.M.Q'#5'-R.QR-'#5'-.-N-)'#5'-*)*)))))))))'#241')'#241')%'
+ +#240#241'))'#241'%)'#241#241#241')('#241#241#241#237'V'#170#167'~V.))))))'
+ +#241'))'#241')))'#241#241'))))))))'#176#177#177'-----1-1.U-2U-U1U1V1V'#7'-))'
+ +#241')))'#241')))))))*)-))-M.).M.Q.)Q).Q-'#5'.Q*)M.'#5'-'#5'-'#5')-'#5')-N-)'
+ +'-))))))'#241')'#241')'#237'))'#241'))'#237#241')'#241#241'('#237')'#241#241
+ +')$'#241')Z'#167'~V))'#241#241'))'#241')'#241')'#241')'#241')'#241'))))))-))'
+ +#241#8#8#212'-1-1--1-1-U-2U2U2UUVUVU-)))'#241')))))))-)--*)Q*)M)--'#5'-MR.Q'
+ +#5'R)QM.QR)Q*Q).Q.-))R-'#5'))))*))))))))'#241#241')'#241'))'#241')'#241'%'
+ +#241')'#241')'#241#241#241#241')zV.)'#241#241')))'#241')'#237'))'#241')'#241
+ +#241')-)'#241'))))))'#241#165#165#165'-----1--1-11Q11U1V1U2U'#7'.)'#241'))))'
+ +')))-))))'#5'--)--.-'#5'.)R)-M.--R.-M.M.Q))RQ'#5'-'#5'.RQ*--*-)))))))))'#241
+ +')%'#241')'#241#241#237#241'('#241#241#241'('#241'%'#241')'#237#241'-))'#241
+ +'))'#241')'#240')'#241')'#241#240#241#241#241'))))))'#241')))'#241#241#160
+ +#160#160'-1--1-11-.U-11R1V1UVUUVU-)))'#241'))))))).)-))*-'#5'-'#5'-M-Q.QR)Q'
+ +#5'.QM.M-N)R)R))N)Q)-'#5'-'#5')'#5'-)))))'#241')'#241'))'#241')%'#241'()))'
+ +#241'))'#237')'#241')'#241#241'))'#241')))'#241')'#241#237')'#241#240#241#241
+ +#241'))'#241'))))'#241#241#236#241#241#241')'#158#158#158'---1----11-1R11Q1V'
+ +'1U2VU'#7'2)'#241'))'#241'))))-)))-*--)-)-).)*M.)R-.M-.M.Q-R)R)R-)Q.N)-)--))'
+ +'))))))))'#237')'#241')'#241')'#241#241#241#241'%'#241#241')'#241#241#240')'
+ +#240#241#241')'#241')'#241')'#241#241')'#241#241#237#241'))))'#241#241'))))'
+ +#241#241#240#241')'#241#153#153#153'-----1----1-1Q21U-V1UU2U'#7'U)'#241'))))'
+ ,#241'))-)-'#5'-'#5'-.M.M*QQ-.M.MRQ.'#5'-M.'#5'-'#5'-M.M*Q*Q)N)R'#5')-.))))))'
+ +#241'))'#241'%'#241')'#237'))%'#241#241'('#241#241')'#237')'#241#237')'#241
+ +')'#241'%'#241#241'%'#241#241#241#240')'#241#237')'#241'))%'#241')'#241#241
+ +')'#241#241#241'))'#151#151#151'----1--1-1-1-11Q2U1UV1UVUV-)'#241')'#241')))'
+ +')))))-))M-))-)*)M-M-.'#5'-Q*Q)-R-R-R)-M.M.--))-'#5')))))))))'#241')))'#240
+ +')'#241#241#241')'#241#241'%)'#240')'#241#241')'#241')'#241')'#241')'#241#240
+ +#241#240#237')'#241#241'('#241'))'#241#241#240#241'))'#241#241'))))'#178#178
+ +#178'--1-----1--1-V-11-UV1VV1VUV))'#241')))))))-))-).))R-N-Q-.-.M-M.M.MR)R'#5
+ +'-'#5'-M*Q))R'#5'.)))-)))))))'#241'))'#241#241#241')'#241'))'#241'%'#241')'
+ +#241#241#241#240'%'#241')'#241#240#241#240#241#241#241#241#241')'#241'))'#241
+ +#241#241#241#241#241')'#241#241#240'))'#241#241#241#241#172#173#173'----1-1-'
+ +'--1-1-1R1V11Q1UUVU'#7'1))'#241'))'#241'))))-*)-)R-))-).'#5'-'#5'-M..M-Q.-*Q'
+ +')R-.RQ)R))Q).)M*)))))))))'#241')%)'#241')'#236#241')'#240')'#241#241'%'#241
+ +')'#241#241#240#241'%'#241#241#241#237#240#237')'#240')'#241#241#241#236#241
+ +#241'))'#241#241')'#241')))'#241#241#241#170#170#171'--'#245'----1-1---1-1-1'
+ +'R12U21UV2UV-)'#241')))))))-)))).Q*Q)-Q.M.-M-.'#5'-'#5'Q)R-'#5')M)*Q.M.))M.)'
+ +')))))))'#241'))%'#241#241')'#237'))'#241#241')'#241')'#240#241')'#241')'#241
+ +')'#241#241#241#241#240#241')'#241#241#241#241#240#237#241')'#241#240#241'))'
+ +#241#241#241#241')'#241'))'#241#165#165#165'-----------1--1-1Q1U-1UV1UUVU-))'
+ +#241')'#241')))-)).)-M--).M*M)-N-.M-.Q*-M.Q.Q.M)M.M.M.))))))))'#241'))'#241
+ +#241'))'#241')'#241#241')'#237')'#241#237')'#241#241'$'#241#241#237#240#241
+ +#240#241#241')'#241')'#241'%'#241#241#241#241#241#241#241')'#241')))'#241')'
+ +#241#241')))'#160#160#160'-----1--1-1--1-U.11.UUV1UV2UV---)'#241'))))))-))).'
+ +'M.M-)Q.-R)Q'#5'-RM*-M.M)'#5'-'#5'-R.M))))M).)))))))'#241'))%'#241'))'#241'%'
+ +#241'('#241#241')'#241'))'#241#241#240#241#241#237')'#241#237#240#241#241#240
+ +#241#240#241#240#241'QR)'#241#241#241')))'#241#241')))'#241#154#154#154'----'
+ +'--------1-1-1-U-211Q2UUVUV-)-)'#241')'#241')))))-))-).M.))M)R-R))-R-.M-R-.M'
+ +'.M)R-N-.))).))))'#241')))'#241#241')'#236#241')'#241')'#241#241')'#241#240
+ +#237#241#241')'#241#241'('#241#241#241')'#241#241#237#241#241#241#241#241#241
+ +'))'#241')'#241')'#241')'#241'))'#241#240#241')'#149#149#149'-'#245'---'#245
+ +'-1--1----1-1-U-R12U2U1VU--)-))))'#241'))))-*-M-)Q.--.))-R-'#5'-'#5'Q.'#5'-'
+ +#5'Q)M.M))-'#5')))))))))))'#241'))'#241'))'#241')'#241')'#237')'#240'%)'#241
+ +')'#241#240#237#241#241#241#240#241#241#241'('#241#240#241#241'))'#241')'#241
+ +').)'#241#241#241')-)'#241')'#241')'#147#147#147'------------1-1-1-2-11Q11U1'
+ +'VUV--))-)'#241'))))))))).)-))'#5'-'#5'-R))R-R-.'#5'Q.-R-R).-N)))-*)))))))))'
+ +#241'%)'#241')'#241'%'#240#241')'#241#241#241#241')'#241'$'#241#241#241#241
+ +#236#241#241#240#241#241#241#241#241')V)'#241#241#241')Q)'#241')'#241'))))'
+ +#241#241#241#174#174#174'----------1------1-U1Q1VQ1VU1V-))'#241'--))'#241')'
+ +#241'))))-)-.M.--M.)QR)-'#5'-M--R'#5'-'#5'.Q)'#5'-M).M)))))))'#241')'#241')'
+ +#241#241')'#237')'#241')'#241')'#241'%'#241')'#236#241#241#241#241'('#241#241
+ +#241#241#237')'#241#241#240#241')))-)'#241')'#241')Q)'#241')'#240#241')))'
+ +#241#168#169#169'---'#245'----------1-1-1--2-12U-2UU1-))))-)))))))))-'#5'-))'
+ +'M*-)Q.)QR)R-R'#5'-Q.MM-R)).)))))))))))))'#241')%'#241')'#241')'#241'%'#241
+ +')'#240')'#241')'#241#241#240#237#241')'#241#240#241#240#241#241'R.)'#241#241
+ +')~z)'#241#241')RQ'#241#241#241')))'#241')'#166#166#167#245'------'#245'1---'
+ +'1------1-U-U-1V1V1R-)'#241'))-)-)'#241')'#241')))))).--)R).M.)QR-'#5'-R)R-.'
+ +')*M.M))-*))))))))'#237'))'#241')'#241')'#240')'#241')'#241#241')'#241#241
+ +#241')'#241#241#241#241#240#241#241')'#241#241')'#130#166'))'#241')zV))'#241
+ +')))'#241')'#241#241#241#241')-'#161#161#161'----------------1-1-1-11.U-U1UU'
+ +'-))'#241')'#241'-))))))'#241')))-)'#5'-)--M)Q*-)R-R-R-'#5'QRQ)M-*-'#5'-))))'
+ +')))'#241')'#241'))'#241'%'#241'%'#241#241#241'('#237#241')'#240'%'#241#240
+ +#241#240#241#237#241')'#241#241#241')UR)-)'#241')'#241'-V)'#241#241#241')Q)'
+ +#241')'#241'))'#156#156#156'-'#245'-'#245'-'#245'-----1--1----1-1.Q11U2-V1.)'
+ +#241'))))---))))))-))-)R)'#5'.-.QMR-'#5'-'#5'-'#5'-.))).M))))'#5'-))))))))'
+ +#241#237')'#241'))'#241')%'#241'))'#237#241#241#241#241'%'#241#241#241#240
+ +#237'-R)'#241')'#241'R~-'#241#241#241'Mz)'#241#241')))'#241')'#241#241#241
+ +#240#154#154#154'-----------------1----11Q2-1U-U1))'#241')'#241'))))--)))))-'
+ +'*-))---'#5'M.-*Q.R-RQ*QM.M)*Q)*))))))'#241'))'#241#241'))'#241'('#241#241'%'
+ +#240#241#241#241#240#241')'#241#240#241#241#241#240#241#241#240'R'#170'R'#241
+ +#241')-~)'#241')'#241#241')'#241'))'#241#241#241')R))'#241#241#149#149#149'-'
+ +#245'------'#245'--'#245'---1--1-1---1Q1R1V1--)'#241'))'#241'))-))--)))))).-'
+ +#5'))--'#5'-Q)Q)R)M-*-M.-M*M-M-)))))'#241')%)'#241')'#241'%)'#241#241'))'#241
+ +'%'#241#241#240#241#237#241#240#241#241')'#241#241')Q)-)'#241')'#241')VQ'#241
+ +#241#240')R-)'#241#241')))'#241#241#241#139#139#139'---'#245'---------------'
+ ,'---1-1-111-UV-'#241')'#241')))'#241'))-)-))))-)))-).M.-M*Q.Q-R-.MQ*-'#5'--)'
+ +'*)*))))))'#241')'#241')'#237')'#241#241')'#241#237#241')'#241#241'%'#241#241
+ +#241#240#241#241')VR'#241#241#241')~z'#241#241#241')VQ'#241'))'#241'))'#241
+ +'))'#240#237#241')-)'#134#134#134'-----'#245'-'#245'---------1--1--1-1.Q-V1-'
+ +'-)'#241')'#241')'#241'))))'#241')-.)))))-)-M)-'#5'.Q.M)R).MQ*-'#5'-.)'#5'-)'
+ +'-))))'#241')'#237')'#241')'#241')'#241'%'#240')'#241'('#241')'#240#241#241
+ +'('#241')'#237#241')'#130'~)'#241#241')RQ'#241')'#241'))'#241')-'#241#241#241
+ +#241'QR'#241#241#241#241')Q'#241#128#129#129'--'#245'-------'#245'---'#245'-'
+ +'-----1----111-2U-))'#240')'#241'))'#241')))-)--))-))*))R)Q)Q).Q)RM.)-'#5'-'
+ +#5'M))-'#5'))))))))'#241')'#237')'#241')'#241#241'%)'#241#241#237')'#241#241
+ +#237#241#241#240#241#241'M-M-)'#241#241#240'R~)'#241#241#241'-R)'#241#241'))'
+ +'))'#241')'#241#241#241')~~'#245'--'#245'-'#245'------------1---1-1---U-1.1'
+ +'-'#241')'#241')'#241'))'#241'))))))-))))-)-).).)R)R-).M.M-*-.-'#5'-)))))))'
+ +#241'))'#241')'#241'('#237')'#241#241#241'%'#240#241#241#240#241#240#241#241
+ +#241')'#241#240#237#7#167'-'#241#241#241'Qz)'#241')'#241'))'#241')))'#241#241
+ +#241'R)'#241'('#241#241'yyy--------'#245'----------------1-1.1Q1Q-)'#241#241
+ +'('#241')'#241'))'#241')-)-)-)-))))))Q)Q)-M.QM-M.)MQ'#5'-))))))))'#241')'#241
+ +'))'#241'%'#241#241#241'$)'#241#241#241')'#241#237#241')'#241#236')'#241#241
+ +#241#241')Q))))'#241#241')Q)'#241#241#241')VQ'#241#241'))Q-)'#241#241')ttt-'
+ +#245'-'#245'--'#245'---'#245'--'#245'------1---1--1-1-1--)'#241')'#241')'#241
+ +'))'#241'))))))))))-)-*-).-.M.-M.-.)M-*-.M)*))))'#241')))'#241'%'#241')'#241
+ +'))'#241#241#240'%'#241#236#241#241#241#240#241#241#241#241#237#240#241#241
+ +#241')'#170'V'#241#241'))zQ'#241#241#241')))'#241')'#241#241#241#237')R)'#241
+ +'rrr-------'#245'------'#245'--'#245'----1--1--1-1.U-'#241')'#240')'#241')'
+ +#241')))'#241')'#245')-)-))))))))-'#5'--'#5'-R-'#5'Q).'#5'-'#5'))-))))))))'
+ +#241'))'#241')'#241#240#237'))'#241#241')'#241')'#240#241#237#241#241#241'('
+ +#241')'#241#236#241')zQ)'#241#241#241')'#241')))'#241#237#241'QR)'#241#241
+ +#241'QV)'#241#141#141#141#245'-'#245'-'#245'----'#245'-'#245'--------------1'
+ +'---1-1-)'#241'%'#241')'#240')'#241#241'))))))-)-)))-)-*--'#5')-'#5'-R).M--M'
+ +')-*)))))))'#241'))'#241')'#241#241'%)'#241#241#241'%'#240#241#241#237#241')'
+ +#240#241#240#237#241#241#237#241#241#241#241#241#241'QR)'#241#241#241'QV)'
+ +#241')'#241')Q)'#241')'#241'))'#241')'#9#9#139'------'#245'-------'#245'----'
+ +'-'#245'-------1--1-U)'#241')'#241#240')'#241')))'#241')))))))))))))))'#5'--'
+ +'*-))-M-N).-'#5'-)))))'#241')))'#241')'#241'(%'#241#241')$'#241#241#241')'
+ +#237#240#241#241#241#237')'#241#241#241#240#241#241#240#237#241#240'V~)'#241
+ +')'#241'))'#241')'#241')'#241#241#241'M-)'#241#241')Q'#134#134#134'-'#245'-'
+ +#245'-'#245'--'#245'---'#245'----'#245'------1--1--1-1.-)'#240#241'%'#241')'
+ +#241')'#241'))'#241'-)-)-))))-)-)--'#5'-).-N-*)-)'#5'-))))))))'#241')))'#237
+ +')'#241#241')'#241#241#241')'#236#241#240#241#241'$'#241#241#240#241#240#237
+ +')'#241'%'#241#241#241#241')'#241#241')'#241#241#241#236')R-'#241#241#241')Q'
+ +'))'#241#241'))'#128#129#129'----------'#245'------------------1---U-'#241
+ +#241'('#241#241')'#240'))'#241'))))'#241'))-))))))-'#5')))-'#5'-)Q)-'#5'))))'
+ +'*))))))))'#241')'#241')'#241'('#241#241'%'#241#241#241#241#237')'#241#241
+ +#241#241')'#241#241#241#241#240#241#241')'#240#237#241#240')R)'#236')'#241')'
+ +'Q)))'#241'))'#241')))'#241#241'zz{'#245'-'#245'-'#245'-'#245'-'#245'---'#245
+ +'--'#245'-'#245'------------1-1--)'#241#241'('#237#241')'#241'))'#241')'#241
+ +'-)-))-)))))-))-*)-M.).'#5'-)R))))))))))'#241')'#241')'#237')'#241'%'#241#240
+ +')'#236#241#241#241#236#241'%'#241#240#241#237#240#241')'#241#240#241#241')'
+ +#241#241'%'#241')'#241#241#241#241#240#241#237'-Q)'#241#241#241')Q'#241')'
+ +#241'uuu----------'#245'---------'#245'--'#245'---1-----1-))'#241#241')'#240
+ +#241')'#241'))))))))-)-)))-))-))Q*)-M--))))))))))))'#241')))'#240'))'#241#241
+ +')'#241#241#241#241#241#240#241#241#240#241')'#237#241')'#241#237#241#237')'
+ +#241#241#240#241#241#240#241#241'))'#241#237')'#241'-z'#241#241')'#241'))'
+ +#241#241#241'ppp-'#245'-'#245'-'#245'-'#245'-'#245'--'#245'-'#245'-'#245'-'
+ +#245'----------1--1-1-'#241#240')'#240')'#241')'#240'))'#241')'#241'-)-)))))'
+ +#241'))-*-))-Q*))'#5'-*))))))))))))'#241#237#241')'#237#241')'#240#237#241
+ +#240#237'('#241#241'%'#241#237#241#240')'#241#241#240#241#241#241#236#241'))'
+ +#241#241#241#236'))'#241#240#241#241')'#241#241')'#241#241#240#237#241'M)nnn'
+ +'-------------------------'#245'----1---1-)'#241#237#241#237')'#241')'#241')'
+ +'))))))-)-))))))))-)*)-*Q))))))))))))'#241')'#241')))'#241#240')'#237')'#241
+ +#237#241#241#241#237#241#240')'#240#241#241#241#236#241#241')'#240#241#241
+ +#241#241#241#237#240')'#241#241#241#241#241#241#240#241#237')Q)'#241#241'))-'
+ +')'#137#137#137#245'-'#245'-'#245'--'#245'-'#245'-'#245'-'#245'-'#245'--'#245
+ +'--'#245'----------1---'#241'('#241'('#241'('#241#241')'#241')'#241')-'#241
+ ,'))))-))-)-)-*-))))).)))-))))))))))'#241#241#237'))'#241#241#240#241#240#241
+ +#241#241#240#241#241#237#241')'#236#241#241')'#241#241#237#241#241#236#241')'
+ +#241#241#241#241#240'%'#241'))'#237#241')'#241'))'#241#241#241#240#237#241
+ +#135#135#135'------'#245'----------'#245'-----'#245'----------1-)'#241#241
+ +#241#241#241')'#241#240')'#241'))'#241')-)-)))-)-)))))-).))))))*)))))))))))%'
+ +')'#241#241')'#237#241#241#241#241#236#241#241'%'#240#241#241#241#241#241#241
+ +#240#237#241')'#240')'#241#241#236#241')'#236#241#241#241#240#241#241#241#240
+ +#241#241#241#241')Q'#241#241')'#241#130#130#130'-'#245'-'#245'-'#245'---'#245
+ +'-'#245'--'#245'-'#245'---'#245'----'#245'-'#245'------1--'#241#240'%'#240')'
+ +#240'))'#241')'#241'))))'#241'))'#245'))-*)))-))))))))))))))))))))'#241')'
+ +#241#240#241'%'#241#240#241#240#237#240')'#241#240#241#241#241'$'#241#237#240
+ +'%'#241#241#240#241#241#241#240#241#241#241#241')'#241#241#241#241#237')'#241
+ +')'#237#241#241'())'#241#241#241#240'|}}-------'#245'----'#245'-----'#245'--'
+ +'-'#245'-------'#245'-1--1-)'#241#241#241#237#241#241#241')'#241'))'#241')-)'
+ +'-))))---)))-).))))))))))))))'#241')'#241')'#241')'#237')'#240#241#241#237
+ +#241#241#241#237#241#241#237#240#241#241')'#241#241#241#240')'#241'%'#241#241
+ +'%'#241#241'('#241#241#241')'#236#241#240#241')'#241#241#240#237#241#241#241
+ +#241')'#241#241'zz{'#245'--'#245'-'#245'--'#245'-'#245'--'#245'-'#245'---'
+ +#245'----'#245'------------'#241'('#241')'#240')'#241')'#240')'#241'))'#241
+ +')))-)-'#241')-)))))))-)))-))))))))))))'#241')'#241')'#241#237#240#241#240
+ +#241#240#241#241#240#241#241#241#237#240#241#236')'#241#237#241#240#241#241
+ +#240#241')'#237#241#241'$'#241#241#241#241#241#241#241#240')'#241#241#241#240
+ +')'#241'M)'#241'uuu--'#245'----'#245'---'#245'-----'#245'---'#245'-'#245'--'
+ +#245'--------1--'#241#241#236#241#241')'#240#241')'#241')'#241'))'#241')))))'
+ +')))-))))))))))))))))'#241')))))))'#241')'#240#241#241#241#241#237#241#241
+ +#241#241'%'#240#241#241#241#241')'#241#240#241')'#241#237#241')'#241#241#240
+ +#241#241#241#241#240'))'#237#240#241'%'#241'))'#240#237#241#241')'#241#241'p'
+ +'pp-'#245'---'#245'----'#245'---'#245'-'#245'--'#245'--------'#245'---------'
+ +#241#240')'#241')'#240#241')'#241'))'#241')'#241')-)-)))'#241'-))))-))))*-))'
+ +')))))))'#241'))'#241')'#241#237#241#241#241#236#241#240#241#236#241#240#241
+ +#241#237'('#241#237#240#237#241#241#237#241#240#241#237#240')'#241')'#237#240
+ +#241#237')'#241#241#241#241#241#241#240#241#241#241#241#240#241#241')'#138
+ +#138#138'---'#245'--'#245'-'#245'---'#245'----'#245'--'#245'-'#245'-'#245'-'
+ +#245'--'#245'---'#245'--1-'#241#241#241#240#241#241')'#241#241')'#240')))))'
+ +#241')'#241'))))-'#241'-))-))-)))))))))'#241'))))))'#241#240#237#240#241#241
+ +#241#241#241#241#237#241#237#240#241#237#240')'#241#241')'#241'('#241')'#241
+ +#241#241#237')'#241#241#241#241#241#241#240#241')'#241#240#241#241#241'))'
+ +#241#237#241#241')'#133#133#133#245'---'#245'----'#245'---'#245'-'#245'--'
+ +#245'------------'#245'------)('#241#237'('#241#240')'#240#241')'#241#241#240
+ +#241')))))'#241')'#241')))'#241')))))-*-)))))))))))))'#241#241#241#237#240
+ +#241#240#237#240#241#240#241#241#241#241#241#241#237#240#241#236#241#241#241
+ +#237#241'('#241#241#241#240')))'#240#237')'#241'%)'#241#236#241#241#237')'
+ +#240#241#240#237#241#131#131#131'--'#245'---'#245'----'#245'-----'#245'--'
+ +#245'-'#245'-'#245'--'#245'---------1-'#241#241#240#241#241')'#241')'#241#241
+ +'))))'#241')'#241')'#241')))-)))-)))))))))))'#241')))'#241')))'#241#236#241
+ +#240#241#241#241#237#241#241#241#241#241'('#237#240')'#240#241#241')'#241#241
+ +#237#241#240')'#237')'#240#237#241#241#237#241#241#241#241#241#240#241#241
+ +#241')'#241#240#241#241')'#241#241#241#7'~~-'#245'---'#245'-'#245'--'#245'--'
+ +'-'#245'-'#245'--'#245'------'#245'--'#245'--'#245'------'#245#240#241'('#237
+ +#240#241#240')'#240')'#241#241#241')))))'#241')'#241'))'#241'))))-))-)))'#241
+ +')))))))'#241#241#236#241#241#237#241#241#236#241#240#241#236#241#236#241#241
+ +#241#241#237')'#241#237#240#241'('#241')'#241#241#241#241#241#241')'#240')'
+ +#241#241#240#241#241#241'))'#241#236#241#241'%'#241')'#241#240'xyy---'#245'-'
+ +'---'#245'---'#245'-----'#245'-'#245'-'#245'-'#245'---------'#245'-----'#241
+ +#237#241#241#241')'#241')'#241#241')))'#241')'#241')'#241')))))-))-))-))))))'
+ +')))'#241')'#241')'#241#240#241')))'#240#241#241#241#237#241#241#241#241#241
+ +')'#236#241#241#236#241')'#241#237#241#241#237#241#240#237')'#241#236#241#241
+ +#236')))'#237#240')'#237#241#241#241#241#241#241#241#240#241#241'vvw'#245'--'
+ +'--'#245'---'#245'---'#245'-'#245'---------'#245'--'#245'-'#245'---------('
+ +#241#240'%'#240#241#241#240')'#241#240#241')'#241'))'#241'('#241')'#241'-'
+ +#241')'#241'))-))-))))))'#241')))))'#237#241#241'V-'#241#237#241#240#241#240
+ +#241#236#241#241#236#241#241#240#241')'#240#241#241')'#241#240#241')'#241')'
+ +#241')'#241#241#241#241#241#237#241#241#241#241#241#240')'#241')'#240#241')'
+ +#237'))qqq--'#245'-'#245'-'#245'-'#245'--'#245'-----'#245'-'#245'-'#245'-'
+ ,#245'---'#245'----'#245'--'#245'-----'#241#241#240#241')'#236#241#241')'#241
+ +')'#240')'#241#241')'#241')'#241'))))))-)-))))-)))))'#241')'#240#237#240#241
+ +')V-*-)'#241#237#241#241')'#241#236#241#241#237')'#237#241#237#241#240#241'%'
+ +#241#241#236#241#241#236#241#241'$'#241')'#241#240#241')'#241#240#241#241#237
+ +'))'#237#241#240#241#241#241#140#140#140'-'#245'--------'#245'---'#245'-'#245
+ +'---'#245'-----'#245'---'#245'----------'#241#240#237#241#240#241#241')'#240
+ +')'#241#241')'#241')'#240')'#241')))'#241'-)-))))'#241'-)))'#241'))'#241')'
+ +#241#241#241#241')-.)~-'#241')'#241#240#237#240#237#241#241'('#241#240#241
+ +#240')'#241'%'#241#240#241')'#241#241')'#241#241')'#241#241#236#241#241')'
+ +#237')'#241#237#240#241#241#240#241#241#241#241#241#241#138#138#138'--'#245
+ +'-'#245'-'#245'-'#245'---'#245'----'#245'-'#245'--'#245'-'#245'---'#245'---'
+ +#245'-'#245'---'#245'-'#245')'#241')'#240#241'%'#240#241#241#240')'#241')'
+ +#241'))'#241'))'#241#241'))))-)-)))))))'#241'))'#241')'#241#236#241')VR-~R)'
+ +#241#241#241#241#241#240#241#241#237#241#241#241#237#241#240#241#241#241#241
+ +'('#241#237#241#240#241#241#241')'#241#241#237#241#241#240')'#241')'#241#241
+ +#241')))'#237#240#241#133#133#133'-'#245'-------'#245'---'#245'--'#245'----'
+ +#245'----'#245'--'#245'---------)-)'#240#241#237#240#241#241#236#241#241#241
+ +'('#241#240#241#241')'#241'))))'#245'))'#241'))-)-)))))'#241')'#241#240#237
+ +#241#240#241'QRVV-)))'#241#241#241#237#241#240#241#240#237')'#240#241#237#240
+ +')'#237#241#237#241'('#241#241'%'#240#237#240'))'#241#240#241#237#241')'#241
+ +#240#237#241#240#237#241#241')'#241'---'#245'-'#245'-'#245'---'#245'---'
+ +#245'--'#245'-'#245'--'#245'-'#245'--'#245'--'#245'-'#245'-'#245'---'#245#240
+ +#245')'#241#240#241#237'('#241')'#236#241#241#241')'#241')'#241#241#240#241
+ +')'#241')))-)-)))'#241'))'#241'))'#241')'#237#241#240#237#241'R-V~-'#241'-)'
+ +#241')'#241#241#240#237#241#241#241#241#241'%'#241#241#241#240')'#241#241#241
+ +'%'#241#241#241')'#241#241#241#240#237#241#241#240#241#237#241')'#241#241#241
+ +#240')'#241#241#7'zz--'#245'------'#245'----'#245'--'#245'----'#245'---'#245
+ +'--'#245'-------'#245'--'#241')-'#240#241#237#240#241#241#236#241')'#236')'
+ +#240')'#241#240')))'#240'))'#241'-))))'#241')))'#241'))'#241#241#241#241#240
+ +#237#241#241'--.V)'#241'V)))))'#241#241#241#236#241#236#241#241#240#241'%'
+ +#241#241#240#237')'#241')'#240#241#241#237#241#237')'#241')'#240#241#241'))'
+ +#241#241#240')'#241'%)'#240'tuu'#245'---'#245'-'#245'-'#245'-'#245'-'#245'--'
+ +#245'--'#245'-'#245'--'#245'-'#245'-'#245'---'#245'--'#245'-----)'#241#241
+ +#241#241#240#241#237#240#241#237#240#241#237#241#240#241')'#241#241#241')'
+ +#241')))'#241')'#241')))'#241')))'#241')'#237'('#237#241#241#240#237'-.QV.QR'
+ +')-Q).))'#241#241#241#241#236#241')'#241#240#241#237')'#241#241#240#241#237
+ +')'#240#241'('#241#241')'#241')'#237')'#241#240#241')'#237#241#241#241#237
+ +#241'rrs-'#245'-----------'#245'--'#245'----'#245'------'#245'---'#245'---'
+ +#245'-'#245'-'#245'('#241')'#236#241#240#241#237#240#241#237#240')'#241#241
+ +')'#240'))'#241')'#241')'#241#241'))))'#241'))'#241')'#241')'#241#241#241#241
+ +#236#241#241#240')V-VQVV'#241'-.)-R'#241')'#241')'#241#241#241#236#241#241
+ +#241#241#240#241#237')'#241')'#241'%'#241#241')'#240#241#237#241#241#240#237
+ +#241#240#241')'#241#241#240#241')m'#5#5'---'#245'-'#245'-'#245'-'#245'-'#245
+ +'---'#245'--'#245'-'#245'--'#245'-'#245'-'#245'--'#245'---'#245'------'#241
+ +#241#240#241')'#241#241#240#241#241#240#241#237#240')'#236#241#241#240')'#241
+ +')'#241'))'#241')'#241')'#241')'#241')'#241#241'$'#241'('#241#240#241#241#236
+ +#241#241'R-V-VR).)'#241'-'#130'Q))'#241#241#241#241#241#241#236')'#240'%'#241
+ +#240#241#241#240#241#241#241#237#241#241#241'('#241')'#241#241')'#241'%'#241
+ +')'#236#241#241#241'ddd--'#245'----------'#245'---'#245'----'#245'-----'#245
+ +'----'#245'---'#245'---'#245'('#241#241#240#237#240')'#237'('#241#237#240')'
+ +#237#241#241'))'#241#241')))'#241')'#241')'#241'))'#241'%'#241')'#241#241#237
+ +#241'%'#241')'#241#241')V-VRV-)V)'#241'QV'#241#241'-)-)'#241#241#241#241#241
+ +#241#241#241#241#237')'#237')'#241'()'#241#236')'#241#237'('#241#241#236#241
+ +#241#240#241#241#241#241#240'bbb'#245'----'#245'-'#245'-'#245'-'#245'--'#245
+ +'-'#245'-'#245'-'#245'---'#245'-'#245'--'#245'-'#245'---'#245'---'#245'--'
+ +#241#240#241#240#241#241#240#241#237#240#241#241#240#241'('#241#236#241'))'
+ +#240#241#241')'#241')'#241')'#240#241')'#241#240#241#241#241'('#241#241')'
+ +#241')'#241#241'-RV-Q.-V'#241#241'R.))~R)))))'#241#241#241#241#240')'#241#240
+ +#241#241#237#241#241')'#241#241#241#241#237')'#241')'#241#241#241'))))'#241
+ +']]]-'#245'-'#245'------'#245'--'#245'-----,-'#245'-----'#245'----'#245'---'
+ +#245'----'#245'-)'#241#237#240#237#241#240#241#237#240')'#241#241#241')'#241
+ +#241#241#241')'#241'('#241')'#241'('#237')'#241#241')'#241#237'('#237#241')'
+ +#241')))-).QV.-R-V))V)'#241'VV-'#241#241')'#241'-)'#241')'#241#241#241#241
+ +#241#241'('#241#241#237#240'%'#241')'#240#241')'#241')'#241'$'#241#241#241')'
+ ,#241#241'[[[----'#245'-'#245'-'#245'---'#245'-'#245'-'#245'-'#245'-'#245'--'
+ +#245'--'#245'--'#245'-'#245'--'#245'---'#245'----'#241#240#241#241#240#241
+ +#237#240#241')'#237#240')'#241#240#241'('#241'('#241')'#241')'#241')'#241#241
+ +#241'('#237#240#241')'#241#241')'#241'))'#241')---V-VQV-V--V-'#241'RU)'#241
+ +'-~.))-)*)'#241#241#241#241#241#241'('#241')'#241#241#240#237#241#241#241#236
+ +#241#241#241#241#240#237'))VVV--'#245'--------'#245'-----'#245'----'#245'--'
+ +#245'--'#245'----'#245'---'#245'---'#245'--'#245#241#240#241#237#240#241#240
+ +#237#240#241#240#237')'#241#241#237#241#241#241#241#236#241#240#237#240')'
+ +#237#241')'#237#240#241')'#241')'#241#241#240')R2).QR.U*VR-V-'#241'VV'#241'-'
+ +'~~-'#241'-RR-)))))'#241#241#241#241#241#241')'#241')'#241'$'#241#241'))'#240
+ +#237#241#241')'#237'PQQ'#245'--'#245'-'#245'-'#245'-'#245'---'#245'-'#245'--'
+ +'-'#245'-'#245'--'#245'--'#245'-'#245'-'#245'---'#245'---'#245'------'#241
+ +#241#240#241#237#240#241#241#237')'#240#241')'#240')'#240'%'#240')'#241')'
+ +#241')'#241#240#241#240#241#241'%'#241#240#241#240#241#241#241#241'-Q.-.V-R-'
+ +'QV.VR)UR'#241')V.'#241')R--R.QVR--)'#241')'#241#241#237#241#241#241#241#241
+ +')'#241#241')'#241')'#240#241#241'JJK-'#245'--------'#245'-----'#245'-'#245
+ +'---'#245'--'#245'------'#245'---'#245'-----'#245'-----'#241#240#241#237#240
+ +#241#240#241#237#240#241#237#241#241#241#237#240#237#240#237#240#241#237#241
+ +#237#241#240#241#241#237#241#241#240#241#241#241'.-)-QVQV.-V-VR-VV)'#245'-))'
+ +'-VRV--VVRR.RV-)--))'#241#241#241#241')'#241#241#241#241#241')'#241'eee---'
+ +#245'-'#245'-'#245'-'#245'--'#245'-'#245'----'#245'-'#245'-'#245'---'#245'-'
+ +#245'-'#245'--'#245'---'#245'-'#245'---'#245'----'#241#240#241#241#236#241
+ +#237#240#241#237#240#241#236#241#240#241#241#241#241#241#236#241#240#241#236
+ +#241#237#240#241#240#237#241#241#241')-R-.-.Q.Q-V-R1*VR-)R'#241#241'-V.-RVV'
+ +#7'R-R-VVR.~'#166'~.-))'#241#241#241#241#241#241#241#240'```--'#245'-----'
+ +#245'--'#245'----'#245'-'#245'-------'#245'------'#245'---'#245'--------'#245
+ +'---'#241#241#236#241#241#240#241#237#240#241#236#241#241#241#236#241#236#241
+ +#236#241#241#237#236#241#241#240#241#237#237#240#241#241'-QV-.-R-.R-.V-RV)-.'
+ +'-)V)'#241#241#241')-RVVVVVVVVRV~V~'#131'~VVV).))))'#241#241'^^^'#245'---'
+ +#245'-'#245'---'#245'-'#245'-'#245'----'#245'-'#245'-'#245'-'#245'-'#245'-'
+ +#245'-'#245'---'#245'----'#245'-'#245'-------'#241#236#241#0#236#241#236#240
+ +#237#241#241#240#237#236#241#236#241#0#241#0#0#240#241#236#241#237#240#241
+ +#240#241#241')RZ~-))-R--R-VQ-R-*U.)V-)'#241#240#241#241')))RVV~'#130'~~'#130
+ +#209'~-~~~~RZzVV-VRRYYY-'#245'-----'#245'-------'#245'-'#245'--------------'
+ +#245'---'#245'-'#245'-----'#245'---'#245#241#237#240#0#241#0#0#241#0#240#0
+ +#237#0#240#241#0#241#0#241#240#237#241#236#241#241#240#241#237#240#237#240
+ +#241'-'#7#247#247'.-)--R-R-V.-VQ-R-'#241'V.)'#241#241#241#241')'#241#241')-V'
+ +'~~R~'#171#130'R.V'#166#166'V)~~~'#130'VV'#130#131'WWW---'#245'-'#245'---'
+ +#245'-'#245'-'#245'----'#245'-'#245'-'#245'-'#245'-'#245'-'#245'-'#245'---'
+ +#245'-----'#245'------)'#241#236#241#0#241#0#236#241#0#241#0#237#0#241#0#0
+ +#237#0#240#0#237#0#240#237#241#236#241#241#240#241#241#241')UZ~V-)'#241'.-R-'
+ +'R-RQ-V.-.R)Q.-'#241#241')'#241#241#241#241#241#241'..V'#166#171#170').Q.'
+ +#175#171'-.V'#175#171'z-*V'#166'RRR--'#245'-----'#245'------'#245'-'#245'---'
+ +'------'#245'-----'#245'---'#245'-'#245'--'#245'---'#241#241#240#241#0#236#0
+ +#0#241#0#0#236#0#240#0#240#0#241#240#0#237#240#241#236#241#241#240#241#241
+ +#240#237#241#241')-V'#7#7'U-'#241')-.--.--V-.Q-RU'#241'.R)'#241#241#241'))'
+ +#241#241'-))-)Z'#130'R'#241'QR-'#166'V-.Q'#170#167'-.-V'#170'LMM'#245'---'
+ +#245'-'#245'----'#245'-'#245'-----'#245'-'#245'-'#245'-'#245'---'#245'-'#245
+ +'---'#245'--------'#245'-'#240#241#0#0#241#0#237#240#0#236#241#0#241#0#241#0
+ +#241#236#0#241#240#0#237#240#237#240#237#241#0#241#240#241')-1V~'#7'.))'#241
+ +'--.)-.-R-R.-.R-)R-'#241#236#241#241'-'#241'))-'#241'*-RV-'#241'.R.R'#241').'
+ +'*V-)-Rz'#212'jjk-'#245'-----'#245'-'#245'----'#245'-'#245'---------'#245'--'
+ +'----'#245'--'#245'-'#245'--'#245'--)'#241#241#0#241#236#0#240#0#241#0#0#0
+ +#241#0#240#0#237#0#241#0#0#241#237#240#237#240#241#240#241#237#236#241')-.Q'
+ +#7#7'V--'#241#241')--.)-)V--R)-.-'#241'U))'#241#241#241'))'#245#241'))-).UR'
+ +#241'-V-R-)--RV)*-.zeee---'#245'-'#245'-----'#245'-'#245'----'#245'-'#245'-'
+ +#245'-'#245'---'#245'-'#245'-'#245'--'#245'-------'#241#241#241#0#241#0#0#241
+ +#0#237#0#237#240#241#0#237#0#241#0#240#0#240#237#240#236#241#240#237#0#241#0
+ +#240#241#241'--Q'#7'Z'#7'Q.-'#241#241')-.--R-V-.-).Q.)R.'#241#241#240#241')'
+ +#241')).)'#241'.)RV)-R.V)).R-V)-R-V```--'#245'---'#245'-'#245'-'#245'----'
+ +#245'-'#245'---------'#245'------'#245'---'#245'--'#245')'#241#240#0#236#0#0
+ +#241#236#0#240#0#240#0#0#0#240#0#0#241#0#237#0#241#236#241#237#0#241#240#241
+ +#236#241')-R-2V'#7#7'---)'#241')--.)V-.--R)-V-)-))'#241#241#241#241#241')'
+ +#241#241'-))-.V-)RV-V'#241'.-.V).-)VZZZ'#245'---'#245'------'#245'-'#245'---'
+ ,'--'#245'-'#245'-'#245'-'#245'--'#245'-'#245'-'#245'---'#245'--'#245'--'#240
+ +#241#0#241#0#241#240#0#0#237#0#241#0#237#240#241#0#241#236#0#237#240#241#0
+ +#241#0#240#241#0#241#236#241#241'-1-1Q'#7#7'V.Q2)'#241#241'.)---.Q.)--).-).-'
+ +')'#241#241#241#241#241')-)'#241#241'.).z-'#241'RVRV)-R)V)-R.VUUU-'#245'---'
+ +#245'-'#245'-'#245'----'#245'-'#245'-'#245'-------'#245'------'#245'-------'
+ +#241#241#241#240#0#0#236#0#237#240#0#240#0#240#0#0#0#236#0#241#0#240#0#237
+ +#236#241#241#0#237#240#237#240#241'-.Q2-V'#7#7'U--U)'#241#241'--.-R-.-)..'
+ +#241'Q.'#241'-.))'#240#241')'#241#241#241')-))--VV)-R-.'#241').-V.).Q.SSS---'
+ +#245'-------'#245'-'#245'------'#245'-'#245'-'#245'---'#245'-'#245'-'#245'--'
+ +#245'-'#245'--'#240#241#240#0#237#0#237#0#241#0#0#237#0#237#0#241#240#237#0
+ +#241#0#236#241#236#240#241#0#0#240#241#236#0#241')1U--QUZ'#7'.-.R-'#241#241
+ +'))--.Q-.)---.-)-.)'#241#241#241#241')'#241')'#241'*)-.-VV'#241'.R-R)-).--)-'
+ +'.-'#5'NN-'#245'----'#245'-'#245'-'#245'----'#245'-'#245'-'#245'-------'#245
+ +'-----------'#241#241#241#0#236#0#240#0#240#0#0#241#240#0#240#237#0#0#0#241#0
+ +#240#241#0#241#241#0#241#236#241#0#0#241#241'-.-.U2V'#7#7'Q-Q1-'#241#241')--'
+ +'*-.-R--.)-.)'#241'R-'#241#241#240')'#241'))'#241'--*-*R'#7')-R2Q'#241').RQV'
+ +#241'.R-'#1'II--'#245'-'#245'------'#245'-'#245'-------'#245'-'#245'-'#245'-'
+ +'--'#245'-'#245'-'#245'--'#245'-'#240#241#236#0#241#0#241#0#237#0#241#240#0#0
+ +#241#0#0#236#241#236#0#241#0#236#241#0#240#237#240#241#0#241#240#241')-1Q1--'
+ +'UZ'#7'-.-V-)'#241#241'))-)---).-'#241')--)-))'#241#241#241')'#241#241')))-)'
+ +'-RV'#241')RUR-'#241'-R.V)-R-ffg-----'#245'-'#245'-'#245'----'#245'-'#245'-'
+ +#245'-'#245'-----'#245'-------'#245'---'#241#241#241#0#236#0#0#0#240#0#0#237
+ +#236#0#236#241#0#0#0#241#0#236#241#241#0#241#237#240#0#241#237#236#241#241'-'
+ +'---.U.U'#7'V---V-'#241#240#241'-'#241'--.-.--.)-R)'#241'.-)'#241#241')'#241
+ +')'#241#241#241'*-*--V-)RVVV))--R'#245#5'-.aaa-'#245'-'#245'-------'#245'-'
+ +#245'--------'#245'-'#245'---'#245'-'#245'-'#245'---'#241#241#241#0#0#240#0
+ +#241#0#237#0#241#0#240#0#241#0#0#236#241#0#240#0#241#0#0#241#236#0#241#237#0
+ +#240#241#241'---R-U--'#7'Z'#7'-----)'#241#241')).'#241'Q-)-).---.'#241'-))'
+ +#241#241#241')'#241')'#241')'#245')-).V-'#241'-V.Q).-*V)-.Q\\\------'#245'-'
+ +#245'-'#245'----'#245'-'#245'-'#245'-'#245'----'#245'--------'#245','#241#240
+ +#0#237#0#241#236#0#240#0#236#0#0#241#0#0#240#241#0#236#237#0#241#236#237#240
+ +#0#241#0#240#0#241#241')---1--.1VU-)))))'#241#241#240#241'--).--.)-)).)'#241
+ +'-.'#241#241#241')'#241#241#241#241'))'#241'-*-R-).RQV'#241').)V-)..ZZZ--'
+ +#245'-'#245'-------'#245'-'#245'-------'#245'-'#245'---'#245'-'#245'-'#245'-'
+ +#245')'#241#0#237#240#0#240#0#0#237#0#241#0#241#236#0#236#241#0#0#241#0#240
+ +#237#0#241#240#0#237#240#0#237#240#241#241'----.----UV-'#241#241')'#241')'
+ +#241#241#241'))'#241'-).)--.-)-)'#241')-))'#241#241')'#241#241#241')'#241')'
+ +#241'-)VV'#241'--.V))--.-)--UUU'#245'----'#245'-'#245'-'#245'-'#245'---'#245
+ +'-'#245'-'#245'------'#245'--------'#241#241#240#0#0#241#0#237#0#240#0#236#0
+ +#0#241#0#0#0#237#236#0#241#0#240#241#0#241#241#0#241#0#236#241#241')------.-'
+ +'-.1-'#241#241#241#241#241#241#241#240#241'-)-'#241'-).)-.'#241'--)--'#241
+ +#241#240#241#241#241#240#241#241')'#241').-QV'#241').QV-'#241').QV).ROOO--'
+ +#245'-'#245'--------'#245'-------'#245'-'#245'-'#245'--'#245'-'#245'-'#245'-'
+ +#241#240#241#0#237#0#0#240#0#240#0#237#0#241#0#0#240#241#0#240#0#241#0#241
+ +#237#0#241#236#0#241#236#240#241#241')------------)'#241#240#241#237#240#241
+ +#240#237#241'-).)-'#241'-))-)-*)'#241'.))'#241#241')'#236#241'))'#241'-)'#245
+ +')RV'#241')-VR)'#241')R-V'#241')-'#5#5'J------'#245'-'#245'-'#245'-'#245'---'
+ +#245'-'#245'-'#245'------'#245'------'#240#237#0#0#240#0#237#0#237#0#241#0
+ +#240#0#240#0#237#0#236#0#241#0#236#240#0#240#0#0#241#0#0#241#241#245'----.--'
+ +'---)--'#241#236#241#237#240#241#241#241#241#241')'#241'-'#241'-).-'#241'.)'
+ +#241'-)'#241'Q)'#241#241#241#240#241#241#241#241#241'))*-.V)'#241'.V--)--.V)'
+ +'-.dee-'#245'--'#245'---------'#245'------'#245'-'#245'-'#245'---'#245'-'#245
+ +'-'#241#241#240#0#237#0#240#0#0#240#0#236#0#237#0#237#240#0#0#241#236#0#241
+ +#241#0#241#0#241#236#0#241#240#241')----------'#241#241#241')'#241#241#241
+ +#240#241#237#240#237#240#241'-)-).-)-)-'#241')-)'#241'.'#241')'#241#241#241
+ +#241#240')'#241'))'#245')--R-'#241').RV'#241').)V)).bbc--'#245'--'#245'-'#245
+ +'-'#245'-'#245'----'#245'-'#245'-------'#245'-----'#241#240#241#0#0#240#0#237
+ +#0#241#0#241#0#0#240#0#0#0#241#0#0#241#0#236#0#241#236#241#0#241#0#236#241
+ +#241#241')-----.--'#245#241#236#241#241#240#237#240#237#240#241#237#240#237
+ +#241'--)'#241')'#241'-.'#241'-)'#241'.-'#241'--'#241')'#241#241#241#237#241
+ +#241#241'-)'#241'.)'#7'R'#241'-Q.-'#241')-)V.'#241')]]]-------------'#245'-'
+ +#245'----'#245'-'#245'-'#245'---'#245'-'#245')'#241#241#0#236#241#0#237#0#240
+ +#0#0#0#240#241#0#237#0#241#0#236#241#0#241#241#241#0#241#0#241#236#0#241#241
+ +')---------))'#241#236#241#241#237#241#236#241#241#236#240#241#240#241#241')'
+ ,'----)-)'#241'-)'#245')'#241')))'#241#240#241#241#240#241#241')'#241').)-RU'
+ +#241').UR)'#241').--)-XXX-'#245'-'#245'--'#245'-'#245'-'#245'-'#245'-----'
+ +#245'--------'#245'---'#241#240#0#241#0#0#0#240#0#0#237#240#237#0#0#0#240#0
+ +#236#0#241#0#240#240#0#236#0#240#241#0#0#241#240')-'#245'---------'#241#241
+ +#240#241#240#241#240#241#241#0#241#241#241#237#240#237#241'-.))'#241'-)'#241
+ +'))'#241')'#241#241'-'#241#241#241#241#236#241#241#241#241')-))'#241'RV'#241
+ +')-R.-'#241#241')-R'#241')VVV----'#245'---------'#245'-'#245'--'#245'-'#245
+ +'-'#245'-'#245'---'#245#241#240#241#236#0#241#0#237#0#241#240#0#0#0#237#0#241
+ +#0#241#0#241#0#241#0#237#0#241#0#237#0#241#236#241#241#245'----------1-)'#0
+ +#241#237#240#237#240#236#241#241#236#241#240#241#240#241')---'#241'.)'#241'.'
+ +#241'-)))-'#241')'#241#241#241#240#241#241')'#241')'#241').-V'#241#241'.-R-'
+ +#241')-.-'#241')QQQ-'#245'---'#245'-'#245'-'#245'-'#245'-----'#245'---------'
+ +#245'-('#241#241#0#241#0#236#0#240#0#0#0#237#240#0#240#0#236#0#236#0#236#240
+ +#0#241#0#240#0#237#240#0#0#240#241')'#241')-------'#241')-Z1'#237#240#241#241
+ +#241#237#241#236#241#240#241#237#241#237#240#241#241'-R'#245')-'#241'-)'#241
+ +'-'#241#241')'#241#241#241#240#241#237#240#241#241')'#241'--)-R)))V-)'#241
+ +#241')-V'#241')OOO---'#245'---------'#245'-'#245'---'#245'-'#245'-'#245'-'
+ +#245'---'#241#241#240#241#0#240#0#241#0#237#0#241#0#0#237#0#241#0#241#0#241#0
+ +#241#237#0#241#0#241#0#0#241#236#241#241#241'--------)'#241#240'-'#7'Q'#241
+ +#241#236#241#236#241#240#240#241#237#241#240#241#240#241#237#240')1R)-)-'#241
+ +#241')-'#241'-)'#241')'#241#241#240#241')'#241#241'))*)-.-'#241')-.-)'#241')'
+ +'-.)'#241'jjj-'#245'---'#245'--'#245'-'#245'-'#245'-----'#245'-------'#245'-'
+ +#241#241#240#237#0#0#0#237#0#0#240#0#236#0#237#240#0#236#0#0#240#0#237#0#240
+ +#0#241#236#0#240#237#0#241#241')---------'#241#240#241#241'--'#241#236#241
+ +#240#241#236#237#241#237#240#236#241#241#241#237#240#241#241')---'#241')'#241
+ +#241')'#241'))'#245#241#241#241#236#241#241#241#241')'#241')--)R-'#241').-)'
+ +#241#241').Q)'#241'dee---'#245'----------'#245'-'#245'---'#245'---'#245'---'
+ +#241#240#241#236#0#237#0#240#0#237#0#241#0#240#0#0#241#0#237#0#241#236#241#0
+ +#241#240#0#0#241#0#240#240#241#241#241')------)'#241')'#241#236#241'-'#241
+ +#241#241#237#240#237#240#241#236#240#241#241#237#240#241#240#241#236#241#241
+ +#241'-R-)'#241#241'))'#241#241'))'#241#241#241#241#241#241')'#241')'#241#245
+ +'*--R'#241')-R-)'#241')).-'#241'^^_------'#245'-'#245'-'#245'-'#245'-----'
+ +#245'---'#245'--'#245'-,'#241#241#0#241#0#236#241#0#0#240#0#0#237#0#241#0#0
+ +#236#240#0#0#241#0#240#0#237#240#0#236#241#0#237#240')'#241#241#245'------'
+ +#241#241#241#0#241'-'#241#240#241#240#241#241#236#241#241#237#240#237#240#237
+ +#241#241#241#241#240#237#240#241'--)-)'#241#245')'#241'-'#241')'#240#241#236
+ +#241#240#241#241#241'))-*--'#241')-.-'#241#241#241'--Q'#241'Y'#7#7'-'#245'-'
+ +#245'-'#245'--------'#245'-'#245'----'#245'-----'#241#241#240#237#0#240#0#0
+ +#236#241#0#241#0#240#0#0#240#241#0#0#241#237#0#240#237#0#236#0#241#0#0#236
+ +#241#241#241#241')-----'#241')--'#241#241#240#241')'#241#241#237#0#241#241
+ +#240#237#240#237#240#241#241#240#237#241#241#241#241#241#241#241')-R-))'#241
+ +')-)'#241#241#241#241#241#241#241#241')'#241#241')--V)'#241')Q.)'#241#241'-*'
+ +'-'#241'TTT-------'#245'-'#245'-'#245'-'#245'-----'#245'----'#245'-'#241#241
+ +#236#241#0#241#0#0#241#0#0#0#236#0#0#237#0#237#0#0#241#0#240#0#241#0#241#0
+ +#241#0#0#241#241#241#240#241#241'-----'#241')'#241'-'#7'-'#241#236#241#241'-'
+ +#241#0#240#237#240#237#240#241#241#241#237#240#237#241#240#241#241#236#241
+ +#236#241#241'--R-'#241')'#241')'#241#241#241#241#241#240#241#241')'#241#241
+ +')-.)R'#241#241#241'.-)'#241'))--'#241'RRR----'#245'------------'#245'---'
+ +#245'----'#240#241#241#0#236#0#236#0#0#241#236#241#0#241#0#240#0#240#0#237
+ +#240#0#237#241#0#240#0#240#0#237#240#237#240#241#241#241'-------'#241#241'-'
+ +#7'-'#0#241')U'#241#240#236#241#236#241#241#241#236#240#237#240#241#240#241
+ +#241#241#241#241#241#241#236#241#241#241'-)--)-'#241')'#241#240#241#237#241
+ +')'#241#241')'#241')-.--'#241')-.'#241#240#241')).)MMM'#245'-'#245'--'#245'-'
+ +'-'#245'---'#245'--'#245'-------'#245'--'#241#240#241#241#0#241#0#241#236#0#0
+ +#0#240#0#237#0#237#0#236#0#241#0#240#0#241#0#237#0#240#0#237#240#241#236#241
+ +#241'------)'#241#241'--)'#240#241'.-)'#241#241#0#241#0#240#237#241#241#240
+ +#237#241#237#240#241#236#241'('#241#241#241#240#237#240#241'))--)'#245')'#241
+ +#237#240#241#240#241')'#241')-'#241'-Q.))'#241')-)'#241#241#241'--'#241#215
+ +#215#215'----------'#245'---'#245'----'#245'-----'#241#241#241#236#0#240#0#0
+ +#236#0#241#0#237#0#0#240#0#240#0#241#0#236#241#0#241#0#0#240#0#237#0#240#237
+ +#241#241#241'-------'#241#0#241#241'-'#241#241'-U-'#241'--'#241#236#241#237
+ +#240#241#236#241#240#241#241#241#241#241#241#241#241#241#241#241#241#241#241
+ +#241#241'))'#245')))'#241#241#241#241#241#241#241')'#241')).--'#241#241')-.'
+ +#241#241')-*)BBB--'#245'---'#245'-'#245'---'#245'----'#245'---'#245'-'#245'-'
+ ,#240#240#236#241#0#241#0#241#0#240#0#236#0#240#237#0#241#0#237#0#240#241#0
+ +#241#236#0#237#0#241#0#241#241#241#240#241'-'#245'-----U'#241#240#237#241'-'
+ +#241#241'U-'#241#240'--'#241#0#241#240#241#236#241#241#241#237#240#241#241
+ +#241#240#241#241#240')'#241#240#241#240#241#241#241#241'))-'#241#241#240#237
+ +#240#241')'#241#241')'#241'---*'#241#241'))-)'#241#241')--<==----'#245'-----'
+ +'-----'#245'--'#245'-----'#241#241#241#241#0#0#0#0#0#237#0#241#0#241#0#0#236
+ +#0#0#240#0#241#0#236#0#241#0#240#0#0#240#0#237#240#241')-------2)'#0#241#236
+ +#241')--'#241#241#241#241')'#241#236#240#237#241#241#240#237#240#241#241#240
+ +#241#241#241#241')'#241#241#241')'#241#241#241#240#241#241#241#241')-'#241
+ +#241#241#241#241#241#241#241#241')).--'#241#241#241'.)'#241#241#241'-*-::;-'
+ +#245'----'#245'--'#245'-'#245'---------'#245'--,'#241#240#237#241#240#237#0#0
+ +#240#0#0#240#0#237#0#241#0#241#0#237#236#241#241#241#0#237#0#241#0#237#240
+ +#241#241#241#245'-)'#245'----U'#241#236#240#241#241'--'#241#240#241#241#241
+ +'-'#241#241#0#241#240#237#241#241#241#240#237#241')'#241')'#241#241#241#241
+ +#241#241'))'#241#241#241#240')'#241#241'))'#241#241#241#240#241#241')'#241
+ +#241'--R-)'#241#241'--)'#240#241')'#245')55'#7'----'#245'--------'#245'--'
+ +#245'--'#245'----'#241#241#241#240#0#0#0#240#237#0#241#0#0#240#0#0#0#240#0
+ +#240#0#241#0#0#240#0#240#0#236#0#241#236#241#240#241'-------1'#7'-'#241#241
+ +#241'-1-'#241#241#241#241'-1'#241#236#241#240#237#241#240#241#241#241#241#240
+ +#241#241#241#241')'#241')'#241#241#241#241#241')'#241#241#241#241')'#241#241
+ +#241#240#241#241#241')'#241#241')'#241')-R'#241#241#240')'#241')'#241#241')-'
+ +')000--'#245'-----'#245'--------------'#245#241#240#241#240#237#0#241#0#0#236
+ +#0#0#237#0#241#240#237#0#237#0#241#0#240#237#0#237#0#241#0#241#236#241#241
+ +#241#241'------'#245'-V-)'#245')--'#241#241')'#241')-)'#241#241#240#237#241
+ +#240#241#241#236#241#241#241#237#240')))'#241#241#241')'#241#241')'#241#241
+ +')'#241#241#241#241#241#240#241#241#241')'#241#241')-'#241'-.-)'#241#241')--'
+ +#241#241#241')'#241'***-----'#245'----'#245'-'#245'--'#245'-'#245'--'#245'--'
+ +#245'--'#241#236#0#0#0#0#241#0#241#0#240#0#0#0#0#0#240#241#0#241#0#236#0#240
+ +#0#0#241#0#241#241#240#241')--'#245'---)-11-'#241'--)'#241'-'#241'---'#241
+ +#241#236#241#240#237#241#236#241#241#240#241#240#241#241#240#241#241'))'#241
+ +#241#241#241#241')'#241#241')'#241')'#241#241#241#241#241#241#241#241')'#241
+ +')'#241')).-'#241#241#241'R-'#241#241')--%%%---'#245'--'#245'-'#245'--------'
+ +'------('#245'-'#241#241#240#0#241#236#0#240#0#237#0#241#236#0#241#0#0#236
+ +#241#0#241#0#241#0#237#240#0#236#241#240#241')'#245'-)--'#241'--'#241'---)-'
+ +#241#240#245#241')--'#241#240#241#241#237#241#240#241#241#236#241#241#237#241
+ +#241#241#241#241#241#241')'#241'))'#241#241#241')'#241#241'-'#241')'#241#241
+ +#241')'#241')'#241')'#241#241')--Q'#7'.-'#241')-'#241#241#241'.)CCC-'#245'--'
+ +'------'#245'--'#245'---'#245'---'#245'-'#245'--'#241#0#0#241#0#0#241#0#0#240
+ +#0#0#0#241#0#236#241#241#0#240#0#240#0#0#0#0#241#241#236#241')'#241'--'#245
+ +'-'#241'--)-)--'#241#241#0#241'))---'#236#241#241#240#241#240#241#237#240#241
+ +#240#241#241#240#241#236#241#241')'#241#241')'#241#241#241')'#241#241#241')'
+ +#241#241'-)'#241#241#241#241#241#241#241')'#241'-'#241'.-.VUV--R-))->>>-----'
+ +#245'--'#245'------'#245'---'#245'---'#241'--'#241#240#237#0#0#236#0#0#237#0
+ +#241#236#241#0#240#0#241#236#0#237#0#237#0#241#240#237#240#0#241#241#241#240
+ +')'#245')---'#241'-'#245'--'#241')'#240#237#241#241#241'1-'#237#241')'#241
+ +#241#241#237#241#240#241#241')'#241#241#241#241#241#241#240#241#241')'#240')'
+ +'))'#241#241#241')'#241#241')'#241#241')'#241'-))-))'#241')*---)).Q.UVU2-899'
+ +'---'#245'------'#245'-'#245'---'#245'-----'#245'-11)'#0#240#0#241#0#241#0
+ +#240#0#0#0#0#0#0#241#0#241#240#0#0#240#0#0#0#0#237#241#240#241#241#241'---)'
+ +#245')-))'#241'--'#241#237#240#0#241')-'#240#241#241#241#241#236#241#240#241
+ +#236#241#241#241#241#241#241#240#241#241#241')'#241#241#241#241#241#241')))'
+ +#241')'#241#241')'#241#241'))--.-.---Q.-.----.-RQ.667'#245'-----'#245'------'
+ +#245'----'#245'---)'#245'-1'#241#241#0#0#0#240#0#237#0#241#240#241#0#237#240
+ +#0#241#0#241#241#0#241#0#237#240#0#240#237#241#240#241'---'#245'--'#241'-'
+ +#241#241#241')--'#241#0#237#240#241#241#241#240')'#241#241#241#241#241#241
+ +#241#236#241#241#241#240#241')'#241')'#241#241#241#241')'#241#241#241#241#241
+ +')'#241#241')'#241'))'#241#241')'#241')--U.Q-.Q2Q-.1R--2--111----'#245'-----'
+ +'-----'#245'------'#245'-1-'#241#240#237#0#241#0#0#240#0#0#0#0#0#236#0#241
+ +#240#237#0#240#0#0#236#0#0#241#0#241#240#241'--'#241'-)-'#241'-'#241#241#236
+ +#241#245'-1'#241#236#241#0#237#240#241')'#241#241#240#241#241#241#240#241#241
+ +#241#241#240#237#241#241#241#241#240#241#241#241#241#241'-'#241#241#241#241
+ +')))'#241#241#241')'#241')'#241')'#245'.-.-.UV--.U.Q.UR-R,,,--'#245'-----'
+ +#245'--'#245'-'#245'-----'#245'-'#245')'#245'1-'#241#0#240#0#236#0#241#0#237
+ +#0#237#0#241#0#240#237#0#241#236#237#0#241#0#241#236#241#240#241#241#241#241
+ ,#241'---'#245'-'#241')'#241#240#241')-U-'#237#240#241#240#241#241#241#241#241
+ +')'#241#240#241#241#241#241#240#237#241#241#241#240#241#241#241#241')'#240
+ +#241'))'#241')'#241#241#241#241#241'))))'#245')'#245')))'#241'---.-VVUVU2UV1'
+ +'UV***-----'#245'---'#245'------------'#245'--1'#241#240#0#241#0#236#0#0#0
+ +#240#0#240#0#241#0#241#236#241#0#240#0#0#240#0#0#0#237#240#241')'#241#241'--'
+ +#241'))'#241'-'#241#241')'#241'-V1'#241#241')'#241#241#241')'#241#241#241')'
+ +#241#241#237#240#241')'#241#240#241#240#237#241')'#241#241#241#241')'#241'--'
+ +')'#241')'#241#241#241#241#241#241#241')'#241')-'#241'-))*-----.UVUVVVR'#7'E'
+ +'EE'#245'--'#245'--'#245'----'#245'--'#245'--'#245'-'#245'--'#241'-11'#241
+ +#237#236#0#241#0#241#240#241#0#237#0#236#0#237#240#241#0#241#0#237#0#0#241
+ +#236#241#241#236#241#240#241'----'#241#241'-'#241#240#241#241')'#245'-U-'#241
+ +#241'--'#241#241')'#240#241#241#241#241#241#241#241#241#241#241#237#241#240
+ +#241#241#240#241#241#241#241#241#241')'#241#241'-))'#241')'#241')'#241')'#241
+ +')))--'#245'-).-.Q.-R--QU1.???--------'#245'----'#245'--'#245'-----('#245'11'
+ +#241#240#241#0#0#236#0#0#0#0#240#0#241#0#240#237#240#241#236#0#0#240#237#0#0
+ +#240#0#241#240#241#241'---'#245')'#245')'#240#241')'#245')'#241')-1--'#241
+ +#241')'#241#241#241#241#241')'#240#241#240#241#241#241#241#240#241#241#241
+ +#241#241#241'))'#241'))'#245')--'#241'-'#7'V---)-'#241#241#241')'#241'))----'
+ +'----.Q2.-Q:::--'#245'--------'#245'---------'#245#245'--1-'#237#0#0#240#241
+ +#0#237#0#237#0#241#0#0#241#0#241#0#241#0#241#0#0#0#241#237#241#241#237#241'-'
+ +#241#241'--'#241')'#241#241')'#245')'#241'-'#241'-)'#241')'#241')'#241#241')'
+ +#241')'#241#241#241#241')'#241#240#241')'#241#241#241#240#241')'#241')'#245
+ +')'#241#245')'#241')'#241'-Z~'#7')--V.--))'#241')'#241')'#241'-.-.-.-.--Q.*U'
+ +#31'---'#13'---'#245'-------'#245'---'#245'--)'#245'11-'#240#236#241#0#0#0
+ +#240#0#240#0#0#236#241#236#241#240#241#0#0#236#241#0#241#0#240#236#241#240
+ +#241'-'#240')---'#241#240#241#241')'#241')'#241'-'#241#241'-'#241')'#241')'
+ +#241#241#241#241#240#241#241#241#241#241#241#241#241#241#241#241')'#241#240
+ +#241#241')'#241'))'#241#241#241'QZ'#7'-'#241#241#241#241'-UVQ2----)-'#241')'
+ +#241'-)---.-.-U'#31'U-----'#245'---'#245'---'#245'---'#245'----'#245')-1-'
+ +#241#0#0#237#0#241#0#237#0#241#0#0#0#241#0#241#236#241#0#0#0#240#0#236#241
+ +#241#236#241#241#241#241'---)'#240#241#245')'#241#241')'#241#241'))'#241#241
+ +#241#241#241#241')'#241')'#241#241#240#241#241#236#241#241')'#241#240#241#241
+ +#241#241#241')'#241#241#241#241'))-'#7#7')'#241#241#236#0#236#241#241'--QVV-'
+ +'V-V-Q)-))'#241'))-)-'#192#1#134'-'#245'----------'#245'----------'#245'111'
+ +#241#240#237#0#240#0#0#240#0#236#0#237#240#0#241#236#241#0#241#0#237#0#0#241
+ +#241#0#241#240#241#237#241'1-'#241#241#241#241')'#241#245')'#241#241')'#241
+ +#241#241')'#241#241')'#241')'#241#241#241#241')'#241#241#241#241#240#241#241
+ +')'#241#240#241#241#241#241#241')'#241'-'#241#241#7'~-'#0#241#0#241#241#241#0
+ +#240#241#241'--1RUVUV'#7#7'V--Q--))-'#0#2#243'-------'#245'--'#245'----'#245
+ +'--'#245'---'#245#245'-11'#241#236#0#241#0#236#237#0#241#0#241#240#0#241#236
+ +#241#241#236#0#240#0#240#237#0#0#240#241#241#241#240'--)'#241#241'-'#241')'
+ +#241'))'#241'('#241#241#241')'#241')'#240#241#241#241#241#241#241#241#241#241
+ +#241#240#241#241#241')'#241#241#241#241#241')'#241')-'#241')'#241')'#7'Z'#241
+ +#237#240#236#241#236#236#241#237#0#237#241'-R1V'#7'Z'#7'ZVUVUV'#7'V'#7#7'V@'
+ +#4'_--'#245'--'#245'-------'#13'--'#245'----1-)1-1-'#241#0#0#241#0#240#0#0
+ +#236#0#0#241#0#241#240#241#0#241#0#241#0#0#241#240#237#241#240#241#241'--'
+ +#241#241'---'#241#241#241#241#241#241#241#241')'#241#241#241')'#241#241#241
+ +')'#241#240#241#241')'#241')'#241#241#241#241')'#241')'#241')-)'#241'-)'#241
+ +#241'-'#7'-'#240#0#241#241#240#241#241#236#240#241#240#241')-V'#7'ZUVU'#7'V'
+ +#7'V'#7'V'#7#7'V'#7#128#5#203'-----------------------'#241'-11-'#240#241#236
+ +#0#241#0#237#0#241#236#0#0#241#236#241#241#240#0#0#236#241#0#0#237#240#241
+ +#237#240#241'-'#241#241'-1--)'#241'-'#241')'#241')'#241#241')'#241')'#241')'
+ +#241#241#241#241')'#241#240#241#241#241#241#240')'#241#241')'#241#241#241#241
+ +#241#241#241')'#241')V'#7#241#237#236#241#241#241')'#241#241#237#0#241#240
+ +#241'-VUV'#7'VV'#7#7#7#7#7#7'~'#7'Z'#7#192#7'8-------'#245'---'#245'-----'
+ +#245'1-'#245'-1'#245'-111'#241#240#0#241#0#0#240#0#0#0#241#236#0#241#240#241
+ +#236#237#0#0#0#0#237#240#241#241#240#241')'#241#241')-)---'#241')'#241#241
+ +#241#241#240#241#241#241#241#241#241#241')'#241#241#241#241#241')'#241')'#241
+ +#237#241#241')'#241#241')'#241')'#241#241')-'#241'-'#7'2'#241#240#241#236#241
+ +'.--'#241#240#241#236#241')-1VUZ'#7#7'Z~'#7'~'#7'~'#7#7#7'Z'#0#8#164'--'#245
+ +'--'#245'---'#245'-----------1--'#241'11-)'#0#237#0#240#237#0#241#236#241#0#0
+ +#241#240#237#241#241#240#0#241#0#237#240#241#241#236#241#241#241#240#241'-'
+ +#241#241'--1-'#241#241#241#241#241')'#241#241')'#241#241#241')'#241#241#240
+ +#241')'#241#241#241#241#241#240#241#241#241#241')'#241')'#241#241')--'#241'-'
+ ,#7')'#240#237#0#241'---'#7')'#241#0#241#241')1VVUZ'#7#7'Z'#7'ZZZZ'#7'V~'#7'@'
+ +#10#16'-1--1---------'#7#7'------1-'#241'-11'#245#240#0#241#0#236#0#0#0#0#241
+ +#236#0#241#240'))%'#0#0#240#0#0#241#236#241#241'))'#241#241'-'#241#240'----)'
+ +'M'#241#241#241#241#241#241#241')'#241#241#241#241')'#241#241#241#241#241'))'
+ +#241#241#241#241')'#241#241')'#245#241')'#241')-)R'#7#241#0#241#240#241'--V'
+ +#7#241#0#237#240#241'-V'#7#7'V'#7#7'VUV'#7#7#7'U'#7#7#7'Z'#128#11'|--------'
+ +#245'---'#8#255#255#255#246#130'-----'#247#255#255#7'1-'#241#236#7#255#255'1'
+ +#237#240#0#0#240#237'n'#253#253#253#253#253#253'J'#240#237#0#241#146#253#253
+ +#253'n-'#5#253#147'--Q'#253#253#253#253'r'#241#253#253#5#241'N'#253#253'M'
+ +#241#241')'#241')'#5#253#253#253#147')M'#253#253'-'#241#241')'#241')'#241')'
+ +#241'-'#7'-'#236#241#236#241#241#241')'#7'V'#236#241#236#241')Q1V'#7#7'VV'#7
+ +'VUVUVV'#7'V'#7#7#192#12#233'-'#245'----'#245'----'#175#246#255#255#255#255
+ +#255#175'---1'#130#255#255#7'1-'#241#240'Z'#255#255'-'#0#0#241#0'%'#253#253
+ +#253#253#253#253#253#253#253#0#0#240#146#253#253#253#253#253#146#147#253#146
+ +'-)'#253#253#253#147#147#253#146#253#253')'#241'n'#253#253')'#241#241#241#241
+ +#5#253#253#253#253#253#253#5#253#253')'#241')'#245')'#241')'#245#241'-V'#241
+ +#241#0#241#241'))1V-'#241#0#241#241'-'#7'V'#7'VU'#7#7#7#7#7'-V-U.UVU'#0#14'U'
+ +'---1------'#8#255#255#8#7#7#8#255#255#8'---'#134#255#255'U11-'#236#7#255#255
+ +'-'#236#241#236')'#253#253#253#146#5'))n'#253#253#0#237')'#253#253#253#5')n'
+ +#253#253#253#151#241'n'#253#253'N--'#5#253#253#253'M'#241#5#253#253#5#241#241
+ +#241')'#253#253#253'))M'#253#253#253#253#241')'#245')-)-)'#241'VU'#241#0#240
+ +#237#241'--VU'#241#236#241#240#241'-VUVUVZZ'#7'V'#7'V'#7#7'VU-V'#7'@'#15#193
+ +'-----'#245'---'#7#255#255#8'----'#8#255#255#7'-1'#130#255#255'--1-'#241#7
+ +#255#255'1'#0#0#0#147#253#253'n'#241#240#241')'#5#253#253#240#0#5#253#253'J'
+ +#240#241'-r'#253#253#146#241#147#253#147'---'#245#147#253#253')'#241#5#253
+ +#253')'#241')'#241'N'#253#253#5#241#241#241'N'#253#253#253#241')-)'#241'-'
+ +#241')-Z-'#236#241#237#240')--V-'#241#0#236#241'-V1VU2'#7'UUVU'#7'ZUVUVV'#7
+ +'V'#128#17'.1--'#245'-----'#134#255#246'1--'#245'-U'#246#255#134'--'#130#255
+ +#255'1'#241'--'#241#7#255#255'-'#237#240#5#253#253'n'#237#240#241#241'-'#5
+ +#253#253#0#241'n'#253#253')'#241'--'#237#253#253#147#240#253#253#146'--)-r'
+ +#253#253#5#241'N'#253#253#5#241#241#241#146#253#253'))'#241#241#241#253#253
+ +#253#241')'#241'))'#241'-)U'#7#241#0#236#241#241#241#241'-Q'#241#240#237#240
+ +#241'.UVUVUVV1V2UVUV'#7#7#7#7#7#192#18#154'---1---'#245'-'#246#255#175'--1--'
+ +'-'#175#246#246'--'#134#255#255'-'#0#245'1-'#7#255#255'-'#240#0#146#253#253
+ +#237#240#236#241#240#241#5#253#253#0#0#146#253#253#240')-'#241#240#253#253
+ +#146#241#253#253#146#241#241'-'#241'r'#253#253')'#241'n'#253#253')'#241#240
+ +#241#253#253#146#241#241#241')'#241#146#253#253#241#241#241#245#241')--.-'
+ +#236#241#240#241')--V1'#241#0#240#241')U'#7'V'#7#7'VUURUUVUV'#7#7'V'#7'Z'#7#0
+ +#20#6'-----1--U'#255#255#130'-----1'#134#255#255#7'-'#130#255#255'-'#241#241
+ +'-1'#247#255#255'-'#0#237#253#253#146#241#0#241#241#241'-'#5#253#253#0#241'n'
+ +#253#253#241#241#241#240#241#253#253#146#241'r'#253#253#241'))'#241'n'#253
+ +#253'M'#241'r'#253#253'%'#241#241')'#253#253'n'#241#241')'#245')'#146#253#253
+ +#241')-))-.-U'#241#241#0#241#237#245'U)'#7'V'#236#241#237#241#241'-V'#7#7'VU'
+ +'2V'#7#7'VVUV'#7'Z'#7#7#7#7'n'#2#211'1-1-----'#7#255#255#7'---'#245'--'#7#255
+ +#255#7'-'#247#255#255'-'#0#236#241'1'#247#255#255'-'#241'%'#253#253#5#0#240
+ +#237#240#241#241'r'#253#253#240#0#146#253#253#240#241#237#240#241#253#253'n'
+ +#241#5#253#253'n'#241#245'-r'#253#253'*-r'#253#253')'#241#241#5#253#253'r'
+ +#241'-'#241')'#241#146#253#253#241#241')---'#241'-.-'#0#241#236#240#241#241
+ +#241'U-'#241#0#240#241')'#7#7'.-UVQ'#7'V'#7#7#7'V'#7#7#7'~'#7'V'#7':'#10'''-'
+ +'---1---'#130#255#255'5--1---'#7#255#255#247'1'#130#255#255'1'#0#241#0#245
+ +#247#255#255'1'#0#5#253#253'%'#241#0#241#236#240#241'r'#253#253#0#237'n'#253
+ +#253#241#236#240#241'-'#253#253#146#241'-n'#253#253#150#5#241'r'#253#253#5'U'
+ +'v'#253#253'M'#241#241'M'#253#253#5#241')'#241#241#241#147#253#253')'#241#241
+ +#241#241'-)--)'#236#241#241#0#237#236#241#241#241#0#241#236#241'-VUQ2VU'#7'V'
+ +#7'V'#7#7#7#7'V'#7'Z'#7#7#7#6#17'{-1-1--1-'#8#255#255'-------1'#255#255#170
+ +'-'#130#255#255'1'#237#0#240#237#7#255#255'-'#237'n'#253#253'%'#0#240#0#241
+ +#241#241'r'#253#253#0#240#146#253#253#0#0#241#241'-'#253#253#146'--'#241'J'
+ +#253#253#253#253#253#253#253'N1n'#253#253#5#241#241')'#253#253'N))'#241')'
+ +#241#146#253#253#241'-)'#241')---.-'#241#236#0#241#240#241#0#0#240#241#236
+ +#241#241'V1V2UUVV'#7#7#7'V'#7'V'#7#7#7#7#7'Z~'#210#24#206'--------'#8#255#255
+ +'-1----1-'#255#255#212'-'#130#255#255'U'#0#0#237#0#247#255#255'1'#240#146#253
+ +#253#241#240#237#0#5#5#5#150#253#253#240#0#147#253#253#240#241#241#241#240
+ +#253#253#147'-'#241#241#240')n'#147#253#253#253#253'Q-'#5#253#253')'#241#241
+ +'%'#253#253'n'#241#241#241#241#241#146#253#253#241#241#241')'#241')-'#241'--'
+ ,#241#241#241#236#237#0#241#241#237#0#241#241'-1UVU'#7'V'#7#7#7#7'V'#7#7#7#7
+ +'V'#7#7'~'#7#7#159' "---'#245'1-1-'#8#246#255'---1'#245'---'#255#255#8'-'#130
+ +#255#255'U'#241#240#0#0#7#255#255'-'#237'n'#253#253#0#237#240#237#146#253#253
+ +#253#253#253#241#0'n'#253#253#0#237#240#241#237#253#253#146#241#0#236#241#241
+ +'-'#241#240#5#253#253'R'#241#5#253#253#5#241#240#241#253#253#146#241#240#241
+ +#241#241#146#253#253#241'-)'#241#241#241')-.--)'#241#241#240#241#236#236#240
+ +#241#241'-R-V-VV'#7'V'#7'V'#7#7#7'~Z'#7#7'~Z'#7'Z'#7'k''v--1-----'#212#255
+ +#255'-1---1--'#255#255#8'1'#130#255#246#247#241#0#241#236#247#255#255'1'#241
+ +#146#253#253#241#236#241#240'nn'#146'n'#146#146'-'#241#146#253#253#240#241#0
+ +#240#0#253#253#150#241#237#240#241'--'#0#241'n'#253#253#5#240#5#253#253#146
+ +#241#241#241#146#253#253#241#241#241#241#241#253#253#253')'#241'----)--)-)-)'
+ +#241#241#241#241#241')-U'#7'RQ--Q'#7#7#7#7#7'V'#7#7#7'V'#7#7#7'V'#7#7'7.'#201
+ +'-1----1-'#8#255#255'--------'#255#255#212'-'#247#255#255#175')'#240#0#0#175
+ +#255#255#241#240#146#253#253#237#240#237#240#237#241#241#240#241'--'#241'n'
+ +#253#253#237#0#237#0#241#253#253#147#0#240#241#241'-)'#241#240'n'#253#253#241
+ +#0'r'#253#253#253#5#241#241#5#253#253'N'#241')'#241#5#253#253#253#241#241'))'
+ +'-'#241#241'-)-.--)-.-)-VVV-1V1V'#7'V-VU2'#7#7#7'V'#7#7'V'#7#7#7#7#3'6'#29'-'
+ +'---1---'#8#255#255'--1-1--1'#255#255#8'-'#130#255#246#255#8#241#236#247#255
+ +#255#170#241#241#5#253#253#240#236#241#241#241#240#236#0#241#241'--'#146#253
+ +#253#240#0#240#0#241#253#253#146#237#241'))'#245#240#0')'#253#253#151#0#241
+ +'n'#253#253#253#253'NI)'#253#253#253'M'#241')'#253#253#253#253')'#241')'#241
+ +'-)'#241')--'#7'--V--U1V-U--VUV'#7'ZUR1VUR'#7'VUV'#7#7#7'~'#7'Z'#207'=q1-1--'
+ +'-1-'#247#255#255'1-'#245'----'#7#255#255#247'-'#247#255#175#8#255#255#255
+ +#255#255#255#7#0#241'N'#253#253'%'#241#236#241#240#241#241#237#236#240#241'-'
+ +#146#253#253#0#241#0#241#236#253#253#146#240#241'r'#253'n'#5'n'#253#253#253#5
+ +#0#241'r'#253#253'J'#253#253#253')N'#253#253#253#253#253#253#147#253#253#241
+ +#241#241#241#241')'#241'-)V'#7')'#241'-VQ.V1V1VUV1VUV'#7#7'z'#7'V'#7#7#7'V'#7
+ +#7'Z'#7'Z'#7#7#155'D'#197'---1----'#247#255#255#7'----1-'#7#255#255#130'1'
+ +#247#255#212'1'#8#255#255#255#255'^'#240#241#0'%'#253#253#5#0#241#0#241#236
+ +#240#241#241#0#241'-'#151#253#253#0#0#237#240#241#253#253'n'#241#241'r'#253
+ +#253#253#253#253#253'n'#236#240#241#5#253#147#240'n'#253#253'%)'#5#253#253
+ +#253#253'N'#146#253#253')'#241#241#241#170#241'V'#130#130#130#130'-'#240#241
+ +'--U-VUV-VUVUVUV'#7#7#7#7'~'#7#7#7'~'#7#7'~'#7'V'#7'gL'#24'-1---1-1'#7#255
+ +#255'^---1--'#247#255#255#7'-U'#7'U-1U'#7#247#245#236#0#0#0#241#253#253#146
+ +#241#0#237#236#241#237#240#236#241#236#241')Q)'#237#0#0#241#0'%%%'#241')-'
+ +#241'%JnN)'#241#0#241#241'MR%'#237#241')n)'#241#241'%'#5#5')'#241#146#253#253
+ +#241')-)'#8#241'-~'#8'~'#7'1'#237#241'-VU.-V1VV1V'#7'VUV'#7'V'#7#7'V'#7'V'#7
+ +'Z'#7'V'#7#7#7#7'3Sl----1---1'#255#255#170'--1---'#8#255#255'1-1--1--'#245
+ +#241#240#0#0#241#236#240'n'#253#253#237#236#241#240#241#240#0#241#241#240#237
+ +#241'--'#0#240#237#0#241#0#240#241#240'--'#240#237#240'-'#7#241#236#241#241
+ +#241'U'#241#237#240#241#241#241#241#241#241#240#241#241#241#240#147#253#253
+ +#241#241#241#241#8'))'#8#171#247#7#237#240#241'-2-Q2QVUUUVU'#7'V'#7#7#7#7'V'
+ +#7#7#7#7#7#7#7#7#7'V'#7#255'Z'#192'1-1---1--'#134#255#255'1----U'#255#246#175
+ +'---1-1-1-'#240#241#236#0#0#0#0'%'#253#253'n'#240#0#0#241#0#237#240#0#237#240
+ +#241#241'-)'#241#240#0#240#0#237#241#0#241#241#0#241#241'--'#241#0#241#241
+ +#241#241#240#240#241#241#241')'#241#241#241#237#241#241#241#241#146#253#253
+ +#241')'#241'-'#171#241'-'#8#130#7'Z'#240#237'--QV1--UV2V'#7'V'#7#7#7#7'V'#7#7
+ +'V'#7#7'V'#7'~'#7'Z'#7#7#7#203'b'#19'----1--1-'#7#255#255#134'----'#134#255
+ +#255#7'1-----1---'#241#241#241#0#241#0#0'n'#253#253'n'#241#0#237#240#237#240
+ +#237#240#237#240#241')'#245'-'#241#0#237#0#240#241#241#0#236#240#241'--'#241
+ +#240#236#241'--'#241#237#240#241')1-'#240#236#241#240#241#241#241#241#146#253
+ +#253#240#241#241')'#8#241'-'#175'U-'#8#237#241'--1RUV-2UU'#7'V'#7'V'#7'V'#7#7
+ +'V'#7#7'Z'#7#7'Z'#7'Z'#7'Z'#7#7#151'ig-1-1--1---'#8#255#255#247'11'#130#255
+ +#255#246'---11-1-1--'#245#240#236#0#236#0#241#236#253#253#253#146'M'#241#236
+ +#241'%'#241#0#240#237#240#241'---'#241#0#240#237#0#240#237#0#241#241'-'#241
+ +#240#0#241#241'--'#241#236#241#241'-'#7#237#0#241#241#241')'#241'-'#241#147
+ +#253#253#241#241#241'-'#175'UV'#246#241#241#246#240#241'-.Q-2V-UVVU'#7'VUV'#7
+ +#7'V'#7'Z'#7#7'~'#7#7#7#7'~'#7#7'Z?y'#128'1----1--1-1'#175#255#255#255#255
+ +#255#255#255#7'--1----1-1-'#241')'#241#240#0#241#0#0')'#146#253#253#253#253
+ +#253#253#253'%'#240#237#241#0#241#240'---'#241#237#0#240#237#0#240#241#241')'
+ +#241#0#241#241#241'U'#241#236#241#241#241'U'#241#240#237#241#241#241'-)'#241
+ +#241#146#253#253#241#241#241'U-V'#7'V'#0#240'-'#241')---2U-1VU1VVUV'#7#7'V'#7
+ +#7#7'~'#7'Z'#7#7'~'#7'Z'#7'~'#7'3p'#192'-1-1--1----1'#8#255#255#255#255#175#7
+ +'--1--1-1-1--'#245#240#241#241#0#236#0#237#0#237#5#253#253#253#253#253#253'r'
+ ,#237#240#0#241')'#245')'#245'---'#241#0#0#237#241#237#240#0#237#240#241')--'
+ +#241#236#241#241')-'#0#237#240#241#241'1-'#240#0#241#146#253#253')'#241')'
+ +#241#241'-'#7#241#237#240#237#241'-V1.UQV-V1V1'#7#7#7'V'#7#7#7#7'V'#7'Z'#7'~'
+ +'Z'#7'~'#7#7#7#7'''h'#0'----1--1-1-1-U'#247#247#7'1-1--1--1--11--'#245'('#241
+ +#241#0#240#0#240#0#241#0'%'#5#5#5'%'#0#241#237#240#236#245'----U--'#241#0#240
+ +#241#241#0#241#0#236#241#245'-'#241#241#240#241'-1'#241#241#236#241#241')'#7
+ +#241#241#236#241#146#253#253'-'#241#241#241#241'UU'#0#241#0#240#241'--UU.1-V'
+ +'UVQV'#7'V'#7#7'V'#7'V'#7#7#7#7#7#7#247#7#7'~'#7'Z'#7#27'_@-1-1--1------1-1-'
+ +'---1---1--1---'#245'-'#241#241#240#241#0#237#0#0#0#240#0#241#0#241#0#240#0
+ +#240#237#241#240'-1---1U-'#241#240#237#240#241#0#236#241#240')-'#241#236#241
+ +#241'1V'#241#0#240#241#241'--'#241#0#240#241#241'UZ)'#240#241')-Z)'#241#236
+ +#241#241#241')-V2-UR1VU'#7#7'VUV'#7#7#7#7#7'V~'#7'Z'#7#7'~'#7#7'Z'#7#7#15'V'
+ +#128'1----1---1-1-----1-1---1---1-1---'#241#240#241#241#240#0#236#241#0#237#0
+ +#236#0#0#240#0#241#241#237#240#237#241'-1-111V1)'#241#0#236#0#241#241#237#241
+ +#240#0#241#241'-U-'#0#241#241')-V'#241#240#237#241#241')'#7'-'#0#241#241')-U'
+ +#241#240#0#241#241')-2--QV1VU2'#7'VUV'#7#7'V'#7#7'V'#7#7'Z'#7#7'~'#7'Z'#7#7
+ +'~-'#3'M'#192'-1-1---11---1-1-1-1-1-1--1--1--'#245'-'#245')'#241#240#241#240
+ +#0#0#240#0#0#241#0#241#0#237#240#241#240#241#240#237#241'--1VU1U1)'#241#241#0
+ +#241#240#241#0#241#236#241#241'1V'#240#237#240#241#241'U-'#0#237#240#241#241
+ +'V-'#240#237#240#241')2-'#241#0#241#240#241')-U--2UV-'#7'UVUV'#7#7'VUV'#7#7#7
+ +#7#7'~'#7'Z'#7#7'ZZU'#241#247'E'#0'--1-1----1-----1-----1--1-11-1--'#245'-'
+ +#245')'#241#241#241#241#236#0#241#0#0#0#236#0#0#237#0#241#236#241#240#237#241
+ +'-11'#7'1V11-'#241#236#241#241#0#241#0#236#241')-'#241#241#0#241')'#241#7'-'
+ +#241#0#241')-'#7#241#241#0#241#241#241'U'#241#0#237#236#241#241'-'#7'V--V--Q'
+ +'2Q2UV'#7#7#7'V'#7#7'~Z~'#7#7'~'#7'~'#7#7#7#241#236#235'<@1-1--1-1--1--1--1-'
+ +'1-1--1----11---'#240'-'#241#240#241#240#241#241#0#0#240#237#0#241#0#241#0
+ +#240#0#241#0#241#240#237#240')1U'#7'1U'#7#7'1-'#241#241#236#0#241#240#241#241
+ +#241#236#0#240')'#241'--'#241#0#240'-)'#7'U'#241#0#236#241#241'-2'#236#0#240
+ +#241#241'-~U'#241')V1U.1Q2U'#7'UV'#7'V'#7#7'V'#7#7#7'Z~'#7#7'Z'#7'~U'#241#241
+ +#223'3'#128'----1-1--1-1---1-1-1-1--11-11---'#245'-'#245'-'#241#241#241#241
+ +#240#236#237#0#0#240#0#236#0#241#0#237#0#240#241#0#241#241#240#241'-1'#7#7'V'
+ +'U2U-'#241#241#240#236#241#241#0#240#0#241#241#241'-1)'#0#241#241'-'#241'Z-'
+ +#241#236#241')-U'#241#240#241#237#241')'#7#7#241#237#240'--VQ-V'#7'QV'#7'V'#7
+ +#7#7'V'#7#7#7'~'#7#7#7'~'#7#7'Z-'#241#0#211'*'#192'1-1--1--1---1-1--1----1--'
+ +'-1--1--'#245#245')'#240#245'('#241#240#241#241#240#241#0#0#241#0#236#0#240#0
+ +#0#237#0#237#240#241#241#240#241')11'#7'1'#7'UV1)'#241#241#241#236#241#0#241
+ +#0')'#241')'#7#240#237#240#241'))1'#241#0#241#241#241'-V'#241#236#0#240')-Z'
+ +#241#0#240#241'-V-'#7'V-V'#7#7'V'#7'UV'#7#7#7'~'#7#7'V'#7'V'#7'Z'#247#7'-'
+ +#237#240#199'"'#0'-1-1-1-1-1-----1--1-1--1-1-1-1--)-'#245')'#241#245#241#241
+ +#240#241#237#240#241#0#0#241#0#241#0#237#240#0#240#0#237#240#241#241#241#240
+ +#241'-U'#7#7'1'#7'U1)-'#241#241#236#241#236#241')'#241#241'-'#241#0#241'--U-'
+ +#241#0#236#245')Q1'#241#241#236#241#241'U1'#237#241#237#241'-UV'#7#241#240'-'
+ +'V'#7'UV'#7'~'#7#7'V'#7'V'#7#7#7#7#7#7'Z'#7')'#241#237#187#25'@1---1--1--1--'
+ +'1--1--1--1-1-1--11--'#245')'#245')'#241'('#241#241#241#240#241#236#237#0#0
+ +#240#0#0#240#0#241#0#241#0#241#0#241#0#241#237#240#241'-U'#7#7'-'#241#241#241
+ +'--'#241#240#0'--'#241#240#237#0#236#241'--'#7#241#236#241#241'-'#241'1-'#236
+ +#0#241#241'-V'#241#240#0#240#241'-V'#7#241#240#237#241'-'#7'V'#7'~'#7#7'Z'#7
+ +#7#7#7'Z~'#247'Z'#7'~U'#241#240#240#174#16#128'--11--1--1--1--1--1--1---1--1'
+ +'---'#245#245'('#241#244#241#245#241#241#240#241#236#241#241#240#237#0#0#237
+ +#0#237#0#236#0#236#0#237#0#237#241#240#241#241#237#241'-U'#7#241#241'-'#7'U1'
+ +'2)'#241')'#241#236#0#240#241'-'#241')1'#241#0#240')'#241')V'#241#0#237#240
+ +#241'-U'#241#0#241#241')-'#7'U'#237#0#241#240'UZ'#7#7'-'#241#241'U'#7#7'Z'
+ +#247#7#7#7#7#7#247#7#237#241#237#162#7#192'-1---1--1--1--1--1-1--1-1--1-11--'
+ +'-'#245#241')'#241'('#241#240#241#241#241#240#236#241#0#241#0#240#0#240#0#241
+ +#0#241#0#240#0#240#0#237#0#240#241#240#241#241'-U-)U2-U2)'#241#241#241#241#0
+ +#241'-'#241#241#241#241#236#241'----'#240#237#240#241#241'V-'#240#241#0#241
+ +'-V'#7')'#0#241#236#241'2Q'#7'V'#0#241#240#241'V~'#7#7')'#241'-'#247'Z'#7#7
+ +#241#240#0#28#186'D1-1-1-11-1--1---1--1-1-1--1-1-1--'#241'-'#240#241#241#241
+ +#241')'#241#240#241#241#241#0#241#236#241#0#241#0#236#0#240#0#237#0#241#0#240
+ +#0#241#0#237#241#240#237#241#241'--UUV1U1-)-'#241#236#241'-'#236#241#0#240#0
+ +#241')'#241'-'#241#241#0#241')-'#7')'#0#237#240#241')'#7'Z'#240#241#236#241
+ +#241'UV'#7'-'#241#0#237')'#7#7#7#241#241#0#241'U'#247'Z-'#241#241#236#24#188
+ +#215'-1-1----1-11-1-1-1--1----1---1-1--'#245')'#245#240#241#240#241#240#241
+ +#241#240#241#240#237#241#240#237#0#0#241#0#241#0#240#0#240#237#0#241#0#240
+ ,#241#240#237#240#241#241#240#241#241'-UU2--'#241'-.-'#241#241#241#240#236#241
+ +#237'-'#241')1'#236#0#241#236'-V-'#241#0#240#237')-'#7'Q'#241#0#241#236#241
+ +'.'#7#7#237#240#237#240#241#7'~-'#241#0#237#236'.'#7#7')'#241#0#241#20#191'j'
+ +'1-1-11-1-1---------1--1-1--11-1--'#245')'#244')'#241#241#241#241#241#240#241
+ +#241#236#241#236#240#237#241#240#237#0#0#0#0#237#0#241#0#240#0#241#0#237#0
+ +#241#0#237#0#241#241#241#241#241'--UV-----'#241#241')'#241#0#240'-'#237#240
+ +#241#241#241#0#241'-U'#241#0#241#236#241'--V'#241#236#241#0#241'-U'#7'-'#241
+ +#241#0#240#241#7#7')'#0#241#240#241'1'#130#7#241#240#237#240#16#193#253'--1-'
+ +'--1-1--1-1---1--11---11--1-1--'#245#241#241#241'('#241#240#241#241#240#241
+ +#241#240#241#241#240#0#241#236#241#240#237#0#240#0#0#237#0#237#0#240#236#0
+ +#241#240#241#237#240#236#241#236#237#241#241'--U1---)'#241#245')'#241#241#241
+ +#240#241#0#236#0#240#241#241'U'#241#237#240#241#241').'#7#241#0#241#240#241
+ +'-V'#7#241#0#240#237#241#241'V'#7#241#241#240#237#241'UZ'#7')'#241#0#241#12
+ +#196#144'1-1-1----1--1--1--1---11---1--1-1-)-'#240#241#241#241#241#240#241
+ +#241#240#241#241#240#237#241#241#240#241#240#237#240#241#0#237#240#0#241#0
+ +#241#0#241#0#236#0#240#0#241#241#240#241#240#241#241#241#241#241')-U--'#241
+ +')'#241'))'#241#241#241#241#241#236#241#241#237#241#241#240#0#241'---1'#241
+ +#240#0#241#241'V'#7#7#241#237#0#240#241'U'#7'-'#241#0#237#240#237'U'#247'U'
+ +#241#241#237#240#8#199'#---1-1-1-1-1--1----1-1---1--1-1-1-'#245#241'-'#241
+ +#240#241#240#241#241#240#241#241#240#241#241#240#236#241#237#0#241#241#236
+ +#240#0#0#241#0#240#0#236#0#241#0#241#0#241#0#0#237#0#241#236#240#237#240#241
+ +#241#241#241')----'#241#241#241#240#241')'#240#241#0#241#240#241#236#0#237
+ +#241')'#241#7')'#0#241#236#236#241'U1V'#236#240#241#236#241'V'#7')'#236#237
+ +#240#241#241#7'~-'#241#240#236#241#4#201#182'1-1-1-1-1--1-1---1--1---1-11-1-'
+ +'1-1--'#240'-'#241#241#241#241#240#241#237#240#237#241#236#241#241#241#240
+ +#241#241#236#241#241#241#241#236#0#0#241#0#241#0#240#0#237#0#240#237#240#0
+ +#241#0#241#0#241#241#236#0#241#241#241#241')))-)'#241#241#241#241#237#240#237
+ +#241#241#241#241#240#241#241#241'-'#240#237#0#241#241'-VV-'#241#237#0#241#241
+ +#7#7#241#240#241#240#241#241#7#247'-'#237#0#241#241#0#204'I-1--1----1---1-1-'
+ +'-1--1-1----1--1-1-'#245#241#241#241#240#241#240#241#241#240#241#241#240#241
+ +#240#241#236#241#237#240#241#241#236#241#236#241#241#236#240#0#0#241#0#237
+ +#240#241#0#240#0#241#236#0#241#240#0#0#241#241#0#241#236#241#241#241#241#241
+ +')'#241'))'#241#240#241#236#241')-)'#241#240#237#241#241#241#236#241#0#241')'
+ +'UU-'#0#240#241#241')'#7'V'#241#237#0#241#241'-Z'#7'-'#241#241#0#241#133#214
+ +'X--1--1-1--11----1--1----1-1--1-1-1---'#240#241')'#241#241#240#241#241#240
+ +#237#241#240#241#241#241#240#240#237#240#241#241#240#241#236#241#241#237#241
+ +#236#236#241#0#0#0#237#0#241#0#241#240#0#237#237#240#0#237#236#0#241#0#237
+ +#240#241#240#241#241#241#241#241')'#241#240#241#240#241')'#241#241#240#236
+ +#241#241#240#241#236#241#241#241')'#241#241#0#240#237'-'#7'1'#241#240#237#240
+ +#237'-'#7#7')'#236#237#240#241'qJ'#198'1--1--1-1---1-11--1-1-11---1-1-1-1-1-'
+ +#241#241#240#241#240#241#237#240#241#240#241#237#240#236#241#237#241#241#241
+ +#236#241#0#241#241#241#240#241#240#241#241#236#237#240#237#240#241#0#240#237
+ +#0#241#240#0#241#0#240#241#241#236#241#0#241#0#241#237#241#240#241#241#241
+ +#241#241')'#241#241#241')'#241#241#241#241#240#241#241#237#240#237#241#241
+ +#241#236#241#237#241'-V-'#236#241#0#241#241'U~'#7#241#241#240#0#241'\'#191'4'
+ +'--1--1-----1-----1---1---11---1-1-1--'#245#240#241#241#241#241#240#241#240
+ +#237#241#240#241#241#241#240#241#240#236#241#240#241#237#240#240#237#241#241
+ +#241#240#241#240#241#236#236#236#0#241#0#240#237#0#240#237#240#237#0#241#241
+ +#0#241#240#237#0#240#236#241#236#237#0#241#241#241#241#241'))-)-'#241#241#241
+ +#241#241#240#241#240#241#240#241#236#240#236#241#240#241#241#236#241#0#241'-'
+ +#7#7#241#236#0#241#241'H3'#162'-1-1---11-1-1-1-1-1-1--1---11--1-1-1--'#241')'
+ +#240#241#240#241#236#241#241#240#241#237#240#236#241#236#241#241#241#237#240
+ +#241#237#241#240#241#236#241#237#241#241#241#241#241#241#236#240#237#0#240#0
+ +#237#240#0#241#240#0#240#237#240#237#240#241#241#241#0#241#240#241#236#0#237
+ +#240#237#241#241#241')'#241')))--)'#241#241#241#241#241#241#241#241#241#241
+ +#240#241#241#236#241#236#241#241#241#240#241#237#240#237'3'#168#16'1---11---'
+ +'----1-1-----1--1----1--1-1-1-'#245#241#241#241#241#241#240#241#236#241#240
+ +#241#241#241#240#241#236#241#240#240#241#240#241#241#237#241#241#240#241#240
+ +#237#240#241#241#241#241#241#240#241#236#241#0#237#240#0#237#241#0#241#236
+ +#241#241#0#240#241')'#241#237#240#241#241#240#237#240#0#241#0#241#236#241#241
+ +#241#241#241#241'-))))'#245')'#241#241#241#241#241#241#241#240#241#240#241
+ +#236#241#240#241#236#240#31#28'~--1---1-1-1-1---1-1-1-1---1-1-1--1-1---'#241
+ +#240#241#240#241#237#241#240#241#237#240#240#237#241#0#241#240#237#241#237
+ +#241#240#241#240#241#240#241#241#241#241#241#241#240#237#241#241#241#241#241
+ ,#240#241#240#240#237#240#0#241#0#241#0#240#237#0#241#240#241#241#241'-'#236
+ +#241#240#237#241#240#237#0#241#0#241#0#241#237#240#237#241#241#241#241')))))'
+ +'))))'#241')'#241')'#241#241#241#241#241#241#10#144#236'-1-1-1-1-----1-1-1--'
+ +'---1-'#13'---1-1-1--11--'#241#241#241#240#241#240#241#237#240#237#241#241
+ +#240#241#241#0#241#236#241#240#237#240#241#241#237#241#241#240#241#241#240
+ +#241#241#240#241#241#241')'#241#241#241#241#241#240#241#236#240#0#236#237#0
+ +#241#0#241#0#241#240#241#241#241#0#241#240#241#237#240#237#240#236#240#237
+ +#240#0#241#241#240#237#241#237#241#241#241#241#241#241#241#241#241#241')'#241
+ +#241')'#241')'#241')G'#245#197'1---1---1-1-1--1---1-1-----1--1-1--1--1-'#241
+ +#240#241#240#241#236#241#240#241#240#241#236#241#237#240#241#241#240#0#241
+ +#241#0#237#240#241#240#241#237#240#237#241#241#241#241')'#240#241#241#241')'
+ +#241'))'#245')'#241#241#241#241#240#241#236#236#0#240#0#237#241#0#236#241#0
+ +#237#240#240#237#240#241#241#241#240#237#241#240#237#241'-----))'#241#241#241
+ +#241#241#241#241#237#241#241#237#240#241#241'=~'#196'-1---11----1-1--1-1---1'
+ +'-1---1--1-11-1--1-'#241#241#241#241#241#236#241#0#241#240#241#236#240#237
+ +#240#237#241#237#240#237#241#240#241#237#241#240#241#241#240#241#240#241#240
+ +#241#241#241#241#241#241#241#241#241')'#241'-'#241'-)'#241#241#241#241#241
+ +#237#240#0#236#241#0#236#241#0#237#241#240#237#241#241#241#241#240#237#240
+ +#241'-'#7#247#247#7#247#7#7#7'UVQ-Q--'#241#241#240#237#240#236'3'#7#195'--1-'
+ +'1--1-1-1---1-1-1-1----1--11----1-11---'#240#241#240#241#241#240#237#241#0
+ +#241#241#241#240#241#240#241#240#241#240#241#237#240#241#240#237#240#241#241
+ +#241#241#241#241#241#241#240#241#241'('#241')'#241#241'-))'#241'-)-'#245')-'
+ +#241')'#241#241#241#241#241#0#241#241'-R---)'#241#241#241#241#241')Z'#7#247
+ +#247#7#247#7#247#247#247#7#247#7#247#7#7'Q'#241#241#241#241'('#144#194'-1---'
+ +'-1------11---1---1--1--1---1-1--1--1-'#245#241#241#241#240#237#240#240#237
+ +#241#240#0#241#0#241#236#241#241#237#241#240#241#236#241#241#241#241#240#241
+ +#240#241#237#240#241#241')'#241#241#241#241#241')'#241#241#245#241')'#245'))'
+ +'---.----))---U1VUU2QRQ----R1V'#7'V'#7#7#7#247'Z'#247#7#247#7#247'-'#241#241
+ +'-'#30#25#193'----1--1--1-1---1--1-1-1---1--11-1-11--1---'#241#240#241#241
+ +#240#237#241#240#0#241#241#236#237#240#241#236#240#241#236#241#241#241#240
+ +#237#240#237#241#237#241#240#241#241#241#241#241#241#241')'#241'-'#241#241')'
+ +')-'#241')-'#245')-----.-V1.Q2V'#7#7#7'VQ'#7#7#7'VYV'#7'UV1UU.QVU'#7#7'V'#7#7
+ +'V-)'#241#245#19#162#192'1----1--1--1-1---1--1---1-1-1----1--1-1-1-1-'#241
+ +#240#241#237#240#237#241#237#240#241#241#241#0#241#241#237#240#241#0#240#237
+ +#241#240#241#241#240#241#241#241#241#240#241#240#241#241#241#241#241#241')'
+ +#241#241#245')-'#241'))'#245')'#245'-)----U1Q1UV'#7#7#7'Z'#7#7'ZUVUV'#7'UVV'
+ +#7#7#7'ZZ'#7#7#7#7'ZUVUVQ'#9'+'#191'--1-1--1------1-1-1--11------1-1--1--1--'
+ +'-----'#241#241#240#241#240#241#240#241#236#241#0#241#240#237#240#241#241#237
+ +#241#241#240#237#241#240#241#241#240#241#236#241#241#241#241#241'('#241#241
+ +')'#241')'#241')'#241#241')'#245')-)-)----.-.1.U1VV'#7#7#7'Z'#7#247'~'#7#7'Z'
+ +'~'#7'U.UVUUVUV'#7'V'#7#7'ZZ'#7#218#218#218'-1----1-1--1-1------1----1--1-1-'
+ +'--1-1-1-1--11-'#240#241#240#241#236#241#236#241#240#241#240#237#240#241#237
+ +#240#240#241#236#241#241#240#237#241#240#241#241#241#241#241#241#240#241#241
+ +#241')'#241#241#241')'#241'-)'#245')'#241'-'#241'-'#245'--.-----Q1V1U'#7'V'#7
+ +#7#7'Z'#7#7'~'#7#7#7'~'#7#7#7#7'VUR---U.--U'#152#153#152'---1-1---1----1-1'
+ +#245'1-1-11--1----1-1-------------'#241#236#241#241#241#241#240#237#241#236
+ +#241#237#240#241#241#237#240#241#240#237#241#240#241#241#241#240#241#241#240
+ +#241#241#241#241#241#241#241')'#241#241')'#241#241')-'#241')-)-)------.-.Q2-'
+ +'VUVU'#7#7'Z'#247#7#7'~'#7#7'~'#7'~Z'#7#7#7#7'VUV1U.-z}'#148'1-----1---1--1-'
+ +'---------1---1-1---1--1-1-1-1-1-'#245#241#0#236#240#241#241#240#241#241#240
+ +#241#240#237#240#241#241#237#241#240#241#241#236#241#241#237#240#241#241#241
+ +#240#241#241'('#241#241#241')'#241#241')'#241#241')'#245')'#241'-)--)--.---1'
+ +'-U21V1VV'#7#7#7'~'#7#7'Z'#7#7#7#7#247#7#247'Z'#7#7'VUVUUV'#135#139#149'--1-'
+ +'1-1-1----1-1--1-1-1---1----1-1----------'#245'--1-'#241#241#241#236#241#237
+ +#240#237#0#241#237#240#241#236#241#240#241#237#240#237#241#241#240#241#241
+ +#241#240#241#241#241')'#241#241')'#241#241#241')'#241#241')'#241')'#241'-)'
+ +#245')'#245'---)---.--QQ2UU1V'#7'V'#7#7'~'#7'Z~'#7'~'#7'~'#7#7#247'Z'#7#7'V'
+ +#7'VU'#141#140#148'-1-------1-1-----1---1---1--1-1----1--1-1-1--11---'#240
+ +#236#241#241#240#241#240#241#241#240#241#0#241#240#237#241#240#241#240#241
+ +#240#237#241#240#237#241#241#241#241#240#241#241#241')'#241')'#245')-'#241
+ +#241'-'#241')'#241')-))'#245')--.---.U21U2VU'#7'U'#7'Z'#7#247#7#7#7#7#247'Z'
+ +#247'~'#247#7#247#7#7#7#7'V'#146#146#135'--1--1-1--'#245'--1-1---1--1-1-1---'
+ +'--1-1-1----------1-'#245'-'#241#240#0#241#0#237#241#236#241#237#240#241#236
+ +#241#0#241#241#236#241#241#240#241#241#240#241#240#241#241#241#241')'#241#241
+ ,')'#241')'#241#241'-)'#241'-)'#241'-)'#245'-)-)--------Q.U1V1V'#7#7#7#7#7'~'
+ +#7'~'#7#7#7#7#7#247#7'~Z'#7'Z'#7'HHH1---1---1-------1---1------11-1----1-11-'
+ +'1--1---'#245'---'#245#241#240#241#240#241#240#241#240#241#237#241#241#240
+ +#241#236#241#241#236#241#241#236#241#241#237#241#241#240#241#241#241#240#241
+ +#241')'#241')'#241#241'-'#241#241'-)'#245'-)-------.--.-1Q.U-VUVUV'#7'V'#7'Z'
+ +#247#7'~'#7'~'#7'~'#7#7#247#7#7#7'555-1----1---1-1-1---1-'#245'-1-1-1-----1-'
+ +'-----1------1-1----'#241#236#237#0#241#0#241#236#241#240#0#241#237#241#236
+ +#241#241#241#236#241#241#240#241#240#241#241')'#240#241#241')'#241')'#241#241
+ +')'#241')-))'#245'-)----.---------.1-V1.12U2U'#7#7#7'~'#7#247#7#7#7'Z~'#7#7
+ +'~'#7'000-----1---1--'#245'--1-1-----------1-1--1-1-1--1-1-1-------'#245#240
+ +#241#240#237#240#241#241#240#237#241#241#240#240#241#240#241#236#241#241#240
+ +#241#241#241#241#241#241#241#241')'#241#241#241#241')'#245')'#245#241')'#245
+ +'))-------1R1-2Q1R1QV1QUURUVQV'#7'V'#7'Z'#7'~'#7'~'#7#7'Z~'#7'Z000-1--'#245
+ +'--1-----1------1-'#245'--1-------'#245'-----1-------1------'#245#241#236#241
+ +#0#241#0#241#240#241#236#241#237#241#237#240#241#241#236#241#236#241#240#237
+ +#240#241')'#241#241#241')'#241')'#241')'#241'))'#245')'#245'-'#241'-).--.--.'
+ +'Q1.V1UV1V'#7'V'#7#7#7#7#7#7#7#7#7#7'Z'#7'Z'#7#7'~'#7#7#7#7'555--1-------1--'
+ +'---1------1---1--1---1-1---1-1--1---1------'#241#240#237#240#241#0#237#240
+ +#241#240#241#240#241#237#240#241#241#241#241#241#241#241#241#241#240#241#241
+ +#240#241#241#241')'#241'-'#241')-))-)--------U.U11R11VU'#7'V'#7#7'Z'#7'~'#7
+ +#247#7'~'#7'~'#7#7'Z'#7#7#7'V'#7#7'Hbf-'#245'--1-1-1--1-1-1---'#245'--1-----'
+ +#245'---1-----1-----1--1----'#245'---'#245')'#240#237#0#240#237#240#237#241#0
+ +#241#236#241#241#236#241#240#241#236#241#240#241#241#241#241')'#241#241'))'
+ +#241#241')'#241'-'#241')'#245')'#245')-)--.-V-1-V-VUVU2U'#7#7'~'#7'~'#7'Z'#7
+ +#7'Z'#7#7#7'~'#7'~'#7'V'#7#7#7'05#---1------1----------1---'#245'----1----'
+ +#245'------1'#245'-----1----1--'#245#241#241#236#241#241#0#241#240#237#240
+ +#241#241#240#241#240#237#241#241#241#241#241#241#241#241#241#241')'#241#241
+ +#241')'#241'-'#241')'#245')---'#245'--------V-UU1V1V'#7#7'Z'#7#7#7#7#7'Z~'#7
+ +#7'~'#7'Z'#7#7#7#7#7#7'VfbH--1---1-1----'#245'1-1'#245'--'#245'---1--1----1-'
+ +'-1-1--1------1----------'#245#240#241#240#236#241#0#237#240#241#0#241#0#237
+ +#241#241#240#241#240#241#240#241#240#241')'#241#241')'#241')'#241#241')'#241
+ +'-)-'#241')-)--.---2Q1R12V1UUV'#7#7#7'~Z'#7'~'#7#7'~'#7#7#247#7#7'~Z'#7#7#7#7
+ +'505-----'#245'----------------'#245'-----1--'#245'------1---1--1'#245'---1-'
+ +'--1-----'#241#241#240#237#240#241#0#241#236#241#241#240#237#240#237#241#237
+ +#241#241#241#241#241#240#241#241#241#241#241')'#245'))'#241'-'#241'-'#241'--'
+ +'-)--.-Q.-1Q1QV2U'#7#7'Z'#7#7#7#7#7'Z'#7#7'~'#7#7'~'#7#7#7#7'VV'#7#158#8#128
+ +'-------1-1'#245'----'#245'-1-----1-1---------1-----1--1---1---1---1--'#245
+ +'-'#241#241#241#236#241#240#237#241#0#240#237#241#241#240#241#240#241#236#241
+ +#241#241#241#241')'#240')'#241#241')'#241#245')'#241')-)-'#241'-------1Q.1V1'
+ +'1U'#7'VU'#7#7'~'#7'~'#7#7'~'#7#7#7'~'#7'Z~'#7'V'#7'U'#7't'#130#228'--1-1---'
+ +'---1--1----'#245'----------1--1'#245'--1--1---------1---1-------'#241#240
+ +#241#241#236#241#236#241#241#241#236#240#237#240#237#241#241#241#240#241#241
+ +#241#241#241#241#241')'#241#241')'#241')'#245')'#245')---)---.-.1U-VUVV'#7'V'
+ +#7'V'#7#7#7#7'Z'#7#7#247'Z'#7#7#247#7#7#7#7#7'V%'#182#156'-'#245'--'#245'---'
+ +'1---1-----1---'#245'---'#245'-1-----------'#245'---'#245'---1'#245'---'#245
+ +'-------'#245'-'#241#240#241#241#240#241#241#236#240#241#241#241#241#240#241
+ +#240#241#237#240#241#240#241#241')'#241#241#241')'#241'-'#241'-)-)'#245')---'
+ +'.---1R-V-2UU'#7#7#7#7#7#7'Z'#247#7#7'~'#7#7#247#7#7'~Z'#7#7'VUP'#0#0'1-----'
+ +#245'---'#245'--'#245'1-1-------'#245'-----'#245'-1--'#245'----------'#245'-'
+ +'---1---1---1----'#241#240#241#237#240#241#241#241#236#241#240#237#241#237
+ +#241#240#241#241#241#241#241#241#241#240#241')'#241')'#241')'#241#241'-)-'
+ +#245')------Q1--U-VVUV'#7#7'Z'#7#7#7'Z'#7#7#247'Z'#7'~'#7#7#7#7'V'#7'V'#160#0
+ +#0'---1-----1----------'#245'-----------------'#245'----'#245'--------------'
+ +'1---'#245'-'#245')'#241#240#241#236#241#236#241#240#237#241#240#241#240#237
+ +#240#241#236#241#240#241#241#241')'#241#241#241')'#245')-)'#245'))-----.-.-R'
+ +'12U11VUV'#7#7'Z'#247'~'#7#247'~'#7#130#7#7#247'~'#7'Z'#7#7'UEBu------------'
+ +'-----------------------------------------------------'#241'-'#241#241#241
+ +#240#241#241#241#241#240#241#241#241#241#241#241#241#241#241#241#241#241#241
+ +#241#241')'#241')'#241')'#245')------------1Q2UVU'#7#7#7#7#7#7#7#7#7#7#7#7#7
+ +#247#7#7#7#7#7#7'V1Fd'#11'Transparent'#9#4'Left'#2#1#6'Height'#3#180#0#3'Top'
+ +#2#1#5'Width'#2'c'#0#0#0#7'TButton'#5'btnOK'#25'BorderSpacing.InnerBorder'#2
+ +#4#6'Cancel'#9#7'Caption'#6#2'OK'#11'ModalResult'#2#2#7'OnClick'#7#10'btnOKC'
+ +'lick'#8'TabOrder'#2#1#4'Left'#3#225#0#6'Height'#2#18#3'Top'#3#240#0#5'Width'
+ +#2'@'#0#0#0
+]);
diff --git a/components/onguard/source/qogabout0.pas b/components/onguard/source/qogabout0.pas
new file mode 100644
index 000000000..a26c286c9
--- /dev/null
+++ b/components/onguard/source/qogabout0.pas
@@ -0,0 +1,178 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* OGABOUT0.PAS 1.13 *}
+{* Copyright (c) 1997-00 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I ONGUARD.INC}
+
+
+unit qogabout0; {AH.01}
+
+interface
+
+uses
+ {$IFDEF MSWINDOWS} Windows, {$ENDIF} {AH.01}
+ SysUtils, Classes,
+ Graphics, Controls,Buttons, Forms, Dialogs, StdCtrls, ExtCtrls,
+ ogutil,
+ {$IFDEF MSWINDOWS} ShellAPI, {$ENDIF} {AH.01}
+ ComponentEditors,
+ PropEdits,
+ LazarusPackageIntf,
+ LResources;
+
+
+type
+ TOgAboutForm = class(TForm)
+ Panel1: TPanel;
+ Image1: TImage;
+ lblVersion: TLabel;
+ btnOK: TButton;
+ WebLbl: TLabel;
+ NewsLbl: TLabel;
+ procedure btnOKClick(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure WebLblMouseMove(Sender: TObject; Shift: TShiftState; X,
+ Y: Integer);
+ procedure NewsLblMouseMove(Sender: TObject; Shift: TShiftState; X,
+ Y: Integer);
+ procedure Panel2MouseMove(Sender: TObject; Shift: TShiftState; X,
+ Y: Integer);
+ procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
+ Y: Integer);
+ procedure WebLblClick(Sender: TObject);
+ procedure NewsLblClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+ TOgAboutProperty = class(TStringProperty) {!!.08}
+ public
+ function GetAttributes: TPropertyAttributes;
+ override;
+ procedure Edit;
+ override;
+ end;
+
+implementation
+
+
+
+
+{*** TOgVersionProperty ***}
+
+function TOgAboutProperty.GetAttributes: TPropertyAttributes; {!!.08}
+begin
+ Result := [paDialog, paReadOnly];
+end;
+
+procedure TOgAboutProperty.Edit; {!!.08}
+begin
+ with TOgAboutForm.Create(Application) do begin
+ try
+ ShowModal;
+ finally
+ Free;
+ end;
+ end;
+end;
+
+
+{*** TEsAboutForm ***}
+
+procedure TOgAboutForm.btnOKClick(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TOgAboutForm.FormCreate(Sender: TObject);
+begin
+ Top := (Screen.Height - Height) div 3;
+ Left := (Screen.Width - Width) div 2;
+ lblVersion.Caption := 'Version ' + OgVersionStr;
+end;
+
+procedure TOgAboutForm.WebLblMouseMove(Sender: TObject; Shift: TShiftState;
+ X, Y: Integer);
+begin
+ WebLbl.Font.Color := clRed;
+end;
+
+procedure TOgAboutForm.NewsLblMouseMove(Sender: TObject;
+ Shift: TShiftState; X, Y: Integer);
+begin
+ NewsLbl.Font.Color := clRed;
+end;
+
+procedure TOgAboutForm.Panel2MouseMove(Sender: TObject; Shift: TShiftState;
+ X, Y: Integer);
+begin
+ NewsLbl.Font.Color := clNavy;
+end;
+
+procedure TOgAboutForm.FormMouseMove(Sender: TObject; Shift: TShiftState;
+ X, Y: Integer);
+begin
+ WebLbl.Font.Color := clNavy;
+ NewsLbl.Font.Color := clNavy;
+end;
+
+procedure TOgAboutForm.WebLblClick(Sender: TObject);
+begin
+{$IFDEF MSWINDOWS}
+ if ShellExecute(0, 'open', PChar('http://sourceforge.net/projects/tponguard'),
+ '', '', SW_SHOWNORMAL) <= 32 then
+ ShowMessage('Unable to start web browser');
+{$ELSE}
+ ShowMessage('Unable to start web browser');
+{$ENDIF}
+ WebLbl.Font.Color := clNavy;
+end;
+
+procedure TOgAboutForm.NewsLblClick(Sender: TObject);
+begin
+{$IFDEF MSWINDOWS}
+ if ShellExecute(0, 'open', PChar('https://sourceforge.net/forum/?group_id=71010'),
+ '', '', SW_SHOWNORMAL) <= 32 then
+ ShowMessage('Unable to start news reader');
+{$ELSE}
+ ShowMessage('Unable to start news reader');
+{$ENDIF}
+ NewsLbl.Font.Color := clNavy;
+end;
+
+initialization
+{$I qogabout0.lrs}
+
+end.
diff --git a/components/onguard/source/qonguard1.lfm b/components/onguard/source/qonguard1.lfm
new file mode 100644
index 000000000..853d4cb1f
--- /dev/null
+++ b/components/onguard/source/qonguard1.lfm
@@ -0,0 +1,171 @@
+object KeyGenerateFrm: TKeyGenerateFrm
+ Left = 269
+ Height = 235
+ Top = 361
+ Width = 464
+ HorzScrollBar.Page = 463
+ HorzScrollBar.Range = 459
+ VertScrollBar.Page = 234
+ VertScrollBar.Range = 229
+ ActiveControl = OKBtn
+ Caption = 'Key Generation'
+ Color = clForm
+ OnCreate = FormCreate
+ OnShow = FormShow
+ Position = poScreenCenter
+ object OKBtn: TBitBtn
+ Left = 305
+ Height = 25
+ Top = 204
+ Width = 75
+ Caption = 'OK'
+ Default = True
+ ModalResult = 1
+ NumGlyphs = 0
+ TabOrder = 0
+ end
+ object CancelBtn: TBitBtn
+ Left = 384
+ Height = 25
+ Top = 204
+ Width = 75
+ Caption = 'Cancel'
+ ModalResult = 2
+ NumGlyphs = 0
+ TabOrder = 1
+ end
+ object Panel1: TPanel
+ Left = 4
+ Height = 191
+ Top = 6
+ Width = 455
+ TabOrder = 2
+ object CopyBlockSb: TSpeedButton
+ Left = 425
+ Height = 20
+ Hint = 'Copy key to clipboard'
+ Top = 138
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888888444444444800000008888
+ 8884FFFFFFF48000000088888884F00000F48000000080000004FFFFFFF48000
+ 000080FFFFF4F00000F48000000080F00004FFFFFFF48000000080FFFFF4F00F
+ 44448000000080F00004FFFF4F488000000080FFFFF4FFFF44888000000080F0
+ 0F04444448888000000080FFFF0F088888888000000080FFFF00888888888000
+ 0000800000088888888880000000888888888888888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = CopyBlockSbClick
+ end
+ object CopyByteKeySb: TSpeedButton
+ Left = 425
+ Height = 20
+ Hint = 'Copy key to clipboard'
+ Top = 162
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888888444444444800000008888
+ 8884FFFFFFF48000000088888884F00000F48000000080000004FFFFFFF48000
+ 000080FFFFF4F00000F48000000080F00004FFFFFFF48000000080FFFFF4F00F
+ 44448000000080F00004FFFF4F488000000080FFFFF4FFFF44888000000080F0
+ 0F04444448888000000080FFFF0F088888888000000080FFFF00888888888000
+ 0000800000088888888880000000888888888888888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = CopyByteKeySbClick
+ end
+ object Label4: TLabel
+ Left = 8
+ Height = 14
+ Top = 12
+ Width = 59
+ Caption = 'Key &Type:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label2: TLabel
+ Left = 8
+ Height = 14
+ Top = 40
+ Width = 76
+ Caption = 'Key &Phrase:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label3: TLabel
+ Left = 8
+ Height = 14
+ Top = 122
+ Width = 23
+ Caption = 'Key:'
+ Color = clNone
+ ParentColor = False
+ end
+ object GenerateBtn: TButton
+ Left = 344
+ Height = 25
+ Hint = 'Generate key'
+ Top = 9
+ Width = 103
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Generate key'
+ Enabled = False
+ OnClick = GenerateBtnClick
+ TabOrder = 2
+ end
+ object KeyTypeCb: TComboBox
+ Left = 96
+ Height = 21
+ Top = 8
+ Width = 169
+ AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
+ ItemHeight = 22
+ Items.Strings = (
+ 'Random'
+ 'Standard Text'
+ 'Case-sensitive Text'
+ )
+ MaxLength = 0
+ OnChange = KeyTypeCbChange
+ Style = csDropDownList
+ TabOrder = 4
+ end
+ object KeyStringMe: TMemo
+ Left = 8
+ Height = 49
+ Top = 64
+ Width = 440
+ OnChange = KeyStringMeChange
+ ScrollBars = ssVertical
+ TabOrder = 0
+ end
+ object BlockKeyEd: TEdit
+ Left = 8
+ Height = 20
+ Top = 138
+ Width = 415
+ OnChange = BlockKeyEdChange
+ TabOrder = 1
+ end
+ object ByteKeyEd: TEdit
+ Left = 8
+ Height = 20
+ Top = 162
+ Width = 415
+ OnChange = ByteKeyEdChange
+ TabOrder = 3
+ end
+ end
+end
diff --git a/components/onguard/source/qonguard1.lrs b/components/onguard/source/qonguard1.lrs
new file mode 100644
index 000000000..c75d4ccdb
--- /dev/null
+++ b/components/onguard/source/qonguard1.lrs
@@ -0,0 +1,67 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TKeyGenerateFrm','FORMDATA',[
+ 'TPF0'#15'TKeyGenerateFrm'#14'KeyGenerateFrm'#4'Left'#3#13#1#6'Height'#3#235#0
+ +#3'Top'#3'i'#1#5'Width'#3#208#1#18'HorzScrollBar.Page'#3#207#1#19'HorzScroll'
+ +'Bar.Range'#3#203#1#18'VertScrollBar.Page'#3#234#0#19'VertScrollBar.Range'#3
+ +#229#0#13'ActiveControl'#7#5'OKBtn'#7'Caption'#6#14'Key Generation'#5'Color'
+ +#7#6'clForm'#8'OnCreate'#7#10'FormCreate'#6'OnShow'#7#8'FormShow'#8'Position'
+ +#7#14'poScreenCenter'#0#7'TBitBtn'#5'OKBtn'#4'Left'#3'1'#1#6'Height'#2#25#3
+ +'Top'#3#204#0#5'Width'#2'K'#7'Caption'#6#2'OK'#7'Default'#9#11'ModalResult'#2
+ +#1#9'NumGlyphs'#2#0#8'TabOrder'#2#0#0#0#7'TBitBtn'#9'CancelBtn'#4'Left'#3#128
+ +#1#6'Height'#2#25#3'Top'#3#204#0#5'Width'#2'K'#7'Caption'#6#6'Cancel'#11'Mod'
+ +'alResult'#2#2#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#6'TPanel'#6'Panel1'#4'Le'
+ +'ft'#2#4#6'Height'#3#191#0#3'Top'#2#6#5'Width'#3#199#1#8'TabOrder'#2#2#0#12
+ +'TSpeedButton'#11'CopyBlockSb'#4'Left'#3#169#1#6'Height'#2#20#4'Hint'#6#21'C'
+ +'opy key to clipboard'#3'Top'#3#138#0#5'Width'#2#23#5'Color'#7#9'clBtnFace'
+ +#10'Glyph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0#0#0#17
+ +#0#0#0#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#128
+ +#128#128#0#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255
+ +#0#255#255#0#0#255#255#255#0#136#136#136#136#136#136#136#136#128#0#0#0#136
+ +#136#136#136#136#136#136#136#128#0#0#0#136#136#136#132'DDDD'#128#0#0#0#136
+ +#136#136#132#255#255#255#244#128#0#0#0#136#136#136#132#240#0#0#244#128#0#0#0
+ +#128#0#0#4#255#255#255#244#128#0#0#0#128#255#255#244#240#0#0#244#128#0#0#0
+ +#128#240#0#4#255#255#255#244#128#0#0#0#128#255#255#244#240#15'DD'#128#0#0#0
+ +#128#240#0#4#255#255'OH'#128#0#0#0#128#255#255#244#255#255'D'#136#128#0#0#0
+ +#128#240#15#4'DDH'#136#128#0#0#0#128#255#255#15#8#136#136#136#128#0#0#0#128
+ +#255#255#0#136#136#136#136#128#0#0#0#128#0#0#8#136#136#136#136#128#0#0#0#136
+ +#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0
+ +#0#0#9'NumGlyphs'#2#0#7'OnClick'#7#16'CopyBlockSbClick'#0#0#12'TSpeedButton'
+ +#13'CopyByteKeySb'#4'Left'#3#169#1#6'Height'#2#20#4'Hint'#6#21'Copy key to c'
+ +'lipboard'#3'Top'#3#162#0#5'Width'#2#23#5'Color'#7#9'clBtnFace'#10'Glyph.Dat'
+ +'a'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0#0#0#17#0#0#0#17#0#0
+ +#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#128
+ +#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#128#128#128#0#192
+ +#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255#0#255#255#0#0
+ +#255#255#255#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136
+ +#136#136#136#128#0#0#0#136#136#136#132'DDDD'#128#0#0#0#136#136#136#132#255
+ +#255#255#244#128#0#0#0#136#136#136#132#240#0#0#244#128#0#0#0#128#0#0#4#255
+ +#255#255#244#128#0#0#0#128#255#255#244#240#0#0#244#128#0#0#0#128#240#0#4#255
+ +#255#255#244#128#0#0#0#128#255#255#244#240#15'DD'#128#0#0#0#128#240#0#4#255
+ +#255'OH'#128#0#0#0#128#255#255#244#255#255'D'#136#128#0#0#0#128#240#15#4'DDH'
+ +#136#128#0#0#0#128#255#255#15#8#136#136#136#128#0#0#0#128#255#255#0#136#136
+ +#136#136#128#0#0#0#128#0#0#8#136#136#136#136#128#0#0#0#136#136#136#136#136
+ +#136#136#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#9'NumGlyphs'
+ +#2#0#7'OnClick'#7#18'CopyByteKeySbClick'#0#0#6'TLabel'#6'Label4'#4'Left'#2#8
+ +#6'Height'#2#14#3'Top'#2#12#5'Width'#2';'#7'Caption'#6#10'Key &Type:'#5'Colo'
+ +'r'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#8#6'Heig'
+ +'ht'#2#14#3'Top'#2'('#5'Width'#2'L'#7'Caption'#6#12'Key &Phrase:'#5'Color'#7
+ +#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2#8#6'Height'#2
+ +#14#3'Top'#2'z'#5'Width'#2#23#7'Caption'#6#4'Key:'#5'Color'#7#6'clNone'#11'P'
+ +'arentColor'#8#0#0#7'TButton'#11'GenerateBtn'#4'Left'#3'X'#1#6'Height'#2#25#4
+ +'Hint'#6#12'Generate key'#3'Top'#2#9#5'Width'#2'g'#25'BorderSpacing.InnerBor'
+ +'der'#2#4#7'Caption'#6#13'&Generate key'#7'Enabled'#8#7'OnClick'#7#16'Genera'
+ +'teBtnClick'#8'TabOrder'#2#2#0#0#9'TComboBox'#9'KeyTypeCb'#4'Left'#2'`'#6'He'
+ +'ight'#2#21#3'Top'#2#8#5'Width'#3#169#0#16'AutoCompleteText'#11#22'cbactEndO'
+ +'fLineComplete'#20'cbactSearchAscending'#0#10'ItemHeight'#2#22#13'Items.Stri'
+ +'ngs'#1#6#6'Random'#6#13'Standard Text'#6#19'Case-sensitive Text'#0#9'MaxLen'
+ +'gth'#2#0#8'OnChange'#7#15'KeyTypeCbChange'#5'Style'#7#14'csDropDownList'#8
+ +'TabOrder'#2#4#0#0#5'TMemo'#11'KeyStringMe'#4'Left'#2#8#6'Height'#2'1'#3'Top'
+ +#2'@'#5'Width'#3#184#1#8'OnChange'#7#17'KeyStringMeChange'#10'ScrollBars'#7
+ +#10'ssVertical'#8'TabOrder'#2#0#0#0#5'TEdit'#10'BlockKeyEd'#4'Left'#2#8#6'He'
+ +'ight'#2#20#3'Top'#3#138#0#5'Width'#3#159#1#8'OnChange'#7#16'BlockKeyEdChang'
+ +'e'#8'TabOrder'#2#1#0#0#5'TEdit'#9'ByteKeyEd'#4'Left'#2#8#6'Height'#2#20#3'T'
+ +'op'#3#162#0#5'Width'#3#159#1#8'OnChange'#7#15'ByteKeyEdChange'#8'TabOrder'#2
+ +#3#0#0#0#0
+]);
diff --git a/components/onguard/source/qonguard1.pas b/components/onguard/source/qonguard1.pas
new file mode 100644
index 000000000..164b65229
--- /dev/null
+++ b/components/onguard/source/qonguard1.pas
@@ -0,0 +1,238 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* ONGUARD1.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I ONGUARD.INC}
+
+
+unit qonguard1;
+ {-Key generation dialog}
+
+interface
+
+uses
+ SysUtils,Classes, Graphics, Controls, Forms, Dialogs,
+ StdCtrls, Buttons, ExtCtrls,LResources,
+ ogutil, onguard;
+
+type
+ TKeyGenerateFrm = class(TForm)
+ OKBtn: TBitBtn;
+ CancelBtn: TBitBtn;
+ Panel1: TPanel;
+ Label4: TLabel;
+ Label2: TLabel;
+ Label3: TLabel;
+ GenerateBtn: TButton;
+ KeyTypeCb: TComboBox;
+ KeyStringMe: TMemo;
+ CopyBlockSb: TSpeedButton;
+ CopyByteKeySb: TSpeedButton;
+ BlockKeyEd: TEdit;
+ ByteKeyEd: TEdit;
+ procedure FormCreate(Sender: TObject);
+ procedure FormShow(Sender: TObject);
+ procedure KeyTypeCbChange(Sender: TObject);
+ procedure KeyStringMeChange(Sender: TObject);
+ procedure BlockKeyEdChange(Sender: TObject);
+ procedure ByteKeyEdChange(Sender: TObject);
+ procedure CopyBlockSbClick(Sender: TObject);
+ procedure CopyByteKeySbClick(Sender: TObject);
+ procedure GenerateBtnClick(Sender: TObject);
+ private
+ { Private declarations }
+ FKey : TKey;
+ FKeyType : TKeyType;
+
+ procedure SetKeyType(Value : TKeyType);
+
+ public
+ { Public declarations }
+ procedure SetKey(Value : TKey); {!!.08}
+ procedure GetKey(var Value : TKey); {!!.08}
+
+ property KeyType : TKeyType
+ read FKeyType
+ write SetKeyType;
+
+ end;
+
+var
+ KeyGenerateFrm: TKeyGenerateFrm;
+
+implementation
+
+
+
+procedure TKeyGenerateFrm.FormCreate(Sender: TObject);
+begin
+ KeyTypeCb.ItemIndex := Ord(FKeyType);
+
+ {set state of memo and generate button}
+ KeyStringMe.Enabled := (KeyTypeCb.ItemIndex <> 0);
+ case KeyStringMe.Enabled of
+ True : KeyStringMe.Color := clWindow;
+ False : KeyStringMe.Color := clBtnFace;
+ end;
+
+ GenerateBtn.Enabled := (KeyTypeCb.ItemIndex = 0) or
+ (KeyStringMe.Lines.Count > 0);
+end;
+
+procedure TKeyGenerateFrm.FormShow(Sender: TObject);
+begin
+ KeyTypeCbChange(Sender);
+end;
+
+procedure TKeyGenerateFrm.KeyTypeCbChange(Sender: TObject);
+begin
+ BlockKeyEd.Text := '';
+ ByteKeyEd.Text := '';
+
+ {set state of memo and generate button}
+ KeyStringMe.Enabled := (KeyTypeCb.ItemIndex <> 0);
+ case KeyStringMe.Enabled of
+ True : KeyStringMe.Color := clWindow;
+ False : KeyStringMe.Color := clBtnFace;
+ end;
+ GenerateBtn.Enabled := (KeyTypeCb.ItemIndex = 0) or
+ (KeyStringMe.Lines.Count > 0);
+
+ if KeyTypeCb.ItemIndex > -1 then
+ FKeyType := TKeyType(KeyTypeCb.ItemIndex);
+end;
+
+procedure TKeyGenerateFrm.KeyStringMeChange(Sender: TObject);
+begin
+ BlockKeyEd.Text := '';
+ ByteKeyEd.Text := '';
+
+ {set state of generate button}
+ GenerateBtn.Enabled := (KeyTypeCb.ItemIndex = 0) or
+ (KeyStringMe.Lines.Count > 0);
+end;
+
+procedure TKeyGenerateFrm.BlockKeyEdChange(Sender: TObject);
+begin
+ CopyBlockSb.Enabled := (BlockKeyEd.Text <> '');
+end;
+
+procedure TKeyGenerateFrm.ByteKeyEdChange(Sender: TObject);
+begin
+ CopyByteKeySb.Enabled := (ByteKeyEd.Text <> '');
+end;
+
+procedure TKeyGenerateFrm.CopyBlockSbClick(Sender: TObject);
+var
+ OldSelStart: Integer;
+begin
+ if (BlockKeyEd.SelLength > 0) then
+ BlockKeyEd.CopyToClipboard
+ else begin
+ OldSelStart := BlockKeyEd.SelStart;
+ BlockKeyEd.SelStart := 0;
+ BlockKeyEd.SelLength := MaxInt;
+ BlockKeyEd.CopyToClipboard;
+ BlockKeyEd.SelStart := OldSelStart;
+ BlockKeyEd.SelLength := 0;
+ end;
+end;
+
+procedure TKeyGenerateFrm.CopyByteKeySbClick(Sender: TObject);
+var
+ OldSelStart: Integer;
+begin
+ if (ByteKeyEd.SelLength > 0) then
+ ByteKeyEd.CopyToClipboard
+ else begin
+ OldSelStart := ByteKeyEd.SelStart;
+ ByteKeyEd.SelStart := 0;
+ ByteKeyEd.SelLength := MaxInt;
+ ByteKeyEd.CopyToClipboard;
+ ByteKeyEd.SelStart := OldSelStart;
+ ByteKeyEd.SelLength := 0;
+ end;
+end;
+
+procedure TKeyGenerateFrm.GenerateBtnClick(Sender: TObject);
+begin
+ case KeyTypeCb.ItemIndex of
+ 0:
+ begin
+ Screen.Cursor := crHourGlass;
+ try
+ GenerateRandomKeyPrim(FKey, SizeOf(FKey));
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ ByteKeyEd.Text := BufferToHexBytes(FKey, SizeOf(FKey));
+ finally
+ Screen.Cursor := crDefault;
+ end;
+ end;
+ 1:
+ begin
+ GenerateTMDKeyPrim(FKey, SizeOf(FKey), AnsiUpperCase(KeyStringMe.Text));
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ ByteKeyEd.Text := BufferToHexBytes(FKey, SizeOf(FKey));
+ end;
+ 2:
+ begin
+ GenerateTMDKeyPrim(FKey, SizeOf(FKey), KeyStringMe.Text);
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ ByteKeyEd.Text := BufferToHexBytes(FKey, SizeOf(FKey));
+ end;
+ end;
+end;
+
+procedure TKeyGenerateFrm.SetKeyType(Value : TKeyType);
+begin
+ if Value <> FKeyType then begin
+ FKeyType := Value;
+ KeyTypeCb.ItemIndex := Ord(FKeyType);
+ end;
+end;
+
+procedure TKeyGenerateFrm.GetKey(var Value : TKey);
+begin
+ Value := FKey;
+end;
+
+procedure TKeyGenerateFrm.SetKey(Value : TKey);
+begin
+ FKey := Value;
+end;
+
+
+initialization
+{$I qonguard1.lrs}
+
+end.
diff --git a/components/onguard/source/qonguard2.lfm b/components/onguard/source/qonguard2.lfm
new file mode 100644
index 000000000..e949d708e
--- /dev/null
+++ b/components/onguard/source/qonguard2.lfm
@@ -0,0 +1,534 @@
+object CodeGenerateFrm: TCodeGenerateFrm
+ Left = 228
+ Height = 516
+ Top = 84
+ Width = 556
+ HorzScrollBar.Page = 555
+ VertScrollBar.Page = 515
+ ActiveControl = OKBtn
+ BorderIcons = [biSystemMenu, biMinimize]
+ Caption = 'Code Generation'
+ Color = clForm
+ OnCreate = FormCreate
+ OnShow = FormShow
+ Position = poScreenCenter
+ object OKBtn: TBitBtn
+ Left = 384
+ Height = 25
+ Top = 472
+ Width = 75
+ Caption = 'OK'
+ ModalResult = 1
+ NumGlyphs = 0
+ TabOrder = 0
+ end
+ object CancelBtn: TBitBtn
+ Left = 464
+ Height = 25
+ Top = 472
+ Width = 75
+ Caption = 'Cancel'
+ ModalResult = 2
+ NumGlyphs = 0
+ TabOrder = 1
+ end
+ object CodesNbk: TPageControl
+ Left = 4
+ Height = 130
+ Top = 4
+ Width = 533
+ ActivePage = TabSheet1
+ TabIndex = 0
+ TabOrder = 2
+ OnChanging = CodesNbkChanging
+ object TabSheet1: TTabSheet
+ Caption = 'Date'
+ object Label9: TLabel
+ Left = 4
+ Height = 13
+ Top = 12
+ Width = 64
+ Caption = 'Start date:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label11: TLabel
+ Left = 204
+ Height = 13
+ Top = 12
+ Width = 64
+ Caption = 'End date:'
+ Color = clNone
+ ParentColor = False
+ end
+ object StartDateEd: TEdit
+ Left = 92
+ Height = 21
+ Top = 8
+ Width = 101
+ OnChange = ParametersChanged
+ OnKeyPress = DateEdKeyPress
+ TabOrder = 0
+ end
+ object EndDateEd: TEdit
+ Left = 284
+ Height = 21
+ Top = 8
+ Width = 101
+ OnChange = ParametersChanged
+ OnKeyPress = DateEdKeyPress
+ TabOrder = 1
+ end
+ end
+ object TabSheet2: TTabSheet
+ Caption = 'Days'
+ ImageIndex = 1
+ object Label13: TLabel
+ Left = 4
+ Height = 13
+ Top = 12
+ Width = 52
+ Caption = 'Day count:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label2: TLabel
+ Left = 228
+ Height = 13
+ Top = 12
+ Width = 37
+ Caption = 'Expires:'
+ Color = clNone
+ ParentColor = False
+ end
+ object DaysCountEd: TEdit
+ Left = 88
+ Height = 21
+ Top = 8
+ Width = 113
+ OnChange = ParametersChanged
+ OnKeyPress = NumberKeyEdPress
+ TabOrder = 0
+ Text = '0'
+ end
+ object DaysExpiresEd: TEdit
+ Left = 296
+ Height = 21
+ Top = 8
+ Width = 97
+ OnChange = ParametersChanged
+ OnKeyPress = DateEdKeyPress
+ TabOrder = 1
+ end
+ end
+ object TabSheet3: TTabSheet
+ Caption = 'Reg'
+ ImageIndex = 2
+ object RegStrCopySb: TSpeedButton
+ Left = 490
+ Height = 23
+ Hint = 'Copy to clipboard'
+ Top = 7
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888888444444444800000008888
+ 8884FFFFFFF48000000088888884F00000F48000000080000004FFFFFFF48000
+ 000080FFFFF4F00000F48000000080F00004FFFFFFF48000000080FFFFF4F00F
+ 44448000000080F00004FFFF4F488000000080FFFFF4FFFF44888000000080F0
+ 0F04444448888000000080FFFF0F088888888000000080FFFF00888888888000
+ 0000800000088888888880000000888888888888888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = RegStrCopySbClick
+ end
+ object Label6: TLabel
+ Left = 8
+ Height = 13
+ Top = 12
+ Width = 30
+ Caption = 'String:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label4: TLabel
+ Left = 292
+ Height = 13
+ Top = 48
+ Width = 37
+ Caption = 'Expires:'
+ Color = clNone
+ ParentColor = False
+ end
+ object RegRandomBtn: TButton
+ Left = 72
+ Height = 25
+ Top = 44
+ Width = 145
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Random Number'
+ OnClick = RegRandomBtnClick
+ TabOrder = 1
+ end
+ object RegStrEd: TEdit
+ Left = 68
+ Height = 21
+ Top = 8
+ Width = 413
+ TabOrder = 0
+ end
+ object RegExpiresEd: TEdit
+ Left = 357
+ Height = 21
+ Top = 44
+ Width = 92
+ OnChange = ParametersChanged
+ OnKeyPress = DateEdKeyPress
+ TabOrder = 2
+ end
+ end
+ object TabSheet4: TTabSheet
+ Caption = 'S/N'
+ ImageIndex = 3
+ object Label7: TLabel
+ Left = 8
+ Height = 13
+ Top = 12
+ Width = 69
+ Caption = '&Serial Number:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label15: TLabel
+ Left = 268
+ Height = 13
+ Top = 12
+ Width = 37
+ Caption = 'Expires:'
+ Color = clNone
+ ParentColor = False
+ end
+ object SerRandomBtn: TButton
+ Left = 8
+ Height = 25
+ Top = 44
+ Width = 145
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Random Number'
+ TabOrder = 2
+ end
+ object SerialNumberEd: TEdit
+ Left = 124
+ Height = 21
+ Top = 8
+ Width = 125
+ OnChange = ParametersChanged
+ OnKeyPress = NumberKeyEdPress
+ TabOrder = 0
+ Text = '0'
+ end
+ object SerialExpiresEd: TEdit
+ Left = 336
+ Height = 21
+ Top = 8
+ Width = 97
+ OnChange = ParametersChanged
+ OnKeyPress = DateEdKeyPress
+ TabOrder = 1
+ end
+ end
+ object TabSheet5: TTabSheet
+ Caption = 'Usage'
+ ImageIndex = 4
+ object Label14: TLabel
+ Left = 4
+ Height = 13
+ Top = 12
+ Width = 64
+ Caption = 'Usage count:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label17: TLabel
+ Left = 268
+ Height = 13
+ Top = 12
+ Width = 37
+ Caption = 'Expires:'
+ Color = clNone
+ ParentColor = False
+ end
+ object UsageCountEd: TEdit
+ Left = 108
+ Height = 21
+ Top = 8
+ Width = 113
+ OnChange = ParametersChanged
+ OnKeyPress = NumberKeyEdPress
+ TabOrder = 0
+ Text = '0'
+ end
+ object UsageExpiresEd: TEdit
+ Left = 336
+ Height = 21
+ Top = 8
+ Width = 97
+ OnChange = ParametersChanged
+ OnKeyPress = DateEdKeyPress
+ TabOrder = 1
+ end
+ end
+ object TabSheet6: TTabSheet
+ Caption = 'Network'
+ ImageIndex = 5
+ object Label10: TLabel
+ Left = 4
+ Height = 13
+ Top = 12
+ Width = 64
+ Caption = 'Access Slots:'
+ Color = clNone
+ ParentColor = False
+ end
+ object NetworkSlotsEd: TEdit
+ Left = 116
+ Height = 21
+ Top = 8
+ Width = 113
+ OnChange = ParametersChanged
+ OnKeyPress = NumberKeyEdPress
+ TabOrder = 0
+ Text = '2'
+ end
+ end
+ object TabSheet7: TTabSheet
+ Caption = 'Special'
+ ImageIndex = 6
+ object Label12: TLabel
+ Left = 4
+ Height = 13
+ Top = 12
+ Width = 62
+ Caption = 'Special data:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label19: TLabel
+ Left = 252
+ Height = 13
+ Top = 12
+ Width = 37
+ Caption = 'Expires:'
+ Color = clNone
+ ParentColor = False
+ end
+ object SpecialDataEd: TEdit
+ Left = 104
+ Height = 21
+ Top = 8
+ Width = 129
+ OnChange = ParametersChanged
+ OnKeyPress = NumberKeyEdPress
+ TabOrder = 0
+ Text = '0'
+ end
+ object SpecialExpiresEd: TEdit
+ Left = 320
+ Height = 21
+ Top = 8
+ Width = 105
+ OnChange = ParametersChanged
+ OnKeyPress = DateEdKeyPress
+ TabOrder = 1
+ end
+ end
+ end
+ object GroupBox1: TGroupBox
+ Left = 4
+ Height = 248
+ Top = 136
+ Width = 540
+ Caption = '&Key used to encode'
+ Color = clBtnFace
+ ParentColor = False
+ TabOrder = 3
+ object GenerateKeySb: TSpeedButton
+ Left = 498
+ Height = 23
+ Hint = 'Generate key'
+ Top = 195
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888888888888888800000008888
+ 8888888888888000000088888888888888888000000088880008888888888000
+ 0000888000008808888080000000880098900808008080000000880089800000
+ 0000800000008800898000000000800000008800989008888888800000008880
+ 0000888888888000000088880008888888888000000088888888888888888000
+ 0000888888888888888880000000888888888888888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = GenerateKeySbClick
+ end
+ object Label1: TLabel
+ Left = 8
+ Height = 13
+ Top = 115
+ Width = 40
+ Caption = 'Modifier:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label5: TLabel
+ Left = 12
+ Height = 13
+ Top = 172
+ Width = 21
+ Caption = 'Key:'
+ Color = clNone
+ ParentColor = False
+ end
+ object NoModifierCb: TCheckBox
+ Left = 16
+ Height = 17
+ Top = 24
+ Width = 129
+ Caption = 'No modifier'
+ Checked = True
+ OnClick = ModifierClick
+ State = cbChecked
+ TabOrder = 0
+ end
+ object MachineModifierCb: TCheckBox
+ Left = 176
+ Height = 17
+ Top = 24
+ Width = 153
+ Caption = 'Machine modifier'
+ OnClick = ModifierClick
+ TabOrder = 1
+ end
+ object UniqueModifierCb: TCheckBox
+ Left = 360
+ Height = 17
+ Top = 24
+ Width = 145
+ Caption = 'Unique modifier'
+ OnClick = ModifierClick
+ TabOrder = 2
+ end
+ object DateModifierCb: TCheckBox
+ Left = 16
+ Height = 17
+ Top = 56
+ Width = 129
+ Caption = 'Date modifier'
+ OnClick = ModifierClick
+ TabOrder = 3
+ end
+ object StringModifierCb: TCheckBox
+ Left = 16
+ Height = 17
+ Top = 88
+ Width = 137
+ Caption = 'String Modifier'
+ OnClick = ModifierClick
+ TabOrder = 4
+ end
+ object ModDateEd: TEdit
+ Left = 159
+ Height = 21
+ Top = 53
+ Width = 98
+ OnChange = ModifierClick
+ OnKeyPress = DateEdKeyPress
+ TabOrder = 6
+ end
+ object ModStringEd: TEdit
+ Left = 160
+ Height = 21
+ Top = 85
+ Width = 361
+ OnChange = ModifierClick
+ TabOrder = 8
+ end
+ object ModifierEd: TEdit
+ Left = 8
+ Height = 21
+ Top = 140
+ Width = 169
+ OnChange = ParametersChanged
+ OnKeyPress = ModifierEdKeyPress
+ TabOrder = 5
+ end
+ object BlockKeyEd: TEdit
+ Left = 8
+ Height = 21
+ Top = 196
+ Width = 481
+ OnChange = InfoChanged
+ TabOrder = 7
+ end
+ end
+ object GroupBox2: TGroupBox
+ Left = 8
+ Height = 69
+ Top = 384
+ Width = 536
+ Caption = 'Generate Code'
+ TabOrder = 4
+ object RegCodeCopySb: TSpeedButton
+ Left = 502
+ Height = 23
+ Hint = 'Copy code to clipboard'
+ Top = 25
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888888444444444800000008888
+ 8884FFFFFFF48000000088888884F00000F48000000080000004FFFFFFF48000
+ 000080FFFFF4F00000F48000000080F00004FFFFFFF48000000080FFFFF4F00F
+ 44448000000080F00004FFFF4F488000000080FFFFF4FFFF44888000000080F0
+ 0F04444448888000000080FFFF0F088888888000000080FFFF00888888888000
+ 0000800000088888888880000000888888888888888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = RegCodeCopySbClick
+ end
+ object GenerateBtn: TButton
+ Left = 8
+ Height = 25
+ Hint = 'Generate code'
+ Top = 24
+ Width = 77
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Generate'
+ Default = True
+ OnClick = GenerateBtnClick
+ TabOrder = 0
+ end
+ object RegCodeEd: TEdit
+ Left = 96
+ Height = 21
+ Top = 26
+ Width = 401
+ OnChange = InfoChanged
+ TabOrder = 1
+ end
+ end
+end
diff --git a/components/onguard/source/qonguard2.lrs b/components/onguard/source/qonguard2.lrs
new file mode 100644
index 000000000..70615ef6b
--- /dev/null
+++ b/components/onguard/source/qonguard2.lrs
@@ -0,0 +1,163 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TCodeGenerateFrm','FORMDATA',[
+ 'TPF0'#16'TCodeGenerateFrm'#15'CodeGenerateFrm'#4'Left'#3#228#0#6'Height'#3#4
+ +#2#3'Top'#2'T'#5'Width'#3','#2#18'HorzScrollBar.Page'#3'+'#2#18'VertScrollBa'
+ +'r.Page'#3#3#2#13'ActiveControl'#7#5'OKBtn'#11'BorderIcons'#11#12'biSystemMe'
+ +'nu'#10'biMinimize'#0#7'Caption'#6#15'Code Generation'#5'Color'#7#6'clForm'#8
+ +'OnCreate'#7#10'FormCreate'#6'OnShow'#7#8'FormShow'#8'Position'#7#14'poScree'
+ +'nCenter'#0#7'TBitBtn'#5'OKBtn'#4'Left'#3#128#1#6'Height'#2#25#3'Top'#3#216#1
+ +#5'Width'#2'K'#7'Caption'#6#2'OK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#8'Tab'
+ +'Order'#2#0#0#0#7'TBitBtn'#9'CancelBtn'#4'Left'#3#208#1#6'Height'#2#25#3'Top'
+ +#3#216#1#5'Width'#2'K'#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#9'NumGlyph'
+ +'s'#2#0#8'TabOrder'#2#1#0#0#12'TPageControl'#8'CodesNbk'#4'Left'#2#4#6'Heigh'
+ +'t'#3#130#0#3'Top'#2#4#5'Width'#3#21#2#10'ActivePage'#7#9'TabSheet1'#8'TabIn'
+ +'dex'#2#0#8'TabOrder'#2#2#10'OnChanging'#7#16'CodesNbkChanging'#0#9'TTabShee'
+ +'t'#9'TabSheet1'#7'Caption'#6#4'Date'#0#6'TLabel'#6'Label9'#4'Left'#2#4#6'He'
+ +'ight'#2#13#3'Top'#2#12#5'Width'#2'@'#7'Caption'#6#11'Start date:'#5'Color'#7
+ +#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#7'Label11'#4'Left'#3#204#0#6'Heig'
+ +'ht'#2#13#3'Top'#2#12#5'Width'#2'@'#7'Caption'#6#9'End date:'#5'Color'#7#6'c'
+ +'lNone'#11'ParentColor'#8#0#0#5'TEdit'#11'StartDateEd'#4'Left'#2'\'#6'Height'
+ +#2#21#3'Top'#2#8#5'Width'#2'e'#8'OnChange'#7#17'ParametersChanged'#10'OnKeyP'
+ +'ress'#7#14'DateEdKeyPress'#8'TabOrder'#2#0#0#0#5'TEdit'#9'EndDateEd'#4'Left'
+ +#3#28#1#6'Height'#2#21#3'Top'#2#8#5'Width'#2'e'#8'OnChange'#7#17'ParametersC'
+ +'hanged'#10'OnKeyPress'#7#14'DateEdKeyPress'#8'TabOrder'#2#1#0#0#0#9'TTabShe'
+ +'et'#9'TabSheet2'#7'Caption'#6#4'Days'#10'ImageIndex'#2#1#0#6'TLabel'#7'Labe'
+ +'l13'#4'Left'#2#4#6'Height'#2#13#3'Top'#2#12#5'Width'#2'4'#7'Caption'#6#10'D'
+ +'ay count:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4
+ +'Left'#3#228#0#6'Height'#2#13#3'Top'#2#12#5'Width'#2'%'#7'Caption'#6#8'Expir'
+ +'es:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#5'TEdit'#11'DaysCountEd'#4
+ +'Left'#2'X'#6'Height'#2#21#3'Top'#2#8#5'Width'#2'q'#8'OnChange'#7#17'Paramet'
+ +'ersChanged'#10'OnKeyPress'#7#16'NumberKeyEdPress'#8'TabOrder'#2#0#4'Text'#6
+ +#1'0'#0#0#5'TEdit'#13'DaysExpiresEd'#4'Left'#3'('#1#6'Height'#2#21#3'Top'#2#8
+ +#5'Width'#2'a'#8'OnChange'#7#17'ParametersChanged'#10'OnKeyPress'#7#14'DateE'
+ +'dKeyPress'#8'TabOrder'#2#1#0#0#0#9'TTabSheet'#9'TabSheet3'#7'Caption'#6#3'R'
+ +'eg'#10'ImageIndex'#2#2#0#12'TSpeedButton'#12'RegStrCopySb'#4'Left'#3#234#1#6
+ +'Height'#2#23#4'Hint'#6#17'Copy to clipboard'#3'Top'#2#7#5'Width'#2#23#5'Col'
+ +'or'#7#9'clBtnFace'#10'Glyph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'
+ +#0#0#0'('#0#0#0#17#0#0#0#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0
+ +#128#128#0#0#128#128#128#0#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255
+ +#0#0#0#255#0#255#0#255#255#0#0#255#255#255#0#136#136#136#136#136#136#136#136
+ +#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#132'DDDD'
+ +#128#0#0#0#136#136#136#132#255#255#255#244#128#0#0#0#136#136#136#132#240#0#0
+ +#244#128#0#0#0#128#0#0#4#255#255#255#244#128#0#0#0#128#255#255#244#240#0#0
+ +#244#128#0#0#0#128#240#0#4#255#255#255#244#128#0#0#0#128#255#255#244#240#15
+ +'DD'#128#0#0#0#128#240#0#4#255#255'OH'#128#0#0#0#128#255#255#244#255#255'D'
+ +#136#128#0#0#0#128#240#15#4'DDH'#136#128#0#0#0#128#255#255#15#8#136#136#136
+ +#128#0#0#0#128#255#255#0#136#136#136#136#128#0#0#0#128#0#0#8#136#136#136#136
+ +#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136
+ +#136#136#128#0#0#0#9'NumGlyphs'#2#0#7'OnClick'#7#17'RegStrCopySbClick'#0#0#6
+ +'TLabel'#6'Label6'#4'Left'#2#8#6'Height'#2#13#3'Top'#2#12#5'Width'#2#30#7'Ca'
+ +'ption'#6#7'String:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6
+ +'Label4'#4'Left'#3'$'#1#6'Height'#2#13#3'Top'#2'0'#5'Width'#2'%'#7'Caption'#6
+ +#8'Expires:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#7'TButton'#12'RegRan'
+ +'domBtn'#4'Left'#2'H'#6'Height'#2#25#3'Top'#2','#5'Width'#3#145#0#25'BorderS'
+ +'pacing.InnerBorder'#2#4#7'Caption'#6#14'&Random Number'#7'OnClick'#7#17'Reg'
+ +'RandomBtnClick'#8'TabOrder'#2#1#0#0#5'TEdit'#8'RegStrEd'#4'Left'#2'D'#6'Hei'
+ +'ght'#2#21#3'Top'#2#8#5'Width'#3#157#1#8'TabOrder'#2#0#0#0#5'TEdit'#12'RegEx'
+ +'piresEd'#4'Left'#3'e'#1#6'Height'#2#21#3'Top'#2','#5'Width'#2'\'#8'OnChange'
+ +#7#17'ParametersChanged'#10'OnKeyPress'#7#14'DateEdKeyPress'#8'TabOrder'#2#2
+ +#0#0#0#9'TTabSheet'#9'TabSheet4'#7'Caption'#6#3'S/N'#10'ImageIndex'#2#3#0#6
+ +'TLabel'#6'Label7'#4'Left'#2#8#6'Height'#2#13#3'Top'#2#12#5'Width'#2'E'#7'Ca'
+ +'ption'#6#15'&Serial Number:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'T'
+ +'Label'#7'Label15'#4'Left'#3#12#1#6'Height'#2#13#3'Top'#2#12#5'Width'#2'%'#7
+ +'Caption'#6#8'Expires:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#7'TButton'
+ +#12'SerRandomBtn'#4'Left'#2#8#6'Height'#2#25#3'Top'#2','#5'Width'#3#145#0#25
+ +'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#14'&Random Number'#8'TabOrder'#2
+ ,#2#0#0#5'TEdit'#14'SerialNumberEd'#4'Left'#2'|'#6'Height'#2#21#3'Top'#2#8#5
+ +'Width'#2'}'#8'OnChange'#7#17'ParametersChanged'#10'OnKeyPress'#7#16'NumberK'
+ +'eyEdPress'#8'TabOrder'#2#0#4'Text'#6#1'0'#0#0#5'TEdit'#15'SerialExpiresEd'#4
+ +'Left'#3'P'#1#6'Height'#2#21#3'Top'#2#8#5'Width'#2'a'#8'OnChange'#7#17'Param'
+ +'etersChanged'#10'OnKeyPress'#7#14'DateEdKeyPress'#8'TabOrder'#2#1#0#0#0#9'T'
+ +'TabSheet'#9'TabSheet5'#7'Caption'#6#5'Usage'#10'ImageIndex'#2#4#0#6'TLabel'
+ +#7'Label14'#4'Left'#2#4#6'Height'#2#13#3'Top'#2#12#5'Width'#2'@'#7'Caption'#6
+ +#12'Usage count:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#7'Lab'
+ +'el17'#4'Left'#3#12#1#6'Height'#2#13#3'Top'#2#12#5'Width'#2'%'#7'Caption'#6#8
+ +'Expires:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#5'TEdit'#12'UsageCount'
+ +'Ed'#4'Left'#2'l'#6'Height'#2#21#3'Top'#2#8#5'Width'#2'q'#8'OnChange'#7#17'P'
+ +'arametersChanged'#10'OnKeyPress'#7#16'NumberKeyEdPress'#8'TabOrder'#2#0#4'T'
+ +'ext'#6#1'0'#0#0#5'TEdit'#14'UsageExpiresEd'#4'Left'#3'P'#1#6'Height'#2#21#3
+ +'Top'#2#8#5'Width'#2'a'#8'OnChange'#7#17'ParametersChanged'#10'OnKeyPress'#7
+ +#14'DateEdKeyPress'#8'TabOrder'#2#1#0#0#0#9'TTabSheet'#9'TabSheet6'#7'Captio'
+ +'n'#6#7'Network'#10'ImageIndex'#2#5#0#6'TLabel'#7'Label10'#4'Left'#2#4#6'Hei'
+ +'ght'#2#13#3'Top'#2#12#5'Width'#2'@'#7'Caption'#6#13'Access Slots:'#5'Color'
+ +#7#6'clNone'#11'ParentColor'#8#0#0#5'TEdit'#14'NetworkSlotsEd'#4'Left'#2't'#6
+ +'Height'#2#21#3'Top'#2#8#5'Width'#2'q'#8'OnChange'#7#17'ParametersChanged'#10
+ +'OnKeyPress'#7#16'NumberKeyEdPress'#8'TabOrder'#2#0#4'Text'#6#1'2'#0#0#0#9'T'
+ +'TabSheet'#9'TabSheet7'#7'Caption'#6#7'Special'#10'ImageIndex'#2#6#0#6'TLabe'
+ +'l'#7'Label12'#4'Left'#2#4#6'Height'#2#13#3'Top'#2#12#5'Width'#2'>'#7'Captio'
+ +'n'#6#13'Special data:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'
+ +#7'Label19'#4'Left'#3#252#0#6'Height'#2#13#3'Top'#2#12#5'Width'#2'%'#7'Capti'
+ +'on'#6#8'Expires:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#5'TEdit'#13'Sp'
+ +'ecialDataEd'#4'Left'#2'h'#6'Height'#2#21#3'Top'#2#8#5'Width'#3#129#0#8'OnCh'
+ +'ange'#7#17'ParametersChanged'#10'OnKeyPress'#7#16'NumberKeyEdPress'#8'TabOr'
+ +'der'#2#0#4'Text'#6#1'0'#0#0#5'TEdit'#16'SpecialExpiresEd'#4'Left'#3'@'#1#6
+ +'Height'#2#21#3'Top'#2#8#5'Width'#2'i'#8'OnChange'#7#17'ParametersChanged'#10
+ +'OnKeyPress'#7#14'DateEdKeyPress'#8'TabOrder'#2#1#0#0#0#0#9'TGroupBox'#9'Gro'
+ +'upBox1'#4'Left'#2#4#6'Height'#3#248#0#3'Top'#3#136#0#5'Width'#3#28#2#7'Capt'
+ +'ion'#6#19'&Key used to encode'#5'Color'#7#9'clBtnFace'#11'ParentColor'#8#8
+ +'TabOrder'#2#3#0#12'TSpeedButton'#13'GenerateKeySb'#4'Left'#3#242#1#6'Height'
+ +#2#23#4'Hint'#6#12'Generate key'#3'Top'#3#195#0#5'Width'#2#23#5'Color'#7#9'c'
+ +'lBtnFace'#10'Glyph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('
+ +#0#0#0#17#0#0#0#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128
+ +#0#0#128#128#128#0#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0
+ +#255#0#255#0#255#255#0#0#255#255#255#0#136#136#136#136#136#136#136#136#128#0
+ +#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136
+ +#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136
+ +#136#136#136#128#0#0#0#136#136#0#8#136#136#136#136#128#0#0#0#136#128#0#0#136
+ +#8#136#128#128#0#0#0#136#0#152#144#8#8#0#128#128#0#0#0#136#0#137#128#0#0#0#0
+ +#128#0#0#0#136#0#137#128#0#0#0#0#128#0#0#0#136#0#152#144#8#136#136#136#128#0
+ +#0#0#136#128#0#0#136#136#136#136#128#0#0#0#136#136#0#8#136#136#136#136#128#0
+ +#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136
+ +#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136
+ +#136#136#136#128#0#0#0#9'NumGlyphs'#2#0#7'OnClick'#7#18'GenerateKeySbClick'#0
+ +#0#6'TLabel'#6'Label1'#4'Left'#2#8#6'Height'#2#13#3'Top'#2's'#5'Width'#2'('#7
+ +'Caption'#6#9'Modifier:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'
+ +#6'Label5'#4'Left'#2#12#6'Height'#2#13#3'Top'#3#172#0#5'Width'#2#21#7'Captio'
+ +'n'#6#4'Key:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#9'TCheckBox'#12'NoM'
+ +'odifierCb'#4'Left'#2#16#6'Height'#2#17#3'Top'#2#24#5'Width'#3#129#0#7'Capti'
+ +'on'#6#11'No modifier'#7'Checked'#9#7'OnClick'#7#13'ModifierClick'#5'State'#7
+ +#9'cbChecked'#8'TabOrder'#2#0#0#0#9'TCheckBox'#17'MachineModifierCb'#4'Left'
+ +#3#176#0#6'Height'#2#17#3'Top'#2#24#5'Width'#3#153#0#7'Caption'#6#16'Machine'
+ +' modifier'#7'OnClick'#7#13'ModifierClick'#8'TabOrder'#2#1#0#0#9'TCheckBox'
+ +#16'UniqueModifierCb'#4'Left'#3'h'#1#6'Height'#2#17#3'Top'#2#24#5'Width'#3
+ +#145#0#7'Caption'#6#15'Unique modifier'#7'OnClick'#7#13'ModifierClick'#8'Tab'
+ +'Order'#2#2#0#0#9'TCheckBox'#14'DateModifierCb'#4'Left'#2#16#6'Height'#2#17#3
+ +'Top'#2'8'#5'Width'#3#129#0#7'Caption'#6#13'Date modifier'#7'OnClick'#7#13'M'
+ +'odifierClick'#8'TabOrder'#2#3#0#0#9'TCheckBox'#16'StringModifierCb'#4'Left'
+ +#2#16#6'Height'#2#17#3'Top'#2'X'#5'Width'#3#137#0#7'Caption'#6#15'String Mod'
+ +'ifier'#7'OnClick'#7#13'ModifierClick'#8'TabOrder'#2#4#0#0#5'TEdit'#9'ModDat'
+ ,'eEd'#4'Left'#3#159#0#6'Height'#2#21#3'Top'#2'5'#5'Width'#2'b'#8'OnChange'#7
+ +#13'ModifierClick'#10'OnKeyPress'#7#14'DateEdKeyPress'#8'TabOrder'#2#6#0#0#5
+ +'TEdit'#11'ModStringEd'#4'Left'#3#160#0#6'Height'#2#21#3'Top'#2'U'#5'Width'#3
+ +'i'#1#8'OnChange'#7#13'ModifierClick'#8'TabOrder'#2#8#0#0#5'TEdit'#10'Modifi'
+ +'erEd'#4'Left'#2#8#6'Height'#2#21#3'Top'#3#140#0#5'Width'#3#169#0#8'OnChange'
+ +#7#17'ParametersChanged'#10'OnKeyPress'#7#18'ModifierEdKeyPress'#8'TabOrder'
+ +#2#5#0#0#5'TEdit'#10'BlockKeyEd'#4'Left'#2#8#6'Height'#2#21#3'Top'#3#196#0#5
+ +'Width'#3#225#1#8'OnChange'#7#11'InfoChanged'#8'TabOrder'#2#7#0#0#0#9'TGroup'
+ +'Box'#9'GroupBox2'#4'Left'#2#8#6'Height'#2'E'#3'Top'#3#128#1#5'Width'#3#24#2
+ +#7'Caption'#6#13'Generate Code'#8'TabOrder'#2#4#0#12'TSpeedButton'#13'RegCod'
+ +'eCopySb'#4'Left'#3#246#1#6'Height'#2#23#4'Hint'#6#22'Copy code to clipboard'
+ +#3'Top'#2#25#5'Width'#2#23#5'Color'#7#9'clBtnFace'#10'Glyph.Data'#10'F'#1#0#0
+ +'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0#0#0#17#0#0#0#17#0#0#0#1#0#4#0#0#0
+ +#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#128#0#0#128#0#0#0
+ +#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#128#128#128#0#192#192#192#0#0#0
+ +#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255#0#255#255#0#0#255#255#255#0
+ +#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136#136
+ +#128#0#0#0#136#136#136#132'DDDD'#128#0#0#0#136#136#136#132#255#255#255#244
+ +#128#0#0#0#136#136#136#132#240#0#0#244#128#0#0#0#128#0#0#4#255#255#255#244
+ +#128#0#0#0#128#255#255#244#240#0#0#244#128#0#0#0#128#240#0#4#255#255#255#244
+ +#128#0#0#0#128#255#255#244#240#15'DD'#128#0#0#0#128#240#0#4#255#255'OH'#128#0
+ +#0#0#128#255#255#244#255#255'D'#136#128#0#0#0#128#240#15#4'DDH'#136#128#0#0#0
+ +#128#255#255#15#8#136#136#136#128#0#0#0#128#255#255#0#136#136#136#136#128#0#0
+ +#0#128#0#0#8#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0
+ +#0#0#136#136#136#136#136#136#136#136#128#0#0#0#9'NumGlyphs'#2#0#7'OnClick'#7
+ +#18'RegCodeCopySbClick'#0#0#7'TButton'#11'GenerateBtn'#4'Left'#2#8#6'Height'
+ +#2#25#4'Hint'#6#13'Generate code'#3'Top'#2#24#5'Width'#2'M'#25'BorderSpacing'
+ +'.InnerBorder'#2#4#7'Caption'#6#9'&Generate'#7'Default'#9#7'OnClick'#7#16'Ge'
+ +'nerateBtnClick'#8'TabOrder'#2#0#0#0#5'TEdit'#9'RegCodeEd'#4'Left'#2'`'#6'He'
+ +'ight'#2#21#3'Top'#2#26#5'Width'#3#145#1#8'OnChange'#7#11'InfoChanged'#8'Tab'
+ +'Order'#2#1#0#0#0#0
+]);
diff --git a/components/onguard/source/qonguard2.pas b/components/onguard/source/qonguard2.pas
new file mode 100644
index 000000000..08da12be4
--- /dev/null
+++ b/components/onguard/source/qonguard2.pas
@@ -0,0 +1,667 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* ONGUARD3.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I ONGUARD.INC}
+
+
+unit qonguard2;
+ {-Code generation dialog}
+
+interface
+
+uses
+//{$IFDEF MSWINDOWS} {AH.01}
+// Windows,
+// Messages, {AH.01}
+//{$ENDIF} {AH.01}
+//{$IFDEF UsingCLX} {AH.01}
+// Types, {AH.01}
+//{$ENDIF} {AH.01}
+ LCLIntf,
+ LResources,
+//{$IFDEF LINUX} {AH.01}
+// Libc, {AH.01}
+//{$ENDIF} {AH.01}
+ SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
+ StdCtrls, Buttons, ComCtrls,
+ ogconst,
+ ognetwrk,
+ ogutil,
+ onguard,
+ qonguard3; {AH.01}
+
+(*
+{$IFDEF MSWINDOWS} {AH.01}
+const
+ OGM_CHECK = WM_USER + 100;
+ OGM_QUIT = WM_USER + 101;
+{$ENDIF} {AH.01}
+*)
+
+type
+ TCodeGenerateFrm = class(TForm)
+ OKBtn: TBitBtn;
+ CancelBtn: TBitBtn;
+ CodesNbk: TPageControl;
+ TabSheet1: TTabSheet;
+ TabSheet2: TTabSheet;
+ TabSheet3: TTabSheet;
+ TabSheet4: TTabSheet;
+ TabSheet5: TTabSheet;
+ TabSheet6: TTabSheet;
+ TabSheet7: TTabSheet;
+ Label9: TLabel;
+ Label11: TLabel;
+ Label13: TLabel;
+ Label2: TLabel;
+ Label6: TLabel;
+ RegRandomBtn: TButton;
+ Label4: TLabel;
+ RegStrCopySb: TSpeedButton;
+ Label7: TLabel;
+ Label15: TLabel;
+ SerRandomBtn: TButton;
+ Label14: TLabel;
+ Label17: TLabel;
+ Label10: TLabel;
+ Label12: TLabel;
+ Label19: TLabel;
+ GroupBox1: TGroupBox;
+ NoModifierCb: TCheckBox;
+ MachineModifierCb: TCheckBox;
+ UniqueModifierCb: TCheckBox;
+ DateModifierCb: TCheckBox;
+ StringModifierCb: TCheckBox;
+ Label1: TLabel;
+ Label5: TLabel;
+ GenerateKeySb: TSpeedButton;
+ GroupBox2: TGroupBox;
+ GenerateBtn: TButton;
+ RegCodeCopySb: TSpeedButton;
+ ModDateEd: TEdit;
+ ModStringEd: TEdit;
+ ModifierEd: TEdit;
+ BlockKeyEd: TEdit;
+ RegCodeEd: TEdit;
+ StartDateEd: TEdit;
+ EndDateEd: TEdit;
+ DaysCountEd: TEdit;
+ DaysExpiresEd: TEdit;
+ RegStrEd: TEdit;
+ RegExpiresEd: TEdit;
+ SerialNumberEd: TEdit;
+ SerialExpiresEd: TEdit;
+ UsageCountEd: TEdit;
+ UsageExpiresEd: TEdit;
+ NetworkSlotsEd: TEdit;
+ SpecialDataEd: TEdit;
+ SpecialExpiresEd: TEdit;
+ procedure FormCreate(Sender: TObject);
+ procedure FormShow(Sender: TObject);
+ procedure GenerateBtnClick(Sender: TObject);
+ procedure InfoChanged(Sender: TObject);
+ procedure RegCodeCopySbClick(Sender: TObject);
+ procedure ParametersChanged(Sender: TObject);
+ procedure ModifierEdKeyPress(Sender: TObject; var Key: Char);
+ procedure ModifierClick(Sender: TObject);
+ procedure DateEdKeyPress(Sender: TObject; var Key: Char);
+ procedure GenerateKeySbClick(Sender: TObject);
+ procedure NumberKeyEdPress(Sender: TObject; var Key: Char);
+ procedure RegStrCopySbClick(Sender: TObject);
+ procedure RegRandomBtnClick(Sender: TObject);
+ procedure CodesNbkChanging(Sender: TObject;
+ var AllowChange: Boolean);
+ private
+ { Private declarations }
+ FCode : TCode;
+ FCodeType : TCodeType;
+ FKey : TKey;
+ FKeyType : TKeyType;
+ FKeyFileName : string;
+
+(*
+{$IFDEF MSWINDOWS} {AH.01}
+ procedure OGMCheck(var Msg : TMessage);
+ message OGM_CHECK;
+ procedure OGMQuit(var Msg : TMessage);
+ message OGM_QUIT;
+{$ELSE} {AH.01}
+*)
+ procedure OGMCheck; {AH.01}
+ procedure OGMQuit; {AH.01}
+//{$ENDIF} {AH.01}
+
+ procedure SetCodeType(Value : TCodeType);
+
+ public
+ procedure SetKey(Value : TKey); {!!.08}
+ procedure GetKey(var Value : TKey); {!!.08}
+
+ property Code : TCode
+ read FCode;
+
+ property CodeType : TCodeType
+ read FCodeType
+ write SetCodeType;
+
+ property KeyFileName : string
+ read FKeyFileName
+ write FKeyFileName;
+
+ property KeyType : TKeyType
+ read FKeyType
+ write FKeyType;
+ end;
+
+var
+ CodeGenerateFrm: TCodeGenerateFrm;
+
+implementation
+
+
+
+procedure TCodeGenerateFrm.FormCreate(Sender: TObject);
+var
+ D : TDateTime;
+begin
+ NoModifierCb.Checked := True;
+ CodesNbk.ActivePageIndex := Ord(FCodeType);
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ if HexStringIsZero(BlockKeyEd.Text)then
+ BlockKeyEd.Text := '';
+
+ {initialize date edits}
+ StartDateEd.Text := OgFormatDate(Date); {!!.09}
+ EndDateEd.Text := OgFormatDate(Date); {!!.09}
+ ModDateEd.Text := OgFormatDate(Date); {!!.09}
+ D := EncodeDate(9999,12,31);
+ UsageExpiresEd.Text := OgFormatDate(D); {!!.09}
+ SpecialExpiresEd.Text := OgFormatDate(D); {!!.09}
+ SerialExpiresEd.Text := OgFormatDate(D); {!!.09}
+ RegExpiresEd.Text := OgFormatDate(D); {!!.09}
+ DaysExpiresEd.Text := OgFormatDate(D); {!!.09}
+
+ NoModifierCb.Checked := True; {!!.11}
+ InfoChanged(Self);
+end;
+
+procedure TCodeGenerateFrm.FormShow(Sender: TObject);
+begin
+ OGMCheck;
+end;
+
+procedure TCodeGenerateFrm.GenerateBtnClick(Sender: TObject);
+var
+ I : LongInt;
+ Work : TCode;
+ K : TKey;
+ Modifier : LongInt;
+ D1, D2 : TDateTime;
+begin
+ Modifier := 0;
+ if ((ModifierEd.Text = '') or HexToBuffer(ModifierEd.Text, Modifier, SizeOf(LongInt))) then begin
+ K := FKey;
+ ApplyModifierToKeyPrim(Modifier, K, SizeOf(K));
+
+ case CodesNbk.ActivePageIndex of
+ 0 : begin
+ try
+ D1 := StrToDate(StartDateEd.Text);
+ except
+ on EConvertError do begin
+ ShowMessage(SCInvalidStartDate);
+ StartDateEd.SetFocus;
+ Exit;
+ end else
+ raise;
+ end;
+
+ try
+ D2 := StrToDate(EndDateEd.Text);
+ except
+ on EConvertError do begin
+ ShowMessage(SCInvalidStartDate);
+ EndDateEd.SetFocus;
+ Exit;
+ end else
+ raise;
+ end;
+
+ InitDateCode(K, Trunc(D1), Trunc(D2), FCode);
+ Work := FCode;
+ MixBlock(T128bit(K), Work, False);
+
+ {sanity check}
+ StartDateEd.Text := OgFormatDate(Work.FirstDate+BaseDate); {!!.09}
+ EndDateEd.Text := OgFormatDate(Work.EndDate+BaseDate); {!!.09}
+ end;
+ 1 : begin
+ try
+ D1 := StrToDate(DaysExpiresEd.Text);
+ except
+ on EConvertError do begin
+ ShowMessage(SCInvalidExDate);
+ DaysExpiresEd.SetFocus;
+ Exit;
+ end else
+ raise;
+ end;
+ InitDaysCode(K, StrToIntDef(DaysCountEd.Text, 0), D1, FCode);
+ end;
+ 2 : begin
+ try
+ D1 := StrToDate(RegExpiresEd.Text);
+ except
+ on EConvertError do begin
+ ShowMessage(SCInvalidExDate);
+ RegExpiresEd.SetFocus;
+ Exit;
+ end else
+ raise;
+ end;
+ InitRegCode(K, RegStrEd.Text, D1, FCode);
+ end;
+ 3 : begin
+ try
+ D1 := StrToDate(SerialExpiresEd.Text);
+ except
+ on EConvertError do begin
+ ShowMessage(SCInvalidExDate);
+ SerialExpiresEd.SetFocus;
+ Exit;
+ end else
+ raise;
+ end;
+ InitSerialNumberCode(K, StrToIntDef(SerialNumberEd.Text, 0), D1, FCode);
+ end;
+ 4 : begin
+ try
+ D1 := StrToDate(UsageExpiresEd.Text);
+ except
+ on EConvertError do begin
+ ShowMessage(SCInvalidExDate);
+ UsageExpiresEd.SetFocus;
+ Exit;
+ end else
+ raise;
+ end;
+ InitUsageCode(K, StrToIntDef(UsageCountEd.Text, 0), D1, FCode);
+ end;
+ 5 : begin
+ I := StrToIntDef(NetworkSlotsEd.Text, 2);
+ if I < 1 then {!!.08}
+ I := 1; {!!.08}
+ NetworkSlotsEd.Text := IntToStr(I);
+ EncodeNAFCountCode(K, I, FCode);
+ end;
+ 6 : begin
+ try
+ D1 := StrToDate(SpecialExpiresEd.Text);
+ except
+ on EConvertError do begin
+ ShowMessage(SCInvalidExDate);
+ SpecialExpiresEd.SetFocus;
+ Exit;
+ end else
+ raise;
+ end;
+ InitSpecialCode(K, StrToIntDef(SpecialDataEd.Text, 0), D1, FCode);
+ end;
+ end;
+
+ RegCodeEd.Text := BufferToHex(FCode, SizeOf(FCode));
+ end else
+ MessageDlg(SCInvalidKeyOrModifier, mtError, [mbOK], 0);
+end;
+
+procedure TCodeGenerateFrm.InfoChanged(Sender: TObject);
+begin
+ // GenerateBtn.Enabled := HexToBuffer(BlockKeyEd.Text, FKey, SizeOf(FKey));
+ // OKBtn.Enabled := Length(RegCodeEd.Text) > 0;
+end;
+
+procedure TCodeGenerateFrm.RegCodeCopySbClick(Sender: TObject);
+var
+ OldSelStart: Integer;
+begin
+ if (RegCodeEd.SelLength > 0) then
+ RegCodeEd.CopyToClipboard
+ else begin
+ OldSelStart := RegCodeEd.SelStart;
+ RegCodeEd.SelStart := 0;
+ RegCodeEd.SelLength := MaxInt;
+ RegCodeEd.CopyToClipboard;
+ RegCodeEd.SelStart := OldSelStart;
+ RegCodeEd.SelLength := 0;
+ end;
+end;
+
+procedure TCodeGenerateFrm.ParametersChanged(Sender: TObject);
+begin
+ RegCodeEd.Text := '';
+end;
+
+procedure TCodeGenerateFrm.ModifierEdKeyPress(Sender: TObject; var Key: Char);
+const
+ CHexChars = ['$', 'A', 'B', 'C', 'D', 'E', 'F', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
+begin
+ if (not (Key in CHexChars)) and (not (Key < #32)) then begin
+ Beep();
+ Key := #0;
+ end;
+end;
+
+procedure TCodeGenerateFrm.ModifierClick(Sender: TObject);
+const
+ Busy : Boolean = False;
+var
+ L : LongInt;
+ D : TDateTime;
+ S : string; {!!.11}
+ i : Integer; {!!.12}
+begin
+ if Busy then
+ Exit;
+
+ {set busy flag so that setting "Checked" won't recurse}
+ Busy := True;
+ try
+ L := 0;
+
+ if (Sender = NoModifierCb) and NoModifierCb.Checked then begin
+ UniqueModifierCb.Checked := False;
+ MachineModifierCb.Checked := False;
+ DateModifierCb.Checked := False;
+ StringModifierCb.Checked := False; {!!.11}
+ ModifierEd.Color := clBtnFace; {!!.11}
+ ModifierEd.ReadOnly := True; {!!.11}
+ end else begin
+ NoModifierCb.Checked := False;
+ ModifierEd.Color := clWindow; {!!.11}
+ ModifierEd.ReadOnly := False; {!!.11}
+ end;
+
+(*
+ if not UniqueModifierCb.Checked and
+ not MachineModifierCb.Checked and
+ not DateModifierCb.Checked and
+ not StringModifierCb.Checked and {!!.11}
+ (ModifierEd.Text = '') then begin {!!.11}
+ NoModifierCb.Checked := True;
+ ModifierEd.Color := clBtnFace; {!!.11}
+ ModifierEd.ReadOnly := True; {!!.11}
+ end;
+*)
+ if MachineModifierCb.Checked then begin
+ if L = 0 then
+ L := GenerateMachineModifierPrim
+ else
+ L := L xor GenerateMachineModifierPrim;
+ end;
+
+ {set status of string field} {!!.11}
+ ModStringEd.Enabled := StringModifierCb.Checked; {!!.11}
+ if ModStringEd.Enabled then {!!.11}
+ ModStringEd.Color := clWindow {!!.11}
+ else {!!.11}
+ ModStringEd.Color := clBtnFace; {!!.11}
+ {!!.11}
+ if StringModifierCb.Checked then begin {!!.11}
+ S := ModStringEd.Text; {!!.11}
+ {strip accented characters from the string} {!!.12}
+ for i := Length(S) downto 1 do {!!.12}
+ if Ord(S[i]) > 127 then {!!.12}
+ Delete(S, i, 1); {!!.12}
+ L := StringHashELF(S); {!!.11}
+ end; {!!.11}
+
+ {set status of date field}
+ ModDateEd.Enabled := DateModifierCb.Checked;
+ if ModDateEd.Enabled then
+ ModDateEd.Color := clWindow
+ else
+ ModDateEd.Color := clBtnFace;
+
+ if DateModifierCb.Checked then begin
+ try
+ D := StrToDate(ModDateEd.Text);
+ except
+ {ignore errors and don't generate modifier}
+ D := 0;
+ end;
+
+ if Trunc(D) <> 0 then begin
+ if L = 0 then
+ L := GenerateDateModifierPrim(D)
+ else
+ L := L xor GenerateDateModifierPrim(D);
+ end;
+ end;
+
+ if UniqueModifierCb.Checked then begin
+ if L = 0 then
+ L := GenerateUniqueModifierPrim
+ else
+ L := L xor GenerateUniqueModifierPrim;
+ end;
+
+ if L = 0 then
+ ModifierEd.Text := ''
+ else
+ ModifierEd.Text := '$' + BufferToHex(L, 4);
+ finally
+ Busy := False;
+ end;
+end;
+
+procedure TCodeGenerateFrm.DateEdKeyPress(Sender: TObject; var Key: Char);
+begin
+ if (not (Key in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', DateSeparator])) and (not (Key < #32)) then begin
+ Beep();
+ Key := #0;
+ end;
+end;
+
+procedure TCodeGenerateFrm.GenerateKeySbClick(Sender: TObject);
+var
+ F : TKeyMaintFrm;
+begin
+ F := TKeyMaintFrm.Create(Self);
+ try
+ F.SetKey(FKey);
+ F.KeyType := FKeyType;
+ F.KeyFileName := FKeyFileName;
+ F.ShowHint := ShowHint;
+ if F.ShowModal = mrOK then begin
+ F.GetKey(FKey);
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ if HexStringIsZero(BlockKeyEd.Text)then
+ BlockKeyEd.Text := '';
+ FKeyType := F.KeyType;
+ FKeyFileName := F.KeyFileName;
+ InfoChanged(Self);
+ end;
+ finally
+ F.Free;
+ end;
+end;
+
+procedure TCodeGenerateFrm.NumberKeyEdPress(Sender: TObject; var Key: Char);
+const
+ CIntChars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
+begin
+ if (not (Key in CIntChars)) and (not (Key < #32)) then begin
+ Beep();
+ Key := #0;
+ end;
+end;
+
+procedure TCodeGenerateFrm.RegStrCopySbClick(Sender: TObject);
+var
+ OldSelStart: Integer;
+begin
+ if (RegStrEd.SelLength > 0) then
+ RegStrEd.CopyToClipboard
+ else begin
+ OldSelStart := RegStrEd.SelStart;
+ RegStrEd.SelStart := 0;
+ RegStrEd.SelLength := MaxInt;
+ RegStrEd.CopyToClipboard;
+ RegStrEd.SelStart := OldSelStart;
+ RegStrEd.SelLength := 0;
+ end;
+end;
+
+procedure TCodeGenerateFrm.RegRandomBtnClick(Sender: TObject);
+var
+ I : Integer;
+ L : LongInt;
+ Bytes : array[0..3] of Byte absolute L;
+begin
+ Randomize;
+ for I := 0 to 3 do
+ Bytes[I] := Random(256);
+ RegStrEd.Text := IntToHex(L, 8);
+end;
+
+procedure TCodeGenerateFrm.CodesNbkChanging(Sender: TObject;
+ var AllowChange: Boolean);
+begin
+ AllowChange := True;
+
+ RegCodeEd.Text := '';
+ NoModifierCb.Checked := True;
+ ModifierEd.Text := '';
+end;
+
+procedure TCodeGenerateFrm.GetKey(var Value : TKey);
+begin
+ Value := FKey;
+end;
+
+(*
+{$IFDEF MSWINDOWS} {AH.01}
+procedure TCodeGenerateFrm.OGMQuit(var Msg : TMessage);
+begin
+ ModalResult := mrCancel;
+end;
+{$ELSE} {AH.01}
+*)
+
+procedure TCodeGenerateFrm.OGMQuit; {AH.01}
+begin
+ ModalResult := mrCancel;
+end;
+
+
+(*
+{$IFDEF MSWINDOWS} {AH.01}
+procedure TCodeGenerateFrm.OGMCheck(var Msg : TMessage);
+var
+ F : TKeyMaintFrm;
+begin
+ if not HexToBuffer(BlockKeyEd.Text, FKey, SizeOf(FKey)) then begin
+ {get a key}
+ F := TKeyMaintFrm.Create(Self);
+ try
+ F.SetKey(FKey);
+ F.KeyType := ktRandom;
+ F.KeyFileName := FKeyFileName;
+ F.ShowHint := ShowHint;
+ if F.ShowModal = mrOK then begin
+ F.GetKey(FKey);
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ if HexStringIsZero(BlockKeyEd.Text)then
+ BlockKeyEd.Text := '';
+ FKeyFileName := F.KeyFileName;
+ InfoChanged(Self);
+ end else
+ PostMessage(HWND(Handle), OGM_QUIT, 0, 0);
+ finally
+ F.Free;
+ end;
+ end;
+end;
+{$ELSE} {AH.01}
+*)
+
+procedure TCodeGenerateFrm.OGMCheck; {AH.01}
+var
+ F : TKeyMaintFrm;
+begin
+ if not HexToBuffer(BlockKeyEd.Text, FKey, SizeOf(FKey)) then begin
+ {get a key}
+ F := TKeyMaintFrm.Create(Self);
+ try
+ F.SetKey(FKey);
+ F.KeyType := ktRandom;
+ F.KeyFileName := FKeyFileName;
+ F.ShowHint := ShowHint;
+ if F.ShowModal = mrOK then begin
+ F.GetKey(FKey);
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ if HexStringIsZero(BlockKeyEd.Text)then
+ BlockKeyEd.Text := '';
+ FKeyFileName := F.KeyFileName;
+ InfoChanged(Self);
+ end else
+ OGMQuit;
+ finally
+ F.Free;
+ end;
+ end;
+end;
+
+
+procedure TCodeGenerateFrm.SetKey(Value : TKey);
+begin
+ FKey := Value;
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ if HexStringIsZero(BlockKeyEd.Text)then
+ BlockKeyEd.Text := '';
+end;
+
+procedure TCodeGenerateFrm.SetCodeType(Value : TCodeType);
+begin
+ if Value <> TCodeType(CodesNbk.ActivePageIndex) then begin
+ FCodeType := Value;
+ CodesNbk.ActivePageIndex := Ord(FCodeType);
+ end;
+end;
+
+initialization
+{$I qonguard2.lrs}
+
+
+end.
diff --git a/components/onguard/source/qonguard3.lfm b/components/onguard/source/qonguard3.lfm
new file mode 100644
index 000000000..ae45e190e
--- /dev/null
+++ b/components/onguard/source/qonguard3.lfm
@@ -0,0 +1,287 @@
+object KeyMaintFrm: TKeyMaintFrm
+ Left = 240
+ Height = 414
+ Top = 219
+ Width = 489
+ HorzScrollBar.Page = 488
+ VertScrollBar.Page = 413
+ ActiveControl = OKBtn
+ BorderIcons = [biSystemMenu, biMinimize]
+ Caption = 'Key Maintenance'
+ OnCreate = FormCreate
+ Position = poScreenCenter
+ object OKBtn: TBitBtn
+ Left = 304
+ Height = 25
+ Top = 376
+ Width = 75
+ Caption = 'OK'
+ Default = True
+ ModalResult = 1
+ NumGlyphs = 0
+ TabOrder = 0
+ end
+ object CancelBtn: TBitBtn
+ Left = 386
+ Height = 25
+ Top = 376
+ Width = 75
+ Caption = 'Cancel'
+ ModalResult = 2
+ NumGlyphs = 0
+ TabOrder = 1
+ end
+ object FileNameGb: TGroupBox
+ Left = 7
+ Height = 63
+ Top = 2
+ Width = 454
+ Caption = '&File name'
+ TabOrder = 2
+ object OpenFileSb: TSpeedButton
+ Left = 328
+ Height = 23
+ Hint = 'Find key maintenance file'
+ Top = 6
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 26050000424D26050000000000003604000028000000100000000F0000000100
+ 0800000000000000000000000000000000000000000000000000000000000000
+ 80000080000000808000800000008000800080800000C0C0C000C0DCC000F0C8
+ A400000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 000000000000000000000000000000000000F0FBFF00A4A0A000808080000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00070707070707
+ 0707070707070707070700000000000000000000000707070707000003030303
+ 0303030303000707070700FB000303030303030303030007070700FFFB000303
+ 0303030303030300070700FBFFFB00030303030303030303000700FFFBFFFB00
+ 0000000000000000000000FBFFFBFFFBFFFBFFFB00070707070700FFFBFFFBFF
+ FBFFFBFF00070707070700FBFFFB000000000000000707070707070000000707
+ 0707070707070000000707070707070707070707070707000007070707070707
+ 0707000707070007000707070707070707070700000007070707070707070707
+ 07070707070707070707
+ }
+ NumGlyphs = 0
+ OnClick = OpenFileClick
+ end
+ object OpenBtn: TBitBtn
+ Left = 357
+ Height = 25
+ Top = 6
+ Width = 90
+ Caption = '&Open'
+ NumGlyphs = 0
+ OnClick = OpenBtnClick
+ TabOrder = 0
+ end
+ object FileNameEd: TEdit
+ Left = 8
+ Height = 25
+ Top = 6
+ Width = 315
+ TabOrder = 1
+ Text = 'onguard.ini'
+ end
+ end
+ object ProductsGb: TGroupBox
+ Left = 7
+ Height = 181
+ Top = 64
+ Width = 454
+ Caption = 'A&pplications'
+ TabOrder = 3
+ object AddBtn: TButton
+ Left = 357
+ Height = 25
+ Hint = 'Add a new product and key'
+ Top = 8
+ Width = 90
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Add...'
+ OnClick = AddBtnClick
+ TabOrder = 0
+ end
+ object EditBtn: TButton
+ Left = 357
+ Height = 25
+ Hint = 'Edit the selected product'
+ Top = 48
+ Width = 90
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Edit...'
+ OnClick = EditBtnClick
+ TabOrder = 1
+ end
+ object DeleteBtn: TButton
+ Left = 357
+ Height = 25
+ Hint = 'Remove the selected product'
+ Top = 88
+ Width = 90
+ BorderSpacing.InnerBorder = 4
+ Caption = '&Delete'
+ OnClick = DeleteBtnClick
+ TabOrder = 2
+ end
+ object ProductsLb: TListBox
+ Left = 8
+ Height = 148
+ Top = 8
+ Width = 343
+ OnClick = ProductsLbClick
+ TabOrder = 3
+ TopIndex = -1
+ end
+ end
+ object GroupBox1: TGroupBox
+ Left = 6
+ Height = 121
+ Top = 248
+ Width = 457
+ Caption = '&Key'
+ TabOrder = 4
+ object CopyBlockKeySb: TSpeedButton
+ Left = 398
+ Height = 23
+ Hint = 'Copy key to clipboard'
+ Top = 24
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888888444444444800000008888
+ 8884FFFFFFF48000000088888884F00000F48000000080000004FFFFFFF48000
+ 000080FFFFF4F00000F48000000080F00004FFFFFFF48000000080FFFFF4F00F
+ 44448000000080F00004FFFF4F488000000080FFFFF4FFFF44888000000080F0
+ 0F04444448888000000080FFFF0F088888888000000080FFFF00888888888000
+ 0000800000088888888880000000888888888888888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = CopyBlockKeySbClick
+ end
+ object KeyPasteSb: TSpeedButton
+ Left = 425
+ Height = 23
+ Hint = 'Paste from clipboard'
+ Top = 26
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 80000080000000808000800000008000800080800000C0C0C000808080000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00222222222222
+ 2222200000002222222222222222200000002222224444444444200000002000
+ 004FFFFFFFF4200000000838384F000000F4200000000383834FFFFFFFF42000
+ 00000838384F000F4444200000000383834FFFFF4F42200000000838384FFFFF
+ 4422200000000383834444444022200000000838383838383022200000000380
+ 0000000380222000000008307777770830222000000003830B00B08380222000
+ 0000200000BB0000022220000000222220000222222220000000222222222222
+ 222220000000
+ }
+ NumGlyphs = 0
+ OnClick = KeyPasteSbClick
+ end
+ object CopyByteKeySb: TSpeedButton
+ Left = 398
+ Height = 23
+ Hint = 'Copy key to clipboard'
+ Top = 57
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888888444444444800000008888
+ 8884FFFFFFF48000000088888884F00000F48000000080000004FFFFFFF48000
+ 000080FFFFF4F00000F48000000080F00004FFFFFFF48000000080FFFFF4F00F
+ 44448000000080F00004FFFF4F488000000080FFFFF4FFFF44888000000080F0
+ 0F04444448888000000080FFFF0F088888888000000080FFFF00888888888000
+ 0000800000088888888880000000888888888888888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = CopyByteKeySbClick
+ end
+ object SpeedButton1: TSpeedButton
+ Left = 425
+ Height = 23
+ Hint = 'Paste from clipboard'
+ Top = 57
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 80000080000000808000800000008000800080800000C0C0C000808080000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00222222222222
+ 2222200000002222222222222222200000002222224444444444200000002000
+ 004FFFFFFFF4200000000838384F000000F4200000000383834FFFFFFFF42000
+ 00000838384F000F4444200000000383834FFFFF4F42200000000838384FFFFF
+ 4422200000000383834444444022200000000838383838383022200000000380
+ 0000000380222000000008307777770830222000000003830B00B08380222000
+ 0000200000BB0000022220000000222220000222222220000000222222222222
+ 222220000000
+ }
+ NumGlyphs = 0
+ OnClick = SpeedButton1Click
+ end
+ object BlockKeyEd: TEdit
+ Left = 8
+ Height = 25
+ Top = 24
+ Width = 388
+ TabOrder = 0
+ end
+ object BytesKeyEd: TEdit
+ Left = 8
+ Height = 25
+ Top = 57
+ Width = 388
+ TabOrder = 1
+ end
+ end
+ object OpenDialog1: TOpenDialog
+ Title = 'Select Key Maintenance File'
+ DefaultExt = '.ini'
+ Filter = 'INI Files (*.ini)|*.ini|All Files (*.*)|*.*'
+ FilterIndex = 0
+ Options = [ofPathMustExist]
+ left = 368
+ top = 144
+ end
+end
diff --git a/components/onguard/source/qonguard3.lrs b/components/onguard/source/qonguard3.lrs
new file mode 100644
index 000000000..e4f80c912
--- /dev/null
+++ b/components/onguard/source/qonguard3.lrs
@@ -0,0 +1,136 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TKeyMaintFrm','FORMDATA',[
+ 'TPF0'#12'TKeyMaintFrm'#11'KeyMaintFrm'#4'Left'#3#240#0#6'Height'#3#158#1#3'T'
+ +'op'#3#219#0#5'Width'#3#233#1#18'HorzScrollBar.Page'#3#232#1#18'VertScrollBa'
+ +'r.Page'#3#157#1#13'ActiveControl'#7#5'OKBtn'#11'BorderIcons'#11#12'biSystem'
+ +'Menu'#10'biMinimize'#0#7'Caption'#6#15'Key Maintenance'#8'OnCreate'#7#10'Fo'
+ +'rmCreate'#8'Position'#7#14'poScreenCenter'#0#7'TBitBtn'#5'OKBtn'#4'Left'#3
+ +'0'#1#6'Height'#2#25#3'Top'#3'x'#1#5'Width'#2'K'#7'Caption'#6#2'OK'#7'Defaul'
+ +'t'#9#11'ModalResult'#2#1#9'NumGlyphs'#2#0#8'TabOrder'#2#0#0#0#7'TBitBtn'#9
+ +'CancelBtn'#4'Left'#3#130#1#6'Height'#2#25#3'Top'#3'x'#1#5'Width'#2'K'#7'Cap'
+ +'tion'#6#6'Cancel'#11'ModalResult'#2#2#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#9
+ +'TGroupBox'#10'FileNameGb'#4'Left'#2#7#6'Height'#2'?'#3'Top'#2#2#5'Width'#3
+ +#198#1#7'Caption'#6#10'&File name'#8'TabOrder'#2#2#0#12'TSpeedButton'#10'Ope'
+ +'nFileSb'#4'Left'#3'H'#1#6'Height'#2#23#4'Hint'#6#25'Find key maintenance fi'
+ +'le'#3'Top'#2#6#5'Width'#2#23#5'Color'#7#9'clBtnFace'#10'Glyph.Data'#10'*'#5
+ +#0#0'&'#5#0#0'BM&'#5#0#0#0#0#0#0'6'#4#0#0'('#0#0#0#16#0#0#0#15#0#0#0#1#0#8#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#128#0#0#128#0#0
+ +#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#192#192#192#0#192#220#192#0
+ +#240#200#164#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#240#251#255#0#164#160#160#0#128#128#128#0#0#0#255#0#0#255#0#0#0#255#255#0
+ +#255#0#0#0#255#0#255#0#255#255#0#0#255#255#255#0#7#7#7#7#7#7#7#7#7#7#7#7#7#7
+ +#7#7#0#0#0#0#0#0#0#0#0#0#0#7#7#7#7#7#0#0#3#3#3#3#3#3#3#3#3#0#7#7#7#7#0#251#0
+ +#3#3#3#3#3#3#3#3#3#0#7#7#7#0#255#251#0#3#3#3#3#3#3#3#3#3#0#7#7#0#251#255#251
+ +#0#3#3#3#3#3#3#3#3#3#0#7#0#255#251#255#251#0#0#0#0#0#0#0#0#0#0#0#0#251#255
+ +#251#255#251#255#251#255#251#0#7#7#7#7#7#0#255#251#255#251#255#251#255#251
+ +#255#0#7#7#7#7#7#0#251#255#251#0#0#0#0#0#0#0#7#7#7#7#7#7#0#0#0#7#7#7#7#7#7#7
+ +#7#0#0#0#7#7#7#7#7#7#7#7#7#7#7#7#7#7#0#0#7#7#7#7#7#7#7#7#7#0#7#7#7#0#7#0#7#7
+ +#7#7#7#7#7#7#7#7#0#0#0#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#9'NumGlyphs'#2
+ +#0#7'OnClick'#7#13'OpenFileClick'#0#0#7'TBitBtn'#7'OpenBtn'#4'Left'#3'e'#1#6
+ +'Height'#2#25#3'Top'#2#6#5'Width'#2'Z'#7'Caption'#6#5'&Open'#9'NumGlyphs'#2#0
+ +#7'OnClick'#7#12'OpenBtnClick'#8'TabOrder'#2#0#0#0#5'TEdit'#10'FileNameEd'#4
+ +'Left'#2#8#6'Height'#2#25#3'Top'#2#6#5'Width'#3';'#1#8'TabOrder'#2#1#4'Text'
+ +#6#11'onguard.ini'#0#0#0#9'TGroupBox'#10'ProductsGb'#4'Left'#2#7#6'Height'#3
+ +#181#0#3'Top'#2'@'#5'Width'#3#198#1#7'Caption'#6#13'A&pplications'#8'TabOrde'
+ +'r'#2#3#0#7'TButton'#6'AddBtn'#4'Left'#3'e'#1#6'Height'#2#25#4'Hint'#6#25'Ad'
+ +'d a new product and key'#3'Top'#2#8#5'Width'#2'Z'#25'BorderSpacing.InnerBor'
+ +'der'#2#4#7'Caption'#6#7'&Add...'#7'OnClick'#7#11'AddBtnClick'#8'TabOrder'#2
+ +#0#0#0#7'TButton'#7'EditBtn'#4'Left'#3'e'#1#6'Height'#2#25#4'Hint'#6#25'Edit'
+ +' the selected product'#3'Top'#2'0'#5'Width'#2'Z'#25'BorderSpacing.InnerBord'
+ +'er'#2#4#7'Caption'#6#8'&Edit...'#7'OnClick'#7#12'EditBtnClick'#8'TabOrder'#2
+ +#1#0#0#7'TButton'#9'DeleteBtn'#4'Left'#3'e'#1#6'Height'#2#25#4'Hint'#6#27'Re'
+ +'move the selected product'#3'Top'#2'X'#5'Width'#2'Z'#25'BorderSpacing.Inner'
+ ,'Border'#2#4#7'Caption'#6#7'&Delete'#7'OnClick'#7#14'DeleteBtnClick'#8'TabOr'
+ +'der'#2#2#0#0#8'TListBox'#10'ProductsLb'#4'Left'#2#8#6'Height'#3#148#0#3'Top'
+ +#2#8#5'Width'#3'W'#1#7'OnClick'#7#15'ProductsLbClick'#8'TabOrder'#2#3#8'TopI'
+ +'ndex'#2#255#0#0#0#9'TGroupBox'#9'GroupBox1'#4'Left'#2#6#6'Height'#2'y'#3'To'
+ +'p'#3#248#0#5'Width'#3#201#1#7'Caption'#6#4'&Key'#8'TabOrder'#2#4#0#12'TSpee'
+ +'dButton'#14'CopyBlockKeySb'#4'Left'#3#142#1#6'Height'#2#23#4'Hint'#6#21'Cop'
+ +'y key to clipboard'#3'Top'#2#24#5'Width'#2#23#5'Color'#7#9'clBtnFace'#10'Gl'
+ +'yph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0#0#0#17#0#0#0
+ +#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#128#128#128
+ +#0#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255#0#255
+ +#255#0#0#255#255#255#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136
+ +#136#136#136#136#136#128#0#0#0#136#136#136#132'DDDD'#128#0#0#0#136#136#136
+ +#132#255#255#255#244#128#0#0#0#136#136#136#132#240#0#0#244#128#0#0#0#128#0#0
+ +#4#255#255#255#244#128#0#0#0#128#255#255#244#240#0#0#244#128#0#0#0#128#240#0
+ +#4#255#255#255#244#128#0#0#0#128#255#255#244#240#15'DD'#128#0#0#0#128#240#0#4
+ +#255#255'OH'#128#0#0#0#128#255#255#244#255#255'D'#136#128#0#0#0#128#240#15#4
+ +'DDH'#136#128#0#0#0#128#255#255#15#8#136#136#136#128#0#0#0#128#255#255#0#136
+ +#136#136#136#128#0#0#0#128#0#0#8#136#136#136#136#128#0#0#0#136#136#136#136
+ +#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#9'NumGl'
+ +'yphs'#2#0#7'OnClick'#7#19'CopyBlockKeySbClick'#0#0#12'TSpeedButton'#10'KeyP'
+ +'asteSb'#4'Left'#3#169#1#6'Height'#2#23#4'Hint'#6#20'Paste from clipboard'#3
+ +'Top'#2#26#5'Width'#2#23#5'Color'#7#9'clBtnFace'#10'Glyph.Data'#10'F'#1#0#0
+ +'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0#0#0#17#0#0#0#17#0#0#0#1#0#4#0#0#0
+ +#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#128#0#0#128#0#0#0
+ +#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#192#192#192#0#128#128#128#0#0#0
+ +#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255#0#255#255#0#0#255#255#255#0
+ +'"""""""" '#0#0#0'"""""""" '#0#0#0'"""DDDDD '#0#0#0' '#0#0'O'#255#255#255#244
+ +' '#0#0#0#8'88O'#0#0#0#244' '#0#0#0#3#131#131'O'#255#255#255#244' '#0#0#0#8
+ +'88O'#0#15'DD '#0#0#0#3#131#131'O'#255#255'OB '#0#0#0#8'88O'#255#255'D" '#0#0
+ +#0#3#131#131'DDD@" '#0#0#0#8'888880" '#0#0#0#3#128#0#0#0#3#128'" '#0#0#0#8'0'
+ +'www'#8'0" '#0#0#0#3#131#11#0#176#131#128'" '#0#0#0' '#0#0#187#0#0#2'" '#0#0
+ +#0'"" '#0#2'""" '#0#0#0'"""""""" '#0#0#0#9'NumGlyphs'#2#0#7'OnClick'#7#15'Ke'
+ +'yPasteSbClick'#0#0#12'TSpeedButton'#13'CopyByteKeySb'#4'Left'#3#142#1#6'Hei'
+ +'ght'#2#23#4'Hint'#6#21'Copy key to clipboard'#3'Top'#2'9'#5'Width'#2#23#5'C'
+ +'olor'#7#9'clBtnFace'#10'Glyph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0
+ +'v'#0#0#0'('#0#0#0#17#0#0#0#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0
+ +#128#0#128#128#0#0#128#128#128#0#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255
+ +#0#255#0#0#0#255#0#255#0#255#255#0#0#255#255#255#0#136#136#136#136#136#136
+ +#136#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#132
+ +'DDDD'#128#0#0#0#136#136#136#132#255#255#255#244#128#0#0#0#136#136#136#132
+ +#240#0#0#244#128#0#0#0#128#0#0#4#255#255#255#244#128#0#0#0#128#255#255#244
+ +#240#0#0#244#128#0#0#0#128#240#0#4#255#255#255#244#128#0#0#0#128#255#255#244
+ +#240#15'DD'#128#0#0#0#128#240#0#4#255#255'OH'#128#0#0#0#128#255#255#244#255
+ +#255'D'#136#128#0#0#0#128#240#15#4'DDH'#136#128#0#0#0#128#255#255#15#8#136
+ +#136#136#128#0#0#0#128#255#255#0#136#136#136#136#128#0#0#0#128#0#0#8#136#136
+ +#136#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136
+ +#136#136#136#136#128#0#0#0#9'NumGlyphs'#2#0#7'OnClick'#7#18'CopyByteKeySbCli'
+ +'ck'#0#0#12'TSpeedButton'#12'SpeedButton1'#4'Left'#3#169#1#6'Height'#2#23#4
+ +'Hint'#6#20'Paste from clipboard'#3'Top'#2'9'#5'Width'#2#23#5'Color'#7#9'clB'
+ +'tnFace'#10'Glyph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0
+ +#0#0#17#0#0#0#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0
+ +#0#192#192#192#0#128#128#128#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255
+ +#0#255#0#255#255#0#0#255#255#255#0'"""""""" '#0#0#0'"""""""" '#0#0#0'"""DDDD'
+ +'D '#0#0#0' '#0#0'O'#255#255#255#244' '#0#0#0#8'88O'#0#0#0#244' '#0#0#0#3#131
+ +#131'O'#255#255#255#244' '#0#0#0#8'88O'#0#15'DD '#0#0#0#3#131#131'O'#255#255
+ +'OB '#0#0#0#8'88O'#255#255'D" '#0#0#0#3#131#131'DDD@" '#0#0#0#8'888880" '#0#0
+ +#0#3#128#0#0#0#3#128'" '#0#0#0#8'0www'#8'0" '#0#0#0#3#131#11#0#176#131#128'"'
+ +' '#0#0#0' '#0#0#187#0#0#2'" '#0#0#0'"" '#0#2'""" '#0#0#0'"""""""" '#0#0#0#9
+ +'NumGlyphs'#2#0#7'OnClick'#7#17'SpeedButton1Click'#0#0#5'TEdit'#10'BlockKeyE'
+ +'d'#4'Left'#2#8#6'Height'#2#25#3'Top'#2#24#5'Width'#3#132#1#8'TabOrder'#2#0#0
+ +#0#5'TEdit'#10'BytesKeyEd'#4'Left'#2#8#6'Height'#2#25#3'Top'#2'9'#5'Width'#3
+ ,#132#1#8'TabOrder'#2#1#0#0#0#11'TOpenDialog'#11'OpenDialog1'#5'Title'#6#27'S'
+ +'elect Key Maintenance File'#10'DefaultExt'#6#4'.ini'#6'Filter'#6'+INI Files'
+ +' (*.ini)|*.ini|All Files (*.*)|*.*'#11'FilterIndex'#2#0#7'Options'#11#15'of'
+ +'PathMustExist'#0#4'left'#3'p'#1#3'top'#3#144#0#0#0#0
+]);
diff --git a/components/onguard/source/qonguard3.pas b/components/onguard/source/qonguard3.pas
new file mode 100644
index 000000000..fe5dc3459
--- /dev/null
+++ b/components/onguard/source/qonguard3.pas
@@ -0,0 +1,361 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* ONGUARD3.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I onguard.inc}
+
+
+unit qonguard3;
+ {-Key selection and maintenance}
+
+interface
+
+uses
+ SysUtils, Classes, Controls, Forms,
+ Dialogs, StdCtrls, Buttons, IniFiles,LResources,
+ ogconst,
+ ogutil,
+ onguard,
+ qonguard1,
+ qonguard4;
+
+type
+
+ { TKeyMaintFrm }
+
+ TKeyMaintFrm = class(TForm)
+ OKBtn: TBitBtn;
+ CancelBtn: TBitBtn;
+ FileNameGb: TGroupBox;
+ OpenFileSb: TSpeedButton;
+ OpenBtn: TBitBtn;
+ FileNameEd: TEdit;
+ ProductsGb: TGroupBox;
+ AddBtn: TButton;
+ EditBtn: TButton;
+ DeleteBtn: TButton;
+ ProductsLb: TListBox;
+ OpenDialog1: TOpenDialog;
+ GroupBox1: TGroupBox;
+ CopyBlockKeySb: TSpeedButton;
+ KeyPasteSb: TSpeedButton;
+ CopyByteKeySb: TSpeedButton;
+ SpeedButton1: TSpeedButton;
+ BlockKeyEd: TEdit;
+ BytesKeyEd: TEdit;
+ procedure FormCreate(Sender: TObject);
+ procedure OpenBtnClick(Sender: TObject);
+ procedure AddBtnClick(Sender: TObject);
+ procedure EditBtnClick(Sender: TObject);
+ procedure DeleteBtnClick(Sender: TObject);
+ procedure InfoChanged(Sender: TObject);
+ procedure ProductsLbClick(Sender: TObject);
+ procedure ProductsLbDblClick(Sender: TObject);
+ procedure CopyBlockKeySbClick(Sender: TObject);
+ procedure KeyPasteSbClick(Sender: TObject);
+ procedure CopyByteKeySbClick(Sender: TObject);
+ procedure SpeedButton1Click(Sender: TObject);
+ procedure OpenFileClick(Sender: TObject);
+ private
+ { Private declarations }
+ FKey : TKey;
+ FKeyType : TKeyType;
+
+ function GetKeyFileName : string;
+ procedure SetKeyFileName(Value : string);
+
+ public
+ { Public declarations }
+ procedure SetKey(Value : TKey); {!!.08}
+ procedure GetKey(var Value : TKey); {!!.08}
+
+ property KeyFileName : string
+ read GetKeyFileName
+ write SetKeyFileName;
+
+ property KeyType : TKeyType
+ read FKeyType
+ write FKeyType;
+
+ end;
+
+var
+ KeyMaintFrm: TKeyMaintFrm;
+
+implementation
+
+
+
+
+procedure TKeyMaintFrm.FormCreate(Sender: TObject);
+begin
+ KeyFileName := '';
+end;
+
+procedure TKeyMaintFrm.OpenBtnClick(Sender: TObject);
+begin
+ InfoChanged(Self);
+end;
+
+
+procedure TKeyMaintFrm.OpenFileClick(Sender: TObject);
+begin
+ if OpenDialog1.Execute then KeyFileName := OpenDialog1.FileName;
+end;
+
+
+procedure TKeyMaintFrm.AddBtnClick(Sender: TObject);
+var
+ F : TEditProductFrm;
+ IniFile : TIniFile;
+begin
+ F := TEditProductFrm.Create(Self);
+ try
+ F.SetKey(FKey);
+ F.KeyType := FKeyType;
+ F.ShowHint := ShowHint;
+ if F.ShowModal = mrOK then begin
+ IniFile := TIniFile.Create(KeyFileName);
+ try
+ IniFile.WriteString(OgKeySection, F.ProductEd.Text, F.KeyEd.Text);
+ finally
+ IniFile.Free;
+ end;
+ F.GetKey(FKey);
+ FKeyType := F.KeyType;
+ end;
+ finally
+ F.Free;
+ end;
+
+ InfoChanged(Self);
+end;
+
+procedure TKeyMaintFrm.EditBtnClick(Sender: TObject);
+var
+ F : TEditProductFrm;
+ IniFile : TIniFile;
+ I : Integer;
+begin
+ I := ProductsLB.ItemIndex;
+ if (I = -1) then Exit;
+
+ F := TEditProductFrm.Create(Self);
+ try
+ F.SetKey(FKey);
+ F.KeyType := FKeyType;
+ F.ShowHint := ShowHint;
+ IniFile := TIniFile.Create(KeyFileName);
+ try
+ F.ProductEd.Text := ProductsLb.Items[ProductsLB.ItemIndex]; {!!.07}
+ F.KeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ if F.ShowModal = mrOK then
+ IniFile.WriteString(OgKeySection, F.ProductEd.Text, F.KeyEd.Text);
+ finally
+ IniFile.Free;
+ end;
+ finally
+ F.Free;
+ end;
+
+ InfoChanged(Self);
+end;
+
+procedure TKeyMaintFrm.DeleteBtnClick(Sender: TObject);
+var
+ IniFile : TIniFile;
+ I : Integer;
+begin
+ I := ProductsLB.ItemIndex; {!!.07}
+ if (I > -1) then {!!.07}
+ if MessageDlg(SCDeleteQuery, mtConfirmation,
+ [mbYes, mbNo], 0) = mrYes then begin
+ IniFile := TIniFile.Create(KeyFileName);
+ try
+ IniFile.DeleteKey(OgKeySection, ProductsLb.Items[I]); {!!.07}
+ finally
+ IniFile.Free;
+ end;
+ BlockKeyEd.Text := '';
+ BytesKeyEd.Text := '';
+
+ InfoChanged(Self);
+ end;
+end;
+
+procedure TKeyMaintFrm.InfoChanged(Sender: TObject);
+var
+ I : Integer;
+ IniFile : TIniFile;
+begin
+ try
+ FillChar(FKey, SizeOf(FKey), 0);
+ if Length(KeyFileName) > 0 then begin
+ IniFile := TIniFile.Create(KeyFileName);
+ try
+ I := ProductsLB.ItemIndex; {!!.07}
+ ProductsLb.Items.BeginUpdate;
+ try
+ ProductsLb.Items.Clear;
+ IniFile.ReadSection(OgKeySection,ProductsLb.Items);
+ if I < ProductsLb.Items.Count then
+ ProductsLb.ItemIndex := I {!!.07}
+ else begin {!!.07}
+ ProductsLb.ItemIndex := pred(ProductsLb.Items.Count); {!!.07}
+ I := ProductsLB.ItemIndex; {!!.07}
+ end; {!!.07}
+
+ if (I > -1) then begin {!!.07}
+ //EditBtn.Enabled := True; {!!.07}
+ //DeleteBtn.Enabled := True; {!!.07}
+ BlockKeyEd.Text := IniFile.ReadString(OgKeySection,
+ ProductsLb.Items[I], ''); {!!.07}
+
+ HexToBuffer(BlockKeyEd.Text, FKey, SizeOf(FKey));
+
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ BytesKeyEd.Text := BufferToHexBytes(FKey, SizeOf(FKey));
+
+ if HexStringIsZero(BlockKeyEd.Text)then
+ BlockKeyEd.Text := '';
+ if HexStringIsZero(BytesKeyEd.Text)then
+ BytesKeyEd.Text := '';
+ end else begin {!!.07}
+ //EditBtn.Enabled := False; {!!.07}
+ //DeleteBtn.Enabled := False; {!!.07}
+ end; {!!.07}
+ finally
+ ProductsLb.Items.EndUpdate;
+ end;
+ finally
+ IniFile.Free;
+ end;
+ end else
+ ProductsLb.Items.Clear;
+
+ //OKBtn.Enabled := HexToBuffer(BlockKeyEd.Text, FKey, SizeOf(FKey));
+ except on E:Exception do
+ ShowMessage(E.Message);
+ end;
+end;
+
+procedure TKeyMaintFrm.ProductsLbClick(Sender: TObject);
+ var
+ I : Integer;
+ IniFile : TIniFile;
+begin
+ I := ProductsLB.ItemIndex;
+ if I < 0 then Exit;
+ IniFile := TIniFile.Create(KeyFileName);
+ try
+ BlockKeyEd.Text := IniFile.ReadString(OgKeySection,ProductsLb.Items[I], '');
+ HexToBuffer(BlockKeyEd.Text, FKey, SizeOf(FKey));
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ BytesKeyEd.Text := BufferToHexBytes(FKey, SizeOf(FKey));
+ finally
+ IniFile.Free;
+ end;
+end;
+
+procedure TKeyMaintFrm.ProductsLbDblClick(Sender: TObject);
+begin
+ ModalResult := mrOK;
+end;
+
+procedure TKeyMaintFrm.CopyBlockKeySbClick(Sender: TObject);
+var
+ OldSelStart: Integer;
+begin
+ OldSelStart := BlockKeyEd.SelStart;
+ BlockKeyEd.SelStart := 0;
+ BlockKeyEd.SelLength := MaxInt;
+ BlockKeyEd.CopyToClipboard;
+ BlockKeyEd.SelStart := OldSelStart;
+ BlockKeyEd.SelLength := 0;
+end;
+
+procedure TKeyMaintFrm.KeyPasteSbClick(Sender: TObject);
+begin
+ BlockKeyEd.PasteFromClipboard;
+ HexToBuffer(BlockKeyEd.Text, FKey, SizeOf(FKey));
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ BytesKeyEd.Text := BufferToHexBytes(FKey, SizeOf(FKey));
+end;
+
+procedure TKeyMaintFrm.CopyByteKeySbClick(Sender: TObject);
+var
+ OldSelStart: Integer;
+begin
+ OldSelStart := BytesKeyEd.SelStart;
+ BytesKeyEd.SelStart := 0;
+ BytesKeyEd.SelLength := MaxInt;
+ BytesKeyEd.CopyToClipboard;
+ BytesKeyEd.SelStart := OldSelStart;
+ BytesKeyEd.SelLength := 0;
+end;
+
+procedure TKeyMaintFrm.SpeedButton1Click(Sender: TObject);
+begin
+ BytesKeyEd.PasteFromClipboard;
+ HexToBuffer(BytesKeyEd.Text, FKey, SizeOf(FKey));
+ BytesKeyEd.Text := BufferToHexBytes(FKey, SizeOf(FKey));
+ BlockKeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+end;
+
+procedure TKeyMaintFrm.GetKey(var Value : TKey); {!!.08}
+begin
+ Value := FKey;
+end;
+
+procedure TKeyMaintFrm.SetKey(Value : TKey); {!!.08}
+begin
+ FKey := Value;
+end;
+
+function TKeyMaintFrm.GetKeyFileName : string;
+begin
+ Result := FileNameEd.Text;
+end;
+
+procedure TKeyMaintFrm.SetKeyFileName(Value : string);
+begin
+ FileNameEd.Text := Value;
+ InfoChanged(Self);
+end;
+
+
+initialization
+{$I qonguard3.lrs}
+
+
+end.
diff --git a/components/onguard/source/qonguard4.lfm b/components/onguard/source/qonguard4.lfm
new file mode 100644
index 000000000..8f7971104
--- /dev/null
+++ b/components/onguard/source/qonguard4.lfm
@@ -0,0 +1,124 @@
+object EditProductFrm: TEditProductFrm
+ Left = 280
+ Height = 110
+ Top = 326
+ Width = 526
+ HorzScrollBar.Page = 525
+ HorzScrollBar.Range = 521
+ VertScrollBar.Page = 109
+ VertScrollBar.Range = 105
+ ActiveControl = ProductEd
+ BorderIcons = []
+ Caption = 'Description and Key'
+ OnCreate = FormCreate
+ Position = poScreenCenter
+ object Panel1: TPanel
+ Left = 4
+ Height = 68
+ Top = 5
+ Width = 517
+ TabOrder = 0
+ object GenerateKeySb: TSpeedButton
+ Left = 482
+ Height = 23
+ Hint = 'Generate encryption key'
+ Top = 37
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
+ 8888800000008888888888888888800000008888888444444444800000008888
+ 8884FFFFFFF48000000088888884F00000F48000000080000004FFFFFFF48000
+ 000080FFFFF4F00000F48000000080F00004FFFFFFF48000000080FFFFF4F00F
+ 44448000000080F00004FFFF4F488000000080FFFFF4FFFF44888000000080F0
+ 0F04444448888000000080FFFF0F088888888000000080FFFF00888888888000
+ 0000800000088888888880000000888888888888888880000000888888888888
+ 888880000000
+ }
+ NumGlyphs = 0
+ OnClick = GenerateKeySbClick
+ end
+ object KeyPasteSb: TSpeedButton
+ Left = 456
+ Height = 23
+ Hint = 'Paste from clipboard'
+ Top = 37
+ Width = 23
+ Color = clBtnFace
+ Glyph.Data = {
+ 42010000424D4201000000000000760000002800000011000000110000000100
+ 040000000000CC00000000000000000000000000000000000000000000000000
+ 80000080000000808000800000008000800080800000C0C0C000808080000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00222222222222
+ 2222200000002222222222222222200000002222224444444444200000002000
+ 004FFFFFFFF4200000000838384F000000F4200000000383834FFFFFFFF42000
+ 00000838384F000F4444200000000383834FFFFF4F42200000000838384FFFFF
+ 4422200000000383834444444022200000000838383838383022200000000380
+ 0000000380222000000008307777770830222000000003830B00B08380222000
+ 0000200000BB0000022220000000222220000222222220000000222222222222
+ 222220000000
+ }
+ NumGlyphs = 0
+ OnClick = KeyPasteSbClick
+ end
+ object Label1: TLabel
+ Left = 12
+ Height = 20
+ Top = 12
+ Width = 84
+ Caption = '&Description:'
+ Color = clNone
+ ParentColor = False
+ end
+ object Label2: TLabel
+ Left = 12
+ Height = 20
+ Top = 40
+ Width = 32
+ Caption = '&Key:'
+ Color = clNone
+ ParentColor = False
+ end
+ object ProductEd: TEdit
+ Left = 104
+ Height = 28
+ Top = 8
+ Width = 345
+ OnChange = InfoChanged
+ TabOrder = 0
+ end
+ object KeyEd: TEdit
+ Left = 104
+ Height = 28
+ Top = 38
+ Width = 345
+ OnChange = InfoChanged
+ TabOrder = 1
+ end
+ end
+ object OKBtn: TButton
+ Left = 361
+ Height = 25
+ Top = 80
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Caption = 'OK'
+ Default = True
+ ModalResult = 1
+ TabOrder = 1
+ end
+ object CancelBtn: TButton
+ Left = 441
+ Height = 25
+ Top = 80
+ Width = 75
+ BorderSpacing.InnerBorder = 4
+ Cancel = True
+ Caption = 'Cancel'
+ ModalResult = 2
+ TabOrder = 2
+ end
+end
diff --git a/components/onguard/source/qonguard4.lrs b/components/onguard/source/qonguard4.lrs
new file mode 100644
index 000000000..3b86462f5
--- /dev/null
+++ b/components/onguard/source/qonguard4.lrs
@@ -0,0 +1,51 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TEditProductFrm','FORMDATA',[
+ 'TPF0'#15'TEditProductFrm'#14'EditProductFrm'#4'Left'#3#24#1#6'Height'#2'n'#3
+ +'Top'#3'F'#1#5'Width'#3#14#2#18'HorzScrollBar.Page'#3#13#2#19'HorzScrollBar.'
+ +'Range'#3#9#2#18'VertScrollBar.Page'#2'm'#19'VertScrollBar.Range'#2'i'#13'Ac'
+ +'tiveControl'#7#9'ProductEd'#11'BorderIcons'#11#0#7'Caption'#6#19'Descriptio'
+ +'n and Key'#8'OnCreate'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#0#6
+ +'TPanel'#6'Panel1'#4'Left'#2#4#6'Height'#2'D'#3'Top'#2#5#5'Width'#3#5#2#8'Ta'
+ +'bOrder'#2#0#0#12'TSpeedButton'#13'GenerateKeySb'#4'Left'#3#226#1#6'Height'#2
+ +#23#4'Hint'#6#23'Generate encryption key'#3'Top'#2'%'#5'Width'#2#23#5'Color'
+ +#7#9'clBtnFace'#10'Glyph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0
+ +#0'('#0#0#0#17#0#0#0#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#0#0#0#0#0#0#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128
+ +#128#0#0#128#128#128#0#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0
+ +#0#255#0#255#0#255#255#0#0#255#255#255#0#136#136#136#136#136#136#136#136#128
+ +#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#132'DDDD'#128#0
+ +#0#0#136#136#136#132#255#255#255#244#128#0#0#0#136#136#136#132#240#0#0#244
+ +#128#0#0#0#128#0#0#4#255#255#255#244#128#0#0#0#128#255#255#244#240#0#0#244
+ +#128#0#0#0#128#240#0#4#255#255#255#244#128#0#0#0#128#255#255#244#240#15'DD'
+ +#128#0#0#0#128#240#0#4#255#255'OH'#128#0#0#0#128#255#255#244#255#255'D'#136
+ +#128#0#0#0#128#240#15#4'DDH'#136#128#0#0#0#128#255#255#15#8#136#136#136#128#0
+ +#0#0#128#255#255#0#136#136#136#136#128#0#0#0#128#0#0#8#136#136#136#136#128#0
+ +#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136
+ +#136#128#0#0#0#9'NumGlyphs'#2#0#7'OnClick'#7#18'GenerateKeySbClick'#0#0#12'T'
+ +'SpeedButton'#10'KeyPasteSb'#4'Left'#3#200#1#6'Height'#2#23#4'Hint'#6#20'Pas'
+ +'te from clipboard'#3'Top'#2'%'#5'Width'#2#23#5'Color'#7#9'clBtnFace'#10'Gly'
+ +'ph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0#0#0#17#0#0#0
+ +#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+ +#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#192#192#192
+ +#0#128#128#128#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255#0#255
+ +#255#0#0#255#255#255#0'"""""""" '#0#0#0'"""""""" '#0#0#0'"""DDDDD '#0#0#0' '
+ +#0#0'O'#255#255#255#244' '#0#0#0#8'88O'#0#0#0#244' '#0#0#0#3#131#131'O'#255
+ +#255#255#244' '#0#0#0#8'88O'#0#15'DD '#0#0#0#3#131#131'O'#255#255'OB '#0#0#0
+ +#8'88O'#255#255'D" '#0#0#0#3#131#131'DDD@" '#0#0#0#8'888880" '#0#0#0#3#128#0
+ +#0#0#3#128'" '#0#0#0#8'0www'#8'0" '#0#0#0#3#131#11#0#176#131#128'" '#0#0#0' '
+ +#0#0#187#0#0#2'" '#0#0#0'"" '#0#2'""" '#0#0#0'"""""""" '#0#0#0#9'NumGlyphs'#2
+ +#0#7'OnClick'#7#15'KeyPasteSbClick'#0#0#6'TLabel'#6'Label1'#4'Left'#2#12#6'H'
+ +'eight'#2#20#3'Top'#2#12#5'Width'#2'T'#7'Caption'#6#13'&Description:'#5'Colo'
+ +'r'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#12#6'Hei'
+ +'ght'#2#20#3'Top'#2'('#5'Width'#2' '#7'Caption'#6#5'&Key:'#5'Color'#7#6'clNo'
+ +'ne'#11'ParentColor'#8#0#0#5'TEdit'#9'ProductEd'#4'Left'#2'h'#6'Height'#2#28
+ +#3'Top'#2#8#5'Width'#3'Y'#1#8'OnChange'#7#11'InfoChanged'#8'TabOrder'#2#0#0#0
+ +#5'TEdit'#5'KeyEd'#4'Left'#2'h'#6'Height'#2#28#3'Top'#2'&'#5'Width'#3'Y'#1#8
+ +'OnChange'#7#11'InfoChanged'#8'TabOrder'#2#1#0#0#0#7'TButton'#5'OKBtn'#4'Lef'
+ +'t'#3'i'#1#6'Height'#2#25#3'Top'#2'P'#5'Width'#2'K'#25'BorderSpacing.InnerBo'
+ +'rder'#2#4#7'Caption'#6#2'OK'#7'Default'#9#11'ModalResult'#2#1#8'TabOrder'#2
+ +#1#0#0#7'TButton'#9'CancelBtn'#4'Left'#3#185#1#6'Height'#2#25#3'Top'#2'P'#5
+ +'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#4#6'Cancel'#9#7'Caption'#6#6'Ca'
+ +'ncel'#11'ModalResult'#2#2#8'TabOrder'#2#2#0#0#0
+]);
diff --git a/components/onguard/source/qonguard4.pas b/components/onguard/source/qonguard4.pas
new file mode 100644
index 000000000..a4b789aae
--- /dev/null
+++ b/components/onguard/source/qonguard4.pas
@@ -0,0 +1,158 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* ONGUARD4.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I ONGUARD.INC}
+
+
+unit qonguard4;
+ {-Product description dialog}
+
+interface
+
+uses
+ SysUtils,Classes, Variants, Graphics, Controls, Forms,
+ Dialogs, StdCtrls, ogutil, onguard, qonguard1, Buttons, ExtCtrls,LResources;
+
+type
+ TEditProductFrm = class(TForm)
+ Panel1: TPanel;
+ Label1: TLabel;
+ Label2: TLabel;
+ GenerateKeySb: TSpeedButton;
+ KeyPasteSb: TSpeedButton;
+ ProductEd: TEdit;
+ KeyEd: TEdit;
+ OKBtn: TButton;
+ CancelBtn: TButton;
+ procedure FormCreate(Sender: TObject);
+ procedure InfoChanged(Sender: TObject);
+ procedure KeyPasteSbClick(Sender: TObject);
+ procedure GenerateKeySbClick(Sender: TObject);
+ private
+ { Private declarations }
+ FKey : TKey;
+ FKeyType : TKeyType;
+
+ function GetShowHints : Boolean;
+ procedure SetShowHints(Value : Boolean);
+
+ public
+ { Public declarations }
+ procedure SetKey(Value : TKey); {!!.08}
+ procedure GetKey(var Value : TKey); {!!.08}
+
+ property KeyType : TKeyType
+ read FKeyType
+ write FKeyType;
+
+ property ShowHints : Boolean
+ read GetShowHints
+ write SetShowHints;
+ end;
+
+var
+ EditProductFrm: TEditProductFrm;
+
+implementation
+
+
+
+procedure TEditProductFrm.FormCreate(Sender: TObject);
+begin
+ InfoChanged(Sender);
+end;
+
+procedure TEditProductFrm.InfoChanged(Sender: TObject);
+var
+ Work : TKey;
+begin
+ OKBtn.Enabled := (Length(ProductEd.Text) > 0) and
+ (HexToBuffer(KeyEd.Text, Work, SizeOf(Work)));
+end;
+
+procedure TEditProductFrm.KeyPasteSbClick(Sender: TObject);
+begin
+ KeyEd.PasteFromClipboard;
+end;
+
+procedure TEditProductFrm.GenerateKeySbClick(Sender: TObject);
+var
+ F : TKeyGenerateFrm;
+begin
+ F := TKeyGenerateFrm.Create(Self);
+ try
+ F.SetKey(FKey);
+ F.KeyType := FKeyType;
+ F.ShowHint := GetShowHints;
+ if F.ShowModal = mrOK then begin
+ F.GetKey(FKey);
+ FKeyType := F.KeyType;
+ KeyEd.Text := BufferToHex(FKey, SizeOf(FKey));
+ if HexStringIsZero(KeyEd.Text)then begin
+ KeyEd.Text := '';
+ FillChar(FKey, SizeOf(FKey), 0);
+ end;
+
+ InfoChanged(Sender);
+ end;
+ finally
+ F.Free;
+ end;
+end;
+
+function TEditProductFrm.GetShowHints : Boolean;
+begin
+ Result := ShowHint;
+end;
+
+procedure TEditProductFrm.SetShowHints(Value : Boolean);
+begin
+ ShowHint := Value;
+end;
+
+procedure TEditProductFrm.GetKey(var Value : TKey);
+begin
+ Value := FKey;
+end;
+
+procedure TEditProductFrm.SetKey(Value : TKey);
+begin
+ FKey := Value;
+end;
+
+initialization
+{$I qonguard4.lrs}
+
+
+end.
diff --git a/components/onguard/source/qonguard5.pas b/components/onguard/source/qonguard5.pas
new file mode 100644
index 000000000..3b8941f81
--- /dev/null
+++ b/components/onguard/source/qonguard5.pas
@@ -0,0 +1,101 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* ONGUARD5.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I onguard.inc}
+
+
+unit qonguard5; {AH.01}
+
+interface
+
+uses
+ Controls, {AH.01}
+ Forms, {AH.01}
+ onguard, {AH.01}
+ ComponentEditors,
+ PropEdits,
+ LazarusPackageIntf,
+ LResources;
+
+
+type
+ {property editor for ranges}
+ TOgCodeProperty = class(TStringProperty)
+ public
+ function GetAttributes: TPropertyAttributes;
+ override;
+ function GetValue : string;
+ override;
+ procedure Edit;
+ override;
+ end;
+
+implementation
+
+uses
+ ogconst, {AH.01}
+ ogutil, {AH.01}
+ qonguard2; {AH.01}
+
+{*** TOgCodeProperty ***}
+
+function TOgCodeProperty.GetAttributes: TPropertyAttributes;
+begin
+ Result := [paDialog];
+end;
+
+function TOgCodeProperty.GetValue : string;
+begin
+ Result := inherited GetValue;
+end;
+
+procedure TOgCodeProperty.Edit;
+var
+ Work : TCode;
+begin
+ with TCodeGenerateFrm.Create(Application) do
+ try
+ ShowHint := True;
+ KeyFileName := OgKeyFile;
+ if ShowModal = mrOK then begin
+ Work := Code;
+ SetValue(BufferToHex(Work, SizeOf(Work)));
+ end;
+ finally
+ Free;
+ end;
+end;
+
+
+end.
diff --git a/components/onguard/source/qonguard6.lfm b/components/onguard/source/qonguard6.lfm
new file mode 100644
index 000000000..6fed45016
--- /dev/null
+++ b/components/onguard/source/qonguard6.lfm
@@ -0,0 +1,111 @@
+object ModifierFrm: TModifierFrm
+ ActiveControl = NoModifierCb
+ BorderIcons = [biSystemMenu, biMinimize]
+ Caption = 'Generate Modifier'
+ ClientHeight = 145
+ ClientWidth = 433
+ Font.Color = clText
+ Font.Height = 11
+ Font.Name = 'MS Sans Serif'
+ Font.Pitch = fpVariable
+ OnCreate = FormCreate
+ PixelsPerInch = 83
+ Position = poScreenCenter
+ TextHeight = 18
+ HorzScrollBar.Page = 432
+ HorzScrollBar.Range = 333
+ VertScrollBar.Page = 144
+ VertScrollBar.Range = 75
+ Left = 295
+ Height = 145
+ Top = 224
+ Width = 433
+ object OKBtn: TBitBtn
+ Caption = 'OK'
+ Default = True
+ ModalResult = 1
+ NumGlyphs = 0
+ TabOrder = 1
+ Left = 285
+ Height = 26
+ Top = 104
+ Width = 57
+ end
+ object CancelBtn: TBitBtn
+ Caption = 'Cancel'
+ ModalResult = 2
+ NumGlyphs = 0
+ TabOrder = 2
+ Left = 344
+ Height = 24
+ Top = 104
+ Width = 62
+ end
+ object GroupBox1: TGroupBox
+ Caption = '&Modifiers'
+ ClientHeight = 73
+ ClientWidth = 402
+ TabOrder = 0
+ Left = 3
+ Height = 90
+ Top = 6
+ Width = 406
+ object UniqueModifierCb: TCheckBox
+ Caption = 'Unique modifier'
+ OnClick = ModifierClick
+ TabOrder = 3
+ Left = 133
+ Height = 20
+ Top = 37
+ Width = 119
+ end
+ object MachineModifierCb: TCheckBox
+ Caption = 'Machine modifier'
+ OnClick = ModifierClick
+ TabOrder = 1
+ Left = 133
+ Height = 20
+ Top = 20
+ Width = 129
+ end
+ object DateModifierCb: TCheckBox
+ Caption = 'Date modifier'
+ OnClick = ModifierClick
+ TabOrder = 2
+ Left = 267
+ Height = 20
+ Top = 20
+ Width = 106
+ end
+ object NoModifierCb: TCheckBox
+ Caption = 'No modifier'
+ OnClick = ModifierClick
+ TabOrder = 0
+ Left = 11
+ Height = 12
+ Top = 20
+ Width = 101
+ end
+ object ModifierEd: TEdit
+ OnChange = InfoChanged
+ OnKeyPress = ModifierEdKeyPress
+ TabOrder = 4
+ Left = 12
+ Height = 26
+ Top = 34
+ Width = 104
+ end
+ object ModDateEd: TEdit
+ Enabled = False
+ MaxLength = 10
+ OnChange = ModifierClick
+ OnKeyPress = DateEdKeyPress
+ TabOrder = 5
+ Left = 267
+ Height = 22
+ Hint = 'Code is invalid after this date'
+ Top = 35
+ Width = 120
+ end
+ end
+end
diff --git a/components/onguard/source/qonguard6.lrs b/components/onguard/source/qonguard6.lrs
new file mode 100644
index 000000000..c961616c6
--- /dev/null
+++ b/components/onguard/source/qonguard6.lrs
@@ -0,0 +1,34 @@
+{ To jest automatycznie wygenerowany plik zasobów lazarusa }
+
+LazarusResources.Add('TModifierFrm','FORMDATA',[
+ 'TPF0'#12'TModifierFrm'#11'ModifierFrm'#13'ActiveControl'#7#12'NoModifierCb'
+ +#11'BorderIcons'#11#12'biSystemMenu'#10'biMinimize'#0#7'Caption'#6#17'Genera'
+ +'te Modifier'#12'ClientHeight'#3#145#0#11'ClientWidth'#3#177#1#10'Font.Color'
+ +#7#6'clText'#11'Font.Height'#2#11#9'Font.Name'#6#13'MS Sans Serif'#10'Font.P'
+ +'itch'#7#10'fpVariable'#8'OnCreate'#7#10'FormCreate'#13'PixelsPerInch'#2'S'#8
+ +'Position'#7#14'poScreenCenter'#10'TextHeight'#2#18#18'HorzScrollBar.Page'#3
+ +#176#1#19'HorzScrollBar.Range'#3'M'#1#18'VertScrollBar.Page'#3#144#0#19'Vert'
+ +'ScrollBar.Range'#2'K'#4'Left'#3''''#1#6'Height'#3#145#0#3'Top'#3#224#0#5'Wi'
+ +'dth'#3#177#1#0#7'TBitBtn'#5'OKBtn'#7'Caption'#6#2'OK'#7'Default'#9#11'Modal'
+ +'Result'#2#1#9'NumGlyphs'#2#0#8'TabOrder'#2#1#4'Left'#3#29#1#6'Height'#2#26#3
+ +'Top'#2'h'#5'Width'#2'9'#0#0#7'TBitBtn'#9'CancelBtn'#7'Caption'#6#6'Cancel'
+ +#11'ModalResult'#2#2#9'NumGlyphs'#2#0#8'TabOrder'#2#2#4'Left'#3'X'#1#6'Heigh'
+ +'t'#2#24#3'Top'#2'h'#5'Width'#2'>'#0#0#9'TGroupBox'#9'GroupBox1'#7'Caption'#6
+ +#10'&Modifiers'#12'ClientHeight'#2'I'#11'ClientWidth'#3#146#1#8'TabOrder'#2#0
+ +#4'Left'#2#3#6'Height'#2'Z'#3'Top'#2#6#5'Width'#3#150#1#0#9'TCheckBox'#16'Un'
+ +'iqueModifierCb'#7'Caption'#6#15'Unique modifier'#7'OnClick'#7#13'ModifierCl'
+ +'ick'#8'TabOrder'#2#3#4'Left'#3#133#0#6'Height'#2#20#3'Top'#2'%'#5'Width'#2
+ +'w'#0#0#9'TCheckBox'#17'MachineModifierCb'#7'Caption'#6#16'Machine modifier'
+ +#7'OnClick'#7#13'ModifierClick'#8'TabOrder'#2#1#4'Left'#3#133#0#6'Height'#2
+ +#20#3'Top'#2#20#5'Width'#3#129#0#0#0#9'TCheckBox'#14'DateModifierCb'#7'Capti'
+ +'on'#6#13'Date modifier'#7'OnClick'#7#13'ModifierClick'#8'TabOrder'#2#2#4'Le'
+ +'ft'#3#11#1#6'Height'#2#20#3'Top'#2#20#5'Width'#2'j'#0#0#9'TCheckBox'#12'NoM'
+ +'odifierCb'#7'Caption'#6#11'No modifier'#7'OnClick'#7#13'ModifierClick'#8'Ta'
+ +'bOrder'#2#0#4'Left'#2#11#6'Height'#2#12#3'Top'#2#20#5'Width'#2'e'#0#0#5'TEd'
+ +'it'#10'ModifierEd'#8'OnChange'#7#11'InfoChanged'#10'OnKeyPress'#7#18'Modifi'
+ +'erEdKeyPress'#8'TabOrder'#2#4#4'Left'#2#12#6'Height'#2#26#3'Top'#2'"'#5'Wid'
+ +'th'#2'h'#0#0#5'TEdit'#9'ModDateEd'#7'Enabled'#8#9'MaxLength'#2#10#8'OnChang'
+ +'e'#7#13'ModifierClick'#10'OnKeyPress'#7#14'DateEdKeyPress'#8'TabOrder'#2#5#4
+ +'Left'#3#11#1#6'Height'#2#22#4'Hint'#6#31'Code is invalid after this date'#3
+ +'Top'#2'#'#5'Width'#2'x'#0#0#0#0
+]);
diff --git a/components/onguard/source/qonguard6.pas b/components/onguard/source/qonguard6.pas
new file mode 100644
index 000000000..98684f2a4
--- /dev/null
+++ b/components/onguard/source/qonguard6.pas
@@ -0,0 +1,230 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* ONGUARD6.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I ONGUARD.INC}
+
+
+unit qonguard6; {AH.01}
+ {-Code generation dialog}
+
+interface
+
+uses
+ SysUtils, Classes, {AH.01}
+ Graphics, Controls, Forms, Dialogs,{ Mask,} {AH.01}
+ ExtCtrls, StdCtrls, Buttons, {AH.01}
+ ogutil, onguard, {AH.01}
+ ComponentEditors,
+ PropEdits,
+ LazarusPackageIntf,
+ LResources;
+
+
+
+type
+ TModifierFrm = class(TForm)
+ OKBtn: TBitBtn;
+ CancelBtn: TBitBtn;
+ GroupBox1: TGroupBox;
+ UniqueModifierCb: TCheckBox;
+ MachineModifierCb: TCheckBox;
+ DateModifierCb: TCheckBox;
+ NoModifierCb: TCheckBox;
+ ModifierEd: TEdit;
+ ModDateEd: TEdit;
+ procedure FormCreate(Sender: TObject);
+ procedure ModifierClick(Sender: TObject);
+ procedure ModifierEdKeyPress(Sender: TObject; var Key: Char);
+ procedure DateEdKeyPress(Sender: TObject; var Key: Char);
+ procedure InfoChanged(Sender: TObject);
+ private
+ public
+ Modifier : LongInt;
+ end;
+
+
+type
+ {property editor for ranges}
+ TOgModifierProperty = class(TStringProperty)
+ public
+ function GetAttributes: TPropertyAttributes;
+ override;
+ function GetValue : string;
+ override;
+ procedure Edit;
+ override;
+ end;
+
+
+implementation
+
+
+
+procedure TModifierFrm.FormCreate(Sender: TObject);
+begin
+ NoModifierCb.Checked := True;
+ ModDateEd.Text := OgFormatDate(Date); {!!.09}
+
+ InfoChanged(nil);
+end;
+
+procedure TModifierFrm.ModifierClick(Sender: TObject);
+const
+ Busy : Boolean = False;
+var
+ L : LongInt;
+ D : TDateTime;
+begin
+ if Busy then
+ Exit;
+
+ {set busy flag so that setting "Checked" won't recurse}
+ Busy := True;
+ try
+ L := 0;
+
+ if (Sender = NoModifierCb) and NoModifierCb.Checked then begin
+ UniqueModifierCb.Checked := False;
+ MachineModifierCb.Checked := False;
+ DateModifierCb.Checked := False;
+ end else
+ NoModifierCb.Checked := False;
+
+ if not UniqueModifierCb.Checked and
+ not MachineModifierCb.Checked and
+ not DateModifierCb.Checked then
+ NoModifierCb.Checked := True;
+
+ if MachineModifierCb.Checked then begin
+ if L = 0 then
+ L := GenerateMachineModifierPrim
+ else
+ L := L xor GenerateMachineModifierPrim;
+ end;
+
+ {set status of date field}
+ ModDateEd.Enabled := DateModifierCb.Checked;
+ if ModDateEd.Enabled then
+ ModDateEd.Color := clWindow
+ else
+ ModDateEd.Color := clBtnFace;
+
+ if DateModifierCb.Checked then begin
+ try
+ D := StrToDate(ModDateEd.Text);
+ except
+ {ignore errors and don't generate modifier}
+ D := 0;
+ end;
+
+ if Trunc(D) > 0 then begin
+ if L = 0 then
+ L := GenerateDateModifierPrim(D)
+ else
+ L := L xor GenerateDateModifierPrim(D);
+ end;
+ end;
+
+ if UniqueModifierCb.Checked then begin
+ if L = 0 then
+ L := GenerateUniqueModifierPrim
+ else
+ L := L xor GenerateUniqueModifierPrim;
+ end;
+
+ if L = 0 then
+ ModifierEd.Text := ''
+ else
+ ModifierEd.Text := '$' + BufferToHex(L, 4);
+
+ InfoChanged(nil);
+ finally
+ Busy := False;
+ end;
+end;
+
+procedure TModifierFrm.DateEdKeyPress(Sender: TObject; var Key: Char);
+const
+ CIntChars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '/'];
+begin
+ if (not (Key in CIntChars)) and (not (Key < #32)) then begin
+ Beep;
+ Key := #0;
+ end;
+end;
+
+procedure TModifierFrm.ModifierEdKeyPress(Sender: TObject; var Key: Char);
+const
+ CHexChars = ['$', 'A', 'B', 'C', 'D', 'E', 'F', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
+begin
+ if (not (Key in CHexChars)) and (not (Key < #32)) then begin
+ Beep;
+ Key := #0;
+ end;
+end;
+
+procedure TModifierFrm.InfoChanged(Sender: TObject);
+begin
+ OKBtn.Enabled := (Length(ModifierEd.Text) > 0) and
+ HexToBuffer(ModifierEd.Text, Modifier, SizeOf(Modifier));
+end;
+
+{*** TOgModifierProperty ***}
+
+function TOgModifierProperty.GetAttributes: TPropertyAttributes;
+begin
+ Result := [paDialog];
+end;
+
+function TOgModifierProperty.GetValue : string;
+begin
+ Result := inherited GetValue;
+end;
+
+procedure TOgModifierProperty.Edit;
+begin
+ with TModifierFrm.Create(Application) do
+ try
+ if ShowModal = mrOK then
+ SetValue(BufferToHex(Modifier, SizeOf(Modifier)));
+ finally
+ Free;
+ end;
+end;
+
+initialization
+{$I qonguard6.lrs}
+
+
+end.
diff --git a/components/onguard/source/qonguard7.pas b/components/onguard/source/qonguard7.pas
new file mode 100644
index 000000000..9d13e72fc
--- /dev/null
+++ b/components/onguard/source/qonguard7.pas
@@ -0,0 +1,101 @@
+(* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is TurboPower OnGuard
+ *
+ * The Initial Developer of the Original Code is
+ * TurboPower Software
+ *
+ * Portions created by the Initial Developer are Copyright (C) 1996-2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Andrew Haines andrew@haines.name {AH.01}
+ * conversion to CLX {AH.01}
+ * December 30, 2003 {AH.01}
+ *
+ * ***** END LICENSE BLOCK ***** *)
+{*********************************************************}
+{* ONGUARD7.PAS 1.13 *}
+{* Copyright (c) 1996-02 TurboPower Software Co *}
+{* All rights reserved. *}
+{*********************************************************}
+
+{$I onguard.inc}
+
+
+unit qonguard7; {AH.01}
+ {-File name property editor}
+
+interface
+
+uses
+ Dialogs
+ ,Forms
+ ,ComponentEditors
+ ,PropEdits
+ ,LazarusPackageIntf
+ ,LResources
+ ;
+
+
+
+type
+ {property editor for ranges}
+ TOgFileNameProperty = class(TStringProperty)
+ public
+ function GetAttributes: TPropertyAttributes;
+ override;
+ function GetValue : string;
+ override;
+ procedure Edit;
+ override;
+ end;
+
+
+implementation
+
+
+{*** TOgFileNameProperty ***}
+
+function TOgFileNameProperty.GetAttributes: TPropertyAttributes;
+begin
+ Result := [paDialog];
+end;
+
+function TOgFileNameProperty.GetValue : string;
+begin
+ Result := inherited GetValue;
+end;
+
+procedure TOgFileNameProperty.Edit;
+var
+ D : TOpenDialog;
+begin
+ D := TOpenDialog.Create(Application);
+ try
+ D.DefaultExt := '*.ini';
+ D.Filter := 'Ini Files (*.ini)|*.ini|Text Files (*.txt)|*.txt|All Files (*.*)|*.*';
+ D.FilterIndex := 0;
+ D.Options := [];
+ D.Title := 'Select File Name';
+ D.FileName := GetValue;
+ if D.Execute then
+ SetValue(D.FileName);
+ finally
+ D.Free;
+ end;
+end;
+
+end.