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 git+https://github.com/Sauci/pyelf.git@master

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.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

sauci_pyelf-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file sauci-pyelf-0.1.1.tar.gz.

File metadata

  • Download URL: sauci-pyelf-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for sauci-pyelf-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a0b2cc9ef9698b3966d26c99686343f659b5d79b1aa9ad2ddb0122318f644c24
MD5 937477430ea552cf0b5238edeaff5fca
BLAKE2b-256 8f32e5b23f5b22b8a46ec523504c19525736e73026552e149247e5f2cb5e2fe9

See more details on using hashes here.

File details

Details for the file sauci_pyelf-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sauci_pyelf-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for sauci_pyelf-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f892a48457a55d3847daf3285bca2115f8c73a84d4f734fa38636ae5f7514a1
MD5 9abcd5ded27badfde64014a4f5ef4e99
BLAKE2b-256 a4896c5e1a89ef733427ae736e42193a4a9e2a6c2868cbae278930b54b802ea3

See more details on using hashes here.

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