RatioMaster_source.RM.createHandshakeResponse C# (CSharp) Method

createHandshakeResponse() private method

private createHandshakeResponse ( ) : byte[]
return byte[]
        private byte[] createHandshakeResponse()
        {
            int num1 = 0;
            Encoding encoding1 = Encoding.GetEncoding(0x6faf);
            new StringBuilder();
            string text1 = "BitTorrent protocol";
            byte[] buffer1 = new byte[0x100];
            buffer1[num1++] = (byte)text1.Length;
            encoding1.GetBytes(text1, 0, text1.Length, buffer1, num1);
            num1 += text1.Length;
            for (int num2 = 0; num2 < 8; num2++)
            {
                buffer1[num1++] = 0;
            }

            Buffer.BlockCopy(currentTorrentFile.InfoHash, 0, buffer1, num1, currentTorrentFile.InfoHash.Length);
            num1 += currentTorrentFile.InfoHash.Length;
            encoding1.GetBytes(currentTorrent.peerID.ToCharArray(), 0, currentTorrent.peerID.Length, buffer1, num1);
            num1 += encoding1.GetByteCount(currentTorrent.peerID);
            return buffer1;
        }