ELFIO - C++ ELF API

A powerful C++ API for creating and parsing Executable and Linking Format (ELF) files.

#include "elfio.hpp"

using namespace ELFIO;

int main() {
    elfio elf;
    elf.sections.push_back(new section(".text"));
    elf.sections.back()->add_entry(...);
}
                    

Why Use ELFIO?

Build robust applications that work directly with ELF binaries through modern C++

Core C++ Functionality

Native C++ implementation with full control over ELF structures, no bindings required

Flexible Architecture

Create, modify, and analyze ELF files as memory-mapped or in-memory formats

Full ELF Support

Complete support for 32- and 64-bit ELF files with full symbol table handling

Getting Started

elfio.cpp
#include "elfio.hpp"
#include 

using namespace ELFIO;

int main() {
    elfio elf;
    
    // Create an ELF object
    elf.create(ELFCLASS64);
    elf.set_os_abi(ELFOSABI_NONE);
    
    // Add a section
    section* text_section = elf.sections.add(new section(".text", SHT_PROGBITS));
    text_section->set_flags(SHF_ALLOC | SHF_EXECINSTR);
    
    // Write to a file
    if (elf.save("myfile.elf")) {
        std::cout << "ELF file created successfully!" << std::endl;
    } else {
        std::cerr << "Failed to create ELF file" << std::endl;
    }
    
    return 0;
}
                

Live Demo

Roadmap

v4.0 - 2025

Done
Modernization for C++20 features

Full C++17/20 compatibility with modern build systems

v4.1 - 2025 Q4

In Progress
ELF64 enhancements

Improved 64-bit format handling and tooling for large binaries

v5.0 - 2026

Planned
Cross Platform Tooling

Unified ELF tooling for Windows, macOS, and Linux

Join Our Community

GitHub Discussions

Ask questions, share projects, and get help from the ELFIO development team

Join Discussion

Stack Overflow

Find or post questions about C++, ELF format, and ELFIO implementation

View Questions

About ELFIO

ELFIO Team

ELFIO (ELF I/O) began as a C++ API in early 2000s to work with the ELF format. Through years of development and community contribution, it evolved into its current form with advanced features and cross-platform capabilities.

The project continues to be actively maintained with contributions from developers worldwide. ELFIO remains the go-to solution for working with ELF files in C++ environments.