Exp=f
//@p1=a:= aSoft_enc_1.a;
@c1=KeyReturn:= aSoft_enc_1.Cal_2('@f', @p, 16, a, b, c, d, PAnsiChar(KeyPath), 2000);
//@p2=a:= aSoft_enc_1.a;
@c2=KeyReturn:= aSoft_enc_1.Cal_2('@f', @p, 16, a, b, c, d, PAnsiChar(KeyPath), 2000);
@va=a
@vb=b
@vc=c
@vd=d
@end
                                        
//YSetValue_1ãԳͱֵ
//VҪõֵ
//ؽҪõֵ
//KeyLastError=0ȷΪμֲ
function YSetValue_1(V: longint): longint;
var
  a, b, c, d: byte;
  KeyReturn: integer;
  IsNegative: boolean; //ֲڴǷ
begin
  KeyLastError:= 0;
  IsNegative:= False;
//VΪΪȻøԣIsNegativeΪTrue
  if V< 0 then
    begin
    V:= -V;
    IsNegative:= True;
    end;
//V256ȡ
//ΪCal_2ʽֻֽڱܳ0~255
  a:= byte(V mod 256);

//Ϊ׼ڼڲм㣬VҪȥԼֵӡ
  V:= V- a;

//ⲽa,b,c,d͵ڲм,
//@fļе@pλдмʽ
  Randomize;            //ʼ
  b:= Random(256); //δʹã
  c:= Random(256); //δʹã
  d:= Random(256); //δʹã
  KeyReturn:= Cal_2('@f', @p, 16, a, b, c, d, PAnsiChar(KeyPath), 2000);
  if KeyReturn<> 0 then
    begin
    Result:= Random(1000);
    KeyLastError:= KeyReturn; //ô
    Exit;
    end;

//Ҫܺa,b,c,dڼӦĽ㣻
//ΪӦļô󣬾ܷԭֵ
//ҪµĽ
{$R-} //ҪλʱȡԽ
  @1
//{$R+} //ָָʾԽ⣬ɲøü⡣

//ٽǰȥVӾͿˡ
 if IsNegative then
   Result:= -(V+ a) //VΪֱaȻȡ;
  else
    Result:= V+ a;  //VΪ,ֱa;
end;
////////////////////////////////////////////////////////////////////////////////