예제 #1
0
        public ElfSymtab(Elf.SectionHeaderTableEntry section, string name)
            : base(section, name)
        {
            uint nrEntries = section.FileImageSize / section.EntrySize;

            _symbols = new ElfSymbol[nrEntries];
            var er = new EndianBinaryReader(new MemoryStream(section.SectionData), Endianness.LittleEndian);

            for (int i = 0; i < nrEntries; i++)
            {
                _symbols[i] = new ElfSymbol(er);
            }
            er.Close();
        }
예제 #2
0
        public static ElfSection CreateInstance(Elf.SectionHeaderTableEntry section, string name)
        {
            switch (section.SectionType)
            {
            case Elf.SectionHeaderTableEntry.ElfSectionType.Strtab:
                return(new ElfStrtab(section, name));

            case Elf.SectionHeaderTableEntry.ElfSectionType.Symtab:
                return(new ElfSymtab(section, name));

            default:
                return(new ElfSection(section, name));
            }
        }
예제 #3
0
 protected ElfSection(Elf.SectionHeaderTableEntry sectionHeader, string name)
 {
     SectionHeader = sectionHeader;
     Name          = name;
 }
예제 #4
0
 public ElfStrtab(Elf.SectionHeaderTableEntry section, string name)
     : base(section, name)
 {
 }