Skip to main content

Python bindings for Detect It Easy (DIE).

Project description

DetectItEasy-Python

Native Python 3.8+ bindings for @horsicq's Detect-It-Easy

Install

From PIP

The easiest and recommended installation is through pip.

pip install die-python

Using Git

git clone https://github.com/calladoum-elastic/die-python
cd die-python

Install Qt into the build. It can be easily installed using aqt as follow (here with Qt version 6.6.2):

python -m pip install aqtinstall --user -U
python -m aqt install-qt -O ./build linux    desktop 6.6.2 gcc_64             # linux only
python -m aqt install-qt -O ./build windows  desktop 6.6.2 win64_msvc2019_64  # windows only
python -m aqt install-qt -O ./build mac      desktop 6.6.2 clang_64           # mac only

Then you can install the package

python -m pip install . --user -U

Quick start

import die, pathlib

print(die.scan_file("c:/windows/system32/ntdll.dll", die.ScanFlags.Deepscan))
'PE64'

print(die.scan_file("../upx.exe", die.ScanFlags.RESULT_AS_JSON, str(die.database_path/'db') ))
{
    "detects": [
        {
            "filetype": "PE64",
            "parentfilepart": "Header",
            "values": [
                {
                    "info": "Console64,console",
                    "name": "GNU linker ld (GNU Binutils)",
                    "string": "Linker: GNU linker ld (GNU Binutils)(2.28)[Console64,console]",
                    "type": "Linker",
                    "version": "2.28"
                },
                {
                    "info": "",
                    "name": "MinGW",
                    "string": "Compiler: MinGW",
                    "type": "Compiler",
                    "version": ""
                },
                {
                    "info": "NRV,brute",
                    "name": "UPX",
                    "string": "Packer: UPX(4.24)[NRV,brute]",
                    "type": "Packer",
                    "version": "4.24"
                }
            ]
        }
    ]
}

for db in die.databases():
    print(db)
C:\Users\User\AppData\Roaming\Python\Python312\site-packages\die\db\db\ACE
C:\Users\User\AppData\Roaming\Python\Python312\site-packages\die\db\db\APK\PackageName.1.sg
C:\Users\User\AppData\Roaming\Python\Python312\site-packages\die\db\db\APK\SingleJar.3.sg
C:\Users\User\AppData\Roaming\Python\Python312\site-packages\die\db\db\APK\_APK.0.sg
C:\Users\User\AppData\Roaming\Python\Python312\site-packages\die\db\db\APK\_init
C:\Users\User\AppData\Roaming\Python\Python312\site-packages\die\db\db\Archive\_init
C:\Users\User\AppData\Roaming\Python\Python312\site-packages\die\db\db\archive-file
C:\Users\User\AppData\Roaming\Python\Python312\site-packages\die\db\db\arj
C:\Users\User\AppData\Roaming\Python\Python312\site-packages\die\db\db\Binary\Amiga loadable.1.sg
C:\Users\User\AppData\Roaming\Python\Python312\site-packages\die\db\db\Binary\archive.7z.1.sg
[...]

Licenses

Released under Apache 2.0 License and integrates the following repositories:

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

die_python-0.1.0-cp312-abi3-win_amd64.whl (12.7 MB view hashes)

Uploaded CPython 3.12+ Windows x86-64

die_python-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl (62.0 MB view hashes)

Uploaded CPython 3.12+ manylinux: glibc 2.28+ x86-64

die_python-0.1.0-cp312-abi3-macosx_13_0_x86_64.whl (4.8 MB view hashes)

Uploaded CPython 3.12+ macOS 13.0+ x86-64

die_python-0.1.0-cp311-cp311-win_amd64.whl (12.7 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

die_python-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (62.0 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

die_python-0.1.0-cp311-cp311-macosx_13_0_x86_64.whl (4.8 MB view hashes)

Uploaded CPython 3.11 macOS 13.0+ x86-64

die_python-0.1.0-cp310-cp310-win_amd64.whl (12.7 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

die_python-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (62.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

die_python-0.1.0-cp310-cp310-macosx_13_0_x86_64.whl (4.8 MB view hashes)

Uploaded CPython 3.10 macOS 13.0+ x86-64

die_python-0.1.0-cp39-cp39-win_amd64.whl (12.7 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

die_python-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl (62.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

die_python-0.1.0-cp39-cp39-macosx_13_0_x86_64.whl (4.8 MB view hashes)

Uploaded CPython 3.9 macOS 13.0+ x86-64

die_python-0.1.0-cp38-cp38-win_amd64.whl (12.7 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

die_python-0.1.0-cp38-cp38-manylinux_2_28_x86_64.whl (62.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

die_python-0.1.0-cp38-cp38-macosx_13_0_x86_64.whl (4.8 MB view hashes)

Uploaded CPython 3.8 macOS 13.0+ x86-64

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