Skip to content

crackinglandia/pylibelf

Repository files navigation

pylibelf

pylibelf is a pure Python library to parse ELF files.

This tool is in early development stage, if you have any question or want help in coding feel free to contact me at crackinglandia [at] gmail.

At the moment, you can only read ELF files. The write functionallity is work-in process.

NOTE: This is not a wrapper around libelf!.

How to use it

>>> import pylibelf
>>> elf = pylibelf.ELF("/bin/bash")
>>> elf.elfHdr
<pylibelf.Elf64_Ehdr object at 0x7f68672d2d50>
>>> elf.elfHdr.e_entry
<elfdatatypes.Elf64_Addr object at 0x7f6867277d50>
>>> elf.elfHdr.e_entry.value.__hex__()
'0x41d438'
>>> elf.ShdrTable[1]
<pylibelf.Elf64_Shdr object at 0x7f686727d6d0>
>>> elf.ShdrTable[1].sectionName
'.interp'
>>> elf.ShdrTable[1].sectionRawData
'/lib64/ld-linux-x86-64.so.2\x00'

License

pylibelf is distributed under BSD 3-Clause.

About

A pure Python library to parse ELF files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages