public Section(string name, uint offset, byte[] contents) { this.HasImage = false; _rawHeader = new Structures.IMAGE_SECTION_HEADER(); this.Name = name; this.RawOffset = offset; this.RawSize = (uint)contents.Length; this._contents = contents; }
internal Section(Win32Assembly assembly, uint headeroffset, Structures.IMAGE_SECTION_HEADER rawHeader) { this._rawHeader = rawHeader; this.headeroffset = headeroffset; this.assembly = assembly; this.HasImage = true; }
private void ReadSections() { image.Stream.Seek(optionalheaderoffset + fileHeader.SizeOfOptionalHeader, SeekOrigin.Begin); for (int i = 0; i < fileHeader.NumberOfSections; i++) { uint byteoffset = (uint)image.Stream.Position; Structures.IMAGE_SECTION_HEADER section = image.ReadStructure <Structures.IMAGE_SECTION_HEADER>(); Section s = new Section(assembly, byteoffset, section); sections.Add(s); } }