Skip to main content

类型检测

Project description

PyPI PyPI - Python Version PyPI - License PyPI - Status PyPI - Downloads

一个类型检测库。

特性

  1. 类型检测完全模块化,需要检测新的类型,直接参考modules中的检测,编写即可。

  2. 主要面向逆向工程方向的类型检测,也支持一般类型检测。

安装

❯ 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 hashes)

Uploaded Python 3

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