Welcome to elffile’s documentation!

Contents of this document:

Elffile is a library which reads and writes ELF format object files.

Current features:

  • Elffile is pure python so installation is easy.
  • Elffile has been tested on python versions 2.[67] and 3.[012].
  • Reads both 32 and 64 bit formats in both big and little endian order.
  • Reads and writes file header, section header table, sections, and the section name string section.
  • Reads program header table.

This is sufficient to compare two object files to determine if they are equivalent aside from having been built at different times and in different file system locations which was my initial goal.

Elffile comes with two scripts:

  • objdump is the beginnings of an objdump utility. It dumps in a python/s-expression sort of format so it’s easy to traverse with emacs.
  • objdmp is the beginnings of an object file comparison utility.

A Note on Supported Python Versions

As I’m trying to straddle the 2 vs 3 jump, I’m relying on some of the python-3 compatibility features from 2.6 and higher. Supporting earlier versions of python would be possible, but would make supporting the python 2 vs 3 straddle somewhat more difficult. I’ve arbitrarily drawn my line in the sand at 2.6.

TODO

Todo

need a “copy” method

(The original entry is located in reference.rst, line 11.)

Todo

need a reverse write method, (for testing)

(The original entry is located in reference.rst, line 13.)

Todo

it would not be difficult to break up the string table, sort, and compare the results. But then we’ll also need a way to stub out the embedded path names.

(The original entry is located in reference.rst, line 96.)

Todo

I don’t understand whether segments overlap sections or not.

(The original entry is located in reference.rst, line 134.)

Indices and tables

Table Of Contents

Next topic

Quick Start

This Page