Giter Club home page Giter Club logo

elfo's Introduction

ELFO: A C-lang ELF Library Parser

An ELF parser library implemented in C.

Contents

Features

  • Efficient Parsing: Written in C for optimal performance and efficiency.
  • Versatility: Supports parsing ELF files, including executables and shared libraries.
  • Accessible Information: Extracts key information such as section headers, program headers, symbols, and more.
  • Integration-Friendly: Easily integrate the library into your projects for seamless ELF file analysis using CMakeLists

Usage

  1. Include the Library:
    #include "elfo.h"
    
    int fd = open("<bin.elf>", O_RDONLY);
    
    const Elf32_Ehdr eh;
    
    if (fd > 0)
    {
        read_elf_header(fd, &eh);
        
        if(is_elf(&eh))
        {
            assert(eh.e_entry == <0xaddr>);
            assert(is_elf_64(&eh) == true);
        }
        
        close(fd);
    }
    
    <...>

    Elf64_Ehdr eh_64;
    read_elf_header_64(fd, &eh_64);

    Elf64_Shdr *sh_64 = malloc(eh_64.e_shentsize * eh_64.e_shnum);

    read_section_header_table_64(fd, sh_64, eh_64);            

    free(sh_64);

Integration

Add the following entry to your CMakeLists.txt file:

add_subdirectory(<clone_path_to_elfo> build/elfo)

Ensure you customize <clone_path_to_elfo> to the appropriate path in your project structure.

Run Tests

To run the tests you need to enter the build/tests folder and then run it inside the ./elfotest folder, you can choose to build or test it or not in CMakeLists by setting BUILD_TESTS

elfo's People

Contributors

vitormob avatar

Stargazers

 avatar  avatar  avatar  avatar

Forkers

lucastracker

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.