public class Elf extends Object
Modifier and Type | Class and Description |
---|---|
class |
Elf.Attribute |
class |
Elf.Dynamic |
class |
Elf.ELFhdr |
class |
Elf.PHdr |
class |
Elf.Section |
class |
Elf.Symbol |
Modifier and Type | Field and Description |
---|---|
protected ERandomAccessFile |
efile |
protected Elf.ELFhdr |
ehdr |
static int |
ELF32_ADDR_SIZE |
static int |
ELF32_OFF_SIZE |
static int |
ELF64_ADDR_SIZE |
static int |
ELF64_OFF_SIZE |
protected String |
EMPTY_STRING |
protected String |
file |
protected byte[] |
section_strtab |
protected Elf.Section[] |
sections |
Modifier | Constructor and Description |
---|---|
protected |
Elf() |
|
Elf(String file) |
|
Elf(String file,
long offset) |
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
protected void |
finalize()
Make sure we do not leak the fds.
|
Elf.Attribute |
getAttributes() |
static Elf.Attribute |
getAttributes(byte[] array) |
static Elf.Attribute |
getAttributes(String file) |
Elf.Dynamic[] |
getDynamicSections(Elf.Section section) |
Elf.Symbol[] |
getDynamicSymbols() |
Elf.ELFhdr |
getELFhdr() |
String |
getFilename() |
Elf.PHdr[] |
getPHdrs() |
Elf.Section |
getSectionByName(String name) |
Elf.Section[] |
getSections() |
Elf.Section[] |
getSections(int type) |
Elf.Symbol |
getSymbol(IAddress vma) |
ISymbolReader |
getSymbolReader() |
Elf.Symbol[] |
getSymbols() |
Elf.Symbol[] |
getSymtabSymbols() |
static boolean |
isElfHeader(byte[] e_ident) |
void |
loadSymbols() |
static long |
makeUnsignedLong(byte[] val,
int offset,
boolean isle) |
protected long |
readUnsignedLong(ERandomAccessFile file) |
protected String |
string_from_elf_section(Elf.Section section,
int index) |
public static final int ELF32_ADDR_SIZE
public static final int ELF32_OFF_SIZE
public static final int ELF64_ADDR_SIZE
public static final int ELF64_OFF_SIZE
protected ERandomAccessFile efile
protected Elf.ELFhdr ehdr
protected Elf.Section[] sections
protected String file
protected byte[] section_strtab
protected String EMPTY_STRING
protected Elf()
public Elf(String file, long offset) throws IOException
IOException
public Elf(String file) throws IOException
IOException
protected String string_from_elf_section(Elf.Section section, int index) throws IOException
IOException
public Elf.PHdr[] getPHdrs() throws IOException
IOException
public Elf.Dynamic[] getDynamicSections(Elf.Section section) throws IOException
IOException
public Elf.ELFhdr getELFhdr() throws IOException
IOException
public Elf.Attribute getAttributes() throws IOException
IOException
public static Elf.Attribute getAttributes(String file) throws IOException
IOException
public static Elf.Attribute getAttributes(byte[] array) throws IOException
IOException
public static boolean isElfHeader(byte[] e_ident)
public void dispose()
protected void finalize() throws Throwable
public Elf.Section getSectionByName(String name) throws IOException
IOException
public Elf.Section[] getSections(int type) throws IOException
IOException
public Elf.Section[] getSections() throws IOException
IOException
public void loadSymbols() throws IOException
IOException
public Elf.Symbol[] getSymbols()
public Elf.Symbol[] getDynamicSymbols()
public Elf.Symbol[] getSymtabSymbols()
public Elf.Symbol getSymbol(IAddress vma)
public String getFilename()
protected long readUnsignedLong(ERandomAccessFile file) throws IOException
IOException
public ISymbolReader getSymbolReader()
public static long makeUnsignedLong(byte[] val, int offset, boolean isle) throws IOException
IOException
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.