本文整理汇总了C#中BlueSheep.Common.IO.BigEndianWriter.WriteBytes方法的典型用法代码示例。如果您正苦于以下问题:C# BigEndianWriter.WriteBytes方法的具体用法?C# BigEndianWriter.WriteBytes怎么用?C# BigEndianWriter.WriteBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlueSheep.Common.IO.BigEndianWriter
的用法示例。
在下文中一共展示了BigEndianWriter.WriteBytes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: hash_function
public byte[] hash_function(byte[] packet)
{
/* Hello Mr.Fourbasse :hap: */
if (this._hashKey == null)
return packet;
using (BigEndianWriter writer = new BigEndianWriter())
{
writer.WriteBytes(packet);
BigEndianWriter writer2 = new BigEndianWriter();
writer2.WriteBytes(this.hash(packet));
using (RijndaelManaged myRijndael = new RijndaelManaged())
{
myRijndael.GenerateIV();
// Encrypt the string to an array of bytes.
byte[] encrypted = EncryptStringToBytes(writer2.Content.ToString(), this._hashKey, myRijndael.IV);
}
writer.WriteBytes(writer2.Content);
return writer.Content;
}
}
示例2: ParseBuffer
public void ParseBuffer(byte[] data)
{
m_Reader.Add(data, 0, data.Length);
if (m_Reader.BytesAvailable <= 0)
return;
while (m_Reader.BytesAvailable != 0)
{
if (Build())
{
if ((account.IsMITM) && (!ForbiddenHeaders.Contains((int)m_ProtocolID)))
{
using (BigEndianWriter writer = new BigEndianWriter())
{
writer.WriteBytes(m_Data);
MessagePackaging pack = new MessagePackaging(writer);
pack.Pack((int)m_ProtocolID);
account.SocketManager.SendToDofusClient(pack.Writer.Content);
account.Log(new BotTextInformation("SND (-> Dof) " + m_ProtocolID), 0);
}
}
//using (
// StreamWriter fileWriter =
// new StreamWriter(
// Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
// @"\BlueSheep\Packets.txt", true))
// fileWriter.WriteLine("[" + DateTime.Now.ToShortTimeString() + "] Paquet reçu : " + m_ProtocolID);
Treatment.Treatment treatment = new Treatment.Treatment(account);
if (m_ProtocolID == 6372)
{
using (BigEndianWriter writer = new BigEndianWriter())
{
writer.WriteBytes(m_Data);
MessagePackaging pack = new MessagePackaging(writer);
pack.Pack(6372);
account.SocketManager.Send(pack.Writer.Content);
}
}
if (m_ProtocolID != null)
treatment.Treat(m_ProtocolID.Value, m_Data);
m_Header = null;
m_Length = null;
m_Data = null;
m_LenghtType = null;
m_ProtocolID = null;
}
else
break;
}
}