I find the *nix tool file very useful. There’s no equivalent on Windows, that’s why I use a Windows port of this tool.
But it has some limitations, the most annoying to me being the lack of support for stdin. This prevents me from using it in a chain of commands.
That’s the main reason I developed file-magic.py, a Python tool that is essentially a wrapper for the Python magic module.
On Windows and OSX, install module python-magic-bin with pip (this will install binaries too), while on Linux install module python-magic.
Here is an example showing how output from base64dump is piped into file-magic:
And here is an example with jsonoutput I mentioned before:
You can also add your own definitions to file file-magic.def.
For example, I added a definition for VBE/JSE files (encoded .vbs/.js scripts).