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


C# Stream.ReadUIntLE方法代码示例

本文整理汇总了C#中System.IO.Stream.ReadUIntLE方法的典型用法代码示例。如果您正苦于以下问题:C# Stream.ReadUIntLE方法的具体用法?C# Stream.ReadUIntLE怎么用?C# Stream.ReadUIntLE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.Stream的用法示例。


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

示例1: Load

        internal void Load(Stream s)
        {
            s.AssumeArgNotNull("s");

            RVA = s.ReadUIntLE();
            Size = s.ReadUIntLE();
        }
开发者ID:scottwis,项目名称:Disil,代码行数:7,代码来源:BlockReference.cs

示例2: Load

        public void Load(Stream s, StringBuilder builder)
        {
            Offset = s.ReadUIntLE();
            Size = s.ReadUIntLE();

            Util.Assume(s.AbosultePosition() % 4 == 0, "Name field not alligned");
            using (var subStream = new SubStream(s, s_maxNameLen, "Invalid stream header (name too long)"))
            {
                var c = (char) subStream.ReadByteOrThrow();
                while (c != '\0')
                {
                    builder.Append(c);
                    c = (char)subStream.ReadByteOrThrow();
                }

                var padding = (builder.Length + 1)%4;
                for (; padding > 0 && padding < 4 ; ++padding)
                {
                    subStream.ReadByteOrThrow().AssumeEquals(
                        (byte)0,
                        "Expected a padding byte"
                    );
                }

                Name = builder.ToString();
                builder.Remove(0, builder.Length);
            }
        }
开发者ID:scottwis,项目名称:Disil,代码行数:28,代码来源:StreamHeader.cs

示例3: Load

 internal void Load(Stream s)
 {
     Name = Encoding.ASCII.GetString(s.ReadBytes(8)).TrimEnd('\0');
     VirtualSize = s.ReadUIntLE();
     SectionRVA = s.ReadUIntLE();
     SizeOfRawData = s.ReadUIntLE();
     PointerToRawData = s.ReadUIntLE();
     PointerToRelocations = s.ReadUIntLE();
     PointerToLineNumbers = s.ReadUIntLE();
     NumberOfRelocations = s.ReadUShortLE();
     NumberOfLineNumbers = s.ReadUShortLE();
     SectionFlags = (SectionFlags)s.ReadUIntLE();
 }
开发者ID:scottwis,项目名称:Disil,代码行数:13,代码来源:SectionHeader.cs

示例4: Load

        internal void Load(Stream s)
        {
            s.AssumeArgNotNull("s");

            HeaderSize = s.ReadUIntLE();
            MajorRuntimeVersion = s.ReadUShortLE();
            MinorRuntimeVersion = s.ReadUShortLE();
            MetaDataPointer.Load(s);
            Flags = (ClrHeaderFlags) s.ReadUIntLE();
            EntryPointToken = s.ReadUIntLE();
            Resources.Load(s);
            StrongNameSignature.Load(s);
            CodeManagerTable.Load(s);
            VTableFixups.Load(s);
            ExportAddressTableJumps.Load(s);
            ManagedNativeHeader.Load(s);
        }
开发者ID:scottwis,项目名称:Disil,代码行数:17,代码来源:ClrHeader.cs

示例5: Load

        internal void Load(Stream s)
        {
            s.AssumeArgNotNull("s");

            MachineType = ((MachineType)s.ReadUShortLE()).AssumeDefined();
            NumberOfSections = s.ReadUShortLE().AssumeGt(0, "Empty section table detected. All valid PE files should contain at least one section.");
            TimeDateStamp = s.ReadUIntLE();
            PointerToSymbolTable = s.ReadUIntLE().AssumeEquals(0u);
            NumberOfSymbols = s.ReadUIntLE().AssumeEquals(0u);
            SizeOfOptionalHeader = s.ReadUShortLE();
            Characteristics = (FileCharacteristics)s.ReadUShortLE();

            Util.Assume(SizeOfOptionalHeader >= 92, "Unexpected optional header size");

            var optHeaderStart = s.Position;

            ImageType = ((ImageType)s.ReadUShortLE()).AssumeDefined();

            if (ImageType == ImageType.PE32PlusFile)
            {
                Util.Assume(SizeOfOptionalHeader >= 108, "Unexpected optional header size");
            }

            MajorLinkerVersion = s.ReadByteOrThrow();
            MinorLinkerVersion = s.ReadByteOrThrow();
            SizeOfCode = s.ReadUIntLE();
            SizeOfInitializedData = s.ReadUIntLE();
            SizeOfUnInitializedData = s.ReadUIntLE();
            EntryPointRVA = s.ReadUIntLE();
            BaseOfCode = s.ReadUIntLE();
            if (ImageType == ImageType.PEFile)
            {
                BaseOfData = s.ReadUIntLE();
                ImageBase = s.ReadUIntLE();
            }
            else
            {
                ImageBase = s.ReadULongLE();
            }

            SectionAlignment = s.ReadUIntLE();
            FileAlignment = s.ReadUIntLE();
            MajorOSVersion = s.ReadUShortLE();
            MinorOSVersion = s.ReadUShortLE();
            MajorImageVersion = s.ReadUShortLE();
            MinorImageVersion = s.ReadUShortLE();
            MajorSubsystemVersion = s.ReadUShortLE();
            MinorSubsystemVersion = s.ReadUShortLE();
            Win32VersionValue = s.ReadUIntLE();
            SizeOfImage = s.ReadUIntLE();
            SizeOfHeaders = s.ReadUIntLE();
            CheckSum = s.ReadUIntLE();
            Subsystem = ((WindowsSubsystem) s.ReadUShortLE()).AssumeDefined();
            DllCharacteristics = (DllCharacteristics) s.ReadUShortLE();

            if (ImageType == ImageType.PEFile)
            {
                SizeOfStackReserve = s.ReadUIntLE();
                SizeOfStackCommit = s.ReadUIntLE();
                SizeOfHeapReserve = s.ReadUIntLE();
                SizeOfHeapCommit = s.ReadUIntLE();
            }
            else
            {
                SizeOfStackReserve = s.ReadULongLE();
                SizeOfStackCommit = s.ReadULongLE();
                SizeOfHeapReserve = s.ReadULongLE();
                SizeOfHeapCommit = s.ReadULongLE();
            }
            LoaderFlags = s.ReadUIntLE();

            var dataDirCount = s.ReadUIntLE();

            Util.Assume(dataDirCount * 8 <= SizeOfOptionalHeader - (s.Position - optHeaderStart), "Inconsistent header fields");

            if (dataDirCount != 0)
            {
                var dirs = new BlockReference[dataDirCount];

                for (int i = 0; i < dirs.Length; ++i)
                {
                    dirs[i] = new BlockReference(s);
                }

                DataDirectories = new ReadOnlyCollection<BlockReference>(dirs);
            }
        }
开发者ID:scottwis,项目名称:Disil,代码行数:87,代码来源:PEHeader.cs


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