dart_elf 2.0.0
dart_elf: ^2.0.0 copied to clipboard
A pure Dart library for parsing ELF binaries. Useful for writing emulators etc.
2.0.0 #
Hardening release. Malformed input is rejected with a contextual exception rather than producing garbage values or unbounded work.
Breaking #
- Malformed files throw
ElfFormatExceptioninstead ofStateError,RangeError, or integer division errors. - Reads past the end of a buffer throw instead of yielding
0xfffilled values, andseekrejects out of range offsets instead of clamping. ElfStringTable.atis bounded by the table size, and throws on an out of range offset or an unterminated string.ElfReader.sectionsandElfReader.segmentsreturn unmodifiable lists.ElfArchitectureIdentifier.ia64and theElfRelocationType.ia64*constants are deprecated aliases for theirx8664equivalents.
Fixed #
- Machine 0x3e is now
x8664(EM_X86_64); real IA-64 added asitanium(0x32). - Relocation identifiers match their ABI names, correcting
ia64(R_X86_64_GOT32) andia64GOT32(R_X86_64_PLT32). - 32 bit
r_addendis read as a signedElf32_Sword. - Note sections parse every record instead of only the first, and accept a zero length name.
- Extended section numbering is supported:
e_shnum == 0resolves the count from section header zero,SHN_XINDEXresolves the name index, ande_shstrndx == SHN_UNDEFyields empty names. - Valid files with no program headers are no longer rejected.
ElfSection.typeresolves against the file architecture, so it agrees with the class the reader built.- Section accessors select on runtime type instead of casting on a type id or a section name.
- Symbol tables are parsed once and cached, removing a quadratic access path.
- The file backed buffer seeks only when its position drifts, instead of once per byte.
Added #
ElfFormatException, carrying a message and file offset.ElfNoterecord andElfNoteSection.notes.ElfReader.fromFileandElfReader.closefor reader owned file handles.- Validation of header, table, and section geometry against the file size.
1.0.2 #
- Various bug fixes.
1.0.1 #
- Package updates
1.0.0 #
- Initial version.