6

I want to be able to parse 32 and 64 bit ELF files - but not create or modify them (e.g. as discussed in this thread). The ELF binaries may possibly come from embedded Linux systems, that is, the library should not be irritated by MIPS, ARM and other non-x86 architectures.

What I have considered:

Do I have forgotten something? Which of the above options would you prefer?

For those who had some practical experience with pylibelf or pydeftools: These seem no longer updated (last commit: 2013 and 2012), are they mature enough?

| improve this question | | | | |
4

Take a look at radare2. It can parse file formats (see here for an example of parsing the ELF header).

Radare2 supports multiple architectures and is being actively developed. On top of that it has bindings for a lot of languages, including Python of course. Read through the bindings source code to see it is pretty straightforward to script it.

HTH!

| improve this answer | | | | |
  • 1
    Thank you for your pointer! Radare2 seems to be a powerful framework but may be a bit too heavy for my task. Have you tried one of the mentioned libraries whose main/only objective is to parse ELF files? In case their parsing capabilities are as good the ones of Radare2, I would prefer a more light-weight solution ... – langlauf.io May 6 '15 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.