當前位置: 首頁>>代碼示例>>C#>>正文


C# Ndr.NdrBuffer類代碼示例

本文整理匯總了C#中SharpCifs.Dcerpc.Ndr.NdrBuffer的典型用法代碼示例。如果您正苦於以下問題:C# NdrBuffer類的具體用法?C# NdrBuffer怎麽用?C# NdrBuffer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NdrBuffer類屬於SharpCifs.Dcerpc.Ndr命名空間,在下文中一共展示了NdrBuffer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Decode

			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Decode(NdrBuffer src)
			{
				src.Align(4);
				Count = src.Dec_ndr_long();
				int arrayp = src.Dec_ndr_long();
				if (arrayp != 0)
				{
					src = src.Deferred;
					int arrays = src.Dec_ndr_long();
					int arrayi = src.Index;
					src.Advance(4 * arrays);
					if (Array == null)
					{
						if (arrays < 0 || arrays > unchecked(0xFFFF))
						{
							throw new NdrException(NdrException.InvalidConformance);
						}
						Array = new ShareInfo0[arrays];
					}
					src = src.Derive(arrayi);
					for (int i = 0; i < arrays; i++)
					{
						if (Array[i] == null)
						{
							Array[i] = new ShareInfo0();
						}
						Array[i].Decode(src);
					}
				}
			}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:31,代碼來源:Srvsvc.cs

示例2: Encode

			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_long(Length);
				dst.Enc_ndr_referent(RootDirectory, 1);
				dst.Enc_ndr_referent(ObjectName, 1);
				dst.Enc_ndr_long(Attributes);
				dst.Enc_ndr_long(SecurityDescriptor);
				dst.Enc_ndr_referent(SecurityQualityOfService, 1);
				if (RootDirectory != null)
				{
					dst = dst.Deferred;
					RootDirectory.Encode(dst);
				}
				if (ObjectName != null)
				{
					dst = dst.Deferred;
					ObjectName.Encode(dst);
				}
				if (SecurityQualityOfService != null)
				{
					dst = dst.Deferred;
					SecurityQualityOfService.Encode(dst);
				}
			}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:26,代碼來源:Lsarpc.cs

示例3: Derive

		public virtual NdrBuffer Derive(int idx)
		{
			NdrBuffer nb = new NdrBuffer(Buf, Start);
			nb.Index = idx;
			nb.Deferred = Deferred;
			return nb;
		}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:7,代碼來源:NdrBuffer.cs

示例4: Decode

			/// <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());
				}
			}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:26,代碼來源:Rpc.cs

示例5: NdrBuffer

		public NdrBuffer(byte[] buf, int start)
		{
			this.Buf = buf;
			this.Start = Index = start;
			Length = 0;
			Deferred = this;
		}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:7,代碼來源:NdrBuffer.cs

示例6: Decode

			/// <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());
			}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:9,代碼來源:Lsarpc.cs

示例7: Encode

			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_referent(Netname, 1);
				if (Netname != null)
				{
					dst = dst.Deferred;
					dst.Enc_ndr_string(Netname);
				}
			}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:11,代碼來源:Srvsvc.cs

示例8: Decode

			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Decode(NdrBuffer src)
			{
				src.Align(4);
				int entryPathp = src.Dec_ndr_long();
				if (entryPathp != 0)
				{
					src = src.Deferred;
					EntryPath = src.Dec_ndr_string();
				}
			}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:11,代碼來源:Netdfs.cs

示例9: Encode

			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_referent(EntryPath, 1);
				if (EntryPath != null)
				{
					dst = dst.Deferred;
					dst.Enc_ndr_string(EntryPath);
				}
			}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:11,代碼來源:Netdfs.cs

示例10: Decode

            public override  void Decode(NdrBuffer _src)  {
                _src.Align(4);
                service_type = (int)_src.Dec_ndr_long();
                current_state = (int)_src.Dec_ndr_long();
                controls_accepted = (int)_src.Dec_ndr_long();
                win32_exit_code = (int)_src.Dec_ndr_long();
                service_specific_exit_code = (int)_src.Dec_ndr_long();
                check_point = (int)_src.Dec_ndr_long();
                wait_hint = (int)_src.Dec_ndr_long();

            }
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:11,代碼來源:svcctl.cs

示例11: Encode

            public override  void Encode(NdrBuffer _dst)  {
                _dst.Align(4);
                _dst.Enc_ndr_long(service_type);
                _dst.Enc_ndr_long(current_state);
                _dst.Enc_ndr_long(controls_accepted);
                _dst.Enc_ndr_long(win32_exit_code);
                _dst.Enc_ndr_long(service_specific_exit_code);
                _dst.Enc_ndr_long(check_point);
                _dst.Enc_ndr_long(wait_hint);

            }
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:11,代碼來源:svcctl.cs

示例12: Encode_header

		internal virtual void Encode_header(NdrBuffer buf)
		{
			buf.Enc_ndr_small(5);
			buf.Enc_ndr_small(0);
			buf.Enc_ndr_small(Ptype);
			buf.Enc_ndr_small(Flags);
			buf.Enc_ndr_long(unchecked(0x00000010));
			buf.Enc_ndr_short(Length);
			buf.Enc_ndr_short(0);
			buf.Enc_ndr_long(CallId);
		}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:11,代碼來源:DcerpcMessage.cs

示例13: Encode_in

		/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
		public override void Encode_in(NdrBuffer dst)
		{
			dst.Enc_ndr_short(MaxXmit);
			dst.Enc_ndr_short(MaxRecv);
			dst.Enc_ndr_long(0);
			dst.Enc_ndr_small(1);
			dst.Enc_ndr_small(0);
			dst.Enc_ndr_short(0);
			dst.Enc_ndr_short(0);
			dst.Enc_ndr_small(1);
			dst.Enc_ndr_small(0);
			Binding.Uuid.Encode(dst);
			dst.Enc_ndr_short(Binding.Major);
			dst.Enc_ndr_short(Binding.Minor);
            DcerpcConstants.DcerpcUuidSyntaxNdr.Encode(dst);
			dst.Enc_ndr_long(2);
		}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:18,代碼來源:DcerpcBind.cs

示例14: Encode

			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_long(TimeLow);
				dst.Enc_ndr_short(TimeMid);
				dst.Enc_ndr_short(TimeHiAndVersion);
				dst.Enc_ndr_small(ClockSeqHiAndReserved);
				dst.Enc_ndr_small(ClockSeqLow);
				int nodes = 6;
				int nodei = dst.Index;
				dst.Advance(1 * nodes);
				dst = dst.Derive(nodei);
				for (int i = 0; i < nodes; i++)
				{
					dst.Enc_ndr_small(Node[i]);
				}
			}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:18,代碼來源:Rpc.cs

示例15: Decode_header

		/// <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();
		}
開發者ID:Cyber-Forensic,項目名稱:Potato,代碼行數:20,代碼來源:DcerpcMessage.cs


注:本文中的SharpCifs.Dcerpc.Ndr.NdrBuffer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。