Native Python 3.11+ bindings for @horsicq's Detect-It-Easy
The easiest and recommended installation is through pip.
pip install die-pythongit clone https://github.com/elastic/die-python
cd die-pythonInstall Qt into the build. It can be easily installed using aqt as follow (here with Qt version 6.7.3):
python -m pip install aqtinstall --user -U
python -m aqt install-qt -O ./build linux desktop 6.7.3 linux_gcc_64 # linux x64 only
python -m aqt install-qt -O ./build linux_arm64 desktop 6.7.3 linux_gcc_arm64 # linux arm64 only
python -m aqt install-qt -O ./build windows desktop 6.7.3 win64_msvc2019_64 # windows x64 only
python -m aqt install-qt -O ./build windows desktop 6.7.3 win64_msvc2019_arm64 # windows arm64 only (will requires `win64_msvc2019_64`)
python -m aqt install-qt -O ./build mac desktop 6.7.3 clang_64 # mac onlyThen you can install the package
python -m pip install . --user -Uimport die, pathlib
print(die.scan_file("c:/windows/system32/ntdll.dll", die.ScanFlags.DEEP_SCAN))
'PE64'
print(die.scan_file("../upx.exe", die.ScanFlags.RESULT_AS_JSON, str(die.database_path) ))
{
"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)
\path\to\your\pyenv\site-packages\die\db\ACE
\path\to\your\pyenv\site-packages\die\db\Amiga\DeliTracker.1.sg
\path\to\your\pyenv\site-packages\die\db\Amiga\_Amiga.0.sg
\path\to\your\pyenv\site-packages\die\db\Amiga\_init
\path\to\your\pyenv\site-packages\die\db\APK\AlibabaProtection.2.sg
[...]Released under Apache 2.0 License and integrates the following repositories:
- Detect-It-Easy: MIT license
- die_library: MIT license
- qt: LGPL license