当前位置: 首页>>代码示例>>C#>>正文


C# RVA类代码示例

本文整理汇总了C#中RVA的典型用法代码示例。如果您正苦于以下问题:C# RVA类的具体用法?C# RVA怎么用?C# RVA使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RVA类属于命名空间,在下文中一共展示了RVA类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindSection

		public ImageSectionHeader FindSection(RVA rva) {
			foreach (var section in peImage.ImageSectionHeaders) {
				if (section.VirtualAddress <= rva && rva < section.VirtualAddress + Math.Max(section.VirtualSize, section.SizeOfRawData))
					return section;
			}
			return null;
		}
开发者ID:GreenDamTan,项目名称:de4dot,代码行数:7,代码来源:MyPEImage.cs

示例2: SetOffset

		/// <inheritdoc/>
		public void SetOffset(FileOffset offset, RVA rva) {
			this.offset = offset;
			this.rva = rva;

			padding = rva.AlignUp(4) - rva + 2;
			length = padding + 6;
		}
开发者ID:GodLesZ,项目名称:ConfuserDeobfuscator,代码行数:8,代码来源:StartupStub.cs

示例3: ToImageSectionHeader

		/// <summary>
		/// Returns the first <see cref="ImageSectionHeader"/> that has data at RVA
		/// <paramref name="rva"/>
		/// </summary>
		/// <param name="rva">The RVA</param>
		/// <returns></returns>
		public ImageSectionHeader ToImageSectionHeader(RVA rva) {
			foreach (var section in imageSectionHeaders) {
				if (rva >= section.VirtualAddress && rva < section.VirtualAddress + Math.Max(section.VirtualSize, section.SizeOfRawData))
					return section;
			}
			return null;
		}
开发者ID:xingkongtianyu,项目名称:Protect.NET,代码行数:13,代码来源:PEInfo.cs

示例4: SetOffset

		/// <inheritdoc/>
		public void SetOffset(FileOffset offset, RVA rva) {
			setOffsetCalled = true;
			this.offset = offset;
			this.rva = rva;

			tinyMethodsDict = null;
			fatMethodsDict = null;

			var rva2 = rva;
			foreach (var mb in tinyMethods) {
				mb.SetOffset(offset, rva2);
				uint len = mb.GetFileLength();
				rva2 += len;
				offset += len;
			}

			foreach (var mb in fatMethods) {
				if (alignFatBodies) {
					uint padding = (uint)rva2.AlignUp(FAT_BODY_ALIGNMENT) - (uint)rva2;
					rva2 += padding;
					offset += padding;
				}
				mb.SetOffset(offset, rva2);
				uint len = mb.GetFileLength();
				rva2 += len;
				offset += len;
			}

			length = (uint)rva2 - (uint)rva;
		}
开发者ID:XQuantumForceX,项目名称:Reflexil,代码行数:31,代码来源:MethodBodyChunks.cs

示例5: SetOffset

		/// <inheritdoc/>
		public void SetOffset(FileOffset offset, RVA rva) {
			this.offset = offset;
			this.rva = rva;

			length = HEADER_SIZE;
			if (data != null)	// Could be null if dontWriteAnything is true
				length += (uint)data.Length;
		}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:9,代码来源:DebugDirectory.cs

示例6: SetOffset

		/// <inheritdoc/>
		public void SetOffset(FileOffset offset, RVA rva) {
			setOffsetCalled = true;
			this.offset = offset;
			this.rva = rva;
			foreach (var resource in resources) {
				resource.SetOffset(offset + 4, rva + 4);
				uint len = 4 + resource.GetFileLength();
				offset = (offset + len).AlignUp(alignment);
				rva = (rva + len).AlignUp(alignment);
			}
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:12,代码来源:NetResources.cs

示例7: FieldDefOptions

		public FieldDefOptions(FieldDef field) {
			this.Attributes = field.Attributes;
			this.Name = field.Name;
			this.FieldSig = field.FieldSig;
			this.FieldOffset = field.FieldOffset;
			this.MarshalType = field.MarshalType;
			this.RVA = field.RVA;
			this.InitialValue = field.InitialValue;
			this.ImplMap = field.ImplMap;
			this.Constant = field.Constant;
			this.CustomAttributes.AddRange(field.CustomAttributes);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:12,代码来源:FieldDefOptions.cs

示例8: FieldDefOptions

		public FieldDefOptions(FieldDef field) {
			Attributes = field.Attributes;
			Name = field.Name;
			FieldSig = field.FieldSig;
			FieldOffset = field.FieldOffset;
			MarshalType = field.MarshalType;
			RVA = field.RVA;
			InitialValue = field.InitialValue;
			ImplMap = field.ImplMap;
			Constant = field.Constant;
			CustomAttributes.AddRange(field.CustomAttributes);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:12,代码来源:FieldDefOptions.cs

示例9: GetFileOffsetAndRvaOf

		/// <summary>
		/// Returns the <see cref="FileOffset"/> and <see cref="RVA"/> of a
		/// <see cref="ResourceDirectoryEntry"/>. <see cref="SetOffset"/> must have been called.
		/// </summary>
		/// <param name="dirEntry">A <see cref="ResourceDirectoryEntry"/></param>
		/// <param name="fileOffset">Updated with the file offset</param>
		/// <param name="rva">Updated with the RVA</param>
		/// <returns><c>true</c> if <paramref name="dirEntry"/> is valid and
		/// <paramref name="fileOffset"/> and <paramref name="rva"/> have been updated. <c>false</c>
		/// if <paramref name="dirEntry"/> is not part of the Win32 resources.</returns>
		public bool GetFileOffsetAndRvaOf(ResourceDirectoryEntry dirEntry, out FileOffset fileOffset, out RVA rva) {
			var dir = dirEntry as ResourceDirectory;
			if (dir != null)
				return GetFileOffsetAndRvaOf(dir, out fileOffset, out rva);

			var dataHeader = dirEntry as ResourceData;
			if (dataHeader != null)
				return GetFileOffsetAndRvaOf(dataHeader, out fileOffset, out rva);

			fileOffset = 0;
			rva = 0;
			return false;
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:23,代码来源:Win32ResourcesChunk.cs

示例10: CilBodyOptions

		public CilBodyOptions(CilBody body, RVA rva, FileOffset fileOffset)
		{
			this.KeepOldMaxStack = body.KeepOldMaxStack;
			this.InitLocals = body.InitLocals;
			this.MaxStack = body.MaxStack;
			this.LocalVarSigTok = body.LocalVarSigTok;
			this.RVA = rva;
			this.FileOffset = fileOffset;
			this.Instructions.AddRange(body.Instructions);
			this.ExceptionHandlers.AddRange(body.ExceptionHandlers);
			this.Locals.AddRange(body.Variables);
			this.Scope = body.Scope;
		}
开发者ID:lisong521,项目名称:dnSpy,代码行数:13,代码来源:CilBodyOptions.cs

示例11: MethodDefOptions

		public MethodDefOptions(MethodDef method) {
			ImplAttributes = method.ImplAttributes;
			Attributes = method.Attributes;
			SemanticsAttributes = method.SemanticsAttributes;
			RVA = method.RVA;
			Name = method.Name;
			MethodSig = method.MethodSig;
			ImplMap = method.ImplMap;
			CustomAttributes.AddRange(method.CustomAttributes);
			DeclSecurities.AddRange(method.DeclSecurities);
			ParamDefs.AddRange(method.ParamDefs);
			GenericParameters.AddRange(method.GenericParameters);
			Overrides.AddRange(method.Overrides);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:14,代码来源:MethodDefOptions.cs

示例12: CilBodyOptions

		public CilBodyOptions(CilBody body, RVA headerRva, FileOffset headerFileOffset, RVA rva, FileOffset fileOffset) {
			KeepOldMaxStack = body.KeepOldMaxStack;
			InitLocals = body.InitLocals;
			HeaderSize = body.HeaderSize;
			MaxStack = body.MaxStack;
			LocalVarSigTok = body.LocalVarSigTok;
			HeaderRVA = headerRva;
			HeaderFileOffset = headerFileOffset;
			RVA = rva;
			FileOffset = fileOffset;
			Instructions.AddRange(body.Instructions);
			ExceptionHandlers.AddRange(body.ExceptionHandlers);
			Locals.AddRange(body.Variables);
			Scope = body.Scope;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:15,代码来源:CilBodyOptions.cs

示例13: SetOffset

		/// <inheritdoc/>
		public void SetOffset(FileOffset offset, RVA rva) {
			this.offset = offset;
			this.rva = rva;

			length = 0x28;
			importLookupTableRVA = rva + length;
			length += 8;

			stringsPadding = (int)(rva.AlignUp(STRINGS_ALIGNMENT) - rva);
			length += (uint)stringsPadding;
			corXxxMainRVA = rva + length;
			length += 0xE;
			mscoreeDllRVA = rva + length;
			length += 0xC;
			length++;
		}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:17,代码来源:ImportDirectory.cs

示例14: Align

		static void Align(ref FileOffset offset, ref RVA rva) {
			offset = offset.AlignUp(HH_ALIGNMENT);
			rva = rva.AlignUp(HH_ALIGNMENT);
		}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:4,代码来源:HotHeap.cs

示例15: ReadCilBody

        /// <summary>
        /// Reads a CIL method body
        /// </summary>
        /// <param name="parameters">Method parameters</param>
        /// <param name="rva">RVA</param>
        /// <param name="gpContext">Generic parameter context</param>
        /// <returns>A new <see cref="CilBody"/> instance. It's empty if RVA is invalid (eg. 0 or
        /// it doesn't point to a CIL method body)</returns>
        public CilBody ReadCilBody(IList<Parameter> parameters, RVA rva, GenericParamContext gpContext)
        {
            if (rva == 0)
                return new CilBody();

            // Create a full stream so position will be the real position in the file. This
            // is important when reading exception handlers since those must be 4-byte aligned.
            // If we create a partial stream starting from rva, then position will be 0 and always
            // 4-byte aligned. All fat method bodies should be 4-byte aligned, but the CLR doesn't
            // seem to verify it. We must parse the method exactly the way the CLR parses it.
            using (var reader = metaData.PEImage.CreateFullStream()) {
                reader.Position = (long)metaData.PEImage.ToFileOffset(rva);
                return MethodBodyReader.CreateCilBody(this, reader, parameters, gpContext);
            }
        }
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:23,代码来源:ModuleDefMD.cs


注:本文中的RVA类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。