ELFSharp

This is ELFSharp by Konrad KruczyƄski (and other authors), a C# library for reading ELF, UImage and Mach-O files. It is an open source software available on a permissive X11 license and hosted on GitHub. For obtaining the binary or getting the source code please visit the download page. You can learn how to use this library by visiting the examples section


News

2023-10-13

ELFSharp 2.17.3 released. Fixed magic value for the x64 BE Mach-O binary.

2023-06-14

ELFSharp 2.17.2 released. Fixed reading LC_UUID command.

2023-04-25

ELFSharp 2.17.1 released. Fixed another edge case regarding SHN_LORESERVE and string table index.

2023-04-03

ELFSharp 2.17 released. Added a command to parse LC_UUID and ability to get the UUID (for Mach-O files, obviously).

2023-01-11

ELFSharp 2.16.1 released. Fixes leaving open stream on ELF loading if it is owned and loading fails.

2022-12-04

ELFSharp 2.16 released. Adds support for multi-file uImage binaries, popular solution for joining e.g. Linux kernel and an FDT describing platform.

2022-11-14

ELFSharp 2.15.2 released. Fixes a bug in which an ELF binary with sections count greater than SHN_LORESERVE and containg string table could not be read.

2022-11-12

ELFSharp 2.15.1 released. Fixes a bug in which number of sections in ELF file was incorrectly read in case it was larger than SHN_LORESERVE.

2022-04-11

ELFSharp 2.15 released. Multiple notes are now available in the NoteSegment. First note is still available via old API for backwards compatibility.

2022-04-08

ELFSharp 2.14 released. Fixes the bug of incorrect interpretation of the value of shouldOwnStream parameter in Mach-O binaries. Also adds useful constraint on what is expected from GetCommandsOfType<T> (commands, naturally) and Mach-O symbol now knows to which section it belongs.

2022-02-17

ELFSharp 2.13.3 released. This is just a technical release, since the binaries are identical. The only difference is in the package itself, now having proper license keyword.

2021-11-10

ELFSharp 2.13.2 released. Fixed a bug when reading a NOBITS ELF section.

2021-11-02

ELFSharp 2.13.1 released. Fixed a bug when 64-bit big-endian Mach-O files were treated as 32-bit.

2021-07-20

ELFSharp 2.13 released. Added Mach-O file flags.

2021-06-21

ELFSharp 2.12.1 released. Fixes a InvalidOperationException when parsing intermediate object file.

2021-03-21

The ELFSharp webpage is now statically generated using Statiq.Web, all subpages should be working fine now (previously only the news page was available).

2020-12-18

ELFSharp 2.12 released. Four new MachO commands are now available: LC_ID_DYLIB, LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB and LC_REEXPORT_DYLIB. Also a CHANGELOG file was introduced, documenting all the changes using the format based on Keep a changelog.

2020-05-31

ELFSharp 2.11.0 released. Fat Mach-O binaries are handled from now.

2020-05-17

ELFSharp 2.10.0 released. The library now provides symbol visibility in symbol table.

2020-05-02

ELFSharp 2.9.0 released. The library now supports big endian Mach-O files.

2020-04-19

ELFSharp 2.8.1 released. Offset parsing issue in MachO is now fixed, also data type of some properties was changed to a proper (unsigned) one.

2020-04-11

ELFSharp 2.8.0 released. NOTE segment is now handled by the library. This is a different animal than NOTE section, altough having the same internal structure.

2020-04-04

ELFSharp 2.7.0 released. Now stream overleads are available also for Mach-O and UImage.

2020-03-29

ELFSharp 2.6.1 released. This fixes a regression that happened during addition of stream reading feature. It resulted in corrupted contents of the sections and should now be fixed.

2020-03-21

ELFSharp 2.6.0 released. The library now targets .NET Standard 2.0 only.

2020-03-16

ELFSharp 2.5.0 released. Properties Sections and Segments are now of type IReadOnlyList<T> (instead of the previously used IEnumerable<T>), so that one can easily check their count or access them by a numeric index.

2020-02-15

ELFSharp 2.4.0 released. ELFReader now offers new overloads that let you read ELF directly from stream, instead from a file only. Therefore one is able to use e.g. MemoryStream directly. Note that the stream have to be seekable in order to be properly read.

2020-02-02

ELFSharp 2.3.0 released. Basic .dynamic section parsing was added.

2019-12-08

ELFSharp 2.2.1 released. This version is able to open files with a dynamic string table being a NOBITS section. I wasn't able to find a part of the ELF specification that allows that, but apparently such binaries exists in the wild.

2019-08-15

ELFSharp 2.2 released. This version is able to silently ignore non-conforming note section.

2018-10-27

ELFSharp 2.1.1 released. This release fixes getting memory contents of a segment when memory size is greater than file size.

2018-05-19

ulong instead of long is now used as a generic type for 64-bit ELF files, which resolves a bug. This is, however, an API breaking change so - according to semantic versioning - I have to bump the major version number. ELFSharp 2.0 is therefore released.

2018-03-18

ELFSharp 1.3 released. With this version, when getting segment contents, you should use one of the two new functions, to get either contents as it was written in the file, or as it should be loaded into memory. Old function is still there and works, but since its name is now misleading, it was turned obsolete.

2018-02-10

ELFSharp 1.2 is the first version that does not use MiscUtil internally.

2018-01-21

ELFSharp is now a .NET Standard 2.0 library. Also tests were updated and they are again available in the main repository. This is released on NuGet - version 1.1. Also - because of that - MiscUtil parts are directly embedded as it used to be some time ago (no MiscUtil for .NET Standard 2.0), but I plan to rewrite endianess related parts of the code, so they should soon be removed from the project.

2016-11-06

The offset of a segment is now public.

2016-06-06

Strongly named assembly is now available.

2016-04-30

New version of ELFSharp is available. From this version on I will not longer offer a binary to download. This is because I removed inlined MiscUtil library sources in favor of having the library as a NuGet dependency. I've also started using different pattern of versioning. Last but not least - basic Mach-O support is now there. Enjoy!

2015-03-13

New ELFSharp available, with some fixes regarding strings handling (we use UTF-8 now).

2014-12-05

New version of ELFSharp available, with a method to try getting section and some fixes. You can also get it from NuGet.

2013-12-03

New version of ELFSharp, with UImage support! 0.0.10 is already available for download, I'll soon put it on nuget gallery.

2013-08-29

New version of ELFSharp released, namely 0.0.9. Bug fixes, tests fixed and new API for testing whether file is an ELF (and of which class) file added.

2013-03-08

New release with examples upgraded.

2012-05-23

ELFSharp is now available as a package on nuget.org with the (not surprising) id ELFSharp.

2012-05-15

The new version of ELFSharp (0.0.5, precisely speaking) was just released. There was some cleanup in code, minor fixes, but, what is most important, two subnamespaces were introduced: Sections and Segments. Their purpose should be self describing ;)

2012-04-21

Some new stuff:

2011-10-23

ELFSharp can be now used to read the NOTE section.

2011-10-09

Today's release contains some important bug fixes. Also missing fields for section and program header were added.

2011-09-25

Library is now able to explore 64-bit ELFs. Enjoy!

2011-09-14

Using the library, you can now explore program headers and get program images from file.

2011-09-07

The library should now work properly with non-native endianess (which usually means big endian).

2011-09-06

The library development has just started and an initial push was made to GitHub.