/// <summary>Create instance of the basic section information with section type check</summary> /// <param name="section">ELF section information</param> /// <param name="type">Required section type</param> /// <exception cref="ArgumentException">section st_type is not equals with <paramref name="type"/></exception> internal SectionBase(Section section, Elf.SHT type) : this(section) { if (section.sh_type != type) { throw new ArgumentException(String.Format(Resources.errUnsupportedSectionArg1, type)); } }
/// <summary>Get all sections by section type</summary> /// <param name="type">Type of the required sections</param> /// <returns>All sections with required type</returns> public IEnumerable <Section> GetSectionByType(Elf.SHT type) { foreach (Section section in this.Sections) { if (section.sh_type == type) { yield return(section); } } }
internal Section(ElfFile file, UInt32 index, Elf.Elf64_Shdr section) : this(file, index) { this.sh_name = section.sh_name; this.sh_type = section.sh_type; this.sh_flags = (Elf.SHF)section.sh_flags; this.sh_addr = section.sh_addr; this.sh_offset = section.sh_offset; this.sh_size = section.sh_size; this.sh_link = section.sh_link; this.sh_info = section.sh_info; this.sh_addralign = section.sh_addralign; this.sh_entsize = section.sh_entsize; }