public void ProcessForNTLMv2() { this.Flags = 2; this.ChannelBindings.length = 0x10; this.ChannelBindings.value = new byte[0x10]; string s = ""; byte[] bytes = Encoding.Unicode.GetBytes(s); this.TargetName.length = bytes.Length; this.TargetName.value = bytes; byte[] buffer = new byte[] { 0x5c, 0xca, 250, 0x4d, 0x40, 0x41, 0xc5, 0x8b, 0x43, 0x93, 0x16, 0x88, 0xce, 0x3b, 0x94, 0x63, 0xf1, 0xc5, 0x61, 0xf4, 0xe1, 0xde, 0xda, 0x7a, 0x43, 0xb8, 0xd6, 200, 0x9e, 80, 0x3f, 0x42 }; this.Restrictions.length = 0x30; RdpPacket packet = new RdpPacket(); packet.WriteLittleEndian32(0x30); packet.WritePadding(4); packet.WriteByte(1); packet.WritePadding(3); packet.WriteLittleEndian32(0x2000); packet.Write(buffer, 0, 0x20); this.Restrictions.value = packet.ToArray(); if (this.Restrictions.value.Length != this.Restrictions.length) { throw new Exception("Restrictions invalid!"); } }