![]() |
|
#12
|
||||
|
||||
![]() Извините, что влезаю в ваш междусобойчик
![]() Код:
uses Math; ... function TxtObfus(ds: string): string; function stk(ds: char): string; const m: array [0..2] of array [1..3] of integer = ((1,2,3),(3,1,2),(2,3,1)); var i: byte; begin Result:='123'; i:= Random(3); Result[m[i,1]]:= ds; Result[m[i,2]]:= chr(RandomRange(byte(ds),255)); Result[m[i,3]]:= chr(RandomRange(byte(ds),255)); end; var i: integer; begin Randomize; Result:=''; for i:=1 to Length(ds) do Result:= Result + stk(ds[i]); end; function ObfusTxt(ds: string): string; function mx(b1, b2, b3 : byte): byte; begin if b1 < b2 then Result:= b1 else Result:= b2; if Result > b3 then Result:= b3; end; var i: integer; s: string; begin Result:=''; i:=1; while i <= Length(ds) do begin Result:= Result+chr(mx(byte(ds[i]),byte(ds[i+1]),byte(ds[i+2]))); inc(i, 3); end; end; Код:
procedure TForm1.Button1Click(Sender: TObject); begin Edit2.Text:= TxtObfus(Edit1.Text); end; procedure TForm1.Button2Click(Sender: TObject); begin Edit3.Text:= ObfusTxt(Edit2.Text); end; Я не понял Вашего вопроса, но всё же Вам на него отвечу! |
Этот пользователь сказал Спасибо Alegun за это полезное сообщение: | ||
nano_bot (08.05.2013)
|