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TdThugwBg9qB+eccUg5yQNEOiYytoNqLGK/GKT2M6R80bD0ts0/vXSa7VpqV7NiOqeKK4p7gFzibLBU7OTXQoKr0la90VsD4hzbL2SufvDvwg3b4CHsK4/X0X0UmaGMMlKy/ySnzViHyEbuejVEDxn22ZeU02ovMC2c1jE1YwTqrkjcsZg4WU8Rga0v6NbjiGT064tAO6NC3balt3Ea/zt0DcHc/VVeVLcRxOzGpb+D6J1XBZrhV9z8FbKPA4eafbiREmyT+D52k4hcosib8mi8ZDw5V4eO4XedDSrFJNQPyNg6KgkA11JGYAu3S8/xjIk+vS83gJVH1P+vjlVmLKv/Gt/hghcPxRf0y/F9FoHasWWjhEtNy0L2NRtACC5ml6J+6gNV4fScq7glApOK2gyaLgNyI4o6DAf9SAXoBXlwdny6Wtujw+vHcVw/xQ=
data: "eyJhcGlrZXkiOiJiZTQzYWQ3YjliNTQxY2NmZjY3Mzk3ZGJiYzMyNTUzOSIsImFwcF91dWlkIjoiMDE1N2MiLCJhcHB0eXBlIjoid2ViIiwiaW50ZXJmYWNlIjoid2ViIiwibG9jYWxlIjoiZW5fVVMiLCJvcGVyYXRvcl9pZCI6IjMwNiIsIm9wZXJhdG9yaWQiOiIzMDYiLCJvcGVyYXRvcklkIjoiMzA2IiwicHBzZXNzaW9uZGF0YSI6IiIsInBwdmVyaWZpZWRwYXJrZXIiOiIiLCJzZXNzX3V1aWQiOiJlNjZlZCIsInRyYW5zYWN0aW9udXVpZCI6IiIsIndoaXRlbGFiZWxfb3BlcmF0b3JfaWQiOiIzMDYiLCJ6b25lY2FzaHB1cmNoYXNldXVpZCI6IiIsInRpbWV6b25lbmFtZSI6IkV0Yy9VVEMifQ=="
key: "9YnfS6zH1Q7r8jqh"
ct := concat(ct,
String(char(Ord(char(Text[Y + 1]))
xor s[((s[i] + s[j]) MOD 256)])));
ct := concat(ct,
StringReplace(String(char(Ord(char(Text[Y + 1]))
xor s[((s[i] + s[j]) MOD 256)])), #0, '', [rfReplaceAll]));
function RC4Encrypt(key, Text: String): String;
var
i, j, X, Y: Integer;
s: array [0 .. 255] of Integer;
charCode: Integer;
ct: String;
NETCODE: TipwNetCode;
begin
Result := '';
NETCODE := TipwNetCode.Create(nil);
NETCODE.Reset();
NETCODE.Config('Base64LineBreak=False');
for i := 0 to 255 do
begin
s[i] := i;
end;
j := 0;
for i := 0 to 255 do
begin
j := (j + s[i] + Ord(char(key[(i MOD Length(key)) + 1]))) MOD 256;
X := s[i];
s[i] := s[j];
s[j] := X;
end;
i := 0;
j := 0;
ct := '';
for Y := 0 to (Length(Text) - 1) do
begin
i := (i + 1) MOD 256;
j := (j + s[i]) MOD 256;
X := s[i];
s[i] := s[j];
s[j] := X;
ct := concat(ct,
StringReplace(String(char(Ord(char(Text[Y + 1]))
xor s[((s[i] + s[j]) MOD 256)])), #0, '', [rfReplaceAll]));
end;
NETCODE.Format := fmtBase64;
NETCODE.DecodedData := ct;
NETCODE.Encode;
Result := EncodedData;
NETCODE.Free;
end;
Напрашивается мнение, что Delphi отработала как надо, а проблема в системе отображения, которая закодирована на устаревшем языке программирования с устаревшей системой кодирования длины строки встроенным в конец строки нулевым символом
'8M'#$0095'¨'#$0095'='#$0086'ÎJ'#$0080#$1D#$7F'¾2'#$C'páS'#$A#$008C'ËÁÛ'#$009F'+<TÐWPÒ'#$1A'µ'#$18#$008F' '#$19#$009D'Â\;T'#$1E'YcEÅ'#$009B')PÙ'#9'uø'#$0095#$1B#$1A#$1F#$008A'¥'#$1C#$7F'Ö#zÙë'#$C'í'#$0098#$1F#$1F'|®iu'#2'w)0ø<E~£'#8'ë'#$11#$E#$008C#1'p'#$0098'_'#$009F'øíõT'#$008E'\¥'#7'¡'#$0093'í0c'#$0094'Æ£'#$0094'uúÓÝ;!'#$008F#$0090'T'#$F'ý'#$0095'eHÙ¥W2,W©xN'#$008F#$0081'ñ'#$008F#$B#$D'¯+ðD\'#$0087'ØÈ'#$0082'"óN-'#$19'?ÜS6]'#$0097#$0089'àÝb~( ÁeIq'#0'O'#$1A#$00AD'±'#$0083'®`¢Ú¹'#4#$C't'#$0087'zÒýEÖÿ'#$10'@'#$E'åÚ>óòz'#$009E#$008F'.ý¨'#$A'aG(ËÓgPRÔΨKÙ'#$1E'$a¢7C['#$E#$14#$0082#$7F'³ ÿ4bÇ8ó´ì=ζoS^Û'#$0085'j'#4'ý5'#$A'¿]'#$1B'JNêa}~`r'#$0090'×ë'#$14'´(·Ô'#$008A'é'#$0090'k`'#$13'ÙôB¨þ_îr'#$0091#$18'Íí§uÆ'#$11'ß'#5'f'#$0096'zãÒ'#$11#$0095'²0X.'#$1E'Â'#9'ÿ'#5'ËFMYØLó]ä='#$1D'99îØöA'#$16'4׿Xv'#7'c%ôk]Îw¦Ri'#$11'ø'#$13'K'#$0090'}B'#$008A'.]ycйZ'#5'±ëçR]'#$0097'dò!&hà1'#$0094'¡'#3'ÐÐ%Èù'#$1A'²®øücè.Õh¿'#$008C'ÞÅáFÉ©ûdC®i'#$12#9'Hpò1Ûâ*u[:«'#4'íA×®'#$1B'+Ðô>±qª3ÔÓÇ['#$008C'¯'#$0084'=rD°Õö'#$009B'ó©óÈB£+J¾#}QTÁ'#$0091#$0097'ÍDP'#$0085#$009B#$0085'}¯È'#5'+ÞPJ±¸'#8'Sî'#$0093'C'#$0082'¦®ÔU³à'#$10#$E'ôEH¶N'#$18'÷b'#8'ô´£ '#$D'J¡C -Ö'#8#2#$0081'ªâJþ`^#'#9'ÇÛ'#$0082'$/G'#$008D'º'#$0082'Ú\Ý'#$B'Oòµ<'#$0091'$"7hµßø{êÞÆN@c'#9'ÕÓ°"ª¢'#$12'Z7FßC±7ø¨`l8'#$008B#$1D'F'#$0094#$1A#$7F'ÕðÏj'#0'A!°'#$009A#$B'ËNv'#$009B'Ã'#3#$009E'E}÷'#$0099#6'Â}Ýa'#$19'¼?d£'#$10#$0082#0#$0096#$0087'í'#$0097'`P0ËExzÖ¦C\'#$0096#$0094'ã¸èÜKmâVâ¹=]Á«'#$1F'Ö'#9'íc5T½'#$0094'?'#$0085'ûi'#$0081'rnô´'#$0088']:'#$0094#$009F'rûÌÛ/'#$008E'º÷'#$009C'RiÑÄù,f÷f7'#$009E'ÓåFÎcð'#$11'ºÀiëÊ'#$10'´8µUÎæ'#$008A#$0090'Ê'#$008A#$1A'&@{Øßé¢Æ)='#$1E#$008B#$008F'ªÑѳy'#8#$11'òd([ »q*¨ï×É'#$0080#$0092#$17#$14#8#$10'R'#$0090'>f'#$1E'Îö#âhE³e'#$008E'M'#$009A'ÀlS'#$C'æ'#2'~''Í'#$19'ÄFÍUõM'#1'^ä'#$19'aÃ2ü¢xc>k`'#1'N'#$10#$13'Ñ8'#$009D'ã'#$0099'êýµ'#$1A'¨Æ'#$0083#$008D'¡Å'#$B'É2<4'#1'<'#$0089'ØF1Ç'
'#0'
var Save := GetTickCount;
<do something>
inc(TestedCount);
var Delta := TestedCount div ((GetTickCount - Save) div 60000);