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


C# FileOffset类代码示例

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


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

示例1: 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

示例2: ToImageSectionHeader

		/// <summary>
		/// Returns the first <see cref="ImageSectionHeader"/> that has data at file offset
		/// <paramref name="offset"/>
		/// </summary>
		/// <param name="offset">The file offset</param>
		/// <returns></returns>
		public ImageSectionHeader ToImageSectionHeader(FileOffset offset) {
			foreach (var section in imageSectionHeaders) {
				if ((long)offset >= section.PointerToRawData && (long)offset < section.PointerToRawData + section.SizeOfRawData)
					return section;
			}
			return null;
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:13,代码来源:PEInfo.cs

示例3: Create

		/// <summary>
		/// Creates a <see cref="HotStream"/> instance
		/// </summary>
		/// <param name="version">Hot heap version</param>
		/// <param name="imageStream">Heap stream</param>
		/// <param name="streamHeader">Stream header info</param>
		/// <param name="fullStream">Stream for the full PE file</param>
		/// <param name="baseOffset">Offset in <paramref name="fullStream"/> where the data starts</param>
		/// <returns>A <see cref="HotStream"/> instance or <c>null</c> if <paramref name="version"/>
		/// is invalid</returns>
		public static HotStream Create(HotHeapVersion version, IImageStream imageStream, StreamHeader streamHeader, IImageStream fullStream, FileOffset baseOffset) {
			switch (version) {
			case HotHeapVersion.CLR20: return new HotStreamCLR20(imageStream, streamHeader, fullStream, baseOffset);
			case HotHeapVersion.CLR40: return new HotStreamCLR40(imageStream, streamHeader, fullStream, baseOffset);
			default: return null;
			}
		}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:17,代码来源:HotStream.cs

示例4: MemoryImageStream

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="fileOffset">File offset of data</param>
		/// <param name="data">The data</param>
		/// <param name="dataOffset">Start offset in <paramref name="data"/></param>
		/// <param name="dataLength">Length of data</param>
		public MemoryImageStream(FileOffset fileOffset, byte[] data, int dataOffset, int dataLength) {
			this.fileOffset = fileOffset;
			this.data = data;
			this.dataOffset = dataOffset;
			this.dataEnd = dataOffset + dataLength;
			this.position = dataOffset;
		}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:14,代码来源:MemoryImageStream.cs

示例5: 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

示例6: UnmanagedMemoryImageStream

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="owner">Owner of memory</param>
		/// <param name="fileOffset">File offset of data</param>
		/// <param name="baseAddr">Address of data</param>
		/// <param name="length">Length of data</param>
		public unsafe UnmanagedMemoryImageStream(UnmanagedMemoryStreamCreator owner, FileOffset fileOffset, long baseAddr, long length) {
			this.fileOffset = fileOffset;
			this.startAddr = baseAddr;
			this.endAddr = baseAddr + length;
			this.currentAddr = this.startAddr;
			this.owner = owner;
		}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:14,代码来源:UnmanagedMemoryImageStream.cs

示例7: Create

		/// <inheritdoc/>
		public unsafe IImageStream Create(FileOffset offset, long length) {
			if ((long)offset < 0 || length < 0)
				return MemoryImageStream.CreateEmpty();

			long offs = Math.Min(Length, (long)offset);
			long len = Math.Min(Length - offs, length);
			return new UnmanagedMemoryImageStream(owner, (FileOffset)((long)fileOffset + (long)offset), startAddr + (long)offs, len);
		}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:9,代码来源:UnmanagedMemoryImageStream.cs

示例8: 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

示例9: Create

		/// <inheritdoc/>
		public IImageStream Create(FileOffset offset, long length) {
			if (offset < 0 || length < 0)
				return MemoryImageStream.CreateEmpty();

			int offs = (int)Math.Min((long)dataLength, (long)offset);
			int len = (int)Math.Min((long)dataLength - offs, length);
			return new MemoryImageStream(offset, data, dataOffset + offs, len);
		}
开发者ID:GodLesZ,项目名称:ConfuserDeobfuscator,代码行数:9,代码来源:MemoryStreamCreator.cs

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: AddReadToIndexInformation

 /// <summary>
 /// Add a read being parsed to the index
 /// </summary>
 /// <param name="alignedSequence"></param>
 /// <param name="offset"></param>
 internal void AddReadToIndexInformation(SAM.SAMAlignedSequence alignedSequence, FileOffset offset)
 {
     if (offset < FirstOffSetSeen) { FirstOffSetSeen = offset; }
     else if (offset > LastOffSetSeen) { LastOffSetSeen = offset; }            
     //update meta-data
     if (alignedSequence.Pos < 1 || (alignedSequence.Flag&SAMFlags.UnmappedQuery)==SAMFlags.UnmappedQuery)
     {
         UnMappedReadsCount++;
         return;
     }
     else
     {
         MappedReadsCount++;
     }
     //update linear index
     LinearIndexMaker.UpdateLinearArrayIndex(alignedSequence, offset);
 }
开发者ID:cpatmoore,项目名称:bio,代码行数:22,代码来源:BAMReferenceIndexes.cs


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