mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
26 lines
612 B
C#
26 lines
612 B
C#
|
|
using System;
|
|||
|
|
using System.Text;
|
|||
|
|
|
|||
|
|
namespace TLSharp.Core.Network
|
|||
|
|
{
|
|||
|
|
public static class Sniffer
|
|||
|
|
{
|
|||
|
|
public static string MessageOut(byte[] data)
|
|||
|
|
{
|
|||
|
|
return WriteMessage(new StringBuilder("[OUT]:"), data);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public static string MessageIn(byte[] data)
|
|||
|
|
{
|
|||
|
|
return WriteMessage(new StringBuilder("[IN]:"), data);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private static string WriteMessage(StringBuilder log, byte[] data)
|
|||
|
|
{
|
|||
|
|
foreach (var b in data)
|
|||
|
|
log.AppendFormat(" {0:x2}", b);
|
|||
|
|
return log.ToString();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|