Esempio n. 1
0
            public byte[] GetProtocolRawData()
            {
                byte[] nowVersion           = new byte[] { 0x03, 0x03 };
                byte[] nowRandom            = Random.CreatRandom();
                byte[] nowSessionID         = SessionID.CreatSessionID(28);
                byte[] nowCipherSuites      = CipherSuites.CreatCipherSuites();
                byte[] nowCompressionMethod = CompressionMethod.CreatCompressionMethod();
                byte[] nowExtention         = Extensions.CreatExtensions(hostName);
                //nowExtention = MyBytes.HexStringToByte("014c0000001c001a00001764617461756e696f6e2e62616977616e6469616e2e636e000500050100000000000a00080006001d00170018000b00020100000d00140012060106030401050102010403050302030202002300d0826acd16d68307143347c574ad11aabec8fb5237460655dfcbb28505c7941a0b80ee75db6b339ab2033e991c5cdb8a39748f313c0dfb08467646007170577fd9f395ff621fbf59cb1aea78081121e0f626d625aab620a760a44b18a14e6eb91dcea5356fdbf2d2f9afa0984ed00e356761ac5693b127b7e0824380eb1968d1a0c6a85ce8d4f532c895e0456a9d56820e57abdd86925d629ef86b75e5f9cea098750d789f5e47e7ec5dcd8bafca47b7709b47fd7ca1e0f258f9d16394923def423aa57cd72149edd10406d1cecc2b31ce0010000e000c02683208687474702f312e310017000000180006000a03020100ff01000100",
                //HexaDecimal.hex16, ShowHexMode.@null);

                byte[] nowClientHello = MyCommonHelper.MyBytes.GroupByteList(new List <byte[]> {
                    nowVersion, nowRandom, nowSessionID, nowCipherSuites, nowCompressionMethod, nowExtention
                });
                base.length = nowClientHello.Length;

                byte[] nowRawData = new byte[nowClientHello.Length + 4];
                nowRawData[0] = (byte)base.handshakeType;
                nowRawData[3] = BitConverter.GetBytes(base.length)[0];
                nowRawData[2] = BitConverter.GetBytes(base.length)[1];
                nowRawData[1] = BitConverter.GetBytes(base.length)[2];
                Array.Copy(nowClientHello, 0, nowRawData, 4, base.length);

                return(nowRawData);
            }