Exemplo n.º 1
0
        private static void sendSynchronize()
        {
            RdpPacket packet = new RdpPacket();

            packet.WriteLittleEndian16((short)1);
            packet.WriteLittleEndian16((short)0x3ea);

            IsoLayer.SendPDU(packet, IsoLayer.PDUType2.PDUTYPE2_SYNCHRONIZE, Secure.RDPEncrypted() ? (int)(MCS.TS_SECURITY_HEADER.SEC_ENCRYPT) : 0);
        }
Exemplo n.º 2
0
        private static void sendFontList()
        {
            RdpPacket packet = new RdpPacket();

            packet.WriteLittleEndian16((short)0);
            packet.WriteLittleEndian16((short)0);
            packet.WriteLittleEndian16((short)3);
            packet.WriteLittleEndian16((short)50);
            IsoLayer.SendPDU(packet, IsoLayer.PDUType2.PDUTYPE2_FONTLIST, Secure.RDPEncrypted() ? (int)(MCS.TS_SECURITY_HEADER.SEC_ENCRYPT) : 0);
        }
Exemplo n.º 3
0
        private static void sendControl(int action)
        {
            RdpPacket packet = new RdpPacket();

            packet.WriteLittleEndian16((short)action);
            packet.WriteLittleEndian16((short)0);
            packet.WriteLittleEndian32(0);

            IsoLayer.SendPDU(packet, IsoLayer.PDUType2.PDUTYPE2_CONTROL, Secure.RDPEncrypted() ? (int)(MCS.TS_SECURITY_HEADER.SEC_ENCRYPT) : 0);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Disconnect packet
        /// </summary>
        public static void Disconnect()
        {
            RdpPacket packet = new RdpPacket();

            packet.WriteLittleEndian16((short)1);
            packet.WriteLittleEndian16((short)0x3ea);
            IsoLayer.SendPDU(packet, IsoLayer.PDUType2.PDUTYPE2_SHUTDOWN_REQUEST, Secure.RDPEncrypted() ? (int)(MCS.TS_SECURITY_HEADER.SEC_ENCRYPT) : 0);
            packet = new RdpPacket();
            packet.WriteByte((byte)(DPUM << 2));
            packet.WriteByte(3);

            IsoLayer.SendTPKT(packet);
        }
Exemplo n.º 5
0
        private static void sendSupressOutput(bool bAllowDisplayUpdates)
        {
            if (Options.suppress_output_supported)
            {
                RdpPacket packet = new RdpPacket();
                packet.WriteByte(bAllowDisplayUpdates ? ((byte)1) : ((byte)0));
                packet.WriteByte(0);
                packet.WriteByte(0);
                packet.WriteByte(0);

                if (bAllowDisplayUpdates)
                {
                    packet.WriteLittleEndian16((short)0);
                    packet.WriteLittleEndian16((short)0);
                    packet.WriteLittleEndian16((ushort)Options.width);
                    packet.WriteLittleEndian16((ushort)Options.height);
                }

                IsoLayer.SendPDU(packet, IsoLayer.PDUType2.PDUTYPE2_SUPPRESS_OUTPUT, Secure.RDPEncrypted() ? (int)(MCS.TS_SECURITY_HEADER.SEC_ENCRYPT) : 0);
            }
        }
Exemplo n.º 6
0
        private static void sendPersistKeyList()
        {
            int num   = 0;
            int num2  = 0;
            int num3  = 0;
            int num4  = 0;
            int num5  = 0;
            int num6  = 0;
            int num7  = 0;
            int num8  = 0;
            int num9  = 0;
            int num10 = 0;

            Cache.TotalBitmapCache(out num, out num2, out num3, out num4, out num5);
            int offset = 0;

            while ((((num6 < num) || (num7 < num2)) || ((num8 < num3) || (num9 < num4))) || (num10 < num5))
            {
                int          num12     = 0;
                int          num13     = 0;
                int          num14     = 0;
                int          num15     = 0;
                int          num16     = 0;
                bool         bMoreKeys = false;
                List <ulong> list      = Cache.GetBitmapCache(offset, 0xff, out num12, out num13, out num14, out num15, out num16, out bMoreKeys);
                RdpPacket    packet    = new RdpPacket();
                packet.WriteLittleEndian16((ushort)num12);
                packet.WriteLittleEndian16((ushort)num13);
                packet.WriteLittleEndian16((ushort)num14);
                packet.WriteLittleEndian16((ushort)num15);
                packet.WriteLittleEndian16((ushort)num16);
                packet.WriteLittleEndian16((ushort)num);
                packet.WriteLittleEndian16((ushort)num2);
                packet.WriteLittleEndian16((ushort)num3);
                packet.WriteLittleEndian16((ushort)num4);
                packet.WriteLittleEndian16((ushort)num5);
                byte num17 = 0;
                if (offset == 0)
                {
                    num17 = (byte)(num17 | 1);
                }
                if (!bMoreKeys)
                {
                    num17 = (byte)(num17 | 2);
                }
                packet.WriteByte(num17);
                packet.WriteByte(0);
                packet.WriteLittleEndian16((short)0);
                foreach (ulong num18 in list)
                {
                    packet.Write(BitConverter.GetBytes(num18), 0, 8);
                }
                IsoLayer.SendPDU(packet, IsoLayer.PDUType2.PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST, Secure.RDPEncrypted() ? (int)(MCS.TS_SECURITY_HEADER.SEC_ENCRYPT) : 0);
                offset += list.Count;
                num6   += num12;
                num7   += num13;
                num8   += num14;
                num9   += num15;
                num10  += num16;
            }
        }