All Projects → finixbit → Elf Parser

finixbit / Elf Parser

Licence: mit
Lightweight elf binary parser with no external dependencies - Sections, Symbols, Relocations, Segments

Programming Languages

symbols
36 projects

Projects that are alternatives of or similar to Elf Parser

Lief
Authors
Stars: ✭ 2,730 (+1487.21%)
Mutual labels:  parser, elf
Vector
A reliable, high-performance tool for building observability data pipelines.
Stars: ✭ 8,736 (+4979.07%)
Mutual labels:  vector, parser
Sharpmath
A small .NET math library.
Stars: ✭ 36 (-79.07%)
Mutual labels:  vector, parser
Fasthash
Go package porting the standard hashing algorithms to a more efficient implementation.
Stars: ✭ 163 (-5.23%)
Mutual labels:  segment
Pegparser
💡 Build your own programming language! A C++17 PEG parser generator supporting parser combination, memoization, left-recursion and context-dependent grammars.
Stars: ✭ 164 (-4.65%)
Mutual labels:  parser
Xlsxir
Xlsx parser for the Elixir language.
Stars: ✭ 167 (-2.91%)
Mutual labels:  parser
Rvg
High level vulkan 2D vector-like graphics api (C++)
Stars: ✭ 171 (-0.58%)
Mutual labels:  vector
Npeg
PEGs for Nim, another take
Stars: ✭ 163 (-5.23%)
Mutual labels:  parser
Wiktextract
Wiktionary dump file parser and multilingual data extractor
Stars: ✭ 170 (-1.16%)
Mutual labels:  parser
Spypi
An (un-)ethical hacking-station based on Raspberry Pi and Python
Stars: ✭ 167 (-2.91%)
Mutual labels:  parser
Complex.js
A complex number library
Stars: ✭ 165 (-4.07%)
Mutual labels:  vector
Glidetovectoryou
Load SVGs in Android with Glide
Stars: ✭ 165 (-4.07%)
Mutual labels:  vector
Elf Dump Fix
Utils use to dump android ELF from memory and do some fix including the ELF section header rebuilding
Stars: ✭ 166 (-3.49%)
Mutual labels:  elf
Stats
Go package for abstracting stats collection
Stars: ✭ 164 (-4.65%)
Mutual labels:  segment
Mandibule
linux elf injector for x86 x86_64 arm arm64
Stars: ✭ 171 (-0.58%)
Mutual labels:  elf
Vue Styleguidist
Created from react styleguidist for Vue Components with a living style guide
Stars: ✭ 2,133 (+1140.12%)
Mutual labels:  parser
Wordvectors
Pre-trained word vectors of 30+ languages
Stars: ✭ 2,043 (+1087.79%)
Mutual labels:  vector
Php Mf2
php-mf2 is a pure, generic microformats-2 parser for PHP. It makes HTML as easy to consume as JSON.
Stars: ✭ 165 (-4.07%)
Mutual labels:  parser
Command Line Api
Command line parsing, invocation, and rendering of terminal output.
Stars: ✭ 2,418 (+1305.81%)
Mutual labels:  parser
Parser
A parsing library, focused on simplicity and great error messages
Stars: ✭ 167 (-2.91%)
Mutual labels:  parser

elf-parser

Lightweight elf binary parser with no external dependencies - Sections, Symbols, Relocations, Segments

Required libraries

No dependencies

Usage

Sections (readelf -S executable)

parse sections header table from elf binary and return vector of section_t below

typedef struct {
    int section_index = 0; 
    std::intptr_t section_offset, section_addr;
    std::string section_name;
    std::string section_type; 
    int section_size, section_ent_size, section_addr_align;
} section_t;

get elf sections using elf-parser

#include <elf-parser.h>
elf_parser::Elf_parser elf_parser(executable_path);
std::vector<elf_parser::section_t> secs = elf_parser.get_sections();

see example

Segments (readelf -l executable)

parse program header table from elf binary and return vector of segment_t below

typedef struct {
    std::string segment_type, segment_flags;
    long segment_offset, segment_virtaddr, segment_physaddr, segment_filesize, segment_memsize;
    int segment_align;
} segment_t;

get elf segments using elf-parser

#include <elf-parser.h>
elf_parser::Elf_parser elf_parser(executable_path);
std::vector<elf_parser::segment_t> segs = elf_parser.get_segments();

see example

Symbols (readelf -s executable)

parse symbols table from elf binary and return vector of symbol_t below

typedef struct {
    std::string symbol_index;
    std::intptr_t symbol_value;
    int symbol_num = 0, symbol_size = 0;
    std::string symbol_type, symbol_bind, symbol_visibility, symbol_name, symbol_section;      
} symbol_t;

get elf symbols using elf-parser

#include <elf-parser.h>
elf_parser::Elf_parser elf_parser(executable_path);
std::vector<elf_parser::symbol_t> syms = elf_parser.get_symbols();

see example

Relocations (readelf -r executable)

parse relocations with plt address from elf binary and return vector of relocation_t below

typedef struct {
    std::intptr_t relocation_offset, relocation_info, relocation_symbol_value;
    std::string   relocation_type, relocation_symbol_name, relocation_section_name;
    std::intptr_t relocation_plt_address;
} relocation_t;

get elf relocations using elf-parser

#include <elf-parser.h>
elf_parser::Elf_parser elf_parser(executable_path);
std::vector<elf_parser::relocation_t> relocs = elf_parser.get_relocations();

see example

Supported Architecture

amd64

Projects using elf-parser

finixbit / ltrace - Library call tracer

finixbit / ftrace - Function call tracer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].