Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jeffbryner/pymagic

python code to determine magic number match for file/data
https://github.com/jeffbryner/pymagic

Last synced: about 2 months ago
JSON representation

python code to determine magic number match for file/data

Awesome Lists containing this project

README

        

A python module to simulate the unix file command.

Largely inspired/taken/copied from the honeynet magic.py
except this attempts to use the non-mime descriptions of data
and to use at least the level 0 magic descriptions from the linux file
command's Magdir repository of file matches.

The hope is to have a python module that can be reasonably used
on windows since python-magic and libmagic seem to be out of
support on windows.

Usage:
./magic.py somefile.mp3
somefile.mp3: MPEG ADTS layer III, v1

BUGS:
Doesn't use any level beyond level 0 of the file hits, so it will determine /usr/bin/less is ELF,
but not ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped