DEV Community

Georgy Grigoriev
Georgy Grigoriev

Posted on

libMiniELF 1.0 — minimal ELF64 parser for C++ now stable

A while ago I wrote about building a minimal ELF64 parser from scratch — mostly because I didn’t want to bring libelf or GPL into a tiny tool. That post explored the motivation behind the project and the early steps of parsing ELF headers by hand.

Now, that project — libMiniELF — has reached version 1.0.0.


What it does

libMiniELF is a lightweight C++17 library for reading ELF64 files. It provides:

  • Parsing of ELF headers, section headers, and symbols
  • Address-to-symbol resolution (exact and nearest match)
  • A small CLI tool dump_elf for inspection
  • MIT license, zero dependencies

The goal isn’t to replicate the full power of libelf, but to provide a clean and embeddable core for system-level tools, profilers, and static analysis utilities.


Why I built it

I needed a fast, dependency-free way to:

  • Extract symbol names from binaries
  • Map instruction pointers to function names
  • Walk ELF structures for tooling purposes

Most existing solutions were either too heavy, too tied to GPL, or over-engineered for what I needed. So I wrote my own.


What’s changed since the early post

  • Fully working CLI interface: dump_elf <binary> with multiple subcommands
  • Accurate symbol parsing, including main and nearest resolution
  • Section offset lookup with binary search
  • Clean and tested C++17 API
  • Versioned releases starting with 1.0.0

What’s next

  • DWARF support in a separate library (libTinyDWARF)
  • Stack snapshot + function name resolution
  • Integration with real-time visualization tools
  • More examples and documentation

Link

GitHub: trianmon/libMiniELF

If you're working on binary inspection, trace tools, or just like lean C++ code — feedback is welcome!

Top comments (0)