Package ghidra.app.util.bin.format.elf
Class ElfDynamic
java.lang.Object
ghidra.app.util.bin.format.elf.ElfDynamic
A class to represent the Elf
32
_Dyn data structure.
typedef int32_t Elf32_Sword;
typedef uint32_t Elf32_Word;
typedef uint32_t Elf32_Addr;
typedef struct {
Elf32_Sword d_tag;
union {
Elf32_Word d_val;
Elf32_Addr d_ptr;
} d_un;
} Elf32_Dyn;
typedef int64_t Elf64_Sxword;
typedef uint64_t Elf64_Xword;
typedef uint64_t Elf64_Addr;
typedef struct {
Elf64_Sxword d_tag; //Dynamic entry type
union {
Elf64_Xword d_val; //Integer value
Elf64_Addr d_ptr; //Address value
} d_un;
} Elf64_Dyn;
-
Constructor Summary
ConstructorDescriptionElfDynamic
(int tag, long value, ElfHeader elf) Constructs a new ELF dynamic with the specified tag and value.ElfDynamic
(BinaryReader reader, ElfHeader elf) Construct an ELF dynamic table entryElfDynamic
(ElfDynamicType tag, long value, ElfHeader elf) Constructs a new ELF dynamic with the specified (enum) tag and value. -
Method Summary
Modifier and TypeMethodDescriptionint
getTag()
Returns the value that controls the interpretation of the the d_val and/or d_ptr.A convenience method for getting a string representing the d_tag value.Returns the enum value that controls the interpretation of the the d_val and/or d_ptr (or null if unknown).long
getValue()
Returns the object whose integer values represent various interpretations.int
sizeof()
toString()
-
Constructor Details
-
ElfDynamic
Construct an ELF dynamic table entry- Parameters:
reader
- to read dynamic entry at current position (reader is not retained, position moves to next entry)elf
- ELF header- Throws:
IOException
- if an IO error occurs during parse
-
ElfDynamic
Constructs a new ELF dynamic with the specified tag and value.- Parameters:
tag
- the tag (or type) of this dynamicvalue
- the value (or pointer) of this dynamicelf
- the elf header
-
ElfDynamic
Constructs a new ELF dynamic with the specified (enum) tag and value.- Parameters:
tag
- the (enum) tag (or type) of this dynamicvalue
- the value (or pointer) of this dynamicelf
- the elf header
-
-
Method Details
-
getTag
public int getTag()Returns the value that controls the interpretation of the the d_val and/or d_ptr.- Returns:
- the tag (or type) of this dynamic
-
getTagType
Returns the enum value that controls the interpretation of the the d_val and/or d_ptr (or null if unknown).- Returns:
- the enum tag (or type) of this dynamic or null if unknown
-
getValue
public long getValue()Returns the object whose integer values represent various interpretations. For example, if d_tag == DT_SYMTAB, then d_val holds the address of the symbol table. But, if d_tag == DT_SYMENT, then d_val holds the size of each symbol entry.- Returns:
- the Elf32_Word object represent integer values with various interpretations
-
getTagAsString
A convenience method for getting a string representing the d_tag value. For example, if d_tag == DT_SYMTAB, then this method returns "DT_SYMTAB".- Returns:
- a string representing the d_tag value
-
toString
-
sizeof
public int sizeof()- Returns:
- the size in bytes of this object.
-