ddn.elf
ddn.elf - High-Level ELF Library Package
This module provides a high-level, user-friendly API for working with ELF files. It re-exports commonly used types and provides convenience functions for common tasks.
Example:
// Read an ELF file
auto file = openElf("my_program.elf");
// Get file information
auto info = getElfInfo("my_program.elf");
writeln("Class: ", info.class_);
writeln("Machine: ", info.machine);
// List symbols
foreach (sym; listSymbols(file))
{
writeln(sym.name, " @ ", sym.address);
}Types 3
structElfInfo
Summary information about an ELF file.
Fields
ElfClass class_ELF class (32-bit or 64-bit)ElfData endianEndianness (little or big)ElfType typeFile type (relocatable, executable, shared object, etc.)ElfMachine machineMachine architectureulong entryEntry point addressuint sectionCountNumber of sectionsuint segmentCountNumber of program headers (segments)size_t fileSizeFile size in bytesMethods
structSymbolInfo
A symbol with additional display information.
Fields
ElfSymbol symbolThe symbolstring nameThe symbol nameulong addressThe symbol value (address)ulong sizeThe symbol sizeSymbolBinding bindingThe symbol bindingSymbolType typeThe symbol typestructSectionInfo
A section with additional display information.
Fields
uint indexThe section indexstring nameThe section nameSectionType typeThe section typeSectionFlags flagsThe section flagsulong addressThe section addressulong offsetThe section file offsetulong sizeThe section sizeulong entSizeEntry size if section holds tableuint linkLink to another sectionuint infoAdditional section informationulong alignmentSection alignmentconst(ubyte)[] dataThe section dataFunctions 13
fn
string[] listDependencies(ElfFile file)List the dynamic dependencies (needed libraries) of an ELF file.