类型检测
Project description
一个类型检测库。
特性
类型检测完全模块化,需要检测新的类型,直接参考modules中的检测,编写即可。
主要面向逆向工程方向的类型检测,也支持一般类型检测。
安装
❯ pip install pyftype
❯ pyftype -h
usage: pyftype [-h] [-V] p
positional arguments:
p path
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
❯ pyftype Makefile
File extension: txt
File MIME type: application/txt
用法
import pyftype
# file
f = open(path, "rb")
data = f.read()
kind = pyftype.guess(data)
# path
kind = pyftype.guess(path)
# bytes
buf = bytearray([0xFF, 0xD8, 0xFF, 0x00, 0x08])
kind = pyftype.guess(buf)
具体参考examples目录
参考
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 Distribution
pyftype-1.2.4-py3-none-any.whl
(13.4 kB
view details)
File details
Details for the file pyftype-1.2.4-py3-none-any.whl
.
File metadata
- Download URL: pyftype-1.2.4-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.10.0 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f58cce4a98276355f5c392c8295fc131aeee5b086f2e0e4953770849c8feb48c |
|
MD5 | bf35d6db7bc7ed71999b17236c499aa7 |
|
BLAKE2b-256 | 0a6a5eb1dc61829df04db7ac6e37602bbc416b3853aaa9ee8e2cc8807d9c4665 |