All Projects → xoofx → Libobjectfile

xoofx / Libobjectfile

Licence: bsd-2-clause
LibObjectFile is a .NET library to read, manipulate and write linker and executable object files (e.g ELF, DWARF, ar...)

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Libobjectfile

dwex
DWARF Explorer - a GUI utility for navigating the DWARF debug information
Stars: ✭ 58 (-7.94%)
Mutual labels:  debugging, elf
ftrace
trace local function calls like strace and ltrace
Stars: ✭ 60 (-4.76%)
Mutual labels:  debugging, elf
Open C Book
开源书籍:《C语言编程透视》,配套视频课程《360° 剖析 Linux ELF》已上线,视频讲解更为系统和深入,欢迎订阅:https://www.cctalk.com/m/group/88089283
Stars: ✭ 715 (+1034.92%)
Mutual labels:  elf, debugging
Video Containers Debugging Tools
A set of command lines to debug video streaming files like mp4 (MPEG-4 Part 14), ts (MPEG-2 Part 1), fmp4 in Dash, HLS, or MSS, with or without DRM.
Stars: ✭ 27 (-57.14%)
Mutual labels:  debugging
Dbgbench.github.io
DBGBench Website:
Stars: ✭ 11 (-82.54%)
Mutual labels:  debugging
Pivirus
sample linux x86_64 ELF virus
Stars: ✭ 45 (-28.57%)
Mutual labels:  elf
Core
🌎 Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging.
Stars: ✭ 62 (-1.59%)
Mutual labels:  debugging
Epsagon Go
Automated tracing library for Go 1.x ⚡️
Stars: ✭ 24 (-61.9%)
Mutual labels:  debugging
Cargo With
A third-party cargo extension to run the build artifacts through tools like `gdb`
Stars: ✭ 53 (-15.87%)
Mutual labels:  debugging
Android Debug Database
A library for debugging android databases and shared preferences - Make Debugging Great Again
Stars: ✭ 7,946 (+12512.7%)
Mutual labels:  debugging
Bpf Map
Generic tool to inspect BPF maps
Stars: ✭ 38 (-39.68%)
Mutual labels:  debugging
Babel Plugin Debug Macros
Stars: ✭ 14 (-77.78%)
Mutual labels:  debugging
Power trace
Buff exception backtrace with local variables, passed in arguments and instance variables!
Stars: ✭ 48 (-23.81%)
Mutual labels:  debugging
Debug kit
Debug Toolbar for CakePHP applications.
Stars: ✭ 858 (+1261.9%)
Mutual labels:  debugging
Post Mortems
A collection of postmortems. Sorry for the delay in merging PRs!
Stars: ✭ 8,772 (+13823.81%)
Mutual labels:  debugging
Dpcwait
Driver demonstrating how to register a DPC to asynchronously wait on an object
Stars: ✭ 27 (-57.14%)
Mutual labels:  debugging
Utils
Docker image with tools like curl, wget, ping, nslookup, dig, psql etc.
Stars: ✭ 49 (-22.22%)
Mutual labels:  debugging
Bugsnag Android
Bugsnag crash monitoring and reporting tool for Android apps
Stars: ✭ 990 (+1471.43%)
Mutual labels:  debugging
Hmlldb
HMLLDB is a collection of LLDB commands to assist in the debugging of iOS apps.
Stars: ✭ 30 (-52.38%)
Mutual labels:  debugging
Lucid
A simple mock-application for programs that work with child processes
Stars: ✭ 45 (-28.57%)
Mutual labels:  debugging

LibObjectFile Build Status NuGet

LibObjectFile is a .NET library to read, manipulate and write linker and executable object files (e.g ELF, ar, DWARF, COFF...)

NOTE: Currently LibObjectFile supports only the following file format:

  • ELF object-file format
  • DWARF debugging format (version 4)
  • Archive ar file format (Common, GNU and BSD variants)

There is a longer term plan to support other file formats (e.g COFF, MACH-O, .lib) but as I don't have a need for them right now, it is left as an exercise for PR contributors! ;)

Usage

// Reads an ELF file
using var inStream = File.OpenRead("helloworld");
var elf = ElfObjectFile.Read(inStream);
foreach(var section in elf.Sections)
{
    Console.WriteLine(section.Name);
}
// Print the content of the ELF as readelf output
elf.Print(Console.Out);
// Write the ElfObjectFile to another file on the disk
using var outStream = File.OpenWrite("helloworld2");
elf.Write(outStream);

Features

  • Full support of Archive ar file format including Common, GNU and BSD variants.
  • Good support for the ELF file format:
    • Read and write from/to a System.IO.Stream
    • Handling of LSB/MSB
    • Support the following sections:
      • String Table
      • Symbol Table
      • Relocation Table: supported I386, X86_64, ARM and AARCH64 relocations (others can be exposed by adding some mappings)
      • Note Table
      • Other sections fallback to ElfCustomSection
    • Program headers with or without sections
    • Print with readelf similar output
  • Support for DWARF debugging format:
    • Partial support of Version 4 (currently still the default for GCC)
    • Support for the sections: .debug_info, .debug_line, .debug_aranges, .debug_abbrev and .debug_str
    • Support for Dwarf expressions
    • High level interface, automatic layout/offsets between sections.
    • Integration with ELF to support easy reading/writing back
    • Support for relocatable sections
  • Use of a Diagnostics API to validate file format (on read/before write)
  • Library requiring .NET netstandard2.1+ and compatible with netcoreapp3.0+

Documentation

The doc/readme.md explains how the library is designed and can be used.

Known Issues

PR Welcome if you are willing to contribute to one of these issues:

  • [ ] Add more unit tests

ELF

There are still a few missing implementation of ElfSection for completeness:

  • [ ] Dynamic Linking Table (SHT_DYNAMIC)
  • [ ] Version Symbol Table (SHT_VERSYM)
  • [ ] Version Needs Table (SHT_VERNEED)

These sections are currently loaded as ElfCustomSection but should have their own ElfXXXTable (e.g ElfDynamicLinkingTable, ElfVersionSymbolTable...)

DWARF

  • [ ] Version 4: support for .debug_types, .debug_frame, .debug_loc, .debug_ranges, .debug_pubnames, .debug_pubtypes, .debug_macinfo section
  • [ ] Version 5

Other file formats

In a future version I would like to implement the following file format:

  • [ ] COFF
  • [ ] Mach-O
  • [ ] Portable in Memory file format to easily convert between ELF/COFF/Mach-O file formats.

Download

LibObjectFile is available as a NuGet package: NuGet

Build

In order to build LibObjectFile, you need to have installed the .NET Core 3.0 SDK.

Running the tests require Ubuntu 18.04. dotnet test will work on Windows (via WSL) and on that version of Ubuntu. If you're using macOS or another Linux, there's a Dockerfile and a helper script under src to run tests in the right OS version.

License

This software is released under the BSD-Clause 2 license.

Author

Alexandre MUTEL aka xoofx

Supporters

Supports this project with a monthly donation and help me continue improving it. [Become a supporter]

bruno-garcia

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].