When you are gnireenigne some binary file, have you ever wondered, WTF are those magic numbers?
When you are browsing source code of a giant project, have you ever complained, what are the values of those magic constants?
Here you are, magic SOLVES these issues for you, just like magic.
$ magic.py (number|name) [keyword | [keyword] ...]
examples here:
$ magic.py 11 open
$ magic.py 15 signal
$ magic.py 10240 term iflags
$ magic.py term signal
$ magic.py creat open
# list all consts in open
$ magic.py '' open
# list all consts with value of 1024
$ magic.py 1024
- python2/3
- termcolor (optional, for color output support)
$ pip install termcolor
The framework is basically finished, but we need to fill with a lot of magic numbers to make magic really useful. Please contribute your magic.