اقتباس من الموضوع الأصلي لــ esso_x
إقتباس :Protection : Serial number based on "MD5 + Custom"
Home Page:
h tt p://www.lazesoft.com/
Target Link:
h tt p://www.lazesoft.com/downloads/lsrspdsetup.exe
const Table = 'B3DKFDFPOWE9NMNTPGAS0QFWS0789E';
var
Form1: TForm1;
n ,s ,p3 : string;
i ,k , j ,temp: Integer;
x : array [1..2] of Integer;
function GetChar(k:Integer ):string ;
begin
Result := Table[ (k mod $1E) + 1 ];
end;
function GetChar(k:Integer ):string ;
begin
Result := Table[ (k mod $1E) + 1 ];
end;
function GetParts(_K,_M:Integer ):String;
begin
temp := ((k * k)div _K); i:=1;
FillChar (x,SizeOf(x),0);
while i <= 5 do
begin
j := (temp mod $1E);
p3 := GetChar(j);
x[1]:= x[1] + (((((i - 1)mod 2)+ 1) * ord(p3[1])));
temp:= temp div _M ;
Result := Result + p3;
inc(i);
end;
end;
procedure TForm1.btn1Click(Sender: TObject);
begin
if edt1.Text <> '' then
begin
n := edt1.Text;
i := 1;
k := 0;
while i <= Length (n) do
begin
k := k + (i * ord(n[i]) ) ;
inc(i)
end;
temp := k;
s := GetChar(k);
x[1]:= ord(s[1]);
i := 1;
while i <= 4 do
begin
j := (temp mod $A)+ $30;
s := s + Char(j);
x[1] := (temp mod $A) + x[1] + $30;
temp := (temp div $A);
inc(i);
end;
s := s + GetChar(x[1])+'-';
s := s + GetParts(3,7) + GetChar(x[1]) +'-';
s := s + GetParts(5,$B) + GetChar(x[1])+'-';
edt2.Text:= Copy( GetMD5('SLNR-'+s+GetParts(7,$11)+GetChar(x[1])), 9,16);
end
else edt2.Text := 'Pls. enter ur name';
end;
implicit conversion (think forward)