Skip to main content

Smeagle Python

PyPI version ELF ABI Parsing Basic Tests

Generate facts for ELF binaries with debug information.

Usage

First create a virtual environment and install dependencies.

$ python -m venv env
$ source env/bin/activate
$ pip install -e .

Or you can install the latest release from pypi:

$ pip install smeagle

If you need a quick binary with debug, compile the example:

cd example
make

Here is the usage in python:

from smeagle.loader import Loader

ld = Loader("example/libmath-v1.so")
print(ld.corpus.to_json())

And an example dev.py is provided to do the same and print to the terminal:

$ python dev.py example/libmath-v1.so
{
    "library": "/home/vanessa/Desktop/Code/smeagle-py/example/libmath-v1.so",
    "locations": [
        {
            "function": {
                "name": "_ZN11MathLibrary10Arithmetic3AddEdd",
                "class": "Function",
                "parameters": [
                    {
                        "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                        "location": "%xmm0",
                        "direction": "import"
                    },
                    {
                        "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                        "location": "%xmm1",
                        "direction": "import"
                    }
                ],
                "return": {
                    "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                    "direction": "export",
                    "location": "%xmm0"
                },
                "direction": "export"
            }
        },
        {
            "function": {
                "name": "_ZN11MathLibrary10Arithmetic8SubtractEdd",
                "class": "Function",
                "parameters": [
                    {
                        "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                        "location": "%xmm0",
                        "direction": "import"
                    },
                    {
                        "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                        "location": "%xmm1",
                        "direction": "import"
                    }
                ],
                "return": {
                    "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                    "direction": "export",
                    "location": "%xmm0"
                },
                "direction": "export"
            }
        },
        {
            "function": {
                "name": "_ZN11MathLibrary10Arithmetic8MultiplyEdd",
                "class": "Function",
                "parameters": [
                    {
                        "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                        "location": "%xmm0",
                        "direction": "import"
                    },
                    {
                        "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                        "location": "%xmm1",
                        "direction": "import"
                    }
                ],
                "return": {
                    "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                    "direction": "export",
                    "location": "%xmm0"
                },
                "direction": "export"
            }
        },
        {
            "function": {
                "name": "_ZN11MathLibrary10Arithmetic6DivideEdd",
                "class": "Function",
                "parameters": [
                    {
                        "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                        "location": "%xmm0",
                        "direction": "import"
                    },
                    {
                        "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                        "location": "%xmm1",
                        "direction": "import"
                    }
                ],
                "return": {
                    "type": "d20be53e889d2cee0c86d0ef9b0fbbc8",
                    "direction": "export",
                    "location": "%xmm0"
                },
                "direction": "export"
            }
        }
    ],
    "types": {
        "d20be53e889d2cee0c86d0ef9b0fbbc8": {
            "type": "double",
            "size": 8,
            "class": "Float"
        }
    }
}

Authors

License

This project is part of Spack. Spack is distributed under the terms of both the MIT license and the Apache License (Version 2.0). Users may choose either license, at their option.

All new contributions must be made under both the MIT and Apache-2.0 licenses.

See LICENSE-MIT, LICENSE-APACHE, COPYRIGHT, and NOTICE for details.

SPDX-License-Identifier: (Apache-2.0 OR MIT)

LLNL-CODE-811652

Metadata

Release files for smeagle 0.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smeagle 0.0.12
File Size Uploaded
smeagle-0.0.12.tar.gz 32.7 kB Details

Release files / smeagle-0.0.12.tar.gz

Download URL smeagle-0.0.12.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
deebda75b8febd736cdb35087fdbb985f68d2242c13c23cf9f27a44da0fba781
BLAKE2b-256 checksum
How to use checksums
b18bf6a9696ce1d39976ed87ead4411866eb2c2a1855801cde555dbc927130b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.0.12 This release

1 release file

0.0.11

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page