Skip to main content

high level API to retrieve information from ELF files.

Project description

tests status code coverage

package description

the purpose of this package is to provide high level API to work with elf files.

installation

using pip

install the package by running the following command: pip install sauci-pyelf

from source

this package uses pyelftools package. if it is not already installed, install it first. once the above prerequisite is installed:

  • download the pyelf package
  • unzip it
  • move to the directory containing the setup.py file
  • run the command python setup.py install

note: the above command might require privileged access to succeed.

example of usage

the bellow code snippet shows how to load an elf file and get some of its properties.

from pyelf import ElfFile

elf = ElfFile('tests/input.elf')

# get a list of all symbols in file tests/input.elf.
symbols = elf.symbols()
assert 'symbol_uint8' in symbols

# get an instance of Symbol class for symbol named symbol_uint8.
symbol = elf.get_symbol('symbol_uint8')

# get address of symbol symbol_uint8.
assert isinstance(symbol.address, int)

# get size of symbol symbol_uint8.
assert symbol.size == 1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sauci-pyelf-0.1.2.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

sauci_pyelf-0.1.2-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page