function Decode (avalue:string): String;
Var
Ivalue:array [0..63]of Byte;
I,j,k,ial,icl:byte;
Pass:array[0..15]of Char; Password is no longer than 15 digits
Begin
STR to int
i:=0;
j:=0;
while (1=1) do
Begin
We need to improve here.
J:=pos (", avalue);
If J<=0 Then
Begin
Ivalue[i]:=strtoint (Avalue);
Break
End
Ivalue[i]:=strtoint (Copy (avalue,1,j-1));
Inc (I);
Avalue:=copy (Avalue,j+1,length (avalue)-j);
End
Xor
For i:=63 Downto 1 do
IVALUE[I-1]:=IVALUE[I-1] XOR ivalue[i];
//
For i:=15 Downto 1 do
Begin
Ial:=ivalue[i];
icl:=ial;
Asm
MOV al,ial
SAR al,4
and AL, $F
MOV Ial,al
End The direct use of SHR is also possible, but the disassembly is sar,pascal without SAR.
j:=ial+$30;
IAL:=IVALUE[J];
Icl:=icl and $f;
ICL:=IVALUE[0]+ICL;
K:=ICL;
ICL:=IVALUE[K];
IVALUE[J]:=ICL;
ivalue[k]:=ial;
End
I:=IVALUE[0];
J:=1;
While ivalue[i]<>0 do
Begin
PASS[J-1]:=CHR (Ivalue[i]);
INC (i);
INC (j);
End
Result:=pass;
End