{"action":"opened","issue":{"url":"https://api.github.com/repos/devttys0/binwalk/issues/143","labels_url":"https://api.github.com/repos/devttys0/binwalk/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/devttys0/binwalk/issues/143/comments","events_url":"https://api.github.com/repos/devttys0/binwalk/issues/143/events","html_url":"https://github.com/devttys0/binwalk/issues/143","id":94949830,"number":143,"title":"Binwalk barfs using magic.mgc from `file`","user":{"login":"bus1ng","id":5714251,"avatar_url":"https://avatars.githubusercontent.com/u/5714251?v=3","gravatar_id":"","url":"https://api.github.com/users/bus1ng","html_url":"https://github.com/bus1ng","followers_url":"https://api.github.com/users/bus1ng/followers","following_url":"https://api.github.com/users/bus1ng/following{/other_user}","gists_url":"https://api.github.com/users/bus1ng/gists{/gist_id}","starred_url":"https://api.github.com/users/bus1ng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bus1ng/subscriptions","organizations_url":"https://api.github.com/users/bus1ng/orgs","repos_url":"https://api.github.com/users/bus1ng/repos","events_url":"https://api.github.com/users/bus1ng/events{/privacy}","received_events_url":"https://api.github.com/users/bus1ng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-14T13:52:18Z","updated_at":"2015-07-14T13:52:18Z","closed_at":null,"body":"I have file 5.24 and binwalk v2.1.0 installed from git on x86_64 Arch Linux.\r\n\r\nGiven that the -m option says it accepts a magic file to use, I would expect the magic file from `file` (which provides libmagic.so) to work. But handing it to binwalk results in barf from trying to interpret the .mgc file as text?\r\n\r\n```\r\n$ file /usr/share/file/misc/magic.mgc    \r\n/usr/share/file/misc/magic.mgc: magic binary file for file(1) cmd (version 13) (little endian)\r\n```\r\n\r\n```\r\n$ binwalk -m /usr/share/file/misc/magic.mgc /dev/null\r\n----------------------------------------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python3.4/site-packages/binwalk/core/module.py\", line 509, in main\r\n    self.init()\r\n  File \"/usr/lib/python3.4/site-packages/binwalk/modules/signature.py\", line 98, in init\r\n    self.magic.load(f)\r\n  File \"/usr/lib/python3.4/site-packages/binwalk/core/magic.py\", line 793, in load\r\n    lines = fp.readlines()\r\n  File \"/usr/lib/python3.4/codecs.py\", line 319, in decode\r\n    (result, consumed) = self._buffer_decode(data, self.errors, final)\r\nUnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 3: invalid continuation byte\r\n----------------------------------------------------------------------------------------------------\r\n```\r\n"}}