Commit a78d78c4 by devttys0

Suppress hashlib exception logging in the bundled IDA python interpreter

parent c2a11ad3
......@@ -5,7 +5,7 @@ import os
import re
import sys
import ast
import hashlib
#import hashlib
import operator as op
import binwalk.core.idb
from binwalk.core.compat import *
......
......@@ -2,11 +2,22 @@
import io
import os
import logging
class ShutUpHashlib(logging.Filter):
'''
This is used to suppress hashlib exception messages
if using the Python interpreter bundled with IDA.
'''
def filter(self, record):
return not record.getMessage().startswith("code for hash")
try:
import idc
import idaapi
LOADED_IN_IDA = True
logger = logging.getLogger()
logger.addFilter(ShutUpHashlib())
except ImportError:
LOADED_IN_IDA = False
......
......@@ -690,7 +690,7 @@ class Modules(object):
if hasattr(binwalk.modules, dependency.name):
dependency.module = getattr(binwalk.modules, dependency.name)
else:
raise ModuleException("%s depends on %s which was not found in binwalk.modules.__init__.py\n" % (str(module), dependency.name))
continue # CJH raise ModuleException("%s depends on %s which was not found in binwalk.modules.__init__.py\n" % (str(module), dependency.name))
# No recursive dependencies, thanks
if dependency.module == module:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment