public final class ElfFile extends Object
http://man7.org/linux/man-pages/man5/elf.5.html http://en.wikipedia.org/wiki/Executable_and_Linkable_Format http://www.ibm.com/developerworks/library/l-dynamic-libraries/ http://downloads.openwatcom.org/ftp/devel/docs/elf-64-gen.pdf Elf64_Addr, Elf64_Off, Elf64_Xword, Elf64_Sxword: 8 bytes Elf64_Word, Elf64_Sword: 4 bytes Elf64_Half: 2 bytes
| 限定符和类型 | 字段和说明 |
|---|---|
short |
arch
The required architecture.
|
static int |
ARCH_68k
Motorola 68000 architecture type.
|
static int |
ARCH_88k
Motorola 88000 architecture type.
|
static int |
ARCH_AARCH64 |
static int |
ARCH_ARM |
static int |
ARCH_ATT
AT&T architecture type.
|
static int |
ARCH_i386
Intel 386 architecture type.
|
static int |
ARCH_i860
Intel 860 architecture type.
|
static int |
ARCH_MIPS
MIPS architecture type.
|
static int |
ARCH_NONE
No architecture type.
|
static int |
ARCH_SPARC
SPARC architecture type.
|
static int |
ARCH_X86_64 |
static byte |
CLASS_32
32-bit objects.
|
static byte |
CLASS_64
64-bit objects.
|
static byte |
DATA_LSB
LSB data encoding.
|
static byte |
DATA_MSB
MSB data encoding.
|
short |
eh_size
ELF header size in bytes.
|
byte |
encoding
Returns a byte identifying the data encoding of the processor specific data.
|
long |
entry_point
Virtual address to which the system first transfers control.
|
short |
file_type
Identifies the object file type.
|
int |
flags
Processor specific flags.
|
static int |
FT_CORE
Core file file type.
|
static int |
FT_DYN
Shared object file type.
|
static int |
FT_EXEC
Executable file type.
|
static int |
FT_REL
Relocatable file type.
|
short |
num_ph
e_phnum.
|
short |
num_sh
Number of entries in the section header table, 0 if no entries.
|
byte |
objectSize
|
short |
ph_entry_size
e_phentsize.
|
long |
ph_offset
Program header table offset in bytes.
|
short |
sh_entry_size
Section header entry size in bytes.
|
long |
sh_offset
Section header table offset in bytes.
|
int |
version
Version
|
| 限定符和类型 | 方法和说明 |
|---|---|
static ElfFile |
fromBytes(ByteBuffer buffer) |
ElfSection |
getDynamicLinkSection()
The
ElfSection.SHT_DYNAMIC section (of which there may be only one). |
net.fornwall.jelf.ElfStringTable |
getDynamicStringTable()
Returns the dynamic symbol table associated with this ELF file, or null if one does not exist.
|
ElfSection |
getDynamicSymbolTableSection()
The
ElfSection.SHT_DYNSYM section (of which there may be only one), if any. |
ElfSymbol |
getELFSymbol(long address)
Returns the elf symbol with the specified address or null if one is not found.
|
ElfSymbol |
getELFSymbol(String symbolName)
Returns the elf symbol with the specified name or null if one is not found.
|
ElfSection |
getInitArraySection() |
String |
getInterpreter()
The interpreter specified by the
ElfSegment.PT_INTERP program header, if any. |
ElfSection |
getPreInitArraySection() |
ElfSegment |
getProgramHeader(int index) |
ElfSection |
getSection(int index)
Returns the section header at the specified index.
|
net.fornwall.jelf.ElfStringTable |
getSectionNameStringTable()
Returns the section header string table associated with this ELF file.
|
net.fornwall.jelf.ElfStringTable |
getStringTable()
Returns the string table associated with this ELF file.
|
ElfSection |
getSymbolTableSection()
The
ElfSection.SHT_SYMTAB section (of which there may be only one), if any. |
public static final int FT_REL
file_type.public static final int FT_EXEC
file_type.public static final int FT_DYN
file_type.public static final int FT_CORE
file_type.public static final byte CLASS_32
public static final byte CLASS_64
public static final byte DATA_LSB
public static final byte DATA_MSB
public static final int ARCH_NONE
public static final int ARCH_ATT
public static final int ARCH_SPARC
public static final int ARCH_i386
public static final int ARCH_68k
public static final int ARCH_88k
public static final int ARCH_i860
public static final int ARCH_MIPS
public static final int ARCH_ARM
public static final int ARCH_X86_64
public static final int ARCH_AARCH64
public final byte objectSize
public final byte encoding
public final short file_type
public final short arch
public final int version
public final long entry_point
public final long ph_offset
public final long sh_offset
public int flags
public short eh_size
public final short ph_entry_size
public final short num_ph
ElfSegment entries in the program header table, 0 if no entries.public final short sh_entry_size
public final short num_sh
public ElfSection getSection(int index) throws ElfException, IOException
public net.fornwall.jelf.ElfStringTable getSectionNameStringTable()
throws ElfException,
IOException
public net.fornwall.jelf.ElfStringTable getStringTable()
throws ElfException,
IOException
public net.fornwall.jelf.ElfStringTable getDynamicStringTable()
throws ElfException,
IOException
public ElfSection getSymbolTableSection() throws ElfException, IOException
ElfSection.SHT_SYMTAB section (of which there may be only one), if any.public ElfSection getDynamicSymbolTableSection() throws ElfException, IOException
ElfSection.SHT_DYNSYM section (of which there may be only one), if any.public ElfSection getDynamicLinkSection() throws IOException
ElfSection.SHT_DYNAMIC section (of which there may be only one). Named ".dynamic".IOExceptionpublic ElfSection getInitArraySection() throws IOException
IOExceptionpublic ElfSection getPreInitArraySection() throws IOException
IOExceptionpublic ElfSymbol getELFSymbol(String symbolName) throws ElfException, IOException
public ElfSymbol getELFSymbol(long address) throws ElfException, IOException
public ElfSegment getProgramHeader(int index) throws IOException
IOExceptionpublic static ElfFile fromBytes(ByteBuffer buffer) throws ElfException
ElfExceptionpublic String getInterpreter() throws IOException
ElfSegment.PT_INTERP program header, if any.IOExceptionCopyright © 2021. All rights reserved.