unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> btn1: TButton;<br> edt1: TEdit;<br> edt2: TEdit;<br> procedure btn1Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br><br>//字段解密<br>function recover(src: PAnsiChar; dest: PAnsiChar): Integer;<br>var<br> ch: Char;<br> i: Integer;<br>begin<br> i := 0;<br> ch := src;<br> while (ch <> #0) do<br> begin<br> ch := Char(Integer(ch) - 4);<br> if (ch < #0) then<br> ch := Char(Integer(ch) + 256);<br> dest := ch;<br><br> Inc(i);<br> ch := src;<br> end;<br> dest := #0;<br> Result := i;<br>end;<br><br>procedure TForm1.btn1Click(Sender: TObject);<br>var<br> buff: array [0..255] of Char;<br>begin<br> recover(PAnsiChar(edt1.Text), buff);<br> edt2.Text := buff;<br>end;<br><br>end.