PackageTrack
Sign in Get early access

elf

A pure-rust library for parsing ELF files

0.8.0 11M downloads/mo #3036 most downloaded on crates.io cole14/rust-elf

What this package is like to depend on

Last release 1 years ago

14 May 2025

Ships unpredictably

gaps range from 8 days to 6.0 years

Some releases are documented

notes for 12 of 26 stable releases

Nothing withdrawn

no release was ever pulled

12 years old

26 releases · first in 2015

0 releases in the last 12 months

see the full history below

Release timeline

26 releases · Jan 2015 to May 2025
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 26
  1. 0.8.0 14 May 2025
    Release notes

    0.8.0 - 2025-05-13

    Breaking Improvements

    • Drop "nightly" feature in favor of stabilized core::error::Error for ParseError when building for no_std. This bumps the MSRV to 1.81.0 (Sept. 5, 2024).
    • Change dyn.d_val() and dyn.d_ptr() to take self by ref
    • Relax NoteAny parsing to allow notes with names that contain invalid utf8 sequences

    New Features

    • Add ElfStream::segment_data() to get raw segment data
    • Add ABI constants for MIPS
    • Drop "nightly" feature in favor of stabilized core::error::Error for ParseError when building for no_std
    • Add EM_CSKY, EM_LOONGARCH EM_FRV, EM_LANAI, and EM_VE
    • Make to_str no_std compatible
    • Make Symbol fields st_info and st_other fully public
    • Add NoteAny::name_str() helper to parse the note name as valid UTF8

    Bug Fixes

    • Update e_machine_to_str to return proper value for EM_RISCV
    • Various docstring fixes
    Open source →
    Release notes

    Breaking Improvements

    • Drop "nightly" feature in favor of stabilized core::error::Error for ParseError when building for no_std. This bumps the MSRV to 1.81.0 (Sept. 5, 2024).
    • Change dyn.d_val() and dyn.d_ptr() to take self by ref
    • Relax NoteAny parsing to allow notes with names that contain invalid utf8 sequences

    New Features

    • Add ElfStream::segment_data() to get raw segment data
    • Add ABI constants for MIPS
    • Drop "nightly" feature in favor of stabilized core::error::Error for ParseError when building for no_std
    • Add EM_CSKY, EM_LOONGARCH EM_FRV, EM_LANAI, and EM_VE
    • Make to_str no_std compatible
    • Make Symbol fields st_info and st_other fully public
    • Add NoteAny::name_str() helper to parse the note name as valid UTF8

    Bug Fixes

    • Update e_machine_to_str to return proper value for EM_RISCV
    • Various docstring fixes
    Open source →
  2. 0.7.4 22 Nov 2023
    Release notes

    [0.7.4] - 2023-11-22

    Bug Fixes

    • Fix note parsing for notes with n_namesz == (align * x + 1)
    Open source →
    Release notes

    Bug Fixes

    • Fix note parsing for notes with n_namesz == (align * x + 1)
    Open source →
  3. 0.7.3 09 Oct 2023
    Release notes

    [0.7.3] - 2023-10-09

    New Features

    • Derive Debug on LittleEndian and BigEndian

    Misc Improvements

    • Enable #![forbid(unsafe_code)]
    • Enable #![deny(missing_debug_implementations)]
    • Enable #![warn(rust_2018_idioms)]
    • Fix doc comment on file::Class
    • Fix README example so it compiles
    Open source →
    Release notes

    New Features

    • Derive Debug on LittleEndian and BigEndian

    Misc Improvements

    • Enable #![forbid(unsafe_code)]
    • Enable #![deny(missing_debug_implementations)]
    • Enable #![warn(rust_2018_idioms)]
    • Fix doc comment on file::Class
    • Fix README example so it compiles
    Open source →
  4. 0.7.2 15 Feb 2023
    Release notes

    [0.7.2] - 2023-02-15

    New Features

    • Implement core::error::Error for ParsingError accessible via a new non-default "nightly" cargo feature
    • Add abi constants for note descriptor types (n_type)
    • Add C-style struct definitions for various abi structs (Elf[32|64]_Ehdr etc). These aren't used by the parser, but are useful definitions for folks wanting to manually muck with elf bytes.

    Bug Fixes

    • Fix an 'attempt to shift right with overflow' panic in the GnuHashTable if nshift is wider than the bloom filter word size

    Misc Improvements

    • Add doc comments for EM_* abi constants
    • Tweak formatting and update language for various doc comments
    Open source →
    Release notes

    New Features

    • Implement core::error::Error for ParsingError accessible via a new non-default "nightly" cargo feature
    • Add abi constants for note descriptor types (n_type)
    • Add C-style struct definitions for various abi structs (Elf[32|64]_Ehdr etc). These aren't used by the parser, but are useful definitions for folks wanting to manually muck with elf bytes.

    Bug Fixes

    • Fix an 'attempt to shift right with overflow' panic in the GnuHashTable if nshift is wider than the bloom filter word size

    Misc Improvements

    • Add doc comments for EM_* abi constants
    • Tweak formatting and update language for various doc comments
    Open source →
  5. 0.7.1 08 Jan 2023
    Release notes

    [0.7.1] - 2023-01-08

    Bug Fixes

    Fix a divide by zero panic in GnuHashTable.find() for tables with nbloom = 0
    
    Open source →
    Release notes

    Bug Fixes

    • Fix a divide by zero panic in GnuHashTable.find() for tables with nbloom = 0
    Open source →
  6. 0.7.0 14 Nov 2022
    Release notes

    [0.7.0] - 2022-11-14

    New Features

    Add new ElfBytes type with better ergonomics for parsing from a &[u8]
    Add GnuHashTable which interprets the contents of a SHT_GNU_HASH section
    Add convenience method section_header_by_name to ElfBytes and ElfStream
    Add GnuBuildIdNote and parsing for NT_GNU_BUILD_ID note contents
    Add GnuAbiTagNote and parsing for NT_GNU_ABI_TAG note contents
    Add ElfBytes::symbol_version_table() to get the GNU extension symbol version table.
    Add ElfBytes::find_common_data() to efficiently discover common ELF structures
    Add a new endian-aware integer parsing trait impl
    Add ParsingTable.is_empty()
    Add abi constants for powerpc and powerpc64
    Add abi constants for RISC-V
    Add abi constants for x86_64
    Add abi constants for ARM32 and ARM64 (AARCH64)
    Add abi constant for GNU-extension ELF note name ELF_NOTE_GNU
    Add abi constant for PT_GNU_PROPERTY
    Add abi constants for SHN_ABS and SHN_COMMON
    Add elf::to_str::d_tag_to_str()
    Add elf::to_str::note_abi_tag_os_to_str()
    

    Changed Interfaces

    Rename elf::File -> elf::ElfStream and make it specific to the Read + Seek interface
    Rename gabi -> abi since it also includes extension constants
    Make ELF structures generic across the new endian-aware integer parsing trait EndianParse
    Refactor parsed Note type to be a typed enum
    Rename ElfStream::dynamic_section() -> dynamic() to match ElfBytes
    Change ElfStream::dynamic() to yield a DynamicTable just like in ElfBytes
    Standardize ElfBytes' interfaces for the .dynamic contents to return a DynamicTable
    Export the parsing utilities ParsingTable, ParsingIterator in the public interface
    Refactor section_headers_with_strtab to work with files that have shdrs but no shstrtab
    Remove redundant hash arg from SysVHashTable.find()
    Expose Class in the public interface alongside FileHeader
    Remove opinionated Display impl for file::Class
    Remove section_data_as_symbol_table() from public ElfBytes interface
    Change SymbolVersionTable::new() to take Options instead of Default-empty iterators
    Change ElfStream to parse out the ProgramHeaders into an allocated vec as part of ElfStream::open_stream()
    Change ElfStream to parse out the SectionHeaders into an allocated Vec as part of ElfStream::open_stream()
    

    Bug Fixes

    Properly parse program header table when ehdr.e_phnum > 0xffff
    Fix OOM in ElfStream parsing when parsing corrupted files
    Fix a divide by zero panic in SysVHashTable.find() for empty tables
    

    Misc Improvements

    Add more fuzz testing
    Add some simple parsing smoke tests for the various sample architecture objects
    Add sample object and testing with > 0xff00 section headers
    Add a lot more doc comments to each of the modules
    
    Open source →
    Release notes

    New Features

    • Add new ElfBytes type with better ergonomics for parsing from a &[u8]
    • Add GnuHashTable which interprets the contents of a SHT_GNU_HASH section
    • Add convenience method section_header_by_name to ElfBytes and ElfStream
    • Add GnuBuildIdNote and parsing for NT_GNU_BUILD_ID note contents
    • Add GnuAbiTagNote and parsing for NT_GNU_ABI_TAG note contents
    • Add ElfBytes::symbol_version_table() to get the GNU extension symbol version table.
    • Add ElfBytes::find_common_data() to efficiently discover common ELF structures
    • Add a new endian-aware integer parsing trait impl
    • Add ParsingTable.is_empty()
    • Add abi constants for powerpc and powerpc64
    • Add abi constants for RISC-V
    • Add abi constants for x86_64
    • Add abi constants for ARM32 and ARM64 (AARCH64)
    • Add abi constant for GNU-extension ELF note name ELF_NOTE_GNU
    • Add abi constant for PT_GNU_PROPERTY
    • Add abi constants for SHN_ABS and SHN_COMMON
    • Add elf::to_str::d_tag_to_str()
    • Add elf::to_str::note_abi_tag_os_to_str()

    Changed Interfaces

    • Rename elf::File -> elf::ElfStream and make it specific to the Read + Seek interface
    • Rename gabi -> abi since it also includes extension constants
    • Make ELF structures generic across the new endian-aware integer parsing trait EndianParse
    • Refactor parsed Note type to be a typed enum
    • Rename ElfStream::dynamic_section() -> dynamic() to match ElfBytes
    • Change ElfStream::dynamic() to yield a DynamicTable just like in ElfBytes
    • Standardize ElfBytes' interfaces for the .dynamic contents to return a DynamicTable
    • Export the parsing utilities ParsingTable, ParsingIterator in the public interface
    • Refactor section_headers_with_strtab to work with files that have shdrs but no shstrtab
    • Remove redundant hash arg from SysVHashTable.find()
    • Expose Class in the public interface alongside FileHeader
    • Remove opinionated Display impl for file::Class
    • Remove section_data_as_symbol_table() from public ElfBytes interface
    • Change SymbolVersionTable::new() to take Options instead of Default-empty iterators
    • Change ElfStream to parse out the ProgramHeaders into an allocated vec as part of ElfStream::open_stream()
    • Change ElfStream to parse out the SectionHeaders into an allocated Vec as part of ElfStream::open_stream()

    Bug Fixes

    • Properly parse program header table when ehdr.e_phnum > 0xffff
    • Fix OOM in ElfStream parsing when parsing corrupted files
    • Fix a divide by zero panic in SysVHashTable.find() for empty tables

    Misc Improvements

    • Add more fuzz testing
    • Add some simple parsing smoke tests for the various sample architecture objects
    • Add sample object and testing with > 0xff00 section headers
    • Add a lot more doc comments to each of the modules
    Open source →
  7. 0.6.1 05 Nov 2022
    Release notes

    [0.6.1] - 2022-11-05

    New Features

    Expose Class and Endian in the public interface. These types are exposed in the FileHeader type and so they should also be accessible for users to inspect.
    
    Open source →
    Release notes

    New Features

    • Expose Class and Endian in the public interface. These types are exposed in the FileHeader type and so they should also be accessible for users to inspect.
    Open source →
  8. 0.6.0 01 Nov 2022
    Release notes

    [0.6.0] - 2022-11-01

    New Features

    Add fuzz targets for parts of our ELF parsing interface via cargo-fuzz
    Add SysVHashTable which interprets the contents of a SHT_HASH section
    Add StringTable::get_raw() to get an uninterpreted &[u8]
    Add ParsingTable.len() method to get the number of elements in the table
    Add some note n_type constants for GNU extension notes.
    Add default "to_str" feature to get &str for gabi constant names
    

    Changed Interfaces

    Change File::segments() to return a ParsingTable instead of just a ParsingIterator
    Change File's SectionHeader interfaces to provide a ParsingTable instead of just a ParsingIterator
    Remove deprecated File::section_data_for_header() in favor of File::section_data()
    Remove FileHeader wrapper types OSABI, Architecture, and ObjectFileType
    Remove ProgramHeader wrapper types ProgType and ProgFlag
    Remove Symbol wrapper types SymbolType SymbolBind SymbolVis
    Remove wrapper type SectionType
    Remove unhelpful SectionFlag wrapper type
    Remove Display impl for FileHeader, SectionHeader, ProgramHeader, Symbol
    Remove ParseError::UnsupportedElfVersion in favor of more general ParseError::UnsupportedVersion
    

    Bug Fixes

    Fix divide by zero panic when parsing a note with alignment of 0 (Error instead of panic)
    Use checked integer math all over the parsing code (Error instead of panic or overflow)
    Fix note parsing for 8-byte aligned .note.gnu.property sections (Successfully parse instead of Erroring)
    Add size validation when parsing tables with entsizes (Error instead of panic)
    
    Open source →
    Release notes

    New Features

    • Add fuzz targets for parts of our ELF parsing interface via cargo-fuzz
    • Add SysVHashTable which interprets the contents of a SHT_HASH section
    • Add StringTable::get_raw() to get an uninterpreted &[u8]
    • Add ParsingTable.len() method to get the number of elements in the table
    • Add some note n_type constants for GNU extension notes.
    • Add default "to_str" feature to get &str for gabi constant names

    Changed Interfaces

    • Change File::segments() to return a ParsingTable instead of just a ParsingIterator
    • Change File's SectionHeader interfaces to provide a ParsingTable instead of just a ParsingIterator
    • Remove deprecated File::section_data_for_header() in favor of File::section_data()
    • Remove FileHeader wrapper types OSABI, Architecture, and ObjectFileType
    • Remove ProgramHeader wrapper types ProgType and ProgFlag
    • Remove Symbol wrapper types SymbolType SymbolBind SymbolVis
    • Remove wrapper type SectionType
    • Remove unhelpful SectionFlag wrapper type
    • Remove Display impl for FileHeader, SectionHeader, ProgramHeader, Symbol
    • Remove ParseError::UnsupportedElfVersion in favor of more general ParseError::UnsupportedVersion

    Bug Fixes

    • Fix divide by zero panic when parsing a note with alignment of 0 (Error instead of panic)
    • Use checked integer math all over the parsing code (Error instead of panic or overflow)
    • Fix note parsing for 8-byte aligned .note.gnu.property sections (Successfully parse instead of Erroring)
    • Add size validation when parsing tables with entsizes (Error instead of panic)
    Open source →
  9. 0.5.0 30 Oct 2022
    Release notes

    [0.5.0] - 2022-10-30

    New Features

    Add File::symbol_version_table() interface to get the GNU extension symbol versioning table
    Add Symbol.is_undefined() helper to check if a symbol is defined in this object
    Add File::section_data() which opportunistically parses the CompressionHeader if present
    

    Bug Fixes

    Fix StringTable to return a ParseError on index out of bounds instead of panicking
    Fix File::section_data_as_rels to properly parse Rels (not Relas)
    
    Open source →
    Release notes

    New Features

    • Add File::symbol_version_table() interface to get the GNU extension symbol versioning table
    • Add Symbol.is_undefined() helper to check if a symbol is defined in this object
    • Add File::section_data() which opportunistically parses the CompressionHeader if present

    Bug Fixes

    • Fix StringTable to return a ParseError on index out of bounds instead of panicking
    • Fix File::section_data_as_rels to properly parse Rels (not Relas)
    Open source →
  10. 0.4.0 24 Oct 2022
    Release notes

    Bump crate version to v0.4.0

    Open source →
    Release notes

    New Features

    • Add .note section and segment parsing
    • Add .dynamic section and segment parsing
    • Add .rel and .rela section parsing
    • Add File::section_headers_with_strtab to get both a header iter and strtab concurrently.

    Changed Interfaces

    • The ReadBytesAt trait was changed to be implemented for an owned CachedReadBytes. This means that File::open_stream now expects to move-own the CachedReadBytes as opposed to taking a mutable reference.
    Open source →
  11. 0.3.1 21 Oct 2022
    Release notes

    New Features

    • Add File::section_data_for_header() to get raw section data for a given section

    Bug fixes

    • Fix section header table parsing when ehdr.e_shnum > 0xff00
    Open source →
  12. 0.3.0 21 Oct 2022
    Release notes

    New Features

    • Add a no_std option by fully moving the parser over to lazy zero-alloc parsing patterns.

    <!-- next-url --> [0.8.0]: https://github.com/cole14/rust-elf/compare/v0.7.4...v0.8.0 [0.7.4]: https://github.com/cole14/rust-elf/compare/v0.7.3...v0.7.4 [0.7.3]: https://github.com/cole14/rust-elf/compare/v0.7.2...v0.7.3 [0.7.2]: https://github.com/cole14/rust-elf/compare/v0.7.1...v0.7.2 [0.7.1]: https://github.com/cole14/rust-elf/compare/v0.7.0...v0.7.1 [0.7.0]: https://github.com/cole14/rust-elf/compare/v0.6.1...v0.7.0 [0.6.1]: https://github.com/cole14/rust-elf/compare/v0.6.0...v0.6.1 [0.6.0]: https://github.com/cole14/rust-elf/compare/v0.5.0...v0.6.0 [0.5.0]: https://github.com/cole14/rust-elf/compare/v0.4.0...v0.5.0 [0.4.0]: https://github.com/cole14/rust-elf/compare/v0.3.1...v0.4.0 [0.3.1]: https://github.com/cole14/rust-elf/compare/v0.3.0...v0.3.1 [0.3.0]: https://github.com/cole14/rust-elf/compare/v0.2.0...v0.3.0

    Open source →
  13. 0.2.0 20 Oct 2022

    Nothing published for this version

  14. 0.1.0 13 Oct 2022

    Nothing published for this version

  15. 0.0.12 04 Oct 2022

    Nothing published for this version

  16. 0.0.11 03 Oct 2022

    Nothing published for this version

  17. 0.0.10 23 Sep 2016

    Nothing published for this version

  18. 0.0.9 21 Apr 2016

    Nothing published for this version

  19. 0.0.8 06 Apr 2016

    Nothing published for this version

  20. 0.0.7 05 Apr 2016

    Nothing published for this version

  21. 0.0.6 12 Jan 2016

    Nothing published for this version

  22. 0.0.5 24 Jul 2015

    Nothing published for this version

  23. 0.0.4 04 Feb 2015

    Nothing published for this version

  24. 0.0.3 01 Feb 2015

    Nothing published for this version

  25. 0.0.2 29 Jan 2015

    Nothing published for this version

  26. 0.0.1 27 Jan 2015

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive