Esempio n. 1
0
            internal void Read(EndianAwareBinaryReader reader)
            {
                this.imageKind             = (PEImageKind)reader.ReadUInt16();
                this.lMajor                = reader.ReadByte();
                this.lMinor                = reader.ReadByte();
                this.codeSize              = reader.ReadUInt32();
                this.initializedDataSize   = reader.ReadUInt32();
                this.uninitializedDataSize = reader.ReadUInt32();
                this.entryPointRVA         = reader.ReadUInt32();
                this.baseOfCode            = reader.ReadUInt32();
                switch (this.imageKind)
                {
                case PEImageKind.x86Image:
                    this.baseOfData = reader.ReadUInt32();
                    break;

                case PEImageKind.x64Image:
                    break;

                case PEImageKind.RomImage:
                    throw new NotImplementedException();

                default:
                    throw new BadImageFormatException();
                }
            }
Esempio n. 2
0
 internal StandardFields(byte lMajor, byte lMinor, uint codeSize, uint initializedDataSize, uint uninitializedDataSize, uint entryPointRVA, uint baseOfCode)
 {
     this.imageKind             = PEImageKind.x64Image;
     this.lMajor                = lMajor;
     this.lMinor                = lMinor;
     this.codeSize              = codeSize;
     this.initializedDataSize   = initializedDataSize;
     this.uninitializedDataSize = uninitializedDataSize;
     this.entryPointRVA         = entryPointRVA;
     this.baseOfCode            = baseOfCode;
     this.baseOfData            = 0;
 }