1、由于 Embarcadero.Delphi.10.1.Berlin.Activator.v13.0 直接使用了 https://github.com/elseif/Rad-Studio-Keygen 的代码,根据项目 GPL 协议要求,放出 Activator.exe 的源码代码
This commit is contained in:
parent
034c429c7d
commit
31281044fa
183
10.1/Activator/Activator.bdsproj
Normal file
183
10.1/Activator/Activator.bdsproj
Normal file
@ -0,0 +1,183 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<BorlandProject>
|
||||
<PersonalityInfo>
|
||||
<Option>
|
||||
<Option Name="Personality">Delphi.Personality</Option>
|
||||
<Option Name="ProjectType">VCLApplication</Option>
|
||||
<Option Name="Version">1.0</Option>
|
||||
<Option Name="GUID">{5CDEFC4B-53B9-445E-9A4F-AE44E310FA07}</Option>
|
||||
</Option>
|
||||
</PersonalityInfo>
|
||||
<Delphi.Personality>
|
||||
<Source>
|
||||
<Source Name="MainSource">Activator.dpr</Source>
|
||||
</Source>
|
||||
<FileVersion>
|
||||
<FileVersion Name="Version">7.0</FileVersion>
|
||||
</FileVersion>
|
||||
<Compiler>
|
||||
<Compiler Name="A">8</Compiler>
|
||||
<Compiler Name="B">0</Compiler>
|
||||
<Compiler Name="C">1</Compiler>
|
||||
<Compiler Name="D">1</Compiler>
|
||||
<Compiler Name="E">0</Compiler>
|
||||
<Compiler Name="F">0</Compiler>
|
||||
<Compiler Name="G">1</Compiler>
|
||||
<Compiler Name="H">1</Compiler>
|
||||
<Compiler Name="I">1</Compiler>
|
||||
<Compiler Name="J">0</Compiler>
|
||||
<Compiler Name="K">0</Compiler>
|
||||
<Compiler Name="L">1</Compiler>
|
||||
<Compiler Name="M">0</Compiler>
|
||||
<Compiler Name="N">1</Compiler>
|
||||
<Compiler Name="O">1</Compiler>
|
||||
<Compiler Name="P">1</Compiler>
|
||||
<Compiler Name="Q">0</Compiler>
|
||||
<Compiler Name="R">0</Compiler>
|
||||
<Compiler Name="S">0</Compiler>
|
||||
<Compiler Name="T">0</Compiler>
|
||||
<Compiler Name="U">0</Compiler>
|
||||
<Compiler Name="V">1</Compiler>
|
||||
<Compiler Name="W">0</Compiler>
|
||||
<Compiler Name="X">1</Compiler>
|
||||
<Compiler Name="Y">1</Compiler>
|
||||
<Compiler Name="Z">1</Compiler>
|
||||
<Compiler Name="ShowHints">True</Compiler>
|
||||
<Compiler Name="ShowWarnings">True</Compiler>
|
||||
<Compiler Name="UnitAliases">Classes=;mirror=</Compiler>
|
||||
<Compiler Name="NamespacePrefix"></Compiler>
|
||||
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||
<Compiler Name="DefaultNamespace"></Compiler>
|
||||
<Compiler Name="SymbolDeprecated">False</Compiler>
|
||||
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||
<Compiler Name="SymbolPlatform">False</Compiler>
|
||||
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||
<Compiler Name="UnitLibrary">True</Compiler>
|
||||
<Compiler Name="UnitPlatform">False</Compiler>
|
||||
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||
<Compiler Name="UnitExperimental">True</Compiler>
|
||||
<Compiler Name="HResultCompat">True</Compiler>
|
||||
<Compiler Name="HidingMember">True</Compiler>
|
||||
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||
<Compiler Name="Garbage">True</Compiler>
|
||||
<Compiler Name="BoundsError">True</Compiler>
|
||||
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||
<Compiler Name="ForVariable">True</Compiler>
|
||||
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||
<Compiler Name="FileOpen">True</Compiler>
|
||||
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||
<Compiler Name="InvalidDirective">True</Compiler>
|
||||
<Compiler Name="PackageNoLink">True</Compiler>
|
||||
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||
<Compiler Name="ImplicitImport">True</Compiler>
|
||||
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||
<Compiler Name="NoRetVal">True</Compiler>
|
||||
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||
<Compiler Name="UnsafeType">False</Compiler>
|
||||
<Compiler Name="UnsafeCode">False</Compiler>
|
||||
<Compiler Name="UnsafeCast">False</Compiler>
|
||||
<Compiler Name="OptionTruncated">True</Compiler>
|
||||
<Compiler Name="WideCharReduced">True</Compiler>
|
||||
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||
<Compiler Name="UnitInitSeq">True</Compiler>
|
||||
<Compiler Name="LocalPInvoke">True</Compiler>
|
||||
<Compiler Name="MessageDirective">True</Compiler>
|
||||
<Compiler Name="TypeInfoImplicitlyAdded">True</Compiler>
|
||||
<Compiler Name="XMLWhitespaceNotAllowed">True</Compiler>
|
||||
<Compiler Name="XMLUnknownEntity">True</Compiler>
|
||||
<Compiler Name="XMLInvalidNameStart">True</Compiler>
|
||||
<Compiler Name="XMLInvalidName">True</Compiler>
|
||||
<Compiler Name="XMLExpectedCharacter">True</Compiler>
|
||||
<Compiler Name="XMLCRefNoResolve">True</Compiler>
|
||||
<Compiler Name="XMLNoParm">True</Compiler>
|
||||
<Compiler Name="XMLNoMatchingParm">True</Compiler>
|
||||
<Compiler Name="CodePage"></Compiler>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Linker Name="MapFile">0</Linker>
|
||||
<Linker Name="OutputObjs">0</Linker>
|
||||
<Linker Name="GenerateHpps">False</Linker>
|
||||
<Linker Name="ConsoleApp">1</Linker>
|
||||
<Linker Name="DebugInfo">False</Linker>
|
||||
<Linker Name="RemoteSymbols">False</Linker>
|
||||
<Linker Name="GenerateDRC">False</Linker>
|
||||
<Linker Name="MinStackSize">16384</Linker>
|
||||
<Linker Name="MaxStackSize">1048576</Linker>
|
||||
<Linker Name="ImageBase">4194304</Linker>
|
||||
<Linker Name="ExeDescription"></Linker>
|
||||
</Linker>
|
||||
<Directories>
|
||||
<Directories Name="OutputDir">..\Release</Directories>
|
||||
<Directories Name="UnitOutputDir">..\Dcu</Directories>
|
||||
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||
<Directories Name="SearchPath">..\KOL</Directories>
|
||||
<Directories Name="Packages">vcl;rtl</Directories>
|
||||
<Directories Name="Conditionals">KOL_MCK;NOT_USE_RICHEDIT;USE_MHTOOLTIP;xDEBUGMODE</Directories>
|
||||
<Directories Name="DebugSourceDirs"></Directories>
|
||||
<Directories Name="UsePackages">False</Directories>
|
||||
</Directories>
|
||||
<Parameters>
|
||||
<Parameters Name="RunParams"></Parameters>
|
||||
<Parameters Name="HostApplication"></Parameters>
|
||||
<Parameters Name="Launcher"></Parameters>
|
||||
<Parameters Name="UseLauncher">False</Parameters>
|
||||
<Parameters Name="DebugCWD"></Parameters>
|
||||
<Parameters Name="Debug Symbols Search Path"></Parameters>
|
||||
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||
</Parameters>
|
||||
<Signing>
|
||||
<Signing Name="SignAssembly">False</Signing>
|
||||
</Signing>
|
||||
<VersionInfo>
|
||||
<VersionInfo Name="IncludeVerInfo">True</VersionInfo>
|
||||
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||
<VersionInfo Name="MajorVer">24</VersionInfo>
|
||||
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||
<VersionInfo Name="Release">22858</VersionInfo>
|
||||
<VersionInfo Name="Build">6822</VersionInfo>
|
||||
<VersionInfo Name="Debug">False</VersionInfo>
|
||||
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||
<VersionInfo Name="Special">False</VersionInfo>
|
||||
<VersionInfo Name="Private">False</VersionInfo>
|
||||
<VersionInfo Name="DLL">False</VersionInfo>
|
||||
<VersionInfo Name="Locale">1033</VersionInfo>
|
||||
<VersionInfo Name="CodePage">1252</VersionInfo>
|
||||
</VersionInfo>
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">24.0.22858.6822</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">24.0.22858.6822</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||
</VersionInfoKeys>
|
||||
<buildevents/>
|
||||
</Delphi.Personality>
|
||||
</BorlandProject>
|
45
10.1/Activator/Activator.cfg
Normal file
45
10.1/Activator/Activator.cfg
Normal file
@ -0,0 +1,45 @@
|
||||
-$A8
|
||||
-$B-
|
||||
-$C+
|
||||
-$D+
|
||||
-$E-
|
||||
-$F-
|
||||
-$G+
|
||||
-$H+
|
||||
-$I+
|
||||
-$J-
|
||||
-$K-
|
||||
-$L+
|
||||
-$M-
|
||||
-$N+
|
||||
-$O+
|
||||
-$P+
|
||||
-$Q-
|
||||
-$R-
|
||||
-$S-
|
||||
-$T-
|
||||
-$U-
|
||||
-$V+
|
||||
-$W-
|
||||
-$X+
|
||||
-$YD
|
||||
-$Z1
|
||||
-cg
|
||||
-AClasses=;mirror=
|
||||
-H+
|
||||
-W+
|
||||
-M
|
||||
-$M16384,1048576
|
||||
-K$00400000
|
||||
-E"..\Release"
|
||||
-N0"..\Dcu"
|
||||
-LE"C:\Users\Public\Documents\RAD Studio\5.0\Bpl"
|
||||
-LN"C:\Users\Public\Documents\RAD Studio\5.0\Dcp"
|
||||
-U"..\KOL"
|
||||
-O"..\KOL"
|
||||
-I"..\KOL"
|
||||
-R"..\KOL"
|
||||
-DKOL_MCK;NOT_USE_RICHEDIT;USE_MHTOOLTIP;xDEBUGMODE
|
||||
-w-SYMBOL_DEPRECATED
|
||||
-w-SYMBOL_PLATFORM
|
||||
-w-UNIT_PLATFORM
|
32
10.1/Activator/Activator.dpr
Normal file
32
10.1/Activator/Activator.dpr
Normal file
@ -0,0 +1,32 @@
|
||||
{ KOL MCK } // Do not remove this line!
|
||||
program Activator;
|
||||
|
||||
uses
|
||||
KOL,
|
||||
FileUtils in 'FileUtils.pas',
|
||||
PatchData in 'PatchData.pas',
|
||||
WinUtils in 'WinUtils.pas',
|
||||
|
||||
AnsiStrings in '..\Keygen\AnsiStrings.pas',
|
||||
|
||||
DllData in '..\Keygen\DllData.pas',
|
||||
FGInt in '..\Keygen\FGInt.pas',
|
||||
RadKeygen in '..\Keygen\RadKeygen.pas',
|
||||
Sha1 in '..\Keygen\Sha1.pas',
|
||||
|
||||
MainFrm in 'MainFrm.pas' {MainForm};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin // PROGRAM START HERE -- Please do not remove this comment
|
||||
|
||||
{$IF Defined(KOL_MCK)} {$I Activator_0.inc} {$ELSE}
|
||||
|
||||
Application.Initialize;
|
||||
Application.MainFormOnTaskbar := True;
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
Application.Run;
|
||||
|
||||
{$IFEND}
|
||||
|
||||
end.
|
BIN
10.1/Activator/Activator.res
Normal file
BIN
10.1/Activator/Activator.res
Normal file
Binary file not shown.
20
10.1/Activator/Activator_0.inc
Normal file
20
10.1/Activator/Activator_0.inc
Normal file
@ -0,0 +1,20 @@
|
||||
{ KOL MCK } // Do not remove this line!
|
||||
{ Activator_0.inc
|
||||
Do not edit this file manually - it is generated automatically.
|
||||
You can only modify Activator_1.inc and Activator_3.inc
|
||||
files. }
|
||||
|
||||
{$IFDEF Pcode}
|
||||
InstallCollapse;
|
||||
{$ENDIF Pcode}
|
||||
NewMainForm( MainForm, nil );
|
||||
{$I Activator_1.inc}
|
||||
|
||||
{$I Activator_2.inc}
|
||||
|
||||
{$I Activator_3.inc}
|
||||
|
||||
Run( MainForm.Form );
|
||||
|
||||
{$I Activator_4.inc}
|
||||
|
9
10.1/Activator/Activator_1.inc
Normal file
9
10.1/Activator/Activator_1.inc
Normal file
@ -0,0 +1,9 @@
|
||||
{ Activator_1.inc
|
||||
This file is for you. Place here any code to run it
|
||||
just following Applet creation (if it present) but
|
||||
before creating other forms. E.g., You can place here
|
||||
<IF> statement, which prevents running of application
|
||||
in some cases. TIP: always use Applet for such checks
|
||||
and make it invisible until final decision if to run
|
||||
application or not. }
|
||||
|
4
10.1/Activator/Activator_2.inc
Normal file
4
10.1/Activator/Activator_2.inc
Normal file
@ -0,0 +1,4 @@
|
||||
{ KOL MCK } // Do not remove this line!
|
||||
{ Activator_2.inc
|
||||
Do not modify this file manually - it is generated automatically. }
|
||||
|
4
10.1/Activator/Activator_3.inc
Normal file
4
10.1/Activator/Activator_3.inc
Normal file
@ -0,0 +1,4 @@
|
||||
{ Activator_3.inc
|
||||
This file is for you. Place here any code to run it
|
||||
after forms creating, but before Run call, if necessary. }
|
||||
|
4
10.1/Activator/Activator_4.inc
Normal file
4
10.1/Activator/Activator_4.inc
Normal file
@ -0,0 +1,4 @@
|
||||
{ Activator_4.inc
|
||||
This file is for you. Place here any code to be inserted
|
||||
after Run call, if necessary. }
|
||||
|
BIN
10.1/Activator/Admin.res
Normal file
BIN
10.1/Activator/Admin.res
Normal file
Binary file not shown.
65
10.1/Activator/FileUtils.pas
Normal file
65
10.1/Activator/FileUtils.pas
Normal file
@ -0,0 +1,65 @@
|
||||
{ *********************************************************************** }
|
||||
{ }
|
||||
{ 工具单元 }
|
||||
{ }
|
||||
{ 设计:Lsuper 2013.02.16 }
|
||||
{ 备注: }
|
||||
{ 审核: }
|
||||
{ }
|
||||
{ Copyright (c) 1998-2014 Super Studio }
|
||||
{ }
|
||||
{ *********************************************************************** }
|
||||
|
||||
unit FileUtils;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes;
|
||||
|
||||
function LoadDataFromFile(const AFile: string): AnsiString;
|
||||
procedure SaveDataToFile(const AFile: string; const ABuffer; ASize: Integer);
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
Windows;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2010.01.19
|
||||
//功能:加载文件内容
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function LoadDataFromFile(const AFile: string): AnsiString;
|
||||
begin
|
||||
with TFileStream.Create(AFile, fmOpenRead or fmShareDenyWrite) do
|
||||
try
|
||||
SetLength(Result, Size);
|
||||
ReadBuffer(PAnsiChar(Result)^, Size);
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2010.01.19
|
||||
//功能:保存文件内容
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
procedure SaveDataToFile(const AFile: string; const ABuffer;
|
||||
ASize: Integer);
|
||||
var
|
||||
F: string;
|
||||
begin
|
||||
F := ExtractFileDir(AFile);
|
||||
ForceDirectories(F);
|
||||
with TFileStream.Create(AFile, fmCreate or fmShareDenyWrite) do
|
||||
try
|
||||
Position := 0;
|
||||
WriteBuffer(ABuffer, ASize);
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
425
10.1/Activator/MainFrm.dfm
Normal file
425
10.1/Activator/MainFrm.dfm
Normal file
@ -0,0 +1,425 @@
|
||||
object MainForm: TMainForm
|
||||
Left = 0
|
||||
Top = 0
|
||||
HorzScrollBar.Visible = False
|
||||
VertScrollBar.Visible = False
|
||||
Caption = 'Delphi 10.1 Berlin Activator'
|
||||
ClientHeight = 122
|
||||
ClientWidth = 534
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
OldCreateOrder = True
|
||||
Scaled = False
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object btnExit: TKOLButton
|
||||
Tag = 0
|
||||
Left = 428
|
||||
Top = 16
|
||||
Width = 90
|
||||
Height = 90
|
||||
Hint = 'Exit'
|
||||
HelpType = htKeyword
|
||||
HelpContext = 0
|
||||
IgnoreDefault = True
|
||||
AnchorLeft = False
|
||||
AnchorTop = False
|
||||
AnchorRight = False
|
||||
AnchorBottom = False
|
||||
AcceptChildren = False
|
||||
MouseTransparent = False
|
||||
TabOrder = 2
|
||||
MinWidth = 0
|
||||
MinHeight = 0
|
||||
MaxWidth = 0
|
||||
MaxHeight = 0
|
||||
PlaceDown = False
|
||||
PlaceRight = False
|
||||
PlaceUnder = False
|
||||
Visible = True
|
||||
Enabled = True
|
||||
DoubleBuffered = False
|
||||
Align = caNone
|
||||
CenterOnParent = False
|
||||
Caption = '&Exit'
|
||||
Ctl3D = True
|
||||
Color = clBtnFace
|
||||
parentColor = False
|
||||
Font.Color = clWindowText
|
||||
Font.FontStyle = []
|
||||
Font.FontHeight = 0
|
||||
Font.FontWidth = 0
|
||||
Font.FontWeight = 0
|
||||
Font.FontName = 'System'
|
||||
Font.FontOrientation = 0
|
||||
Font.FontCharset = 1
|
||||
Font.FontPitch = fpDefault
|
||||
Font.FontQuality = fqDefault
|
||||
parentFont = True
|
||||
OnClick = btnExitClick
|
||||
EraseBackground = False
|
||||
Localizy = loForm
|
||||
Border = 2
|
||||
TextAlign = taCenter
|
||||
VerticalAlign = vaCenter
|
||||
TabStop = True
|
||||
autoSize = False
|
||||
DefaultBtn = False
|
||||
CancelBtn = False
|
||||
windowed = True
|
||||
Flat = False
|
||||
WordWrap = False
|
||||
LikeSpeedButton = False
|
||||
end
|
||||
object btnAbout: TKOLButton
|
||||
Tag = 0
|
||||
Left = 325
|
||||
Top = 16
|
||||
Width = 90
|
||||
Height = 90
|
||||
Hint = 'About'
|
||||
HelpType = htKeyword
|
||||
HelpContext = 0
|
||||
IgnoreDefault = True
|
||||
AnchorLeft = False
|
||||
AnchorTop = False
|
||||
AnchorRight = False
|
||||
AnchorBottom = False
|
||||
AcceptChildren = False
|
||||
MouseTransparent = False
|
||||
TabOrder = 0
|
||||
MinWidth = 0
|
||||
MinHeight = 0
|
||||
MaxWidth = 0
|
||||
MaxHeight = 0
|
||||
PlaceDown = False
|
||||
PlaceRight = False
|
||||
PlaceUnder = False
|
||||
Visible = True
|
||||
Enabled = True
|
||||
DoubleBuffered = False
|
||||
Align = caNone
|
||||
CenterOnParent = False
|
||||
Caption = '&About'
|
||||
Ctl3D = True
|
||||
Color = clBtnFace
|
||||
parentColor = False
|
||||
Font.Color = clWindowText
|
||||
Font.FontStyle = []
|
||||
Font.FontHeight = 0
|
||||
Font.FontWidth = 0
|
||||
Font.FontWeight = 0
|
||||
Font.FontName = 'System'
|
||||
Font.FontOrientation = 0
|
||||
Font.FontCharset = 1
|
||||
Font.FontPitch = fpDefault
|
||||
Font.FontQuality = fqDefault
|
||||
parentFont = True
|
||||
OnClick = btnAboutClick
|
||||
EraseBackground = False
|
||||
Localizy = loForm
|
||||
Border = 2
|
||||
TextAlign = taCenter
|
||||
VerticalAlign = vaCenter
|
||||
TabStop = True
|
||||
autoSize = False
|
||||
DefaultBtn = False
|
||||
CancelBtn = False
|
||||
windowed = True
|
||||
Flat = False
|
||||
WordWrap = False
|
||||
LikeSpeedButton = False
|
||||
end
|
||||
object btnReset: TKOLButton
|
||||
Tag = 0
|
||||
Left = 222
|
||||
Top = 16
|
||||
Width = 90
|
||||
Height = 90
|
||||
Hint = 'Reset Delphi 10.1'
|
||||
HelpType = htKeyword
|
||||
HelpContext = 0
|
||||
IgnoreDefault = True
|
||||
AnchorLeft = False
|
||||
AnchorTop = False
|
||||
AnchorRight = False
|
||||
AnchorBottom = False
|
||||
AcceptChildren = False
|
||||
MouseTransparent = False
|
||||
TabOrder = 1
|
||||
MinWidth = 0
|
||||
MinHeight = 0
|
||||
MaxWidth = 0
|
||||
MaxHeight = 0
|
||||
PlaceDown = False
|
||||
PlaceRight = False
|
||||
PlaceUnder = False
|
||||
Visible = True
|
||||
Enabled = True
|
||||
DoubleBuffered = False
|
||||
Align = caNone
|
||||
CenterOnParent = False
|
||||
Caption = 'Re&set'
|
||||
Ctl3D = True
|
||||
Color = clBtnFace
|
||||
parentColor = False
|
||||
Font.Color = clWindowText
|
||||
Font.FontStyle = []
|
||||
Font.FontHeight = 0
|
||||
Font.FontWidth = 0
|
||||
Font.FontWeight = 0
|
||||
Font.FontName = 'System'
|
||||
Font.FontOrientation = 0
|
||||
Font.FontCharset = 1
|
||||
Font.FontPitch = fpDefault
|
||||
Font.FontQuality = fqDefault
|
||||
parentFont = True
|
||||
OnClick = btnResetClick
|
||||
EraseBackground = False
|
||||
Localizy = loForm
|
||||
Border = 2
|
||||
TextAlign = taCenter
|
||||
VerticalAlign = vaCenter
|
||||
TabStop = True
|
||||
autoSize = False
|
||||
DefaultBtn = False
|
||||
CancelBtn = False
|
||||
windowed = True
|
||||
Flat = False
|
||||
WordWrap = False
|
||||
LikeSpeedButton = False
|
||||
end
|
||||
object btnRunX10: TKOLButton
|
||||
Tag = 0
|
||||
Left = 119
|
||||
Top = 16
|
||||
Width = 90
|
||||
Height = 90
|
||||
Hint = 'Run Delphi 10.1'
|
||||
HelpType = htKeyword
|
||||
HelpContext = 0
|
||||
IgnoreDefault = True
|
||||
AnchorLeft = False
|
||||
AnchorTop = False
|
||||
AnchorRight = False
|
||||
AnchorBottom = False
|
||||
AcceptChildren = False
|
||||
MouseTransparent = False
|
||||
TabOrder = 3
|
||||
MinWidth = 0
|
||||
MinHeight = 0
|
||||
MaxWidth = 0
|
||||
MaxHeight = 0
|
||||
PlaceDown = False
|
||||
PlaceRight = False
|
||||
PlaceUnder = False
|
||||
Visible = True
|
||||
Enabled = True
|
||||
DoubleBuffered = False
|
||||
Align = caNone
|
||||
CenterOnParent = False
|
||||
Caption = '&Run'
|
||||
Ctl3D = True
|
||||
Color = clBtnFace
|
||||
parentColor = False
|
||||
Font.Color = clWindowText
|
||||
Font.FontStyle = []
|
||||
Font.FontHeight = 0
|
||||
Font.FontWidth = 0
|
||||
Font.FontWeight = 0
|
||||
Font.FontName = 'System'
|
||||
Font.FontOrientation = 0
|
||||
Font.FontCharset = 1
|
||||
Font.FontPitch = fpDefault
|
||||
Font.FontQuality = fqDefault
|
||||
parentFont = True
|
||||
OnClick = btnRunX10Click
|
||||
EraseBackground = False
|
||||
Localizy = loForm
|
||||
Border = 2
|
||||
TextAlign = taCenter
|
||||
VerticalAlign = vaCenter
|
||||
TabStop = True
|
||||
autoSize = False
|
||||
DefaultBtn = False
|
||||
CancelBtn = False
|
||||
windowed = True
|
||||
Flat = False
|
||||
WordWrap = False
|
||||
LikeSpeedButton = False
|
||||
end
|
||||
object btnActive: TKOLButton
|
||||
Tag = 0
|
||||
Left = 16
|
||||
Top = 16
|
||||
Width = 90
|
||||
Height = 90
|
||||
Hint = 'Active Delphi 10.1'
|
||||
HelpType = htKeyword
|
||||
HelpContext = 0
|
||||
IgnoreDefault = True
|
||||
AnchorLeft = False
|
||||
AnchorTop = False
|
||||
AnchorRight = False
|
||||
AnchorBottom = False
|
||||
AcceptChildren = False
|
||||
MouseTransparent = False
|
||||
TabOrder = 4
|
||||
MinWidth = 0
|
||||
MinHeight = 0
|
||||
MaxWidth = 0
|
||||
MaxHeight = 0
|
||||
PlaceDown = False
|
||||
PlaceRight = False
|
||||
PlaceUnder = False
|
||||
Visible = True
|
||||
Enabled = True
|
||||
DoubleBuffered = False
|
||||
Align = caNone
|
||||
CenterOnParent = False
|
||||
Caption = '&Active'
|
||||
Ctl3D = True
|
||||
Color = clBtnFace
|
||||
parentColor = False
|
||||
Font.Color = clWindowText
|
||||
Font.FontStyle = []
|
||||
Font.FontHeight = 0
|
||||
Font.FontWidth = 0
|
||||
Font.FontWeight = 0
|
||||
Font.FontName = 'System'
|
||||
Font.FontOrientation = 0
|
||||
Font.FontCharset = 1
|
||||
Font.FontPitch = fpDefault
|
||||
Font.FontQuality = fqDefault
|
||||
parentFont = True
|
||||
OnClick = btnActiveClick
|
||||
EraseBackground = False
|
||||
Localizy = loForm
|
||||
Border = 2
|
||||
TextAlign = taCenter
|
||||
VerticalAlign = vaCenter
|
||||
TabStop = True
|
||||
autoSize = False
|
||||
DefaultBtn = False
|
||||
CancelBtn = False
|
||||
windowed = True
|
||||
Flat = False
|
||||
WordWrap = False
|
||||
LikeSpeedButton = False
|
||||
end
|
||||
object kolActivator: TKOLProject
|
||||
Locked = False
|
||||
Localizy = False
|
||||
projectName = 'Activator'
|
||||
projectDest = 'Activator'
|
||||
sourcePath = 'F:\LITE\D10.1\13.0\Crack\Activator\'
|
||||
outdcuPath = '0"..\Dcu\'
|
||||
dprResource = True
|
||||
protectFiles = True
|
||||
showReport = False
|
||||
isKOLProject = True
|
||||
autoBuild = True
|
||||
autoBuildDelay = 500
|
||||
BUILD = False
|
||||
consoleOut = False
|
||||
SupportAnsiMnemonics = 0
|
||||
PaintType = ptWYSIWIG
|
||||
ShowHint = True
|
||||
ReportDetailed = False
|
||||
GeneratePCode = False
|
||||
NewIF = True
|
||||
DefaultFont.Color = clWindowText
|
||||
DefaultFont.FontStyle = []
|
||||
DefaultFont.FontHeight = 0
|
||||
DefaultFont.FontWidth = 0
|
||||
DefaultFont.FontWeight = 0
|
||||
DefaultFont.FontName = 'System'
|
||||
DefaultFont.FontOrientation = 0
|
||||
DefaultFont.FontCharset = 1
|
||||
DefaultFont.FontPitch = fpDefault
|
||||
DefaultFont.FontQuality = fqDefault
|
||||
FormCompactDisabled = False
|
||||
Left = 32
|
||||
Top = 8
|
||||
end
|
||||
object kolMainForm: TKOLForm
|
||||
Tag = 0
|
||||
ForceIcon16x16 = False
|
||||
Caption = 'Delphi 10.1 Berlin Activator'
|
||||
Visible = True
|
||||
OnMessage = kolMainFormMessage
|
||||
OnDestroy = kolMainFormDestroy
|
||||
AllBtnReturnClick = False
|
||||
Tabulate = False
|
||||
TabulateEx = False
|
||||
UnitSourcePath = 'F:\LITE\D10.1\13.0\Crack\Activator\'
|
||||
Locked = False
|
||||
formUnit = 'MainFrm'
|
||||
formMain = True
|
||||
Enabled = True
|
||||
defaultSize = False
|
||||
defaultPosition = False
|
||||
MinWidth = 0
|
||||
MinHeight = 0
|
||||
MaxWidth = 0
|
||||
MaxHeight = 0
|
||||
HasBorder = True
|
||||
HasCaption = True
|
||||
StayOnTop = False
|
||||
CanResize = False
|
||||
CenterOnScreen = True
|
||||
Ctl3D = True
|
||||
WindowState = wsNormal
|
||||
minimizeIcon = False
|
||||
maximizeIcon = False
|
||||
closeIcon = True
|
||||
helpContextIcon = False
|
||||
borderStyle = fbsSingle
|
||||
HelpContext = 0
|
||||
Color = clBtnFace
|
||||
Font.Color = clWindowText
|
||||
Font.FontStyle = []
|
||||
Font.FontHeight = 0
|
||||
Font.FontWidth = 0
|
||||
Font.FontWeight = 0
|
||||
Font.FontName = 'System'
|
||||
Font.FontOrientation = 0
|
||||
Font.FontCharset = 1
|
||||
Font.FontPitch = fpDefault
|
||||
Font.FontQuality = fqDefault
|
||||
FontDefault = True
|
||||
Brush.Color = clBtnFace
|
||||
Brush.BrushStyle = bsSolid
|
||||
DoubleBuffered = False
|
||||
PreventResizeFlicks = False
|
||||
Transparent = False
|
||||
AlphaBlend = 255
|
||||
Border = 2
|
||||
MarginLeft = 0
|
||||
MarginRight = 0
|
||||
MarginTop = 0
|
||||
MarginBottom = 0
|
||||
MinimizeNormalAnimated = False
|
||||
RestoreNormalMaximized = False
|
||||
zOrderChildren = False
|
||||
statusSizeGrip = True
|
||||
Localizy = False
|
||||
ShowHint = True
|
||||
KeyPreview = False
|
||||
OnShow = kolMainFormShow
|
||||
OnFormCreate = kolMainFormFormCreate
|
||||
EraseBackground = False
|
||||
supportMnemonics = False
|
||||
FormCompact = False
|
||||
GenerateCtlNames = False
|
||||
Unicode = False
|
||||
OverrideScrollbars = False
|
||||
AssignTabOrders = False
|
||||
Left = 64
|
||||
Top = 8
|
||||
end
|
||||
end
|
641
10.1/Activator/MainFrm.pas
Normal file
641
10.1/Activator/MainFrm.pas
Normal file
@ -0,0 +1,641 @@
|
||||
{ KOL MCK } // Do not remove this line!
|
||||
{$DEFINE KOL_MCK}
|
||||
unit MainFrm;
|
||||
|
||||
interface
|
||||
|
||||
{$IFDEF KOL_MCK}
|
||||
uses Windows, Messages, KOL {$IF Defined(KOL_MCK)}{$ELSE}, mirror, Classes, Controls, mckCtrls, mckObjs, Graphics {$IFEND (place your units here->)};
|
||||
{$ELSE}
|
||||
{$I uses.inc}
|
||||
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, mirror;
|
||||
{$ENDIF}
|
||||
|
||||
type
|
||||
{$IF Defined(KOL_MCK)}
|
||||
{$I MCKfakeClasses.inc}
|
||||
{$IFDEF KOLCLASSES} {$I TMainFormclass.inc} {$ELSE OBJECTS} PMainForm = ^TMainForm; {$ENDIF CLASSES/OBJECTS}
|
||||
{$IFDEF KOLCLASSES}{$I TMainForm.inc}{$ELSE} TMainForm = object(TObj) {$ENDIF}
|
||||
Form: PControl;
|
||||
{$ELSE not_KOL_MCK}
|
||||
TMainForm = class(TForm)
|
||||
{$IFEND KOL_MCK}
|
||||
btnAbout: TKOLButton;
|
||||
btnActive: TKOLButton;
|
||||
btnExit: TKOLButton;
|
||||
btnReset: TKOLButton;
|
||||
btnRunX10: TKOLButton;
|
||||
kolActivator: TKOLProject;
|
||||
kolMainForm: TKOLForm;
|
||||
procedure btnAboutClick(Sender: PObj);
|
||||
procedure btnActiveClick(Sender: PObj);
|
||||
procedure btnExitClick(Sender: PObj);
|
||||
procedure btnResetClick(Sender: PObj);
|
||||
procedure btnRunX10Click(Sender: PObj);
|
||||
procedure kolMainFormDestroy(Sender: PObj);
|
||||
procedure kolMainFormFormCreate(Sender: PObj);
|
||||
function kolMainFormMessage(var Msg: TMsg; var Rslt: Integer): Boolean;
|
||||
procedure kolMainFormShow(Sender: PObj);
|
||||
private
|
||||
FAppPath,
|
||||
FBdsPath: string;
|
||||
FCurFileBuild: Integer;
|
||||
FSerialNumber,
|
||||
FRegCode,
|
||||
FInformation: string;
|
||||
private
|
||||
function FindBdsPath: Boolean;
|
||||
|
||||
function GetSystemHostsFile: string;
|
||||
|
||||
procedure BeginCursor;
|
||||
procedure EndCursor;
|
||||
|
||||
procedure BuildGenuineCglmFile(const ASerialNumber: string = '');
|
||||
procedure BuildGenuineSlipFile;
|
||||
|
||||
procedure BuildTrialCglmFile;
|
||||
procedure BuildTrialSlipFile;
|
||||
|
||||
procedure DeleteFiles(const AFileMask: string);
|
||||
|
||||
procedure GenerateRegistrationCode;
|
||||
procedure GenerateKeyGenLicense;
|
||||
|
||||
procedure PatchLicenseHostsFile;
|
||||
procedure RestoreLicenseHostsFile;
|
||||
|
||||
procedure PatchBdsFile;
|
||||
procedure RestoreBdsFile;
|
||||
|
||||
procedure DeleteTrialFiles;
|
||||
procedure DeleteTrialRegKeys;
|
||||
|
||||
procedure DoActive;
|
||||
procedure DoReset;
|
||||
procedure DoRunX10;
|
||||
|
||||
procedure ShowAboutMessage;
|
||||
|
||||
procedure Execute;
|
||||
end;
|
||||
|
||||
var
|
||||
MainForm {$IFDEF KOL_MCK} : PMainForm {$ELSE} : TMainForm {$ENDIF} ;
|
||||
|
||||
{$IFDEF KOL_MCK}
|
||||
procedure NewMainForm( var Result: PMainForm; AParent: PControl );
|
||||
{$ENDIF}
|
||||
|
||||
implementation
|
||||
|
||||
{.$DEFINE DEBUGMODE}
|
||||
|
||||
uses
|
||||
SysUtils, ShellAPI, Registry, FileUtils, PatchData, WinUtils, RadKeygen;
|
||||
|
||||
{$IF Defined(KOL_MCK)}{$ELSE}{$R *.DFM}{$IFEND}
|
||||
|
||||
{$IFDEF KOL_MCK}
|
||||
{$I MainFrm_1.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF DEBUGMODE}
|
||||
{$R WindowsXP.res}
|
||||
{$ELSE}
|
||||
{$R 'Admin.res'} { 管理员运行 }
|
||||
{$ENDIF}
|
||||
|
||||
const
|
||||
CSIDL_APPDATA = $001A; // Application Data, new for NT4, <user name>\Application Data
|
||||
CSIDL_COMMON_APPDATA = $0023; // All Users\Application Data
|
||||
|
||||
UM_SHOWABOUT = 100;
|
||||
|
||||
const
|
||||
defAppMessage = 'Based on the hard work of unis, x-force, cjack. 3x ;>';
|
||||
defAppVersion = '13.0';
|
||||
|
||||
defAppHelperFileName = 'SHFolder.dll';
|
||||
|
||||
defBdsVersion = '18.0';
|
||||
defBdsdLicenseManager = '"%s" -reg -skey 8218_21 -loadKey 2024 -a';
|
||||
|
||||
defBdsPatchFileName = defAppHelperFileName;
|
||||
|
||||
defLicenseHosts: array[0..10] of string = (
|
||||
'127.0.0.1 comapi.embarcadero.com',
|
||||
'127.0.0.1 license.embarcadero.com',
|
||||
'127.0.0.1 track.embarcadero.com',
|
||||
'127.0.0.1 external.ws.sanctx.embarcadero.com',
|
||||
'127.0.0.1 object.ws.sanctx.embarcadero.com',
|
||||
'127.0.0.1 license.codegear.com',
|
||||
'127.0.0.1 license-stage.codegear.com',
|
||||
'127.0.0.1 services.server.v8.srs.sanctuary.codegear.com',
|
||||
'127.0.0.1 LicenseRenewalServicesImpl.services.server.v8.srs.sanctuary.codegear.com',
|
||||
'127.0.0.1 LicenseUsageServicesImpl.services.server.v8.srs.sanctuary.codegear.com',
|
||||
'127.0.0.1 RegistrationServicesImpl.services.server.v8.srs.sanctuary.codegear.com'
|
||||
);
|
||||
|
||||
{ TMainForm }
|
||||
|
||||
procedure TMainForm.BeginCursor;
|
||||
begin
|
||||
SetCursor(LoadCursor(0, IDC_WAIT));
|
||||
end;
|
||||
|
||||
procedure TMainForm.btnAboutClick(Sender: PObj);
|
||||
begin
|
||||
ShowAboutMessage;
|
||||
end;
|
||||
|
||||
procedure TMainForm.btnActiveClick(Sender: PObj);
|
||||
begin
|
||||
BeginCursor;
|
||||
try
|
||||
DoActive;
|
||||
finally
|
||||
EndCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.btnExitClick(Sender: PObj);
|
||||
begin
|
||||
Self.Form.Close;
|
||||
end;
|
||||
|
||||
procedure TMainForm.btnResetClick(Sender: PObj);
|
||||
begin
|
||||
BeginCursor;
|
||||
try
|
||||
DoReset;
|
||||
finally
|
||||
EndCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.btnRunX10Click(Sender: PObj);
|
||||
begin
|
||||
BeginCursor;
|
||||
try
|
||||
DoRunX10;
|
||||
finally
|
||||
EndCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.BuildGenuineCglmFile(const ASerialNumber: string);
|
||||
var
|
||||
F: AnsiString;
|
||||
S: string;
|
||||
begin
|
||||
SetLength(F, Length(defCglmFileDatas));
|
||||
Move(defCglmFileDatas, Pointer(F)^, Length(defCglmFileDatas));
|
||||
if ASerialNumber <> '' then
|
||||
F := AnsiString(StringReplace(string(F), defCglmSerialNumber, ASerialNumber, [rfReplaceAll]));
|
||||
S := FBdsPath + 'Bin\cglm.ini';
|
||||
SaveDataToFile(S, Pointer(F)^, Length(F));
|
||||
S := GetShellFolderPath(CSIDL_COMMON_APPDATA) + 'Embarcadero\Studio\' + defBdsVersion + '\cglm.ini';
|
||||
SaveDataToFile(S, Pointer(F)^, Length(F));
|
||||
end;
|
||||
|
||||
procedure TMainForm.BuildGenuineSlipFile;
|
||||
var
|
||||
S: string;
|
||||
begin
|
||||
S := FBdsPath + 'License\*.slip';
|
||||
DeleteFiles(S);
|
||||
S := FBdsPath + 'License\RADStudio10.slip';
|
||||
SaveDataToFile(S, defGenuineLicFileDatas, Length(defGenuineLicFileDatas));
|
||||
end;
|
||||
|
||||
procedure TMainForm.BuildTrialCglmFile;
|
||||
var
|
||||
S: string;
|
||||
begin
|
||||
S := FBdsPath + 'Bin\cglm.ini';
|
||||
SaveDataToFile(S, defCglmFileDatas, Length(defCglmFileDatas));
|
||||
end;
|
||||
|
||||
procedure TMainForm.BuildTrialSlipFile;
|
||||
var
|
||||
S: string;
|
||||
begin
|
||||
S := FBdsPath + 'License\*.slip';
|
||||
DeleteFiles(S);
|
||||
S := FBdsPath + 'License\RADStudio10.slip';
|
||||
SaveDataToFile(S, defTrialLicFileDatas, Length(defTrialLicFileDatas));
|
||||
end;
|
||||
|
||||
procedure TMainForm.DeleteFiles(const AFileMask: string);
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计: Lsuper 2005.09.21
|
||||
//功能: 判断特殊文件
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function IsDirNotation(const AName: string): Boolean;
|
||||
begin
|
||||
Result := (AName = '.') or (AName = '..');
|
||||
end;
|
||||
var
|
||||
cSearchRec: TSearchRec;
|
||||
strFilePath: string;
|
||||
begin
|
||||
strFilePath := ExtractFilePath(AFileMask);
|
||||
if FindFirst(AFileMask, faAnyFile, cSearchRec) = 0 then
|
||||
repeat
|
||||
if (cSearchRec.Name <> '') and not IsDirNotation(cSearchRec.Name) then
|
||||
begin
|
||||
SysUtils.DeleteFile(strFilePath + cSearchRec.Name);
|
||||
end;
|
||||
until FindNext(cSearchRec) <> 0;
|
||||
SysUtils.FindClose(cSearchRec);
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2011.01.05
|
||||
//功能:清理授权信息
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
procedure TMainForm.DeleteTrialFiles;
|
||||
var
|
||||
AllUsersPath, UserPath: string;
|
||||
begin
|
||||
AllUsersPath := GetShellFolderPath(CSIDL_COMMON_APPDATA) + 'Embarcadero\';
|
||||
UserPath := GetShellFolderPath(CSIDL_APPDATA) + 'Embarcadero\';
|
||||
|
||||
DeleteFile(UserPath + '.cgb_license');
|
||||
DeleteFile(AllUsersPath + '.cgb_license');
|
||||
|
||||
DeleteFile(UserPath + '.licenses\.cg_license');
|
||||
DeleteFile(AllUsersPath + '.licenses\.cg_license');
|
||||
|
||||
DeleteFile(AllUsersPath + 'RAD Studio Activation.slip');
|
||||
|
||||
DeleteFiles(AllUsersPath + '.82*.slip');
|
||||
end;
|
||||
|
||||
procedure TMainForm.DeleteTrialRegKeys;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TMainForm.DoActive;
|
||||
var
|
||||
S: string;
|
||||
nBuild: Integer;
|
||||
begin
|
||||
if not FindBdsPath then
|
||||
begin
|
||||
ShowError('No BDS find!');
|
||||
Exit;
|
||||
end;
|
||||
S := FBdsPath + 'Bin\bds.exe';
|
||||
nBuild := GetFileBuildVersion(S);
|
||||
if nBuild <> FCurFileBuild then
|
||||
begin
|
||||
ShowError('BDS version not support!');
|
||||
Exit;
|
||||
end;
|
||||
BuildTrialCglmFile;
|
||||
BuildTrialSlipFile;
|
||||
RestoreBdsFile;
|
||||
GenerateRegistrationCode;
|
||||
GenerateKeyGenLicense;
|
||||
BuildGenuineCglmFile;
|
||||
BuildGenuineSlipFile;
|
||||
PatchBdsFile;
|
||||
PatchLicenseHostsFile;
|
||||
ShowMessage('Active', 'OK! Code: ' + FRegCode + ', Serial: ' + FSerialNumber);
|
||||
end;
|
||||
|
||||
procedure TMainForm.DoReset;
|
||||
begin
|
||||
if not FindBdsPath then
|
||||
begin
|
||||
ShowError('No BDS find!');
|
||||
Exit;
|
||||
end;
|
||||
DeleteTrialFiles;
|
||||
DeleteTrialRegKeys;
|
||||
BuildTrialCglmFile;
|
||||
BuildTrialSlipFile;
|
||||
RestoreBdsFile;
|
||||
RestoreLicenseHostsFile;
|
||||
ShowMessage('Reset', 'OK!');
|
||||
end;
|
||||
|
||||
procedure TMainForm.DoRunX10;
|
||||
var
|
||||
BdsExe: string;
|
||||
begin
|
||||
if not FindBdsPath then
|
||||
begin
|
||||
ShowError('No BDS find!');
|
||||
Exit;
|
||||
end;
|
||||
FBdsPath := FBdsPath + 'Bin';
|
||||
BdsExe := FBdsPath + '\bds.exe';
|
||||
ShellExecute(0, 'open', PChar(BdsExe), '-pDelphi', PChar(FBdsPath), SW_NORMAL);
|
||||
Delay(20);
|
||||
end;
|
||||
|
||||
procedure TMainForm.EndCursor;
|
||||
begin
|
||||
SetCursor(LoadCursor(0, IDC_ARROW));
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2011.09.20
|
||||
//功能:直接执行 Lite 的安装任务
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
procedure TMainForm.Execute;
|
||||
var
|
||||
S: string;
|
||||
nBuild: Integer;
|
||||
begin
|
||||
if not FindBdsPath then
|
||||
begin
|
||||
LogMessage('No BDS find!');
|
||||
Exit;
|
||||
end;
|
||||
S := FBdsPath + 'Bin\bds.exe';
|
||||
nBuild := GetFileBuildVersion(S);
|
||||
if nBuild <> FCurFileBuild then
|
||||
begin
|
||||
LogMessage('BDS version not support!');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
GenerateRegistrationCode;
|
||||
GenerateKeyGenLicense;
|
||||
BuildGenuineCglmFile;
|
||||
BuildGenuineSlipFile;
|
||||
PatchBdsFile;
|
||||
PatchLicenseHostsFile;
|
||||
|
||||
LogMessage('Done. Code: ' + FRegCode + ', Serial: ' + FSerialNumber);
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2013.02.15
|
||||
//功能:查找 Delphi
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function TMainForm.FindBdsPath: Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
with TRegistry.Create do
|
||||
try
|
||||
Access := KEY_READ;
|
||||
RootKey := HKEY_LOCAL_MACHINE;
|
||||
if OpenKeyReadOnly('SOFTWARE\Embarcadero\BDS\' + defBdsVersion) then
|
||||
begin
|
||||
FBdsPath := ReadString('RootDir');
|
||||
CloseKey;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
if FBdsPath <> '' then
|
||||
begin
|
||||
FBdsPath := IncludeTrailingPathDelimiter(FBdsPath);
|
||||
Result := FileExists(FBdsPath + 'Bin\bds.exe');
|
||||
end;
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2013.05.01
|
||||
//功能:
|
||||
//参数:
|
||||
//注意:设置环境变量,用于 IPC 通知、通讯
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
procedure TMainForm.GenerateKeyGenLicense;
|
||||
begin
|
||||
FSerialNumber := RadKeygen.GenerateSerialNumber;
|
||||
FRegCode := RadKeygen.GetRegistrationCode;
|
||||
RadKeygen.GenerateActiveFile(FSerialNumber, FRegCode, FInformation);
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计: Lsuper 2006.09.19
|
||||
//功能: 注入启动
|
||||
//参数:
|
||||
//注意:设置环境变量,用于 IPC 通知、通讯
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
procedure TMainForm.GenerateRegistrationCode;
|
||||
var
|
||||
si: TStartupInfo;
|
||||
pi: TProcessInformation;
|
||||
nExitCode: LongWord;
|
||||
strHelper, strCommandLine, strWorkDir: string;
|
||||
begin
|
||||
strHelper := FAppPath + defAppHelperFileName;
|
||||
if not FileExists(strHelper) then
|
||||
SaveDataToFile(strHelper, defHelperDatas, Length(defHelperDatas));
|
||||
strWorkDir := FBdsPath + 'Bin';
|
||||
strCommandLine := Format('%s\LicenseManager.exe', [strWorkDir]);
|
||||
if not FileExists(strCommandLine) then
|
||||
raise Exception.CreateFmt('File %s not exists!', [strCommandLine]);
|
||||
strCommandLine := Format(defBdsdLicenseManager, [strCommandLine]);
|
||||
FillChar(si, SizeOf(TStartupInfo), 0);
|
||||
with si do
|
||||
begin
|
||||
cb := SizeOf(TStartupInfo);
|
||||
dwFlags := STARTF_USESHOWWINDOW + STARTF_FORCEONFEEDBACK;
|
||||
wShowWindow := SW_HIDE;
|
||||
end;
|
||||
if CreateProcessEx(nil, PChar(strCommandLine), nil, nil, False, 0, nil, PChar(strWorkDir), si, pi, AnsiString(strHelper)) then
|
||||
try
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
GetExitCodeProcess(pi.hProcess, nExitCode);
|
||||
if nExitCode = 0 then
|
||||
raise Exception.Create('BdsReg error!');
|
||||
finally
|
||||
CloseHandle(pi.hThread);
|
||||
CloseHandle(pi.hProcess);
|
||||
end
|
||||
else RaiseLastOSError;
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2009.01.30
|
||||
//功能:取Windows系统目录
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function TMainForm.GetSystemHostsFile: string;
|
||||
const
|
||||
defHostsFilePath = 'drivers\etc\hosts';
|
||||
var
|
||||
nRet: LongWord;
|
||||
begin
|
||||
SetLength(Result, MAX_PATH);
|
||||
nRet := GetSystemDirectory(PChar(Result), MAX_PATH);
|
||||
if nRet = 0 then
|
||||
Result := ''
|
||||
else begin
|
||||
SetLength(Result, nRet);
|
||||
Result := IncludeTrailingPathDelimiter(Result) + defHostsFilePath;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.kolMainFormDestroy(Sender: PObj);
|
||||
begin
|
||||
LogMessage('Destroy');
|
||||
{$IFNDEF DEBUGMODE}
|
||||
DeleteFiles(FAppPath + '*.*');
|
||||
RemoveDirectory(PChar(FAppPath));
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TMainForm.kolMainFormFormCreate(Sender: PObj);
|
||||
var
|
||||
S: string;
|
||||
begin
|
||||
LogMessage('Create');
|
||||
|
||||
FAppPath := GetShellFolderPath(CSIDL_APPDATA);
|
||||
FAppPath := IncludeTrailingPathDelimiter(FAppPath) + 'Activator\' + defAppVersion + '\';
|
||||
ForceDirectories(FAppPath);
|
||||
S := GetModuleName(HInstance);
|
||||
FCurFileBuild := GetFileBuildVersion(S);
|
||||
|
||||
SetEnvironmentVariable('SESSIONNAME', 'Conso1e');
|
||||
|
||||
if ParamStr(1) = '-process' then
|
||||
begin
|
||||
Execute;
|
||||
Halt(1);
|
||||
end;
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2003.09.21
|
||||
//功能:处理系统菜单
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function TMainForm.kolMainFormMessage(var Msg: TMsg;
|
||||
var Rslt: Integer): Boolean;
|
||||
begin
|
||||
if (Msg.message = WM_SYSCOMMAND) and (Msg.WParam = UM_SHOWABOUT) then
|
||||
ShowAboutMessage;
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
procedure TMainForm.kolMainFormShow(Sender: PObj);
|
||||
var
|
||||
hMain : HMENU;
|
||||
begin
|
||||
LogMessage('Show');
|
||||
|
||||
hMain := GetSystemMenu(Self.Form.Handle, False);
|
||||
AppendMenu(hMain, MF_SEPARATOR, 0, nil);
|
||||
AppendMenu(hMain, MF_STRING{ or MF_CHECKED}, UM_SHOWABOUT, 'About ...');
|
||||
SetMainFormHandle(Self.Form.Handle);
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2011.09.21
|
||||
//功能:修改 BDS.exe 文件
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
procedure TMainForm.PatchBdsFile;
|
||||
var
|
||||
S: string;
|
||||
begin
|
||||
S := FBdsPath + 'Bin\' + defBdsPatchFileName;
|
||||
SaveDataToFile(S, defBdsPatchDllDatas, SizeOf(defBdsPatchDllDatas));
|
||||
end;
|
||||
|
||||
procedure TMainForm.PatchLicenseHostsFile;
|
||||
var
|
||||
F, S: string;
|
||||
nIndex, I: Integer;
|
||||
pList, pHosts: PStrListEx;
|
||||
begin
|
||||
F := GetSystemHostsFile;
|
||||
pHosts := NewStrListEx;
|
||||
with pHosts^ do
|
||||
try
|
||||
if FileExists(F) then
|
||||
LoadFromFile(F);
|
||||
pList := NewStrListEx;
|
||||
for S in defLicenseHosts do
|
||||
pList.Add(S);
|
||||
for I := 0 to Count - 1 do
|
||||
begin
|
||||
S := Trim(Items[I]);
|
||||
nIndex := pList.IndexOf(S);
|
||||
if nIndex >= 0 then
|
||||
pList.Delete(nIndex);
|
||||
end;
|
||||
if pList.Count > 0 then
|
||||
try
|
||||
AddStrings(pList);
|
||||
FileSetReadOnly(F, False);
|
||||
SaveToFile(F);
|
||||
except
|
||||
on E: Exception do
|
||||
LogMessage('Disable Hosts Error: ' + E.Message);
|
||||
end;
|
||||
pList.Free;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.RestoreBdsFile;
|
||||
var
|
||||
S: string;
|
||||
begin
|
||||
S := FBdsPath + 'Bin\' + defBdsPatchFileName;
|
||||
SysUtils.DeleteFile(S);;
|
||||
end;
|
||||
|
||||
procedure TMainForm.RestoreLicenseHostsFile;
|
||||
var
|
||||
F, S: string;
|
||||
nIndex, nRet, I: Integer;
|
||||
pList, pHosts: PStrListEx;
|
||||
begin
|
||||
F := GetSystemHostsFile;
|
||||
if not FileExists(F) then
|
||||
Exit;
|
||||
pHosts := NewStrListEx;
|
||||
with pHosts^ do
|
||||
try
|
||||
LoadFromFile(F);
|
||||
pList := NewStrListEx;
|
||||
for S in defLicenseHosts do
|
||||
pList.Add(S);
|
||||
nRet := 0;
|
||||
for I := Count - 1 downto 0 do
|
||||
begin
|
||||
S := Trim(Items[I]);
|
||||
nIndex := pList.IndexOf(S);
|
||||
if nIndex < 0 then
|
||||
Continue;
|
||||
pHosts.Delete(I);
|
||||
Inc(nRet);
|
||||
end;
|
||||
if nRet > 0 then
|
||||
try
|
||||
FileSetReadOnly(F, False);
|
||||
SaveToFile(F);
|
||||
except
|
||||
on E: Exception do
|
||||
LogMessage('Disable Hosts Error: ' + E.Message);
|
||||
end;
|
||||
pList.Free;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.ShowAboutMessage;
|
||||
begin
|
||||
with Self.Form^ do
|
||||
ShellAbout(Handle, PChar(string(Caption) + ', Lsuper'), PAnsiChar(AnsiString(defAppMessage)), Icon);
|
||||
end;
|
||||
|
||||
end.
|
49
10.1/Activator/MainFrm_1.$$$
Normal file
49
10.1/Activator/MainFrm_1.$$$
Normal file
@ -0,0 +1,49 @@
|
||||
{ KOL MCK } // Do not remove this line!
|
||||
|
||||
procedure NewMainForm( var Result: PMainForm; AParent: PControl );
|
||||
begin
|
||||
|
||||
{$IFDEF KOLCLASSES}
|
||||
Result := PMainForm.Create;
|
||||
{$ELSE OBJECTS}
|
||||
New( Result, Create );
|
||||
{$ENDIF KOL CLASSES/OBJECTS}
|
||||
Result.Form := NewForm( AParent, 'Delphi 10.1 Berlin Activator' ).SetPosition( 8, 8 );
|
||||
Applet := Result.Form;
|
||||
Result.Form.Add2AutoFree( Result );
|
||||
Result.Form.Style := Result.Form.Style and not (WS_MINIMIZEBOX or WS_MAXIMIZEBOX);
|
||||
Result.Form.SetClientSize( 534, 122 );
|
||||
Result.Form.OnMessage := Result.kolMainFormMessage;
|
||||
Result.Form.OnShow := Result.kolMainFormShow;
|
||||
Result.Form.OnDestroy := Result.kolMainFormDestroy;
|
||||
Result.btnAbout := NewButton( Result.Form, '&About' ).SetPosition( 325, 16 ).SetSize( 90, 90 );
|
||||
{$IFDEF USE_MHTOOLTIP}
|
||||
Result.btnAbout.Hint.Text := 'About';
|
||||
{$ENDIF USE_MHTOOLTIP}
|
||||
Result.btnReset := NewButton( Result.Form, '&Reset' ).SetPosition( 222, 16 ).SetSize( 90, 90 );
|
||||
{$IFDEF USE_MHTOOLTIP}
|
||||
Result.btnReset.Hint.Text := 'Reset Delphi 10.1';
|
||||
{$ENDIF USE_MHTOOLTIP}
|
||||
Result.btnExit := NewButton( Result.Form, '&Exit' ).SetPosition( 428, 16 ).SetSize( 90, 90 );
|
||||
{$IFDEF USE_MHTOOLTIP}
|
||||
Result.btnExit.Hint.Text := 'Exit';
|
||||
{$ENDIF USE_MHTOOLTIP}
|
||||
Result.btnRunX10 := NewButton( Result.Form, '&Run' ).SetPosition( 119, 16 ).SetSize( 90, 90 );
|
||||
{$IFDEF USE_MHTOOLTIP}
|
||||
Result.btnRunX10.Hint.Text := 'Run Delphi 10.1';
|
||||
{$ENDIF USE_MHTOOLTIP}
|
||||
Result.btnActive := NewButton( Result.Form, '&Active' ).SetPosition( 16, 16 ).SetSize( 90, 90 );
|
||||
{$IFDEF USE_MHTOOLTIP}
|
||||
Result.btnActive.Hint.Text := 'Active Delphi 10.1';
|
||||
{$ENDIF USE_MHTOOLTIP}
|
||||
Result.btnAbout.OnClick := Result.btnAboutClick;
|
||||
Result.btnReset.OnClick := Result.btnResetClick;
|
||||
Result.btnExit.OnClick := Result.btnExitClick;
|
||||
Result.btnRunX10.OnClick := Result.btnRunX10Click;
|
||||
Result.btnActive.OnClick := Result.btnActiveClick;
|
||||
Result.Form.CenterOnParent.CanResize := False;
|
||||
Result.Form.Perform( WM_INITMENU, 0, 0 );
|
||||
Result.kolMainFormFormCreate( Result );
|
||||
|
||||
end;
|
||||
|
49
10.1/Activator/MainFrm_1.inc
Normal file
49
10.1/Activator/MainFrm_1.inc
Normal file
@ -0,0 +1,49 @@
|
||||
{ KOL MCK } // Do not remove this line!
|
||||
|
||||
procedure NewMainForm( var Result: PMainForm; AParent: PControl );
|
||||
begin
|
||||
|
||||
{$IFDEF KOLCLASSES}
|
||||
Result := PMainForm.Create;
|
||||
{$ELSE OBJECTS}
|
||||
New( Result, Create );
|
||||
{$ENDIF KOL CLASSES/OBJECTS}
|
||||
Result.Form := NewForm( AParent, 'Delphi 10.1 Berlin Activator' ).SetPosition( 8, 8 );
|
||||
Applet := Result.Form;
|
||||
Result.Form.Add2AutoFree( Result );
|
||||
Result.Form.Style := Result.Form.Style and not (WS_MINIMIZEBOX or WS_MAXIMIZEBOX);
|
||||
Result.Form.SetClientSize( 534, 122 );
|
||||
Result.Form.OnMessage := Result.kolMainFormMessage;
|
||||
Result.Form.OnShow := Result.kolMainFormShow;
|
||||
Result.Form.OnDestroy := Result.kolMainFormDestroy;
|
||||
Result.btnAbout := NewButton( Result.Form, '&About' ).SetPosition( 325, 16 ).SetSize( 90, 90 );
|
||||
{$IFDEF USE_MHTOOLTIP}
|
||||
Result.btnAbout.Hint.Text := 'About';
|
||||
{$ENDIF USE_MHTOOLTIP}
|
||||
Result.btnReset := NewButton( Result.Form, 'Re&set' ).SetPosition( 222, 16 ).SetSize( 90, 90 );
|
||||
{$IFDEF USE_MHTOOLTIP}
|
||||
Result.btnReset.Hint.Text := 'Reset Delphi 10.1';
|
||||
{$ENDIF USE_MHTOOLTIP}
|
||||
Result.btnExit := NewButton( Result.Form, '&Exit' ).SetPosition( 428, 16 ).SetSize( 90, 90 );
|
||||
{$IFDEF USE_MHTOOLTIP}
|
||||
Result.btnExit.Hint.Text := 'Exit';
|
||||
{$ENDIF USE_MHTOOLTIP}
|
||||
Result.btnRunX10 := NewButton( Result.Form, '&Run' ).SetPosition( 119, 16 ).SetSize( 90, 90 );
|
||||
{$IFDEF USE_MHTOOLTIP}
|
||||
Result.btnRunX10.Hint.Text := 'Run Delphi 10.1';
|
||||
{$ENDIF USE_MHTOOLTIP}
|
||||
Result.btnActive := NewButton( Result.Form, '&Active' ).SetPosition( 16, 16 ).SetSize( 90, 90 );
|
||||
{$IFDEF USE_MHTOOLTIP}
|
||||
Result.btnActive.Hint.Text := 'Active Delphi 10.1';
|
||||
{$ENDIF USE_MHTOOLTIP}
|
||||
Result.btnAbout.OnClick := Result.btnAboutClick;
|
||||
Result.btnReset.OnClick := Result.btnResetClick;
|
||||
Result.btnExit.OnClick := Result.btnExitClick;
|
||||
Result.btnRunX10.OnClick := Result.btnRunX10Click;
|
||||
Result.btnActive.OnClick := Result.btnActiveClick;
|
||||
Result.Form.CenterOnParent.CanResize := False;
|
||||
Result.Form.Perform( WM_INITMENU, 0, 0 );
|
||||
Result.kolMainFormFormCreate( Result );
|
||||
|
||||
end;
|
||||
|
3407
10.1/Activator/PatchData.inc
Normal file
3407
10.1/Activator/PatchData.inc
Normal file
File diff suppressed because it is too large
Load Diff
26
10.1/Activator/PatchData.pas
Normal file
26
10.1/Activator/PatchData.pas
Normal file
@ -0,0 +1,26 @@
|
||||
{ *********************************************************************** }
|
||||
{ }
|
||||
{ 工具单元 }
|
||||
{ }
|
||||
{ 设计:Lsuper 2013.02.16 }
|
||||
{ 备注: }
|
||||
{ 审核: }
|
||||
{ }
|
||||
{ Copyright (c) 1998-2014 Super Studio }
|
||||
{ }
|
||||
{ *********************************************************************** }
|
||||
|
||||
unit PatchData;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes;
|
||||
|
||||
const
|
||||
|
||||
{$I PatchData.inc} { 文件补丁数据 }
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
1
10.1/Activator/TMainForm.inc
Normal file
1
10.1/Activator/TMainForm.inc
Normal file
@ -0,0 +1 @@
|
||||
TMainForm = class(TObj)
|
1
10.1/Activator/TMainFormclass.inc
Normal file
1
10.1/Activator/TMainFormclass.inc
Normal file
@ -0,0 +1 @@
|
||||
TMainForm = class; PMainForm = TMainForm;
|
295
10.1/Activator/WinUtils.pas
Normal file
295
10.1/Activator/WinUtils.pas
Normal file
@ -0,0 +1,295 @@
|
||||
{ *********************************************************************** }
|
||||
{ }
|
||||
{ Win 辅助函数单元 }
|
||||
{ }
|
||||
{ 设计:Lsuper 2013.04.26 }
|
||||
{ 备注: }
|
||||
{ 审核: }
|
||||
{ }
|
||||
{ Copyright (c) 1998-2014 Super Studio }
|
||||
{ }
|
||||
{ *********************************************************************** }
|
||||
|
||||
unit WinUtils;
|
||||
|
||||
{$WARNINGS OFF}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Windows;
|
||||
|
||||
function GetFileBuildVersion(const AFile: string): Integer;
|
||||
function GetShellFolderPath(nFolder: Integer): string;
|
||||
|
||||
function TaskMessageBox(const AHandle: THandle; const AText, ACaption: string;
|
||||
const Icon, Buttons: Integer): Integer;
|
||||
function IsWindowsVista: Boolean;
|
||||
|
||||
procedure Delay(ASeconds: Double);
|
||||
|
||||
function CreateProcessEx(lpApplicationName: PChar; lpCommandLine: PChar;
|
||||
lpProcessAttributes, lpThreadAttributes: PSecurityAttributes;
|
||||
bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer;
|
||||
lpCurrentDirectory: PChar; const lpStartupInfo: TStartupInfo;
|
||||
var lpProcessInformation: TProcessInformation; const ALibraryName: AnsiString): Boolean;
|
||||
function InjectLibraryModule(AProcessID: LongWord; const ALibraryName: AnsiString): Boolean;
|
||||
|
||||
procedure LogMessage(const AMessage: string);
|
||||
|
||||
procedure ShowMessage(const ACaption, AMessage: string);
|
||||
procedure ShowError(const AMessage: string);
|
||||
|
||||
procedure SetMainFormHandle(const AHandle: HWND);
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
ShlObj;
|
||||
|
||||
const
|
||||
TD_BUTTON_OK = 01;
|
||||
TD_BUTTON_YES = 02;
|
||||
TD_BUTTON_NO = 04;
|
||||
TD_BUTTON_CANCEL = 08;
|
||||
TD_BUTTON_RETRY = 16;
|
||||
TD_BUTTON_CLOSE = 32;
|
||||
|
||||
TD_ICON_BLANK = 00;
|
||||
TD_ICON_WARNING = 84;
|
||||
TD_ICON_QUESTION = 99;
|
||||
TD_ICON_ERROR = 98;
|
||||
TD_ICON_INFORMATION = 81;
|
||||
|
||||
TD_ICON_SHIELD_QUESTION = 104;
|
||||
TD_ICON_SHIELD_ERROR = 105;
|
||||
TD_ICON_SHIELD_OK = 106;
|
||||
TD_ICON_SHIELD_WARNING = 107;
|
||||
|
||||
var
|
||||
MainFormHandle: HWND = 0;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// 说明:用于延迟n秒
|
||||
// 参数:ASeconds -- 延迟秒数
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
procedure Delay(ASeconds: Double);
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计: Lsuper 2004.11.10
|
||||
//功能: 调用消息循环,防止僵死
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
procedure ProcessMessages;
|
||||
const
|
||||
WM_QUIT = $0012;
|
||||
var
|
||||
Msg: TMsg;
|
||||
begin
|
||||
while PeekMessage(Msg, 0, 0, 0, PM_REMOVE) do
|
||||
begin
|
||||
if Msg.Message = WM_QUIT then
|
||||
Halt(Msg.wParam);
|
||||
TranslateMessage(Msg);
|
||||
DispatchMessage(Msg);
|
||||
end;
|
||||
end;
|
||||
var
|
||||
nTimeOut: TDateTime;
|
||||
nHours, nMins, nSeconds, nMilliSecs: Integer;
|
||||
begin
|
||||
nSeconds := Trunc(ASeconds);
|
||||
nMilliSecs := Round(Frac(ASeconds) * 1000);
|
||||
nHours := nSeconds div 3600;
|
||||
nMins := (nSeconds mod 3600) div 60;
|
||||
nSeconds := nSeconds mod 60;
|
||||
nTimeOut := Now + EncodeTime(nHours, nMins, nSeconds, nMilliSecs);
|
||||
// wait until the TimeOut time
|
||||
while Now < nTimeOut do
|
||||
ProcessMessages;
|
||||
end;
|
||||
|
||||
function GetFileBuildVersion(const AFile: string): Integer;
|
||||
var
|
||||
nInfoSize, dwHandle: DWORD;
|
||||
cFileInfo: PVSFixedFileInfo;
|
||||
nVerSize: DWORD;
|
||||
strBuffer: AnsiString;
|
||||
begin
|
||||
Result := 0;
|
||||
nInfoSize := GetFileVersionInfoSize(PChar(AFile), dwHandle);
|
||||
if nInfoSize = 0 then
|
||||
Exit;
|
||||
SetLength(strBuffer, nInfoSize);
|
||||
if not GetFileVersionInfo(PChar(AFile), dwHandle, nInfoSize, Pointer(strBuffer)) then
|
||||
Exit;
|
||||
if VerQueryValue(Pointer(strBuffer), '\', Pointer(cFileInfo), nVerSize) then
|
||||
Result := LOWORD(cFileInfo.dwFileVersionLS);
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2010.04.09
|
||||
//功能:获取 Shell 文件夹位置,如 GetSpecialFolderPath(CSIDL_COMMON_APPDATA) 等
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function GetShellFolderPath(nFolder: Integer): string;
|
||||
begin
|
||||
SetLength(Result, MAX_PATH);
|
||||
SHGetSpecialFolderPath(0, PChar(Result), nFolder, False);
|
||||
SetLength(Result, StrLen(PChar(Result)));
|
||||
if (Result <> '') and (Result[Length(Result)] <> '\') then
|
||||
Result := Result + '\';
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2013.05.01
|
||||
//功能:创建注入进程
|
||||
//参数:
|
||||
//注意:加入 500ms 等待时间,确保 dll 加载成功后执行
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function CreateProcessEx(lpApplicationName: PChar; lpCommandLine: PChar;
|
||||
lpProcessAttributes, lpThreadAttributes: PSecurityAttributes;
|
||||
bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer;
|
||||
lpCurrentDirectory: PChar; const lpStartupInfo: TStartupInfo;
|
||||
var lpProcessInformation: TProcessInformation; const ALibraryName: AnsiString): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
if not CreateProcess(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags or CREATE_SUSPENDED, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation) then
|
||||
Exit;
|
||||
Result := InjectLibraryModule(lpProcessInformation.hProcess, ALibraryName);
|
||||
{
|
||||
Result := uallHook.InjectLibrary(lpProcessInformation.dwProcessId, PChar(ALibraryName));
|
||||
}
|
||||
Sleep(500);
|
||||
ResumeThread(lpProcessInformation.hThread);
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2013.05.01
|
||||
//功能:注入 DLL
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function InjectLibraryModule(AProcessID: LongWord; const ALibraryName: AnsiString): Boolean;
|
||||
var
|
||||
dwProcessID2: DWord;
|
||||
dwMemSize: DWord;
|
||||
dwWritten: DWord;
|
||||
dwThreadID: DWord;
|
||||
pLLA: Pointer;
|
||||
pTargetMemory: Pointer;
|
||||
begin
|
||||
Assert(ALibraryName <> '');
|
||||
Result := False;
|
||||
dwProcessID2 := OpenProcess(PROCESS_ALL_ACCESS, False, AProcessID);
|
||||
if (dwProcessID2 <> 0) then
|
||||
AProcessID := dwProcessID2;
|
||||
dwMemSize := Length(ALibraryName) + 1;
|
||||
pTargetMemory := VirtualAllocEx(AProcessID, nil, dwMemSize, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);
|
||||
pLLA := GetProcAddress(GetModuleHandleA('kernel32.dll'), 'LoadLibraryA');
|
||||
if (pLLA <> nil) and (pTargetMemory <> nil) then
|
||||
begin
|
||||
if WriteProcessMemory(AProcessID, pTargetMemory, PChar(ALibraryName), dwMemSize, dwWritten) and (dwWritten = dwMemSize) then
|
||||
Result := CreateRemoteThread(AProcessID, nil, 0, pLLA, pTargetMemory, 0, dwThreadID) <> 0;
|
||||
end;
|
||||
if (dwProcessID2 <> 0) then
|
||||
CloseHandle(dwProcessID2);
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2009.10.25
|
||||
//功能:判断是否 Vista/7
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function IsWindowsVista: Boolean;
|
||||
var
|
||||
hKernel32: HMODULE;
|
||||
begin
|
||||
hKernel32 := GetModuleHandle('kernel32');
|
||||
if hKernel32 > 0 then
|
||||
Result := GetProcAddress(hKernel32, 'GetLocaleInfoEx') <> nil
|
||||
else Result := false;
|
||||
end;
|
||||
|
||||
procedure LogMessage(const AMessage: string);
|
||||
begin
|
||||
OutputDebugString(PChar(AMessage));
|
||||
end;
|
||||
|
||||
procedure SetMainFormHandle(const AHandle: HWND);
|
||||
begin
|
||||
MainFormHandle := AHandle;
|
||||
end;
|
||||
|
||||
procedure ShowError(const AMessage: string);
|
||||
begin
|
||||
TaskMessageBox(MainFormHandle, AMessage, 'Error', TD_ICON_ERROR, TD_BUTTON_OK);
|
||||
end;
|
||||
|
||||
procedure ShowMessage(const ACaption, AMessage: string);
|
||||
begin
|
||||
TaskMessageBox(MainFormHandle, AMessage, ACaption, TD_ICON_INFORMATION, TD_BUTTON_OK);
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//设计:Lsuper 2009.10.25
|
||||
//功能: 内部使用的用于显示对话框的函数,适应 Vista/7 系统风格
|
||||
//参数:
|
||||
//注意:参考 Application 的 MessageBox 和 Dialogs 的 代码,忽略多显示器判断代码
|
||||
// http://www.tmssoftware.com/site/atbdev5.asp
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function TaskMessageBox(const AHandle: THandle; const AText, ACaption: string;
|
||||
const Icon, Buttons: Integer): Integer;
|
||||
const
|
||||
conTaskDialogProcName = 'TaskDialog';
|
||||
var
|
||||
DLLHandle: THandle;
|
||||
wTitle, wContent: array[0..1024] of widechar;
|
||||
TaskDialogProc: function(HWND: THandle; hInstance: THandle; cTitle,
|
||||
cDescription, cContent: PWideChar; Buttons: Integer; Icon: Integer;
|
||||
ResButton: PInteger): Integer; cdecl stdcall;
|
||||
Flags: Integer;
|
||||
begin
|
||||
Result := 0;
|
||||
if IsWindowsVista then
|
||||
begin
|
||||
DLLHandle := LoadLibrary(comctl32);
|
||||
@TaskDialogProc := GetProcAddress(DLLHandle, conTaskDialogProcName);
|
||||
end
|
||||
else TaskDialogProc := nil;
|
||||
if Assigned(TaskDialogProc) then
|
||||
begin
|
||||
StringToWideChar(ACaption, wTitle, SizeOf(wTitle));
|
||||
StringToWideChar(AText, wContent, SizeOf(wContent));
|
||||
TaskDialogProc(AHandle, 0, wTitle, nil, wContent, Buttons, Icon, @Result);
|
||||
end
|
||||
else begin
|
||||
Flags := 0;
|
||||
if Buttons = TD_BUTTON_OK then
|
||||
Flags := MB_OK;
|
||||
if Buttons = TD_BUTTON_OK or TD_BUTTON_CANCEL then
|
||||
Flags := MB_OKCANCEL;
|
||||
if Buttons = TD_BUTTON_CLOSE or TD_BUTTON_RETRY or TD_BUTTON_CANCEL then
|
||||
Flags := MB_ABORTRETRYIGNORE;
|
||||
if Buttons = TD_BUTTON_YES or TD_BUTTON_NO or TD_BUTTON_CANCEL then
|
||||
Flags := MB_YESNOCANCEL;
|
||||
if Buttons = TD_BUTTON_YES or TD_BUTTON_NO then
|
||||
Flags := MB_YESNO;
|
||||
if Buttons = TD_BUTTON_RETRY or TD_BUTTON_CANCEL then
|
||||
Flags := MB_RETRYCANCEL;
|
||||
case Icon of
|
||||
TD_ICON_BLANK:
|
||||
;
|
||||
TD_ICON_WARNING, TD_ICON_SHIELD_WARNING:
|
||||
Flags := Flags or MB_ICONWARNING;
|
||||
TD_ICON_QUESTION, TD_ICON_SHIELD_QUESTION:
|
||||
Flags := Flags or MB_ICONQUESTION;
|
||||
TD_ICON_ERROR, TD_ICON_SHIELD_ERROR:
|
||||
Flags := Flags or MB_ICONERROR;
|
||||
TD_ICON_INFORMATION, TD_ICON_SHIELD_OK:
|
||||
Flags := Flags or MB_ICONINFORMATION;
|
||||
end;
|
||||
Result := Windows.MessageBox(AHandle, PChar(AText), PChar(ACaption), Flags);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
9
10.1/Activator/uses.inc
Normal file
9
10.1/Activator/uses.inc
Normal file
@ -0,0 +1,9 @@
|
||||
{ KOL MCK } // Do not remove this line!
|
||||
{ uses.inc
|
||||
This file is generated automatically - do not modify it manually.
|
||||
It is included to be recognized by compiler, but replacing word
|
||||
<uses> with compiler directive <$I uses.inc> fakes auto-completion
|
||||
preventing it from automatic references adding to VCL units into
|
||||
uses clause aimed for KOL environment only. }
|
||||
|
||||
uses
|
1
10.1/Dcu/dirinfo.txt
Normal file
1
10.1/Dcu/dirinfo.txt
Normal file
@ -0,0 +1 @@
|
||||
This directory is intended as a common place for sample application's EXE files
|
7
10.1/Keygen/AnsiStrings.pas
Normal file
7
10.1/Keygen/AnsiStrings.pas
Normal file
@ -0,0 +1,7 @@
|
||||
unit AnsiStrings;
|
||||
|
||||
interface
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
2628
10.1/Keygen/DllData.pas
Normal file
2628
10.1/Keygen/DllData.pas
Normal file
File diff suppressed because it is too large
Load Diff
2282
10.1/Keygen/FGInt.pas
Normal file
2282
10.1/Keygen/FGInt.pas
Normal file
File diff suppressed because it is too large
Load Diff
711
10.1/Keygen/RadKeygen.pas
Normal file
711
10.1/Keygen/RadKeygen.pas
Normal file
@ -0,0 +1,711 @@
|
||||
unit RadKeygen;
|
||||
|
||||
interface
|
||||
uses Classes,SysUtils,Windows,Registry,SHFolder,Sha1,FGInt,DllData;
|
||||
|
||||
function GenerateSerialNumber():string;
|
||||
function GetRegistrationCode():string;
|
||||
function GenerateActiveFile(SerialNumber,RegistrationCode:string;var FileName:string):Boolean;
|
||||
function PatchFile(var FileName:string):Boolean;
|
||||
procedure PatchmOasisRuntime();
|
||||
|
||||
implementation
|
||||
|
||||
const
|
||||
HostPID:Integer=8218;
|
||||
HostSKU:Integer=53;
|
||||
ByteMap:array[0..255] of Byte=($00, $07, $0E, $09, $1C, $1B, $12, $15, $38, $3F,
|
||||
$36, $31, $24, $23, $2A, $2D, $70, $77, $7E, $79,
|
||||
$6C, $6B, $62, $65, $48, $4F, $46, $41, $54, $53,
|
||||
$5A, $5D, $E0, $E7, $EE, $E9, $FC, $FB, $F2, $F5,
|
||||
$D8, $DF, $D6, $D1, $C4, $C3, $CA, $CD, $90, $97,
|
||||
$9E, $99, $8C, $8B, $82, $85, $A8, $AF, $A6, $A1,
|
||||
$B4, $B3, $BA, $BD, $C7, $C0, $C9, $CE, $DB, $DC,
|
||||
$D5, $D2, $FF, $F8, $F1, $F6, $E3, $E4, $ED, $EA,
|
||||
$B7, $B0, $B9, $BE, $AB, $AC, $A5, $A2, $8F, $88,
|
||||
$81, $86, $93, $94, $9D, $9A, $27, $20, $29, $2E,
|
||||
$3B, $3C, $35, $32, $1F, $18, $11, $16, $03, $04,
|
||||
$0D, $0A, $57, $50, $59, $5E, $4B, $4C, $45, $42,
|
||||
$6F, $68, $61, $66, $73, $74, $7D, $7A, $89, $8E,
|
||||
$87, $80, $95, $92, $9B, $9C, $B1, $B6, $BF, $B8,
|
||||
$AD, $AA, $A3, $A4, $F9, $FE, $F7, $F0, $E5, $E2,
|
||||
$EB, $EC, $C1, $C6, $CF, $C8, $DD, $DA, $D3, $D4,
|
||||
$69, $6E, $67, $60, $75, $72, $7B, $7C, $51, $56,
|
||||
$5F, $58, $4D, $4A, $43, $44, $19, $1E, $17, $10,
|
||||
$05, $02, $0B, $0C, $21, $26, $2F, $28, $3D, $3A,
|
||||
$33, $34, $4E, $49, $40, $47, $52, $55, $5C, $5B,
|
||||
$76, $71, $78, $7F, $6A, $6D, $64, $63, $3E, $39,
|
||||
$30, $37, $22, $25, $2C, $2B, $06, $01, $08, $0F,
|
||||
$1A, $1D, $14, $13, $AE, $A9, $A0, $A7, $B2, $B5,
|
||||
$BC, $BB, $96, $91, $98, $9F, $8A, $8D, $84, $83,
|
||||
$DE, $D9, $D0, $D7, $C2, $C5, $CC, $CB, $E6, $E1,
|
||||
$E8, $EF, $FA, $FD, $F4, $F3);
|
||||
CheckMap:array[0..255] of Word=($0020, $0020, $0020, $0020, $0020, $0020, $0020, $0020, $0020, $0068,
|
||||
$0028, $0028, $0028, $0028, $0020, $0020, $0020, $0020, $0020, $0020,
|
||||
$0020, $0020, $0020, $0020, $0020, $0020, $0020, $0020, $0020, $0020,
|
||||
$0020, $0020, $0048, $0010, $0010, $0010, $0010, $0010, $0010, $0010,
|
||||
$0010, $0010, $0010, $0010, $0010, $0010, $0010, $0010, $0084, $0084,
|
||||
$0084, $0084, $0084, $0084, $0084, $0084, $0084, $0084, $0010, $0010,
|
||||
$0010, $0010, $0010, $0010, $0010, $0181, $0181, $0181, $0181, $0181,
|
||||
$0181, $0101, $0101, $0101, $0101, $0101, $0101, $0101, $0101, $0101,
|
||||
$0101, $0101, $0101, $0101, $0101, $0101, $0101, $0101, $0101, $0101,
|
||||
$0101, $0010, $0010, $0010, $0010, $0010, $0010, $0182, $0182, $0182,
|
||||
$0182, $0182, $0182, $0102, $0102, $0102, $0102, $0102, $0102, $0102,
|
||||
$0102, $0102, $0102, $0102, $0102, $0102, $0102, $0102, $0102, $0102,
|
||||
$0102, $0102, $0102, $0010, $0010, $0010, $0010, $0020, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000,
|
||||
$0000, $0000, $0000, $0000, $0000, $0000);
|
||||
|
||||
|
||||
function GenerateSerialNumber():string;
|
||||
const
|
||||
StrMap:string='ABC2DE34FGHJKLM5NPQRST6U7VWX8YZ9';
|
||||
var
|
||||
i,v1,v2,v3,v4,v5,v6,v7,v8,v9:Integer;
|
||||
SumValue:string;
|
||||
ByteArray:array[0..19] of Byte;
|
||||
begin
|
||||
Randomize();
|
||||
v1:=0;
|
||||
v2:=0;
|
||||
v3:=0;
|
||||
v4:=0;
|
||||
v5:=1;
|
||||
v6:=8217;
|
||||
v7:=53;
|
||||
v8:= Random(32) shl 8;
|
||||
v8:=v8 xor Random(32);
|
||||
v8:= v8 mod $10000;
|
||||
SumValue:=Format('%d',[v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8]);
|
||||
v9:=0;
|
||||
|
||||
for i := 0 to Length(SumValue)-1 do
|
||||
begin
|
||||
v9:=v9 xor ByteMap[Ord(SumValue[i+1])];
|
||||
end;
|
||||
ByteArray[0] := ((v8 shr 1) and 8) or ((v8 shr 5) and 4) or (2 * v5 and 2);
|
||||
ByteArray[1] := ((v7 shr 1) and 16) or ((v7 shr 4) and 8) or ((v6 shr 5) and 2) or ((v6 shr 8) and 1);
|
||||
ByteArray[2] := (2 * v7 and 16) or (8 * v8 and 8) or ((v5 shr 1) and 4) or ((v6 shr 4) and 2) or (v3 and 1);
|
||||
ByteArray[3] := (4 * v5 and 16);
|
||||
ByteArray[4] := (4 * v9 and 16) or ((v6 shr 4) and 8);
|
||||
ByteArray[5] := (8 * v4 and 8) or ((v8 shr 1) and 4) or ((v8 shr 12) and 2);
|
||||
ByteArray[6] := ((v9 shr 3) and 8) or ((v8 shr 4) and 4) or (2 * v1 and 2);
|
||||
ByteArray[7] := ((v8 shr 11) and 16) or ((v8 shr 7) and 8) or (4 * v6 and 4) or ((v5 shr 3) and 2);
|
||||
ByteArray[8] := ((v8 shr 7) and 16) or ((v6 shr 1) and 1);
|
||||
ByteArray[9] := (4 * v6 and 16) or (v9 and 8) or (v8 and 4);
|
||||
ByteArray[10] := ((v8 shr 9) and 8);
|
||||
ByteArray[11] := (4 * v9 and 8) or (4 * v9 and 4) or (v8 and 2) or ((v8 shr 5) and 1);
|
||||
ByteArray[12] := ((v8 shr 8) and 1);
|
||||
ByteArray[13] := ((v6 shr 7) and 16) or ((v9 shr 7) and 1);
|
||||
ByteArray[14] := (2 * v7 and 2) or ((v7 shr 1) and 1);
|
||||
ByteArray[15] := (v6 and 8) or ((v6 shr 2) and 4) or ((v8 shr 9) and 1);
|
||||
ByteArray[16] := (16 * v2 and 16) or (2 * v7 and 8) or ((v5 shr 1) and 1);
|
||||
ByteArray[17] := ((v9 shr 3) and 2);
|
||||
ByteArray[18] := (v7 and 16) or ((v6 shr 6) and 8) or ((v6 shr 8) and 4) or ((v8 shr 13) and 2) or ((v9 shr 5) and 1);
|
||||
ByteArray[19] := ((v6 shr 9) and 16) or ((v7 shr 3) and 8) or ((v6 shr 11) and 2);
|
||||
|
||||
Result:='';
|
||||
for i := 0 to Length(ByteArray)-1 do
|
||||
begin
|
||||
if (i=4) or (i=10) or (i=16) then Result:=Result+'-';
|
||||
Result:=Result+StrMap[ByteArray[i]+1];
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
function AppDataPath():string;
|
||||
var
|
||||
Path:array [0..MAX_PATH-1] of Char;
|
||||
begin
|
||||
if Succeeded(SHGetFolderPath(0, CSIDL_COMMON_APPDATA, 0, 0, @Path[0])) then
|
||||
Result:=string(Path)
|
||||
else
|
||||
Result:='';
|
||||
end;
|
||||
|
||||
function GetRegistrationCode():string;
|
||||
function GetKey():DWORD;
|
||||
const
|
||||
KeyMap:string='ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890X';
|
||||
var
|
||||
ComputerName:array[0..MAX_PATH-1] of Char;
|
||||
Key:string;
|
||||
nSize:Cardinal;
|
||||
i,j:Integer;
|
||||
begin
|
||||
Result:=$ED864640;
|
||||
if (GetComputerName(@ComputerName[0],nSize)=False) then
|
||||
Key:='localhost'
|
||||
else
|
||||
Key:=string(ComputerName);
|
||||
|
||||
Key:=UpperCase(Key);
|
||||
for i := 0 to Length(Key)-1 do
|
||||
begin
|
||||
for j := 0 to Length(KeyMap)-1 do
|
||||
begin
|
||||
if (Key[i+1]=KeyMap[j+1]) then Break;
|
||||
end;
|
||||
if j>=Length(KeyMap) then
|
||||
Result:=Result+16*88
|
||||
else
|
||||
Result:=Result+16*Ord(KeyMap[36-j]);
|
||||
end;
|
||||
end;
|
||||
var
|
||||
FileName:string;
|
||||
MemoryStream:TMemoryStream;
|
||||
dwVerify,dwSize:DWORD;
|
||||
pBuf,p:PByte;
|
||||
i,j,eax,ebx,esi:Cardinal;
|
||||
|
||||
begin
|
||||
Result:='';
|
||||
MemoryStream:=TMemoryStream.Create;
|
||||
try
|
||||
if AppDataPath<>'' then
|
||||
begin
|
||||
FileName:=AppDataPath+'\Embarcadero\.licenses\.cg_license';
|
||||
if FileExists(FileName) then
|
||||
begin
|
||||
MemoryStream.LoadFromFile(FileName);
|
||||
end
|
||||
else
|
||||
begin
|
||||
FileName:=AppDataPath+'\Embarcadero\.cg_license';
|
||||
if FileExists(FileName) then
|
||||
begin
|
||||
MemoryStream.LoadFromFile(FileName);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
if MemoryStream.Size>8 then
|
||||
begin
|
||||
MemoryStream.Position:=0;
|
||||
MemoryStream.Read(dwVerify,SizeOf(dwVerify));
|
||||
MemoryStream.Read(dwSize,SizeOf(dwSize));
|
||||
dwVerify:=(Swap(loWord(dwVerify)) shl 16) or Swap(HiWord(dwVerify));
|
||||
dwSize:=(Swap(loWord(dwSize)) shl 16) or Swap(HiWord(dwSize));
|
||||
pBuf:=AllocMem(dwSize);
|
||||
MemoryStream.Read(pBuf^,dwSize);
|
||||
p:=pBuf;
|
||||
eax:=GetKey();
|
||||
for i := 0 to dwSize-1 do
|
||||
begin
|
||||
esi:=p^;
|
||||
if (esi and $80)=$80 then esi:=esi or $ffffff00;
|
||||
ebx:=(eax shr 24) and $FF;
|
||||
p^:=p^ xor ebx;
|
||||
inc(p);
|
||||
eax:=eax xor esi;
|
||||
ebx:=eax shl 8;
|
||||
eax:=eax xor ebx;
|
||||
ebx:=eax shl 16;
|
||||
eax:= eax xor ebx;
|
||||
ebx:=eax shl 24;
|
||||
eax:=eax xor ebx;
|
||||
end;
|
||||
eax:=eax and $7FFFFFFF;
|
||||
if eax=dwVerify then
|
||||
begin
|
||||
for i := 0 to dwSize-1 do
|
||||
begin
|
||||
if PByte(Cardinal(pBuf)+i)^=36 then Break; //$
|
||||
end;
|
||||
Inc(i);
|
||||
j:=0;
|
||||
while (i<dwSize) and (PByte(Cardinal(pBuf)+i)^<>13) and (j<10) do
|
||||
begin
|
||||
Result:=Result+Chr(PByte(Cardinal(pBuf)+i)^);
|
||||
Inc(i);
|
||||
inc(j);
|
||||
end;
|
||||
end;
|
||||
FreeMem(pBuf,dwSize);
|
||||
end;
|
||||
finally
|
||||
MemoryStream.Free;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
function ActiveTemplate(SerialNumber,ActiveCode:string):string;
|
||||
var
|
||||
pid,skuid:string;
|
||||
begin
|
||||
pid:=IntToStr(HostPID);
|
||||
skuid:=IntToStr(HostSKU);
|
||||
|
||||
Result:='11'#10;
|
||||
Result:=Result+'e.pkg'#10'RAD Studio 10.1 Berlin Architect\n'#10;
|
||||
Result:=Result+'e.pt'#10'10'#10;
|
||||
Result:=Result+'e.sign'#10'0'#10;
|
||||
Result:=Result+'e.sign2'#10'0'#10;
|
||||
Result:=Result+'e.sign3'#10'0'#10;
|
||||
Result:=Result+'export.allowed'#10'0'#10;
|
||||
Result:=Result+'import.allowed'#10'1'#10;
|
||||
Result:=Result+'import.silent'#10'1'#10;
|
||||
Result:=Result+'licensed.serialno'#10+SerialNumber+#10;
|
||||
Result:=Result+'nodelock.node'#10'0'#10;
|
||||
Result:=Result+'nodelock.session'#10+ActiveCode+#10;
|
||||
|
||||
Result:=Result+'6'#10;
|
||||
|
||||
Result:=Result+'26'#10;
|
||||
Result:=Result+'active'#10'T'#10;
|
||||
Result:=Result+'beta'#10'0'#10;
|
||||
Result:=Result+'exportable'#10'0'#10;
|
||||
Result:=Result+'hostpid'#10+pid+#10;
|
||||
Result:=Result+'hostskuid'#10+skuid+#10;
|
||||
Result:=Result+'internaluse'#10'0'#10;
|
||||
Result:=Result+'naggy'#10'0'#10;
|
||||
Result:=Result+'noncommercial'#10'0'#10;
|
||||
Result:=Result+'noncommercial_label'#10'No'#10;
|
||||
Result:=Result+'platform'#10'1'#10;
|
||||
Result:=Result+'platform_label'#10'Windows'#10;
|
||||
Result:=Result+'product'#10'2000'#10;
|
||||
Result:=Result+'productid'#10'2024'#10;
|
||||
Result:=Result+'productid_label'#10'Delphi 10.1 Berlin'#10;
|
||||
Result:=Result+'productsku'#10+skuid+#10;
|
||||
Result:=Result+'productsku_label'#10'Architect'#10;
|
||||
Result:=Result+'rndkey'#10'13371337'#10;
|
||||
Result:=Result+'serialno'#10+SerialNumber+#10;
|
||||
Result:=Result+'sku'#10+skuid+#10;
|
||||
Result:=Result+'templicense'#10'0'#10;
|
||||
Result:=Result+'termtype'#10'0'#10;
|
||||
Result:=Result+'termtype_label'#10'Permanent'#10;
|
||||
Result:=Result+'title'#10'Delphi 10.1 Berlin Architect'#10;
|
||||
Result:=Result+'trial'#10'0'#10;
|
||||
Result:=Result+'upgrade'#10'0'#10;
|
||||
Result:=Result+'version'#10'24'#10;
|
||||
Result:=Result+'27'#10;
|
||||
Result:=Result+'Android'#10'T'#10;
|
||||
Result:=Result+'DESIGNDIAGRAMS'#10'TRUE'#10;
|
||||
Result:=Result+'DESIGNPROJECTS'#10'TRUE'#10;
|
||||
Result:=Result+'Desktop'#10'T'#10;
|
||||
Result:=Result+'FULLQA'#10'TRUE'#10;
|
||||
Result:=Result+'FirstRegistered'#10'9151978200000'#10;
|
||||
Result:=Result+'FulliOS'#10'T'#10;
|
||||
Result:=Result+'MODELLING'#10'TRUE'#10;
|
||||
Result:=Result+'Mobile'#10'T'#10;
|
||||
Result:=Result+'OSX32'#10'T'#10;
|
||||
Result:=Result+'Win32'#10'T'#10;
|
||||
Result:=Result+'Win64'#10'T'#10;
|
||||
Result:=Result+'a100'#10'MakeThingsHappen'#10;
|
||||
Result:=Result+'a1000'#10'PrintMoreMoney'#10;
|
||||
Result:=Result+'a101'#10'ImGivinItAllShesGot'#10;
|
||||
Result:=Result+'a200'#10'StampIt'#10;
|
||||
Result:=Result+'a250'#10'ItsToolTimeBaby'#10;
|
||||
Result:=Result+'a300'#10'TheMalteseFalcon'#10;
|
||||
Result:=Result+'a301'#10'GlueSolvent'#10;
|
||||
Result:=Result+'a3013'#10'GlueSolvent'#10;
|
||||
Result:=Result+'crd'#10'9151978200000'#10;
|
||||
Result:=Result+'hostsuite'#10+pid+#10;
|
||||
Result:=Result+'iOSDevice'#10'T'#10;
|
||||
Result:=Result+'iOSDevice32'#10'T'#10;
|
||||
Result:=Result+'iOSDevice64'#10'T'#10;
|
||||
Result:=Result+'iOSSimulator'#10'T'#10;
|
||||
Result:=Result+'updatelevel'#10'0.0'#10;
|
||||
|
||||
Result:=Result+'26'#10;
|
||||
Result:=Result+'active'#10'T'#10;
|
||||
Result:=Result+'beta'#10'0'#10;
|
||||
Result:=Result+'exportable'#10'0'#10;
|
||||
Result:=Result+'hostpid'#10+pid+#10;
|
||||
Result:=Result+'hostskuid'#10+skuid+#10;
|
||||
Result:=Result+'internaluse'#10'0'#10;
|
||||
Result:=Result+'naggy'#10'0'#10;
|
||||
Result:=Result+'noncommercial'#10'0'#10;
|
||||
Result:=Result+'noncommercial_label'#10'No'#10;
|
||||
Result:=Result+'platform'#10'1'#10;
|
||||
Result:=Result+'platform_label'#10'Windows'#10;
|
||||
Result:=Result+'product'#10'4000'#10;
|
||||
Result:=Result+'productid'#10'4021'#10;
|
||||
Result:=Result+'productid_label'#10'C++Builder 10.1 Berlin'#10;
|
||||
Result:=Result+'productsku'#10+skuid+#10;
|
||||
Result:=Result+'productsku_label'#10'Architect'#10; //Architect
|
||||
Result:=Result+'rndkey'#10'13371337'#10;
|
||||
Result:=Result+'serialno'#10+SerialNumber+#10;
|
||||
Result:=Result+'sku'#10+skuid+#10;
|
||||
Result:=Result+'templicense'#10'0'#10;
|
||||
Result:=Result+'termtype'#10'0'#10;
|
||||
Result:=Result+'termtype_label'#10'Permanent'#10;
|
||||
Result:=Result+'title'#10'C++Builder 10.1 Berlin Architect'#10;
|
||||
Result:=Result+'trial'#10'0'#10;
|
||||
Result:=Result+'upgrade'#10'0'#10;
|
||||
Result:=Result+'version'#10'17'#10;
|
||||
Result:=Result+'26'#10;
|
||||
Result:=Result+'Android'#10'T'#10;
|
||||
Result:=Result+'DESIGNDIAGRAMS'#10'TRUE'#10;
|
||||
Result:=Result+'DESIGNPROJECTS'#10'TRUE'#10;
|
||||
Result:=Result+'Desktop'#10'T'#10;
|
||||
Result:=Result+'FULLQA'#10'TRUE'#10;
|
||||
Result:=Result+'FirstRegistered'#10'9151978200000'#10;
|
||||
Result:=Result+'FulliOS'#10'T'#10;
|
||||
Result:=Result+'MODELLING'#10'TRUE'#10;
|
||||
Result:=Result+'Mobile'#10'T'#10;
|
||||
Result:=Result+'OSX32'#10'T'#10;
|
||||
Result:=Result+'Win32'#10'T'#10;
|
||||
Result:=Result+'Win64'#10'T'#10;
|
||||
Result:=Result+'a100'#10'MakeThingsHappen'#10;
|
||||
Result:=Result+'a1000'#10'PrintMoreMoney'#10;
|
||||
Result:=Result+'a101'#10'ImGivinItAllShesGot'#10;
|
||||
Result:=Result+'a200'#10'StampIt'#10;
|
||||
Result:=Result+'a250'#10'ItsToolTimeBaby'#10;
|
||||
Result:=Result+'a300'#10'TheMalteseFalcon'#10;
|
||||
Result:=Result+'a301'#10'GlueSolvent'#10;
|
||||
Result:=Result+'crd'#10'9151978200000'#10;
|
||||
Result:=Result+'hostsuite'#10+pid+#10;
|
||||
Result:=Result+'iOSDevice'#10'T'#10;
|
||||
Result:=Result+'iOSDevice32'#10'T'#10;
|
||||
Result:=Result+'iOSDevice64'#10'T'#10;
|
||||
Result:=Result+'iOSSimulator'#10'T'#10;
|
||||
Result:=Result+'updatelevel'#10'0.0'#10;
|
||||
|
||||
Result:=Result+'26'#10;
|
||||
Result:=Result+'active'#10'T'#10;
|
||||
Result:=Result+'beta'#10'0'#10;
|
||||
Result:=Result+'exportable'#10'0'#10;
|
||||
Result:=Result+'hostpid'#10+pid+#10;
|
||||
Result:=Result+'hostskuid'#10+skuid+#10;
|
||||
Result:=Result+'internaluse'#10'0'#10;
|
||||
Result:=Result+'naggy'#10'0'#10;
|
||||
Result:=Result+'noncommercial'#10'0'#10;
|
||||
Result:=Result+'noncommercial_label'#10'No'#10;
|
||||
Result:=Result+'platform'#10'0'#10;
|
||||
Result:=Result+'platform_label'#10'Cross platform'#10;
|
||||
Result:=Result+'product'#10'7000'#10;
|
||||
Result:=Result+'productid'#10'7111'#10;
|
||||
Result:=Result+'productid_label'#10'InterBase XE7'#10; //InterBase XE7
|
||||
Result:=Result+'productsku'#10'0'#10;
|
||||
Result:=Result+'productsku_label'#10'Server'#10; //Server
|
||||
Result:=Result+'rndkey'#10'13371337'#10;
|
||||
Result:=Result+'serialno'#10+SerialNumber+#10;
|
||||
Result:=Result+'sku'#10'0'#10;
|
||||
Result:=Result+'templicense'#10'0'#10;
|
||||
Result:=Result+'termtype'#10'0'#10;
|
||||
Result:=Result+'termtype_label'#10'Unlimited'#10;
|
||||
Result:=Result+'title'#10'InterBase XE7 Server'#10; //InterBase XE7 Server
|
||||
Result:=Result+'trial'#10'0'#10;
|
||||
Result:=Result+'upgrade'#10'0'#10;
|
||||
Result:=Result+'version'#10'6'#10;
|
||||
Result:=Result+'22'#10;
|
||||
Result:=Result+'FirstRegistered'#10'9151978200000'#10;
|
||||
Result:=Result+'changeView'#10'1'#10;
|
||||
Result:=Result+'connectionMonitoring'#10'1'#10;
|
||||
Result:=Result+'connectionsPerUser'#10'200'#10;
|
||||
Result:=Result+'customVarId'#10' '#10;
|
||||
Result:=Result+'databaseAccess'#10'1'#10;
|
||||
Result:=Result+'dbEncryption'#10'1'#10;
|
||||
Result:=Result+'ddlOperations'#10'1'#10;
|
||||
Result:=Result+'devLicense'#10'1'#10;
|
||||
Result:=Result+'externalFileAccess'#10'1'#10;
|
||||
Result:=Result+'internetAccess'#10'1'#10;
|
||||
Result:=Result+'languages'#10'ALL'#10;
|
||||
Result:=Result+'licensedCpus'#10'32'#10;
|
||||
Result:=Result+'licensedUsers'#10'5000'#10;
|
||||
Result:=Result+'nodeID'#10' '#10;
|
||||
Result:=Result+'otwEncryption'#10'1'#10;
|
||||
Result:=Result+'remoteAccess'#10'1'#10;
|
||||
Result:=Result+'serverAccess'#10'1'#10;
|
||||
Result:=Result+'togoAccess'#10'0'#10;
|
||||
Result:=Result+'updatelevel'#10'0.0'#10;
|
||||
Result:=Result+'useAddons'#10'0'#10;
|
||||
Result:=Result+'version'#10'12.0'#10;
|
||||
|
||||
Result:=Result+'26'#10;
|
||||
Result:=Result+'active'#10'T'#10;
|
||||
Result:=Result+'beta'#10'0'#10;
|
||||
Result:=Result+'exportable'#10'0'#10;
|
||||
Result:=Result+'hostpid'#10+pid+#10;
|
||||
Result:=Result+'hostskuid'#10+skuid+#10;
|
||||
Result:=Result+'internaluse'#10'0'#10;
|
||||
Result:=Result+'naggy'#10'0'#10;
|
||||
Result:=Result+'noncommercial'#10'0'#10;
|
||||
Result:=Result+'noncommercial_label'#10'No'#10;
|
||||
Result:=Result+'platform'#10'0'#10;
|
||||
Result:=Result+'platform_label'#10'Cross platform'#10;
|
||||
Result:=Result+'product'#10'7000'#10;
|
||||
Result:=Result+'productid'#10'7111'#10;
|
||||
Result:=Result+'productid_label'#10'InterBase XE7'#10; //InterBase XE7
|
||||
Result:=Result+'productsku'#10'16'#10;
|
||||
Result:=Result+'productsku_label'#10'ToGo Edition'#10; //ToGo Edition
|
||||
Result:=Result+'rndkey'#10'13371337'#10;
|
||||
Result:=Result+'serialno'#10+SerialNumber+#10;
|
||||
Result:=Result+'sku'#10'16'#10;
|
||||
Result:=Result+'templicense'#10'0'#10;
|
||||
Result:=Result+'termtype'#10'0'#10;
|
||||
Result:=Result+'termtype_label'#10'Unlimited'#10;
|
||||
Result:=Result+'title'#10'InterBase XE7 ToGo Edition'#10; //InterBase XE7 ToGo Edition
|
||||
Result:=Result+'trial'#10'0'#10;
|
||||
Result:=Result+'upgrade'#10'0'#10;
|
||||
Result:=Result+'version'#10'6'#10;
|
||||
Result:=Result+'22'#10;
|
||||
Result:=Result+'FirstRegistered'#10'9151978200000'#10;
|
||||
Result:=Result+'changeView'#10'1'#10;
|
||||
Result:=Result+'connectionMonitoring'#10'1'#10;
|
||||
Result:=Result+'connectionsPerUser'#10'200'#10;
|
||||
Result:=Result+'customVarId'#10' '#10;
|
||||
Result:=Result+'databaseAccess'#10'1'#10;
|
||||
Result:=Result+'dbEncryption'#10'1'#10;
|
||||
Result:=Result+'ddlOperations'#10'1'#10;
|
||||
Result:=Result+'devLicense'#10'1'#10;
|
||||
Result:=Result+'externalFileAccess'#10'1'#10;
|
||||
Result:=Result+'internetAccess'#10'1'#10;
|
||||
Result:=Result+'languages'#10'ALL'#10;
|
||||
Result:=Result+'licensedCpus'#10'32'#10;
|
||||
Result:=Result+'licensedUsers'#10'5000'#10;
|
||||
Result:=Result+'nodeID'#10' '#10;
|
||||
Result:=Result+'otwEncryption'#10'1'#10;
|
||||
Result:=Result+'remoteAccess'#10'1'#10;
|
||||
Result:=Result+'serverAccess'#10'1'#10;
|
||||
Result:=Result+'togoAccess'#10'1'#10;
|
||||
Result:=Result+'updatelevel'#10'0.0'#10;
|
||||
Result:=Result+'useAddons'#10'0'#10;
|
||||
Result:=Result+'version'#10'12.0'#10;
|
||||
|
||||
Result:=Result+'26'#10;
|
||||
Result:=Result+'active'#10'T'#10;
|
||||
Result:=Result+'beta'#10'0'#10;
|
||||
Result:=Result+'exportable'#10'0'#10;
|
||||
Result:=Result+'hostpid'#10+pid+#10;
|
||||
Result:=Result+'hostskuid'#10+skuid+#10;
|
||||
Result:=Result+'internaluse'#10'0'#10;
|
||||
Result:=Result+'naggy'#10'0'#10;
|
||||
Result:=Result+'noncommercial'#10'0'#10;
|
||||
Result:=Result+'noncommercial_label'#10'No'#10;
|
||||
Result:=Result+'platform'#10'1'#10;
|
||||
Result:=Result+'platform_label'#10'Windows'#10;
|
||||
Result:=Result+'product'#10'2700'#10;
|
||||
Result:=Result+'productid'#10'2705'#10;
|
||||
Result:=Result+'productid_label'#10'HTML5 Builder'#10; //HTML5 Builder
|
||||
Result:=Result+'productsku'#10'0'#10;
|
||||
Result:=Result+'productsku_label'#10'RadPHP'#10; //RadPHP
|
||||
Result:=Result+'rndkey'#10'13371337'#10;
|
||||
Result:=Result+'serialno'#10+SerialNumber+#10;
|
||||
Result:=Result+'sku'#10'0'#10;
|
||||
Result:=Result+'templicense'#10'0'#10;
|
||||
Result:=Result+'termtype'#10'0'#10;
|
||||
Result:=Result+'termtype_label'#10'Permanent'#10;
|
||||
Result:=Result+'title'#10'HTML5 Builder'#10; //HTML5 Builder
|
||||
Result:=Result+'trial'#10'0'#10;
|
||||
Result:=Result+'upgrade'#10'0'#10;
|
||||
Result:=Result+'version'#10'5'#10;
|
||||
Result:=Result+'1'#10;
|
||||
Result:=Result+'updatelevel'#10'0.0'#10;
|
||||
|
||||
Result:=Result+'26'#10;
|
||||
Result:=Result+'active'#10'T'#10;
|
||||
Result:=Result+'beta'#10'0'#10;
|
||||
Result:=Result+'exportable'#10'0'#10;
|
||||
Result:=Result+'hostpid'#10+pid+#10;
|
||||
Result:=Result+'hostskuid'#10+skuid+#10;
|
||||
Result:=Result+'internaluse'#10'0'#10;
|
||||
Result:=Result+'naggy'#10'0'#10;
|
||||
Result:=Result+'noncommercial'#10'0'#10;
|
||||
Result:=Result+'noncommercial_label'#10'No'#10;
|
||||
Result:=Result+'platform'#10'1'#10;
|
||||
Result:=Result+'platform_label'#10'Windows'#10;
|
||||
Result:=Result+'product'#10'14100'#10;
|
||||
Result:=Result+'productid'#10'14110'#10;
|
||||
Result:=Result+'productid_label'#10'ER/Studio 2016'#10;
|
||||
Result:=Result+'productsku'#10'15'#10;
|
||||
Result:=Result+'productsku_label'#10'Developer MultiPlatform'#10; //Developer MultiPlatform
|
||||
Result:=Result+'rndkey'#10'13371337'#10;
|
||||
Result:=Result+'serialno'#10+SerialNumber+#10;
|
||||
Result:=Result+'sku'#10'15'#10;
|
||||
Result:=Result+'templicense'#10'0'#10;
|
||||
Result:=Result+'termtype'#10'0'#10;
|
||||
Result:=Result+'termtype_label'#10'Permanent'#10;
|
||||
Result:=Result+'title'#10'ER/Studio Developer 2016'#10;
|
||||
Result:=Result+'trial'#10'0'#10;
|
||||
Result:=Result+'upgrade'#10'0'#10;
|
||||
Result:=Result+'version'#10'10'#10;
|
||||
Result:=Result+'3'#10;
|
||||
Result:=Result+'CrossPlatform'#10'T'#10;
|
||||
Result:=Result+'baseLicense'#10'Developer'#10;
|
||||
Result:=Result+'updatelevel'#10'0.0'#10;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
function GenerateActiveFile(SerialNumber,RegistrationCode:string;var FileName:string):Boolean;
|
||||
const
|
||||
ModStr:string='8EBD9E688D7106E57BCF63D41BADCE133FEB4CDB718F48F7BF39F6A26EB60BAE'+
|
||||
'0E930DC984FDED2537750C9DCFBB87D7AC7F3AA4D65D9E35C2D277BCB0ECDCA0'+
|
||||
'2D7DAE739AC8BCAE86914F6E77C17A82C77438421FC315DC38F09C7E840AF41E'+
|
||||
'663C5562222E661ED22578A234B58481F862CEABF477C89AE70F15134F83BC7E'+
|
||||
'C2EF57E7274EB74353DE22283113485D9803D4050EF46DB1467EE9D066B104EB'+
|
||||
'385D3C36BD29B58E237E22C0BE66D450BDFCED524481B6DCE3F83BBEC547F926'+
|
||||
'AD23057504DEDB9723EBFD26218167AAC79485FF608F8881D9A6AF5C57BE9A2F'+
|
||||
'B52047ABA92F806955580517F6D147BA1FD5DB3EEF1CEE4CA250D1C0FA824CD9';
|
||||
ExpStr:string='7E8325B1791B628766F2EB82057E4895DB234C1D7B4B09DB3B8BBE433D68F075'+
|
||||
'36C9B38096F51088D9DC4E7058BBD7AC9A60B1B383A3BA23E026F6A53112DE80'+
|
||||
'C191115BB9268DC509D424D8BE1FA7DBDDB7EE5CFD15C57C48A349B1008B4CCE'+
|
||||
'DCC240D31784945260E3814612FD871242FA203F5C1006A6F47FF3A807E3B4DE'+
|
||||
'39535FB5523ABED7B4337606E69245EC13BF9B553FD6F45B0FD290D7CBBEB8C8'+
|
||||
'DF2252DE7EB6A83A679873CC9842B52A093ED00742F11CD23CB5278873253E79'+
|
||||
'0E30B16AC72B7ACF9824B568ED971D768B95CA9D4C9A40C884542B8696AADF58'+
|
||||
'184CE6376E51451EF8D266ECA691ECAB25E15AA8E527312755A55C2B7D390AD9';
|
||||
var
|
||||
Slip,Tmp:AnsiString;
|
||||
Len,v2,v5:Cardinal;
|
||||
FGInt,exp,modb,res:TFGInt;
|
||||
i:Integer;
|
||||
Stream:TMemoryStream;
|
||||
SearchRec:TSearchRec;
|
||||
begin
|
||||
Result:=False;
|
||||
if (Trim(SerialNumber)='') or (Trim(RegistrationCode)='') or
|
||||
(TryStrToInt(Trim(RegistrationCode),i)=False) then Exit;
|
||||
|
||||
Slip:=AnsiString(ActiveTemplate(SerialNumber,RegistrationCode));
|
||||
|
||||
Len:= Length(Slip);
|
||||
Len:=(Swap(loWord(Len)) shl 16) or Swap(HiWord(Len));
|
||||
Tmp:=PChar(@Len)^+(PChar(@Len)+1)^+(PChar(@Len)+2)^+(PChar(@Len)+3)^+Slip;
|
||||
Tmp:='01'+StringOfChar('F',66)+'00'+UpperCase(SHA1Print(SHA1String(Tmp)));
|
||||
|
||||
ConvertHexStringToBase256String(Tmp,Tmp);
|
||||
Base256StringToFGInt(Tmp,FGInt);
|
||||
|
||||
ConvertHexStringToBase256String(ExpStr,Tmp);
|
||||
Base256StringToFGInt(Tmp,exp);
|
||||
|
||||
ConvertHexStringToBase256String(ModStr,Tmp);
|
||||
Base256StringToFGInt(Tmp,modb);
|
||||
|
||||
FGIntModExp(FGInt,exp,modb,res);
|
||||
FGIntToBase256String(res,Tmp);
|
||||
PGPConvertBase256to64(Tmp,Tmp);
|
||||
|
||||
FGIntDestroy(FGInt);
|
||||
FGIntDestroy(exp);
|
||||
FGIntDestroy(modb);
|
||||
FGIntDestroy(res);
|
||||
|
||||
Slip:=StringReplace(Slip,'e.sign'#10'0'#10,'e.sign'#10'CgeEeu66fCgQJBaqKQwwyiqyHYb22nc2VZRmQVasSDnZAtB/QTLt0CYdgdN16XCz/Nt032fMwTsytchG0l2UeA=='#10,[rfReplaceAll]);
|
||||
Slip:=StringReplace(Slip,'e.sign2'#10'0'#10,'e.sign2'#10'JWKzOwTKBL+zOP5wrouG5ta/mH+Fvsgb7hb8oJTzu4r3gK/6sh95zKAWKiydqsgvV9pxPXTAlkxv9wAecqJKTQ=='#10,[rfReplaceAll]);
|
||||
Slip:=StringReplace(Slip,'e.sign3'#10'0'#10,'e.sign3'#10+Tmp+#10,[rfReplaceAll]);
|
||||
|
||||
v2:=$E7F931C2;
|
||||
for i := 0 to Length(Slip) - 1 do
|
||||
begin
|
||||
Slip[i+1]:=Chr(Ord(Slip[i+1]) xor ((v2 shr 24) and $FF));
|
||||
v5:=Ord(Slip[i+1]);
|
||||
if (v5 and $80)=$80 then v5:=v5 or $ffffff00;
|
||||
v5:= v5 xor v2;
|
||||
v5:=(v5 shl 8) xor v5;
|
||||
v5:=(v5 shl 16) xor v5;
|
||||
v5:=(v5 shl 24) xor v5;
|
||||
v2:=v5;
|
||||
end;
|
||||
v2:=(Swap(loWord(v2)) shl 16) or Swap(HiWord(v2));
|
||||
Len:=Length(Slip);
|
||||
Len:=(Swap(loWord(Len)) shl 16) or Swap(HiWord(Len));
|
||||
|
||||
Stream:=TMemoryStream.Create;
|
||||
try
|
||||
Stream.Write(v2,4);
|
||||
Stream.Write(Len,4);
|
||||
Stream.Write(Slip[1],Length(Slip));
|
||||
if (FileName='') or (not DirectoryExists(ExtractFilePath(FileName))) then
|
||||
begin
|
||||
if DirectoryExists(AppDataPath+'\Embarcadero') then
|
||||
begin
|
||||
Tmp:=Format('%s\Embarcadero\.%d_%d.19*.slip',[AppDataPath,HostPID,HostSKU]);
|
||||
{
|
||||
if (FindFirst(Tmp,faAnyFile,SearchRec)=0) and
|
||||
(MessageBox(0,PAnsiChar(Format('Do you want to Delete the old slip file int %s folder',[AppDataPath])), 'Rad Studio Keygen',MB_YESNO + MB_ICONQUESTION) = IDYES) then
|
||||
}
|
||||
if (FindFirst(Tmp,faAnyFile,SearchRec)=0) then
|
||||
begin
|
||||
DeleteFile(PAnsiChar(Format('%s\Embarcadero\%s',[AppDataPath,SearchRec.Name])));
|
||||
while FindNext(SearchRec)=0 do
|
||||
begin
|
||||
DeleteFile(PAnsiChar(Format('%s\Embarcadero\%s',[AppDataPath,SearchRec.Name])));
|
||||
end;
|
||||
end;
|
||||
SysUtils.FindClose(SearchRec);
|
||||
FileName:=Format('%s\Embarcadero\.%d_%d.19%d%d%d%d%d%d%d%d%d%d%d.slip',[AppDataPath,HostPID,HostSKU,
|
||||
Random(10),Random(10),Random(10),Random(10),Random(10),
|
||||
Random(10),Random(10),Random(10),Random(10),Random(10),Random(10)]);
|
||||
end
|
||||
else
|
||||
FileName:=ExtractFileDir(ParamStr(0))+'\RAD Studio Activation.slip';
|
||||
end;
|
||||
Stream.SaveToFile(FileName);
|
||||
PatchmOasisRuntime();
|
||||
Result:=True;
|
||||
finally
|
||||
Stream.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
function PatchFile(var FileName:string):Boolean;
|
||||
var
|
||||
Stream:TMemoryStream;
|
||||
Reg:TRegistry;
|
||||
RootDir:string;
|
||||
begin
|
||||
Result:=False;
|
||||
RootDir:='';
|
||||
FileName:='';
|
||||
Reg:=TRegistry.Create;
|
||||
try
|
||||
Reg.RootKey:=HKEY_LOCAL_MACHINE;
|
||||
Reg.OpenKey('SOFTWARE\Embarcadero\BDS\18.0', False);
|
||||
RootDir:=Reg.ReadString('RootDir');
|
||||
finally
|
||||
Reg.Free;
|
||||
end;
|
||||
if DirectoryExists(RootDir+'\Bin') and FileExists(RootDir+'\Bin\LicenseManager.exe') then
|
||||
begin
|
||||
if SHA1Print(SHA1File(RootDir+'\Bin\LicenseManager.exe'))=LicenseManagerHash then
|
||||
begin
|
||||
FileName:= RootDir+'\Bin\SHFolder.dll';
|
||||
Stream:=TMemoryStream.Create;
|
||||
try
|
||||
Stream.Write(SHFolderData,Length(SHFolderData));
|
||||
Stream.SaveToFile(FileName);
|
||||
Result:=True;
|
||||
finally
|
||||
Stream.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
procedure PatchmOasisRuntime();
|
||||
var
|
||||
Stream:TMemoryStream;
|
||||
FileName:string;
|
||||
P:PByte;
|
||||
begin
|
||||
FileName:=Format('%s\{655CBACE-A23C-42B8-B924-A88E80F352B5}\OFFLINE\mOasisDesigntime.dll\mOasisRuntime.dll',[AppDataPath]);
|
||||
if FileExists(FileName) then
|
||||
begin
|
||||
Stream:=TMemoryStream.Create;
|
||||
try
|
||||
Stream.LoadFromFile(FileName);
|
||||
P:= PByte(Integer(Stream.Memory)+$00162CBD);
|
||||
P^:=$EB;
|
||||
Stream.SaveToFile(FileName);
|
||||
finally
|
||||
Stream.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
251
10.1/Keygen/Sha1.pas
Normal file
251
10.1/Keygen/Sha1.pas
Normal file
@ -0,0 +1,251 @@
|
||||
{
|
||||
|
||||
***************************************************
|
||||
* A binary compatible SHA1 implementation *
|
||||
* written by Dave Barton (davebarton@bigfoot.com) *
|
||||
***************************************************
|
||||
* 160bit hash size *
|
||||
***************************************************
|
||||
|
||||
}
|
||||
unit SHA1;
|
||||
|
||||
interface
|
||||
uses
|
||||
Windows,SysUtils;
|
||||
|
||||
type
|
||||
TSHA1Digest = array[0..19] of byte;
|
||||
TSHA1Context = record
|
||||
Hash: array[0..4] of DWord;
|
||||
Hi, Lo: integer;
|
||||
Buffer: array[0..63] of byte;
|
||||
Index: integer;
|
||||
end;
|
||||
|
||||
procedure SHA1Init(var Context: TSHA1Context);
|
||||
procedure SHA1Update(var Context: TSHA1Context; Buffer: pointer; Len: integer);
|
||||
procedure SHA1Final(var Context: TSHA1Context; var Digest: TSHA1Digest);
|
||||
|
||||
|
||||
function SHA1String(M: AnsiString): TSHA1Digest;
|
||||
function SHA1File(N: string): TSHA1Digest;
|
||||
function SHA1Print(Digest: TSHA1Digest): AnsiString;
|
||||
|
||||
//******************************************************************************
|
||||
implementation
|
||||
{
|
||||
$R-
|
||||
}
|
||||
|
||||
function LRot16(X: Word; c: longint): Word;
|
||||
begin
|
||||
LRot16 := (X shl c) or (X shr (16 - c));
|
||||
end;
|
||||
|
||||
|
||||
function RRot16(X: Word; c: longint): Word;
|
||||
begin
|
||||
RRot16 := (X shr c) or (X shl (16 - c));
|
||||
end;
|
||||
|
||||
|
||||
function LRot32(X: DWord; c: longint): DWord;
|
||||
begin
|
||||
LRot32 := (X shl c) or (X shr (32 - c));
|
||||
end;
|
||||
|
||||
|
||||
function RRot32(X: DWord; c: longint): DWord;
|
||||
begin
|
||||
RRot32 := (X shr c) or (X shl (32 - c));
|
||||
end;
|
||||
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
|
||||
function F1(x, y, z: DWord): DWord;
|
||||
begin
|
||||
Result := z xor (x and (y xor z));
|
||||
end;
|
||||
|
||||
function F2(x, y, z: DWord): DWord;
|
||||
begin
|
||||
Result := x xor y xor z;
|
||||
end;
|
||||
|
||||
function F3(x, y, z: DWord): DWord;
|
||||
begin
|
||||
Result := (x and y) or (z and (x or y));
|
||||
end;
|
||||
|
||||
//******************************************************************************
|
||||
|
||||
function RB(A: DWord): DWord;
|
||||
begin
|
||||
Result := (A shr 24) or ((A shr 8) and $FF00) or ((A shl 8) and $FF0000) or (A shl 24);
|
||||
end;
|
||||
|
||||
procedure SHA1Compress(var Data: TSHA1Context);
|
||||
var
|
||||
A, B, C, D, E, T: DWord;
|
||||
W: array[0..79] of DWord;
|
||||
i: integer;
|
||||
begin
|
||||
Move(Data.Buffer, W, Sizeof(Data.Buffer));
|
||||
for i := 0 to 15 do
|
||||
W[i] := RB(W[i]);
|
||||
for i := 16 to 79 do
|
||||
W[i] := LRot32(W[i - 3] xor W[i - 8] xor W[i - 14] xor W[i - 16], 1);
|
||||
A := Data.Hash[0]; B := Data.Hash[1]; C := Data.Hash[2]; D := Data.Hash[3]; E := Data.Hash[4];
|
||||
for i := 0 to 19 do
|
||||
begin
|
||||
T := LRot32(A, 5) + F1(B, C, D) + E + W[i] + $5A827999;
|
||||
E := D; D := C; C := LRot32(B, 30); B := A; A := T;
|
||||
end;
|
||||
for i := 20 to 39 do
|
||||
begin
|
||||
T := LRot32(A, 5) + F2(B, C, D) + E + W[i] + $6ED9EBA1;
|
||||
E := D; D := C; C := LRot32(B, 30); B := A; A := T;
|
||||
end;
|
||||
for i := 40 to 59 do
|
||||
begin
|
||||
T := LRot32(A, 5) + F3(B, C, D) + E + W[i] + $8F1BBCDC;
|
||||
E := D; D := C; C := LRot32(B, 30); B := A; A := T;
|
||||
end;
|
||||
for i := 60 to 79 do
|
||||
begin
|
||||
T := LRot32(A, 5) + F2(B, C, D) + E + W[i] + $CA62C1D6;
|
||||
E := D; D := C; C := LRot32(B, 30); B := A; A := T;
|
||||
end;
|
||||
Data.Hash[0] := Data.Hash[0] + A;
|
||||
Data.Hash[1] := Data.Hash[1] + B;
|
||||
Data.Hash[2] := Data.Hash[2] + C;
|
||||
Data.Hash[3] := Data.Hash[3] + D;
|
||||
Data.Hash[4] := Data.Hash[4] + E;
|
||||
FillChar(W, Sizeof(W), 0);
|
||||
FillChar(Data.Buffer, Sizeof(Data.Buffer), 0);
|
||||
end;
|
||||
|
||||
//******************************************************************************
|
||||
|
||||
procedure SHA1Init(var Context: TSHA1Context);
|
||||
begin
|
||||
Context.Hi := 0; Context.Lo := 0;
|
||||
Context.Index := 0;
|
||||
FillChar(Context.Buffer, Sizeof(Context.Buffer), 0);
|
||||
Context.Hash[0] := $67452301;
|
||||
Context.Hash[1] := $EFCDAB89;
|
||||
Context.Hash[2] := $98BADCFE;
|
||||
Context.Hash[3] := $10325476;
|
||||
Context.Hash[4] := $C3D2E1F0;
|
||||
end;
|
||||
|
||||
//******************************************************************************
|
||||
|
||||
procedure SHA1UpdateLen(var Context: TSHA1Context; Len: integer);
|
||||
var
|
||||
i, k: integer;
|
||||
begin
|
||||
for k := 0 to 7 do
|
||||
begin
|
||||
i := Context.Lo;
|
||||
Inc(Context.Lo, Len);
|
||||
if Context.Lo < i then
|
||||
Inc(Context.Hi);
|
||||
end;
|
||||
end;
|
||||
|
||||
//******************************************************************************
|
||||
|
||||
procedure SHA1Update(var Context: TSHA1Context; Buffer: pointer; Len: integer);
|
||||
type
|
||||
PByte = ^Byte;
|
||||
begin
|
||||
SHA1UpdateLen(Context, Len);
|
||||
while Len > 0 do
|
||||
begin
|
||||
Context.Buffer[Context.Index] := PByte(Buffer)^;
|
||||
Inc(PByte(Buffer));
|
||||
Inc(Context.Index);
|
||||
Dec(Len);
|
||||
if Context.Index = 64 then
|
||||
begin
|
||||
Context.Index := 0;
|
||||
SHA1Compress(Context);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
//******************************************************************************
|
||||
|
||||
procedure SHA1Final(var Context: TSHA1Context; var Digest: TSHA1Digest);
|
||||
type
|
||||
PDWord = ^DWord;
|
||||
begin
|
||||
Context.Buffer[Context.Index] := $80;
|
||||
if Context.Index >= 56 then
|
||||
SHA1Compress(Context);
|
||||
PDWord(@Context.Buffer[56])^ := RB(Context.Hi);
|
||||
PDWord(@Context.Buffer[60])^ := RB(Context.Lo);
|
||||
SHA1Compress(Context);
|
||||
Context.Hash[0] := RB(Context.Hash[0]);
|
||||
Context.Hash[1] := RB(Context.Hash[1]);
|
||||
Context.Hash[2] := RB(Context.Hash[2]);
|
||||
Context.Hash[3] := RB(Context.Hash[3]);
|
||||
Context.Hash[4] := RB(Context.Hash[4]);
|
||||
Move(Context.Hash, Digest, Sizeof(Digest));
|
||||
FillChar(Context, Sizeof(Context), 0);
|
||||
end;
|
||||
|
||||
|
||||
function SHA1String(M: AnsiString): TSHA1Digest;
|
||||
var
|
||||
Context: TSHA1Context;
|
||||
begin
|
||||
SHA1Init(Context);
|
||||
SHA1Update(Context, PAnsiChar(M), length(M));
|
||||
SHA1Final(Context, Result);
|
||||
end;
|
||||
|
||||
function SHA1File(N: string): TSHA1Digest;
|
||||
var
|
||||
FileHandle: THandle;
|
||||
MapHandle: THandle;
|
||||
ViewPointer: pointer;
|
||||
Context: TSHA1Context;
|
||||
begin
|
||||
SHA1Init(Context);
|
||||
FileHandle := CreateFile(pChar(N), GENERIC_READ, FILE_SHARE_READ or FILE_SHARE_WRITE,
|
||||
nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL or FILE_FLAG_SEQUENTIAL_SCAN, 0);
|
||||
if FileHandle <> INVALID_HANDLE_VALUE then try
|
||||
MapHandle := CreateFileMapping(FileHandle, nil, PAGE_READONLY, 0, 0, nil);
|
||||
if MapHandle <> 0 then try
|
||||
ViewPointer := MapViewOfFile(MapHandle, FILE_MAP_READ, 0, 0, 0);
|
||||
if ViewPointer <> nil then try
|
||||
SHA1Update(Context, ViewPointer, GetFileSize(FileHandle, nil));
|
||||
finally
|
||||
UnmapViewOfFile(ViewPointer);
|
||||
end;
|
||||
finally
|
||||
CloseHandle(MapHandle);
|
||||
end;
|
||||
finally
|
||||
CloseHandle(FileHandle);
|
||||
end;
|
||||
SHA1Final(Context, Result);
|
||||
end;
|
||||
|
||||
function SHA1Print(Digest: TSHA1Digest): AnsiString;
|
||||
var
|
||||
I: byte;
|
||||
const
|
||||
Digits: array[0..15] of AnsiChar =
|
||||
('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
|
||||
begin
|
||||
Result := '';
|
||||
for I := 0 to 19 do Result := Result + Digits[(Digest[I] shr 4) and $0F] + Digits[Digest[I] and $0F];
|
||||
end;
|
||||
|
||||
end.
|
1
10.1/Release/dirinfo.txt
Normal file
1
10.1/Release/dirinfo.txt
Normal file
@ -0,0 +1 @@
|
||||
This directory is intended as a common place for sample application's EXE files
|
Loading…
Reference in New Issue
Block a user