Package ghidra.app.util.bin.format.elf
Class ElfStringTable
- java.lang.Object
- 
- ghidra.app.util.bin.format.elf.ElfStringTable
 
- 
- All Implemented Interfaces:
- ElfFileSection,- StructConverter
 
 public class ElfStringTable extends java.lang.Object implements ElfFileSection 
- 
- 
Constructor SummaryConstructors Constructor Description ElfStringTable()DO NOT USE THIS CONSTRUCTOR, USE create*(GenericFactory ...) FACTORY METHODS INSTEAD.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ElfStringTablecreateElfStringTable(FactoryBundledWithBinaryReader reader, ElfHeader header, ElfSectionHeader stringTableSection, long fileOffset, long addrOffset, long length)Create and parse an Elf string tablelonggetAddressOffset()Preferred memory address offset where data should be loaded.intgetEntrySize()Size of each structured entry in byteslonggetFileOffset()Offset within file where section bytes are specifiedlonggetLength()Length of file section in bytesElfSectionHeadergetTableSectionHeader()Get section header which corresponds to this table, or null if only associated with a dynamic table entryjava.lang.StringreadString(BinaryReader reader, long stringOffset)Read string from table at specified relative table offsetDataTypetoDataType()Returns a structure datatype representing the contents of the implementor of this interface.
 
- 
- 
- 
Method Detail- 
createElfStringTablepublic static ElfStringTable createElfStringTable(FactoryBundledWithBinaryReader reader, ElfHeader header, ElfSectionHeader stringTableSection, long fileOffset, long addrOffset, long length) throws java.io.IOException Create and parse an Elf string table- Parameters:
- reader-
- header- elf header
- stringTableSection- string table section header or null if associated with a dynamic table entry
- fileOffset- symbol table file offset
- addrOffset- memory address of symbol table (should already be adjusted for prelink)
- length- length of symbol table in bytes of -1 if unknown
- entrySize- size of each symbol entry in bytes
- sectionType- symbol table section type (SHT_DYNSYM, SHT_SYMTAB, or -1 if not section-based)
- stringTable- string table to be associated with symbol table
- Returns:
- Elf string table object
- Throws:
- java.io.IOException
 
 - 
readStringpublic java.lang.String readString(BinaryReader reader, long stringOffset) Read string from table at specified relative table offset- Parameters:
- reader-
- stringOffset- table relative string offset
- Returns:
- string or null on error
 
 - 
getAddressOffsetpublic long getAddressOffset() Description copied from interface:ElfFileSectionPreferred memory address offset where data should be loaded. The returned offset will already have the prelink adjustment applied, although will not reflect any change in the image base.- Specified by:
- getAddressOffsetin interface- ElfFileSection
- Returns:
- default memory address offset where data should be loaded
 
 - 
getTableSectionHeaderpublic ElfSectionHeader getTableSectionHeader() Get section header which corresponds to this table, or null if only associated with a dynamic table entry- Returns:
- string table section header or null
 
 - 
getFileOffsetpublic long getFileOffset() Description copied from interface:ElfFileSectionOffset within file where section bytes are specified- Specified by:
- getFileOffsetin interface- ElfFileSection
- Returns:
- offset within file where section bytes are specified
 
 - 
getLengthpublic long getLength() Description copied from interface:ElfFileSectionLength of file section in bytes- Specified by:
- getLengthin interface- ElfFileSection
- Returns:
- length of file section in bytes
 
 - 
getEntrySizepublic int getEntrySize() Description copied from interface:ElfFileSectionSize of each structured entry in bytes- Specified by:
- getEntrySizein interface- ElfFileSection
- Returns:
- entry size or -1 if variable
 
 - 
toDataTypepublic DataType toDataType() throws DuplicateNameException, java.io.IOException Description copied from interface:StructConverterReturns a structure datatype representing the contents of the implementor of this interface.For example, given: class A { int foo; double bar; }The return value should be a structure data type with two data type components; an INT and a DOUBLE. The structure should contain field names and, if possible, field comments. - Specified by:
- toDataTypein interface- StructConverter
- Returns:
- returns a structure datatype representing the implementor of this interface
- Throws:
- DuplicateNameException- when a datatype of the same name already exists
- java.io.IOException
- See Also:
- StructureDataType
 
 
- 
 
-