Dec_ndr_small() публичный Метод

public Dec_ndr_small ( ) : int
Результат int
Пример #1
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Decode(NdrBuffer src)
			{
				src.Align(4);
				TimeLow = src.Dec_ndr_long();
				TimeMid = (short)src.Dec_ndr_short();
				TimeHiAndVersion = (short)src.Dec_ndr_short();
				ClockSeqHiAndReserved = unchecked((byte)src.Dec_ndr_small());
				ClockSeqLow = unchecked((byte)src.Dec_ndr_small());
				int nodes = 6;
				int nodei = src.Index;
				src.Advance(1 * nodes);
				if (Node == null)
				{
					if (nodes < 0 || nodes > unchecked(0xFFFF))
					{
						throw new NdrException(NdrException.InvalidConformance);
					}
					Node = new byte[nodes];
				}
				src = src.Derive(nodei);
				for (int i = 0; i < nodes; i++)
				{
					Node[i] = unchecked((byte)src.Dec_ndr_small());
				}
			}
Пример #2
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Decode(NdrBuffer src)
			{
				src.Align(4);
				Length = src.Dec_ndr_long();
				ImpersonationLevel = (short)src.Dec_ndr_short();
				ContextMode = unchecked((byte)src.Dec_ndr_small());
				EffectiveOnly = unchecked((byte)src.Dec_ndr_small());
			}
Пример #3
0
		/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
		internal virtual void Decode_header(NdrBuffer buf)
		{
			if (buf.Dec_ndr_small() != 5 || buf.Dec_ndr_small() != 0)
			{
				throw new NdrException("DCERPC version not supported");
			}
			Ptype = buf.Dec_ndr_small();
			Flags = buf.Dec_ndr_small();
			if (buf.Dec_ndr_long() != unchecked(0x00000010))
			{
				throw new NdrException("Data representation not supported");
			}
			Length = buf.Dec_ndr_short();
			if (buf.Dec_ndr_short() != 0)
			{
				throw new NdrException("DCERPC authentication not supported");
			}
			CallId = buf.Dec_ndr_long();
		}
Пример #4
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Decode(NdrBuffer src)
			{
				src.Align(4);
				int subAuthoritys = src.Dec_ndr_long();
				Revision = unchecked((byte)src.Dec_ndr_small());
				SubAuthorityCount = unchecked((byte)src.Dec_ndr_small());
				int identifierAuthoritys = 6;
				int identifierAuthorityi = src.Index;
				src.Advance(1 * identifierAuthoritys);
				int subAuthorityi = src.Index;
				src.Advance(4 * subAuthoritys);
				if (IdentifierAuthority == null)
				{
					if (identifierAuthoritys < 0 || identifierAuthoritys > unchecked(0xFFFF))
					{
						throw new NdrException(NdrException.InvalidConformance);
					}
					IdentifierAuthority = new byte[identifierAuthoritys];
				}
				src = src.Derive(identifierAuthorityi);
				for (int i = 0; i < identifierAuthoritys; i++)
				{
					IdentifierAuthority[i] = unchecked((byte)src.Dec_ndr_small());
				}
				if (SubAuthority == null)
				{
					if (subAuthoritys < 0 || subAuthoritys > unchecked(0xFFFF))
					{
						throw new NdrException(NdrException.InvalidConformance);
					}
					SubAuthority = new int[subAuthoritys];
				}
				src = src.Derive(subAuthorityi);
				for (int i1 = 0; i1 < subAuthoritys; i1++)
				{
					SubAuthority[i1] = src.Dec_ndr_long();
				}
			}
Пример #5
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Decode(NdrBuffer src)
			{
				src.Align(4);
				src.Align(4);
				if (Name == null)
				{
					Name = new Rpc.Unicode_string();
				}
				Name.Length = (short)src.Dec_ndr_short();
				Name.MaximumLength = (short)src.Dec_ndr_short();
				int nameBufferp = src.Dec_ndr_long();
				src.Align(4);
				if (DnsDomain == null)
				{
					DnsDomain = new Rpc.Unicode_string();
				}
				DnsDomain.Length = (short)src.Dec_ndr_short();
				DnsDomain.MaximumLength = (short)src.Dec_ndr_short();
				int dnsDomainBufferp = src.Dec_ndr_long();
				src.Align(4);
				if (DnsForest == null)
				{
					DnsForest = new Rpc.Unicode_string();
				}
				DnsForest.Length = (short)src.Dec_ndr_short();
				DnsForest.MaximumLength = (short)src.Dec_ndr_short();
				int dnsForestBufferp = src.Dec_ndr_long();
				src.Align(4);
				if (DomainGuid == null)
				{
					DomainGuid = new Rpc.UuidT();
				}
				DomainGuid.TimeLow = src.Dec_ndr_long();
				DomainGuid.TimeMid = (short)src.Dec_ndr_short();
				DomainGuid.TimeHiAndVersion = (short)src.Dec_ndr_short();
				DomainGuid.ClockSeqHiAndReserved = unchecked((byte)src.Dec_ndr_small());
				DomainGuid.ClockSeqLow = unchecked((byte)src.Dec_ndr_small());
				int domainGuidNodes = 6;
				int domainGuidNodei = src.Index;
				src.Advance(1 * domainGuidNodes);
				int sidp = src.Dec_ndr_long();
				if (nameBufferp != 0)
				{
					src = src.Deferred;
					int nameBuffers = src.Dec_ndr_long();
					src.Dec_ndr_long();
					int nameBufferl = src.Dec_ndr_long();
					int nameBufferi = src.Index;
					src.Advance(2 * nameBufferl);
					if (Name.Buffer == null)
					{
						if (nameBuffers < 0 || nameBuffers > unchecked(0xFFFF))
						{
							throw new NdrException(NdrException.InvalidConformance);
						}
						Name.Buffer = new short[nameBuffers];
					}
					src = src.Derive(nameBufferi);
					for (int i = 0; i < nameBufferl; i++)
					{
						Name.Buffer[i] = (short)src.Dec_ndr_short();
					}
				}
				if (dnsDomainBufferp != 0)
				{
					src = src.Deferred;
					int dnsDomainBuffers = src.Dec_ndr_long();
					src.Dec_ndr_long();
					int dnsDomainBufferl = src.Dec_ndr_long();
					int dnsDomainBufferi = src.Index;
					src.Advance(2 * dnsDomainBufferl);
					if (DnsDomain.Buffer == null)
					{
						if (dnsDomainBuffers < 0 || dnsDomainBuffers > unchecked(0xFFFF))
						{
							throw new NdrException(NdrException.InvalidConformance);
						}
						DnsDomain.Buffer = new short[dnsDomainBuffers];
					}
					src = src.Derive(dnsDomainBufferi);
					for (int i = 0; i < dnsDomainBufferl; i++)
					{
						DnsDomain.Buffer[i] = (short)src.Dec_ndr_short();
					}
				}
				if (dnsForestBufferp != 0)
				{
					src = src.Deferred;
					int dnsForestBuffers = src.Dec_ndr_long();
					src.Dec_ndr_long();
					int dnsForestBufferl = src.Dec_ndr_long();
					int dnsForestBufferi = src.Index;
					src.Advance(2 * dnsForestBufferl);
					if (DnsForest.Buffer == null)
					{
						if (dnsForestBuffers < 0 || dnsForestBuffers > unchecked(0xFFFF))
						{
							throw new NdrException(NdrException.InvalidConformance);
						}
						DnsForest.Buffer = new short[dnsForestBuffers];
					}
					src = src.Derive(dnsForestBufferi);
					for (int i = 0; i < dnsForestBufferl; i++)
					{
						DnsForest.Buffer[i] = (short)src.Dec_ndr_short();
					}
				}
				if (DomainGuid.Node == null)
				{
					if (domainGuidNodes < 0 || domainGuidNodes > unchecked(0xFFFF))
					{
						throw new NdrException(NdrException.InvalidConformance);
					}
					DomainGuid.Node = new byte[domainGuidNodes];
				}
				src = src.Derive(domainGuidNodei);
				for (int i1 = 0; i1 < domainGuidNodes; i1++)
				{
					DomainGuid.Node[i1] = unchecked((byte)src.Dec_ndr_small());
				}
				if (sidp != 0)
				{
					if (Sid == null)
					{
						Sid = new Rpc.SidT();
					}
					src = src.Deferred;
					Sid.Decode(src);
				}
			}
Пример #6
0
 public override void Decode_out(NdrBuffer _src)  {
     int _services = _src.Dec_ndr_long();
     int _servicei = _src.Index;
     _src.Advance(1 * _services);
     if (service == null) {
         if (_services < 0 || _services > 0xFFFF) throw new NdrException( NdrException.InvalidConformance );
         service = new byte[_services];
     }
     _src = _src.Derive(_servicei);
     for (int _i = 0; _i < _services; _i++) {
         service[_i] = (byte)_src.Dec_ndr_small();
     }
     bytes_needed = (int)_src.Dec_ndr_long();
     services_returned = (int)_src.Dec_ndr_long();
     resume_handle = (int)_src.Dec_ndr_long();
     retval = (int)_src.Dec_ndr_long();
 }
Пример #7
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Decode(NdrBuffer src)
			{
				src.Align(4);
				int netnamep = src.Dec_ndr_long();
				Type = src.Dec_ndr_long();
				int remarkp = src.Dec_ndr_long();
				Permissions = src.Dec_ndr_long();
				MaxUses = src.Dec_ndr_long();
				CurrentUses = src.Dec_ndr_long();
				int pathp = src.Dec_ndr_long();
				int passwordp = src.Dec_ndr_long();
				SdSize = src.Dec_ndr_long();
				int securityDescriptorp = src.Dec_ndr_long();
				if (netnamep != 0)
				{
					src = src.Deferred;
					Netname = src.Dec_ndr_string();
				}
				if (remarkp != 0)
				{
					src = src.Deferred;
					Remark = src.Dec_ndr_string();
				}
				if (pathp != 0)
				{
					src = src.Deferred;
					Path = src.Dec_ndr_string();
				}
				if (passwordp != 0)
				{
					src = src.Deferred;
					Password = src.Dec_ndr_string();
				}
				if (securityDescriptorp != 0)
				{
					src = src.Deferred;
					int securityDescriptors = src.Dec_ndr_long();
					int securityDescriptori = src.Index;
					src.Advance(1 * securityDescriptors);
					if (SecurityDescriptor == null)
					{
						if (securityDescriptors < 0 || securityDescriptors > unchecked(0xFFFF))
						{
							throw new NdrException(NdrException.InvalidConformance);
						}
						SecurityDescriptor = new byte[securityDescriptors];
					}
					src = src.Derive(securityDescriptori);
					for (int i = 0; i < securityDescriptors; i++)
					{
						SecurityDescriptor[i] = unchecked((byte)src.Dec_ndr_small());
					}
				}
			}
Пример #8
0
		/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
		public override void Decode_out(NdrBuffer src)
		{
			src.Dec_ndr_short();
			src.Dec_ndr_short();
			src.Dec_ndr_long();
			int n = src.Dec_ndr_short();
			src.Advance(n);
			src.Align(4);
			src.Dec_ndr_small();
			src.Align(4);
			Result = src.Dec_ndr_short();
			src.Dec_ndr_short();
			src.Advance(20);
		}