最简单最有效实现一个程序一次开机只运行一个实例,用于限制版或注册版......
function Decrypt(const S: String; Key: Word): String;
var
I: Integer;
S1: string;
begin
S1 := HexToStr(S);
Result := S1;
for I := 1 to Length(S1) do
begin
if char(byte(S1[I]) xor (Key shr 8)) = Chr(0) then
begin
Result[I] := S1[I];
Key := (byte(Chr(0)) + Key) * C1 + C2; //保证Key的正确性 end
else
begin
Result[I] := char(byte(S1[I]) xor (Key shr 8));
Key := (byte(S1[I]) + Key) * C1 + C2;
end;
end;
end;
查看本文来源