January 06, 2012 at 08:59 Tags Linux , Python

I'm happy and proud to announce the release of a new open-source Python package to the world. pyelftools is a pure-Python library for parsing and analyzing ELF files and DWARF debugging information. It provides both low-level and high-level APIs for querying ELF and DWARF, and is mostly feature-complete. As a proof of capability, pyelftools ships with a fairly powerful clone of readelf .

Some basic information:

Website - managed as an open-source project on Github. It's the place for documentation, opening issues and closely following the development in general.

Downloading - from PyPI, or the Github site.

Documentation - there's a detailed user guide, and the source distribution contains several examples.

License - public domain.

Pre-requisites - Python version 2.6 or 2.7; 3.x support is in the works.

The goal of this project was two-fold. First, to better understand the ELF and DWARF formats. Second, to have a feature-complete pure-Python parser for these formats with a sufficiently high-level API to be generally useful.

Although the initial release of pyelftools (version 0.10) is formally "beta", it's quite well validated with a comprehensive test-suite. It should also be simple to learn and tweak, due to the detailed user's and hacker's guides on the Github site Wiki, along with several functioning examples that ship with the library.

There are some existing tools with overlapping functionality: