Ejemplo n.º 1
0
        private void ReadOptionalHeader()
        {
            optionalheaderoffset = image.Stream.Position;
            optionalheadersig    = image.Reader.ReadUInt16();
            image.Stream.Seek(-2, SeekOrigin.Current);

            if (optionalheadersig == 0x10b)
            {
                optionalHeader32 = image.ReadStructure <Structures.IMAGE_OPTIONAL_HEADER32>();
                optionalHeader   = OptionalHeader32.FromAssembly(assembly);
            }
            else
            {
                optionalHeader64 = image.ReadStructure <Structures.IMAGE_OPTIONAL_HEADER64>();
                optionalHeader   = OptionalHeader64.FromAssembly(assembly);
            }
        }
Ejemplo n.º 2
0
        private void ReadOptionalHeader()
        {
            optionalheaderoffset = image.Stream.Position;
            optionalheadersig = image.Reader.ReadUInt16();
            image.Stream.Seek(-2, SeekOrigin.Current);

            if (optionalheadersig == 0x10b)
            {
                optionalHeader32 = image.ReadStructure<Structures.IMAGE_OPTIONAL_HEADER32>();
                optionalHeader = OptionalHeader32.FromAssembly(assembly);
            }
            else
            {
                optionalHeader64 = image.ReadStructure<Structures.IMAGE_OPTIONAL_HEADER64>();
                optionalHeader = OptionalHeader64.FromAssembly(assembly);
            }
        }