当前位置: 首页>>代码示例>>C#>>正文


C# ByteBuffer.ToByteArray方法代码示例

本文整理汇总了C#中System.ByteBuffer.ToByteArray方法的典型用法代码示例。如果您正苦于以下问题:C# ByteBuffer.ToByteArray方法的具体用法?C# ByteBuffer.ToByteArray怎么用?C# ByteBuffer.ToByteArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.ByteBuffer的用法示例。


在下文中一共展示了ByteBuffer.ToByteArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PutBody

        protected override void PutBody(ByteBuffer buf)
        {
            // 初始密钥
            buf.PutChar((char)user.QQKey.LoginInfo_Magic_Token.Length);
            buf.Put(user.QQKey.LoginInfo_Magic_Token);
            ByteBuffer DecodedBuf = new ByteBuffer();
            DecodedBuf.PutChar((char)0x010D);
            DecodedBuf.Put(0x00);
            DecodedBuf.Put(new byte[] { 0x01, 0x01 });
            DecodedBuf.Put(VersionData.QQ09_LOCALE);
            DecodedBuf.Put(VersionData.QQ09_VERSION_SPEC);
            DecodedBuf.PutChar((char)Client.QQUser.QQKey.Answer_Token.Length);
            DecodedBuf.Put(Client.QQUser.QQKey.Answer_Token);

            DecodedBuf.PutChar((char)Client.QQUser.QQKey.LoginInfo_Token.Length);
            DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_Token);
            DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_UnknowData);
            DecodedBuf.Put(Client.ServerTime);

            DecodedBuf.PutChar((char)Client.QQUser.QQKey.LoginInfo_Data_Token.Length);
            DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_Data_Token);
            DecodedBuf.PutChar((char)0x0000);
            DecodedBuf.PutInt(0x00000000);
            //Client.QQUser.QQKey.Key = Client.QQUser.QQKey.LoginInfo_Key1;//可能要用到
            byte[] EncodedBuf = crypter.Encrypt(DecodedBuf.ToByteArray(), user.QQKey.LoginInfo_Key1);
            buf.Put(EncodedBuf);
            #if DEBUG
            Client.LogManager.Log(ToString() + " key:" + Utils.Util.ToHex(user.QQKey.InitKey));
            Client.LogManager.Log(ToString() + " UnBody: " + Utils.Util.ToHex(DecodedBuf.ToByteArray()));
            #endif
        }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:31,代码来源:LoginGetInfoPacket.cs

示例2: PutBody

        protected override void PutBody(ByteBuffer buf)
        {
            // 初始密钥
            //buf.Put(user.QQKey.InitKey);
            buf.PutChar((char)user.QQKey.LoginInfo_Magic_Token.Length);
            buf.Put(user.QQKey.LoginInfo_Magic_Token);
            ByteBuffer DecodedBuf = new ByteBuffer();
            DecodedBuf.PutChar((char)0x0101);
            DecodedBuf.PutChar((char)0x0000);
            DecodedBuf.Put((byte)Client.QQUser.QQKey.LoginInfo_Token.Length);
            DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_Token);

            DecodedBuf.Put(new byte[]{0x10,0x03,0xC8,0xEC,0xC8,0x96,
                0x8B,0xF2,0xB3,0x6B,0x4D,0x0C,0x5C,0xE0,0x6A,0x51,0xCE});//unknown data
            //Client.QQUser.QQKey.Key = Client.QQUser.QQKey.LoginInfo_Key1;//可能要用到
            byte[] EncodedBuf = crypter.Encrypt(DecodedBuf.ToByteArray(), user.QQKey.LoginInfo_Key1);
            #if DEBUG
            Client.LogManager.Log(ToString() + " key:" + Utils.Util.ToHex(user.QQKey.LoginInfo_Key1));
            Client.LogManager.Log(ToString() + " UnBody:" + Utils.Util.ToHex(DecodedBuf.ToByteArray()));
            #endif
            buf.Put(EncodedBuf);
            #if DEBUG
            Client.LogManager.Log(ToString() + " EnBody:" + Utils.Util.ToHex(buf.ToByteArray()));
            #endif
        }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:25,代码来源:LoginA4Packet.cs

示例3: Read

 /// <summary>
 /// </summary>
 /// <param name="buf">The buf.</param>
 public void Read(ByteBuffer buf)
 {
     ByteBuffer temp = new ByteBuffer();
     int i = 0;
     while (true)
     {
         byte b = buf.Get();
         if (b != 0x1F)
         {
             if (b != 0x1E)
             {
                 temp.Put(b);
             }
             else
             {
                 if (i == 0)
                 {
                     QQ = Utils.Util.GetInt(Utils.Util.GetString(temp.ToByteArray()), 0000);
                 }
                 else if (i == 1)
                     Nick = Utils.Util.GetString(temp.ToByteArray());
                 else if (i == 2)
                     Province = Utils.Util.GetString(temp.ToByteArray());
                 i++;
                 temp.Initialize();
             }
         }
         else
         {
             Face = Utils.Util.GetInt(Utils.Util.GetString(temp.ToByteArray()), 0);
             break;
         }
     }
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:37,代码来源:UserInfo.cs

示例4: ParseBody

 protected override void ParseBody(ByteBuffer buf)
 {
     #if DEBUG
     Client.LogManager.Log(ToString() + " Decoded Data:" + Utils.Util.ToHex(buf.ToByteArray()));
     Client.LogManager.Log(ToString() + ":No use data until now!You can check this dat! It's said it has a key");
     #endif
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:7,代码来源:LoginA4ReplyPacket.cs

示例5: ParseBody

 protected override void ParseBody(ByteBuffer buf)
 {
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
     ReplyCode = (ReplyCode)buf.Get();
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:7,代码来源:UploadGroupFriendReplyPacket.cs

示例6: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     buf.Put(Reply);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:7,代码来源:ReceiveIMReplyPacket.cs

示例7: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     // 要加的QQ号的字符串形式
     buf.PutInt(To);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:8,代码来源:AddFriendPacket.cs

示例8: ParseBody

 protected override void ParseBody(ByteBuffer buf)
 {
     byte[] b = buf.ToByteArray();
     QQ = Utils.Util.GetInt(Utils.Util.GetString(b), 0);
     if (QQ == user.QQ)
         Success = true;
     else
         Success = false;
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:9,代码来源:ModifyInfoReplyPacket.cs

示例9: ParseBody

 protected override void ParseBody(ByteBuffer buf)
 {
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
     SubCommand =(AddFriendAuthSubCmd) buf.Get();
     To = buf.GetInt();
     ReplyCode = (ReplyCode)buf.Get();
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:9,代码来源:AddFriendAuthorizeReplyPacket.cs

示例10: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     buf.Put(0x88);
     buf.PutInt(Client.QQUser.QQ);
     buf.Put(0x00);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:9,代码来源:GetLevelPacket.cs

示例11: PutBody

 /// <summary>
 /// 初始化包体
 /// </summary>
 /// <param name="buf">The buf.</param>
 protected override void PutBody(ByteBuffer buf)
 {
     buf.Put((byte)0x1F);
     buf.Put((byte)0x01);
     buf.PutInt(BeginFrom);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:13,代码来源:DownloadGroupFriendPacket.cs

示例12: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     // 初始密钥
     buf.Put(user.QQKey.InitKey);
     ByteBuffer DecodedBuf = new ByteBuffer();
     DecodedBuf.Put(new byte[] { 0x00, 0x01 });
     DecodedBuf.Put(VersionData.QQ09_LOCALE);
     DecodedBuf.Put(VersionData.QQ09_VERSION_SPEC);
     DecodedBuf.Put((byte)0x00);
     DecodedBuf.Put(Client.ServerInfo.GetBytes());
     //DecodedBuf.Put(zeros);//15字节长度00
     byte[] EncodedBuf = crypter.Encrypt(DecodedBuf.ToByteArray(), user.QQKey.InitKey);
     buf.Put(EncodedBuf);
     #if DEBUG
     Client.LogManager.Log(ToString() + " key:" + Utils.Util.ToHex(user.QQKey.InitKey));
     Client.LogManager.Log(ToString() + " Uncrypt Body:" + Utils.Util.ToHex(DecodedBuf.ToByteArray()));
     #endif
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:18,代码来源:LoginTouchPacket.cs

示例13: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     buf.Position += 15;//16个00
     buf.Put(0x00);
     //buf.Put(user.PasswordKey);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:9,代码来源:LogoutPacket.cs

示例14: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     // 命令类型
     buf.Put((byte)SubCommand);
     // 内部ID
     buf.PutInt(ClusterId);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:10,代码来源:ClusterJoinPacket.cs

示例15: GetBytes

 /// <summary>
 /// 将serverInfo转成byte[]
 /// </summary>
 /// <returns></returns>
 public byte[] GetBytes()
 {
     ByteBuffer buf = new ByteBuffer();
     buf.Put(CSP_wRedirectCount);
     buf.Put(CSP_cRedirectCount);
     buf.Put(CSP_dwConnIspID);
     buf.Put(CSP_dwServerReserve);
     buf.Put(CSP_dwConnIP);
     return buf.ToByteArray();
 }
开发者ID:leaker,项目名称:fuhj-widgets,代码行数:14,代码来源:ServerInfo.cs


注:本文中的System.ByteBuffer.ToByteArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。