跳转到主要内容

带有调试信息的ELF二进制文件的事实生成

项目描述

小鹰 Python

PyPI version ELF ABI Parsing Basic Tests

为带有调试信息的ELF二进制文件生成事实。

用法

首先创建一个虚拟环境并安装依赖项。

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

或者,您可以从PyPI安装最新版本

$ pip install smeagle

如果您需要一个带有调试的快速二进制文件,请编译示例

cd example
make

以下是Python中的用法

from smeagle.loader import Loader

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

提供了一个dev.py示例,用于执行相同的操作并将输出打印到终端

$ 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"
        }
    }
}

作者

许可证

此项目是Spack的一部分。Spack根据MIT许可和Apache许可(版本2.0)的条款进行分发。用户可以选择任一许可证。

所有新的贡献都必须在MIT和Apache-2.0许可证下进行。

有关详细信息,请参阅LICENSE-MIT、LICENSE-APACHE、COPYRIGHT和NOTICE。

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

LLNL-CODE-811652

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

smeagle-0.0.12.tar.gz (32.7 kB 查看哈希值)

上传于 源码

支持者