Witam, mam mały problem, gdy chcę odczytać dane które do mnie przychodzą to są one inne niż te które przechodzą przez sniffer, czemu tak to jest?
Oczywiście kodzik ale tylko testowy.
function bintostr(const bin: array of byte): string;
const HexSymbols = '0123456789ABCDEF';
var i: integer;
begin
SetLength(Result, 2*Length(bin));
for i := 0 to Length(bin)-1 do begin
Result[1 + 2*i + 0] := HexSymbols[1 + bin[i] shr 4];
Result[1 + 2*i + 1] := HexSymbols[1 + bin[i] and $0F];
end;
end;
procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
var
buf : array [0..255] of byte;
i : integer;
str : string;
begin
for i := 0 to 255 do
buf[i] := 0;
socket.ReceiveBuf(buf,sizeof(buf));
memo1.Lines.add('read, length : '+inttostr(socket.ReceiveLength)) ;
memo1.Lines.Add(bintostr(buf)) ;
end;