add perl script to genenrate magic definitions

array of magic definitions will be inserted into magic.c