private static void sendConfirmActive() { int num = 390; int num2 = 0; if (Secure.RDPEncrypted()) { num2 |= MCS.SEC_ENCRYPT; } RdpPacket data = new RdpPacket(); data.WriteLittleEndian16((short)((0x10 + num) + RDP_SOURCE.Length)); data.WriteLittleEndian16((short)0x13); data.WriteLittleEndian16((short)(RDPClient.McsUserID + 0x3e9)); data.WriteLittleEndian32(RDPClient.rdp_shareid); data.WriteLittleEndian16((short)0x3ea); data.WriteLittleEndian16((short)RDP_SOURCE.Length); data.WriteLittleEndian16((short)num); data.Write(RDP_SOURCE, 0, RDP_SOURCE.Length); data.WriteLittleEndian16((short)13); data.Position += 2L; sendGeneralCaps(data); sendBitmapCaps(data); sendOrderCaps(data); sendBitmapcacheCaps(data); sendColorcacheCaps(data); sendActivateCaps(data); sendControlCaps(data); sendPointerCaps(data); sendShareCaps(data); sendInputCaps(data); sendSoundCaps(data); sendFontCaps(data); sendGlyphCacheCaps(data); IsoLayer.SendMCS_GlobalChannel(data, num2); }
internal static void send_connection_request(byte[] loadBalanceToken, bool bAutoReconnect) { int num; RDPClient.dec_count = 0; RDPClient.enc_count = 0; Network.ConnectionStage = RDPClient.eConnectionStage.Negotiating; if (RDPClient.enableNLA) { sendConnectNegotiation(3, loadBalanceToken); num = receiveConnectNegotiation(); if (num == 0x10000000) { Network.Close(); Network.Connect(RDPClient.Host, RDPClient.Port); sendConnectNegotiation(0, loadBalanceToken); num = receiveConnectNegotiation(); if (num != 0) { throw new RDFatalException("Security negotiation failed!"); } } else { if (((num & 1) != 0) || ((num & 2) != 0)) { Network.ConnectionStage = RDPClient.eConnectionStage.Securing; Network.ConnectSSL(); } if ((num & 2) != 0) { Network.ConnectionStage = RDPClient.eConnectionStage.Authenticating; CredSSP.Negotiate(Network.GetSSLPublicKey()); } } } else { sendConnectNegotiation(0, loadBalanceToken); num = receiveConnectNegotiation(); if (num != 0) { throw new RDFatalException("Security negotiation failed!"); } } Network.ConnectionStage = RDPClient.eConnectionStage.Establishing; IsoLayer.SendTPKT(sendConnectInitial(sendMcsData(true, Channels.RegisteredChannels.Count, num))); receiveConnectResponse(); send_ErectDomainRequest(); send_AttachUserRequest(); RDPClient.McsUserID = receive_AttachUserConfirm(); send_ChannelJoinRequest(RDPClient.McsUserID + MCS_USERCHANNEL_BASE); receive_ChannelJoinConfirm(); send_ChannelJoinRequest(MSC_GLOBAL_CHANNEL); receive_ChannelJoinConfirm(); foreach (IVirtualChannel channel in Channels.RegisteredChannels) { send_ChannelJoinRequest(channel.ChannelID); receive_ChannelJoinConfirm(); } int num2 = 0x40; if (Secure.RDPEncrypted()) { Network.ConnectionStage = RDPClient.eConnectionStage.SecureAndLogin; RdpPacket packet = Secure.establishKey(); packet.Position = 0L; IsoLayer.SendMCS(packet, MSC_GLOBAL_CHANNEL); num2 |= SEC_ENCRYPT; } else { Network.ConnectionStage = RDPClient.eConnectionStage.Login; } IsoLayer.SendMCS_GlobalChannel(getLoginInfo(RDPClient.Domain, RDPClient.Username, RDPClient.Password, "", "", bAutoReconnect), num2); }