Class ElfFile

java.lang.Object
net.fornwall.jelf.ElfFile

public final class ElfFile extends Object
An ELF (Executable and Linkable Format) file that can be a relocatable, executable, shared or core file.

Use one of the following methods to parse input to get an instance of this class:

Resources about ELF files:

  • Field Details

    • ET_REL

      public static final int ET_REL
      Relocatable file type. A possible value of e_type.
      See Also:
    • ET_EXEC

      public static final int ET_EXEC
      Executable file type. A possible value of e_type.
      See Also:
    • ET_DYN

      public static final int ET_DYN
      Shared object file type. A possible value of e_type.
      See Also:
    • ET_CORE

      public static final int ET_CORE
      Core file file type. A possible value of e_type.
      See Also:
    • CLASS_32

      public static final byte CLASS_32
      32-bit objects. A possible value of ei_class.
      See Also:
    • CLASS_64

      public static final byte CLASS_64
      64-bit objects. A possible value of ei_class.
      See Also:
    • ABI_SYSTEMV

      public static final byte ABI_SYSTEMV
      System V application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_HPUX

      public static final byte ABI_HPUX
      HP-UX application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_NETBSD

      public static final byte ABI_NETBSD
      NetBSD application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_LINUX

      public static final byte ABI_LINUX
      Linux application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_GNUHERD

      public static final byte ABI_GNUHERD
      GNU Hurd application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_SOLARIS

      public static final byte ABI_SOLARIS
      Solaris application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_AIX

      public static final byte ABI_AIX
      AIX application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_IRIX

      public static final byte ABI_IRIX
      IRIX application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_FREEBSD

      public static final byte ABI_FREEBSD
      FreeBSD application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_TRU64

      public static final byte ABI_TRU64
      Tru64 application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_MODESTO

      public static final byte ABI_MODESTO
      Novell Modesto application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_OPENBSD

      public static final byte ABI_OPENBSD
      OpenBSD application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_OPENVMS

      public static final byte ABI_OPENVMS
      OpenVMS application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_NONSTOP

      public static final byte ABI_NONSTOP
      NonStop Kernel application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_AROS

      public static final byte ABI_AROS
      AROS application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_FENIX

      public static final byte ABI_FENIX
      Fenix OS application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_CLOUD

      public static final byte ABI_CLOUD
      CloudABI application binary interface. A possible value of ei_osabi.
      See Also:
    • ABI_OPENVOS

      public static final byte ABI_OPENVOS
      Stratus Technologies OpenVOS application binary interface. A possible value of ei_osabi.
      See Also:
    • DATA_LSB

      public static final byte DATA_LSB
      LSB data encoding. A possible value of ei_data.
      See Also:
    • DATA_MSB

      public static final byte DATA_MSB
      MSB data encoding. A possible value of ei_data.
      See Also:
    • ARCH_NONE

      public static final int ARCH_NONE
      No architecture type. A possible value of e_machine.
      See Also:
    • ARCH_ATT

      public static final int ARCH_ATT
      AT&T architecture type. A possible value of e_machine.
      See Also:
    • ARCH_SPARC

      public static final int ARCH_SPARC
      SPARC architecture type. A possible value of e_machine.
      See Also:
    • ARCH_i386

      public static final int ARCH_i386
      Intel 386 architecture type. A possible value of e_machine.
      See Also:
    • ARCH_68k

      public static final int ARCH_68k
      Motorola 68000 architecture type. A possible value of e_machine.
      See Also:
    • ARCH_88k

      public static final int ARCH_88k
      Motorola 88000 architecture type. A possible value of e_machine.
      See Also:
    • ARCH_i860

      public static final int ARCH_i860
      Intel 860 architecture type. A possible value of e_machine.
      See Also:
    • ARCH_MIPS

      public static final int ARCH_MIPS
      MIPS architecture type. A possible value of e_machine.
      See Also:
    • ARCH_ARM

      public static final int ARCH_ARM
      See Also:
    • ARCH_X86_64

      public static final int ARCH_X86_64
      See Also:
    • ARCH_AARCH64

      public static final int ARCH_AARCH64
      See Also:
    • ei_class

      public final byte ei_class
      Byte identifying the size of objects, either CLASS_32 or {link 0x2.
    • ei_data

      public final byte ei_data
      Returns a byte identifying the data encoding of the processor specific data. This byte will be either DATA_INVALID, DATA_LSB or DATA_MSB.
    • ei_version

      public final byte ei_version
      Set to 1 for the original and current (as of writing) version of ELF.
    • ei_osabi

      public final byte ei_osabi
      Identifies the target operating system ABI.
    • es_abiversion

      public final byte es_abiversion
      Further specifies the ABI version. Its interpretation depends on the target ABI.
    • e_type

      public final short e_type
      Identifies the object file type. One of the ET_* constants in the class.
    • e_machine

      public final short e_machine
      The required architecture. One of the ARCH_* constants in the class.
    • e_version

      public final int e_version
      Version
    • e_entry

      public final long e_entry
      Virtual address to which the system first transfers control. If there is no entry point for the file the value is 0.
    • e_phoff

      public final long e_phoff
      e_phoff. Program header table offset in bytes. If there is no program header table the value is 0.
    • e_shoff

      public final long e_shoff
      e_shoff. Section header table offset in bytes. If there is no section header table the value is 0.
    • e_flags

      public final int e_flags
      e_flags. Processor specific flags.
    • e_ehsize

      public final short e_ehsize
      e_ehsize. ELF header size in bytes.
    • e_phentsize

      public final short e_phentsize
      e_phentsize. Size of one entry in the file's program header table in bytes. All entries are the same size.
    • e_phnum

      public final short e_phnum
      e_phnum. Number of ElfSegment entries in the program header table, 0 if no entries.
    • e_shentsize

      public final short e_shentsize
      e_shentsize. Section header entry size in bytes - all entries are the same size.
    • e_shnum

      public final short e_shnum
      e_shnum. Number of entries in the section header table, 0 if no entries.
    • e_shstrndx

      public final short e_shstrndx
      Elf{32,64}_Ehdr#e_shstrndx. Index into the section header table associated with the section name string table. SH_UNDEF if there is no section name string table.
  • Method Details