/// <summary> /// Gets the raw section data of the image. The sections are saved in /// <see cref="origSections"/>. /// </summary> void CreateRawSections() { var fileAlignment = peImage.ImageNTHeaders.OptionalHeader.FileAlignment; origSections = new List <OrigSection>(peImage.ImageSectionHeaders.Count); foreach (var peSection in peImage.ImageSectionHeaders) { var newSection = new OrigSection(peSection); origSections.Add(newSection); uint sectionSize = Utils.AlignUp(peSection.SizeOfRawData, fileAlignment); newSection.chunk = new BinaryReaderChunk(peImage.CreateStream(peSection.VirtualAddress, sectionSize), peSection.VirtualSize); } }
/// <summary> /// Gets the raw section data of the image. The sections are saved in /// <see cref="origSections"/>. /// </summary> void CreateRawSections() { var fileAlignment = peImage.ImageNTHeaders.OptionalHeader.FileAlignment; origSections = new List<OrigSection>(peImage.ImageSectionHeaders.Count); foreach (var peSection in peImage.ImageSectionHeaders) { var newSection = new OrigSection(peSection); origSections.Add(newSection); uint sectionSize = Utils.AlignUp(peSection.SizeOfRawData, fileAlignment); newSection.chunk = new BinaryReaderChunk(peImage.CreateStream(peSection.VirtualAddress, sectionSize), peSection.VirtualSize); } }