Gravitational plate of three masses and a slashed discABC0Static engraved plate. Three-dimensional view is unavailable or reduced motion is requested.

← back to fieldarchive

archiveAug 16, 2020

Device Files Useful for ELF Analysis

Procfs and boot artifacts that help map process and kernel memory when reversing ELF binaries: maps, kcore, System.map, kallsyms, and iomem.

Device files

/proc//maps

  • Lists each memory mapping and the layout of the process image.
  • Covers the executable, shared libraries, stack, heap, VDSO, and more.
  • The fastest way to see how a process's address space is arranged.

./0.png
./0.png

/proc/kcore

  • A procfs entry that behaves like a live core file of the Linux kernel.
  • It is a raw memory dump in ELF core form, useful with GDB for kernel debugging and analysis.

/boot/System.map

  • Available on essentially every Linux distribution and useful for kernel work.
  • Holds symbols for the whole kernel.

/proc/kallsyms

  • Very close to System.map, except it is managed by the kernel and updated dynamically through a /proc entry.
  • Load a new LKM and its symbols show up in /proc/kallsyms right away.
  • It includes most symbols, and everything enabled by CONFIG_KALLSYMS_ALL.

./1.png
./1.png

/proc/iomem

  • Similar to /proc/<pid>/maps, but for system-wide physical memory.
  • To find where the kernel text segment sits in physical memory, search for Kernel and check the code/text, data, and bss ranges.

related

  1. Aug 16, 2020/archiveLinux Linker Environment Variables
  2. Aug 16, 2020/archiveELF file format
  3. Aug 16, 2020/archiveELF program headers

graphfeed