{"id":18339005,"url":"https://github.com/xoofx/libobjectfile","last_synced_at":"2025-05-16T02:08:56.937Z","repository":{"id":55906098,"uuid":"222077969","full_name":"xoofx/LibObjectFile","owner":"xoofx","description":"LibObjectFile is a .NET library to read, manipulate and write linker and executable object files (e.g ELF, PE, DWARF, ar...)","archived":false,"fork":false,"pushed_at":"2024-10-15T20:36:58.000Z","size":3269,"stargazers_count":162,"open_issues_count":10,"forks_count":11,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-01T11:05:50.689Z","etag":null,"topics":["csharp","debugging","dotnet","dwarf","elf","elf-parser","linker","pe-file"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xoofx.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["xoofx"]}},"created_at":"2019-11-16T09:45:58.000Z","updated_at":"2025-03-13T23:59:15.000Z","dependencies_parsed_at":"2023-12-09T07:26:18.700Z","dependency_job_id":"ac222c8c-8e86-4173-8dc3-8f9d881dc245","html_url":"https://github.com/xoofx/LibObjectFile","commit_stats":{"total_commits":171,"total_committers":5,"mean_commits":34.2,"dds":0.08187134502923976,"last_synced_commit":"dcf2ac5bd79953a54ad1fb8c1ca3627616bdf58f"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2FLibObjectFile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2FLibObjectFile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2FLibObjectFile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2FLibObjectFile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xoofx","download_url":"https://codeload.github.com/xoofx/LibObjectFile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247847609,"owners_count":21006099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","debugging","dotnet","dwarf","elf","elf-parser","linker","pe-file"],"created_at":"2024-11-05T20:16:12.040Z","updated_at":"2025-04-08T13:05:44.850Z","avatar_url":"https://github.com/xoofx.png","language":"C#","funding_links":["https://github.com/sponsors/xoofx"],"categories":[],"sub_categories":[],"readme":"# LibObjectFile [![ci](https://github.com/xoofx/LibObjectFile/actions/workflows/CI.yml/badge.svg)](https://github.com/xoofx/LibObjectFile/actions/workflows/CI.yml) [![NuGet](https://img.shields.io/nuget/v/LibObjectFile.svg)](https://www.nuget.org/packages/LibObjectFile/)\n\n\u003cimg align=\"right\" width=\"200px\" height=\"200px\" src=\"https://raw.githubusercontent.com/xoofx/LibObjectFile/master/img/libobjectfile.png\"\u003e\n\nLibObjectFile is a .NET library to read, manipulate and write linker and executable object files (e.g ELF, ar, DWARF, PE...)\n\n\u003e NOTE: Currently LibObjectFile supports the following file format:\n\u003e\n\u003e - **PE** image file format (Portable Executable / DLL)\n\u003e - **ELF** object-file format\n\u003e - **DWARF** debugging format (version 4)\n\u003e - **Archive `ar`** file format (Common, GNU and BSD variants)\n\u003e\n\u003e There is a longer term plan to support other file formats (e.g COFF, MACH-O, .lib) but as I don't \n\u003e have a need for them right now, it is left as an exercise for PR contributors! ;)\n\n## Usage\n\n```C#\n// Reads an ELF file\nusing var inStream = File.OpenRead(\"helloworld\");\nvar elf = ElfFile.Read(inStream);\nforeach(var section in elf.Sections)\n{\n    Console.WriteLine(section.Name);\n}\n// Print the content of the ELF as readelf output\nelf.Print(Console.Out);\n// Write the ElfFile to another file on the disk\nusing var outStream = File.OpenWrite(\"helloworld2\");\nelf.Write(outStream);\n```\n\n## Features\n- Full support of **Archive `ar` file format** including Common, GNU and BSD variants.\n- Full support for the **PE file format**\n  - Support byte-to-byte roundtrip\n  - Read and write from/to a `System.IO.Stream`\n  - All PE Directories are supported\n  - `PEFile.Relocate` to relocate the image base of a PE file\n  - `PEFile.Print` to print the content of a PE file to a textual representation\n  - Support for calculating the checksum of a PE file\n- Good support for the **ELF file format**:\n  - Support byte-to-byte roundtrip\n  - Read and write from/to a `System.IO.Stream`\n  - Handling of LSB/MSB\n  - Support the following sections: \n    - String Table\n    - Symbol Table\n    - Relocation Table: supported I386, X86_64, ARM and AARCH64 relocations (others can be exposed by adding some mappings)\n    - Note Table\n    - Other sections fallback to `ElfCustomSection`\n  - Program headers with or without sections\n  - Print with `readelf` similar output\n- Support for **DWARF debugging format**:\n  - Partial support of Version 4 (currently still the default for GCC)\n  - Support for the sections: `.debug_info`, `.debug_line`, `.debug_aranges`, `.debug_abbrev` and `.debug_str` \n  - Support for Dwarf expressions\n  - High level interface, automatic layout/offsets between sections.\n  - Integration with ELF to support easy reading/writing back\n  - Support for relocatable sections\n- Use of a Diagnostics API to validate file format (on read/before write)\n- Library requiring `net8.0`\n    - If you are looking for `netstandard2.1` support you will need to use `0.4.0` version\n\n## Documentation\n\nThe [doc/readme.md](doc/readme.md) explains how the library is designed and can be used.\n\n## Download\n\nLibObjectFile is available as a NuGet package: [![NuGet](https://img.shields.io/nuget/v/LibObjectFile.svg)](https://www.nuget.org/packages/LibObjectFile/)\n\n## Build\n\nIn order to build LibObjectFile, you need to have installed the [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download).\n\nRunning the tests require Ubuntu 22.04. `dotnet test` will work on Windows (via WSL) and on that version of Ubuntu.\nIf 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.\n\n## License\n\nThis software is released under the [BSD-Clause 2 license](https://github.com/xoofx/LibObjectFile/blob/master/license.txt).\n\n## Author\n\nAlexandre MUTEL aka [xoofx](https://xoofx.github.io)\n\n## Supporters\n\nSupports this project with a monthly donation and help me continue improving it. \\[[Become a supporter](https://github.com/sponsors/xoofx)\\]\n\n[\u003cimg src=\"https://github.com/bruno-garcia.png?size=200\" width=\"64px;\" style=\"border-radius: 50%\" alt=\"bruno-garcia\"/\u003e](https://github.com/bruno-garcia)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxoofx%2Flibobjectfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxoofx%2Flibobjectfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxoofx%2Flibobjectfile/lists"}