Skip to content

elf-info

Command elf-info

elf-info (alias elf) provides some basic information on the currently loaded ELF binary:

gef➤  elf
Magic                 : 7f 45 4c 46
Class                 : 0x2 - 64-bit
Endianness            : 0x1 - Little-Endian
Version               : 0x1
OS ABI                : 0x0 - System V
ABI Version           : 0x0
Type                  : 0x2 - Executable
Machine               : 0x3e - x86-64
Program Header Table  : 0x0000000000000040
Section Header Table  : 0x00000000000021a8
Header Table          : 0x0000000000000040
ELF Version           : 0x1
Header size           : 64 (0x40)
Entry point           : 0x0000000000400750

────────────────────────────────────────── Program Header ──────────────────────────────────────────
  [ #] Type           Offset Virtaddr Physaddr  FileSiz   MemSiz Flags    Align
  [ 0] PHDR             0x40 0x400040 0x400040    0x1f8    0x1f8 R-X        0x8
  [ 1] INTERP          0x238 0x400238 0x400238     0x1c     0x1c R--        0x1
  [ 2] LOAD              0x0 0x400000 0x400000   0x1414   0x1414 R-X   0x200000
  [ 3] LOAD           0x1e10 0x601e10 0x601e10    0x268    0x330 RW-   0x200000
  [ 4] DYNAMIC        0x1e28 0x601e28 0x601e28    0x1d0    0x1d0 RW-        0x8
  [ 5] NOTE            0x254 0x400254 0x400254     0x44     0x44 R--        0x4
  [ 6] GNU_EH_FLAME   0x11a0 0x4011a0 0x4011a0     0x74     0x74 R--        0x4
  [ 7] GNU_STACK         0x0      0x0      0x0      0x0      0x0 RW-       0x10
  [ 8] GNU_RELRO      0x1e10 0x601e10 0x601e10    0x1f0    0x1f0 R--        0x1

────────────────────────────────────────── Section Header ──────────────────────────────────────────
  [ #] Name                            Type  Address   Offset     Size   EntSiz Flags Link Info    Align
  [ 0]                                 NULL      0x0      0x0      0x0      0x0        0x0  0x0      0x0
  [ 1] .interp                     PROGBITS 0x400238    0x238     0x1c      0x0 A      0x0  0x0      0x1
  [ 2] .note.ABI-tag                   NOTE 0x400254    0x254     0x20      0x0 A      0x0  0x0      0x4
  [ 3] .note.gnu.build-id              NOTE 0x400274    0x274     0x24      0x0 A      0x0  0x0      0x4
  [ 4] .gnu.hash                   GNU_HASH 0x400298    0x298     0x30      0x0 A      0x5  0x0      0x8
  [ 5] .dynsym                       DYNSYM 0x4002c8    0x2c8    0x168     0x18 A      0x6  0x1      0x8
  [ 6] .dynstr                       STRTAB 0x400430    0x430     0x96      0x0 A      0x0  0x0      0x1
  [ 7] .gnu.version                    HIOS 0x4004c6    0x4c6     0x1e      0x2 A      0x5  0x0      0x2
  [ 8] .gnu.version_r           GNU_verneed 0x4004e8    0x4e8     0x30      0x0 A      0x6  0x1      0x8
  [ 9] .rela.dyn                       RELA 0x400518    0x518     0x60     0x18 A      0x5  0x0      0x8
  [10] .rela.plt                       RELA 0x400578    0x578     0xf0     0x18 AI     0x5 0x18      0x8
  [11] .init                       PROGBITS 0x400668    0x668     0x1a      0x0 AX     0x0  0x0      0x4
  [12] .plt                        PROGBITS 0x400690    0x690     0xb0     0x10 AX     0x0  0x0     0x10
  [13] .plt.got                    PROGBITS 0x400740    0x740      0x8      0x0 AX     0x0  0x0      0x8
  [14] .text                       PROGBITS 0x400750    0x750    0x842      0x0 AX     0x0  0x0     0x10
  [15] .fini                       PROGBITS 0x400f94    0xf94      0x9      0x0 AX     0x0  0x0      0x4
  [16] .rodata                     PROGBITS 0x400fa0    0xfa0    0x200      0x0 A      0x0  0x0      0x8
  [17] .eh_frame_hdr               PROGBITS 0x4011a0   0x11a0     0x74      0x0 A      0x0  0x0      0x4
  [18] .eh_frame                   PROGBITS 0x401218   0x1218    0x1fc      0x0 A      0x0  0x0      0x8
  [19] .init_array               INIT_ARRAY 0x601e10   0x1e10      0x8      0x0 WA     0x0  0x0      0x8
  [20] .fini_array               FINI_ARRAY 0x601e18   0x1e18      0x8      0x0 WA     0x0  0x0      0x8
  [21] .jcr                        PROGBITS 0x601e20   0x1e20      0x8      0x0 WA     0x0  0x0      0x8
  [22] .dynamic                     DYNAMIC 0x601e28   0x1e28    0x1d0     0x10 WA     0x6  0x0      0x8
  [23] .got                        PROGBITS 0x601ff8   0x1ff8      0x8      0x8 WA     0x0  0x0      0x8
  [24] .got.plt                    PROGBITS 0x602000   0x2000     0x68      0x8 WA     0x0  0x0      0x8
  [25] .data                       PROGBITS 0x602068   0x2068     0x10      0x0 WA     0x0  0x0      0x8
  [26] .bss                          NOBITS 0x602080   0x2078     0xc0      0x0 WA     0x0  0x0     0x20
  [27] .comment                    PROGBITS      0x0   0x2078     0x34      0x1 MS     0x0  0x0      0x1
  [28] .shstrtab                     STRTAB      0x0   0x20ac     0xfc      0x0        0x0  0x0      0x1

Optionally a filepath to another ELF binary can be provided to view the basic information for that binary instead.

gef➤ elf-info --filename /path/to/elf/executable