Quantcast
Channel: Delphi Forum - Delphi Programming Kings of Code - Existing Project Development
Viewing all articles
Browse latest Browse all 182

Intraweb.License.Keymaker(Src)

$
0
0
Compiled with Seattle...

for newer intraweb version, please note that function: edt_SerialNoChange . There is a serial no range check in intraweb. thats all.
PHP Code:
Key functions:

function 
GenerateLicData(IWLicenseTIWLicense): string;
begin
Result 
:= Format
('Name=%S%SCompany=%S%SDeveloper=%S%SExpiration=%S%SEdition=%S%SSerialNo=%S%SEmai​l=%S%SHash=%S%S',
[
IWLicense.sNameLineBreakerIWLicense.sCompanyLineBreaker,
IWLicense.sDeveloperLineBreakerIWLicense.sExpirationLineBreaker,
IWLicense.sEditionLineBreakerIWLicense.sSerialNoLineBreaker,
IWLicense.sEmailLineBreakerIWLicense.sIDEHashLineBreaker]);
end;

function 
EncodeLicense(LicDatastring): string;
var
LicRawSplited : array of Byte;
pRawData PWORD;
nRawDataLen Word;
nCycle Integer;
DecNumStr string;
OddSumEvenSumSumHashWord;
// sTail : string;
begin
// Split the Rawlicense data
nRawDataLen := LicData.Length;
SetLength(LicRawSplitednRawDataLen 2);
for 
nCycle := 1 to nRawDataLen do
begin
pRawData 
:= @LicData[nCycle];
LicRawSplited[(nCycle 1) * 2] := (pRawData^ and $FFshr 4;
LicRawSplited[(nCycle 1) * 1] := (pRawData^ and $F);
end;

// double the byte
nRawDataLen := nRawDataLen 2;
for 
nCycle := 0 to nRawDataLen do
begin
LicRawSplited
[nCycle] := LicRawSplited[nCycle] * 2;
end;

// Expand the Raw data
nRawDataLen := nRawDataLen 2;
SetLength(LicRawSplitednRawDataLen);
LicRawSplited[nRawDataLen 2] := $7;
LicRawSplited[nRawDataLen 1] := $30;

// Hex To Dec as String
DecNumStr := '';
for 
nCycle := 0 to nRawDataLen do
begin
DecNumStr 
:= DecNumStr Format('%.3d', [LicRawSplited[nCycle]]);
end;
{
$IFDEF debug}
CnDebugger.LogMsg(DecNumStr);
{
$ENDIF}
// Calc Odd
nCycle := 1;
OddSum := 0;
pRawData := @DecNumStr[nCycle];
while 
nCycle DecNumStr.Length do
begin
Inc
(OddSumpRawData^ - $30);
Inc(pRawData2);
Inc(nCycle2);
end;
{
$IFDEF debug}
CnDebugger.LogMsg(IntToHex(OddSum8));
{
$ENDIF}
// Calc Even
nCycle := 2;
EvenSum := 0;
pRawData := @DecNumStr[nCycle];
while 
nCycle DecNumStr.Length do
begin
Inc
(EvenSumpRawData^ - $30);
Inc(pRawData2);
Inc(nCycle2);
end;
{
$IFDEF debug}
CnDebugger.LogMsg(IntToHex(EvenSum8));
{
$ENDIF}
SumHash := $A - (OddSum EvenSummod $A;
{
$IFDEF debug}
CnDebugger.LogMsg(IntToHex(SumHash8));
{
$ENDIF}
Result := Copy(DecNumStr1DecNumStr.Length 1);
Delete(DecNumStr1DecNumStr.Length 1);

Result := Result '3' Format('%.3d', [SumHash]) + '02' DecNumStr;
{
$IFDEF debug}
CnDebugger.LogMsg(Result);
{
$ENDIF}
for 
nCycle := 1 to Result.Length do
begin
pRawData 
:= @Result[nCycle];
pRawData^ := pRawData^ + $11;
Inc(pRawData);
end;

Result := '+0010' Result;
{
$IFDEF debug}
CnDebugger.LogMsg(Result);
{
$ENDIF}
end
 

Viewing all articles
Browse latest Browse all 182


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>