net.fornwall.jelf.ElfSymbolStructure Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unidbg Show documentation
Show all versions of unidbg Show documentation
Allows you to emulate an Android ARM32 and/or ARM64 native library
package net.fornwall.jelf;
import java.io.IOException;
public class ElfSymbolStructure implements SymbolLocator {
private final ElfParser parser;
private final long offset;
private final int entrySize;
private final MemoizedObject stringTable;
private final MemoizedObject hashTable;
ElfSymbolStructure(final ElfParser parser, long offset, int entrySize, MemoizedObject stringTable, MemoizedObject hashTable) {
this.parser = parser;
this.offset = offset;
this.entrySize = entrySize;
this.stringTable = stringTable;
this.hashTable = hashTable;
}
/** Returns the symbol at the specified index. The ELF symbol at index 0 is the undefined symbol. */
@Override
public ElfSymbol getELFSymbol(int index) throws IOException {
return new ElfSymbol(parser, offset + index * entrySize, -1).setStringTable(stringTable.getValue());
}
@Override
public ElfSymbol getELFSymbolByName(String name) throws IOException {
if (hashTable == null) {
return null;
}
return hashTable.getValue().getSymbol(this, name);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy