Commit 888bf4560d81987c8786f6ffde51bb58bbedd027

Authored by decalage2
1 parent 2fa61161

olevba: quick hack to avoid pcodedmp errors to appear on the console

Showing 1 changed file with 4 additions and 0 deletions
oletools/olevba.py
@@ -3611,7 +3611,11 @@ class VBA_Parser(object): @@ -3611,7 +3611,11 @@ class VBA_Parser(object):
3611 try: 3611 try:
3612 # TODO: handle files in memory too 3612 # TODO: handle files in memory too
3613 log.debug('before pcodedmp') 3613 log.debug('before pcodedmp')
  3614 + # TODO: we just ignore pcodedmp errors
  3615 + stderr = sys.stderr
  3616 + sys.stderr = output
3614 pcodedmp.processFile(self.filename, args, output_file=output) 3617 pcodedmp.processFile(self.filename, args, output_file=output)
  3618 + sys.stderr = stderr
3615 log.debug('after pcodedmp') 3619 log.debug('after pcodedmp')
3616 except Exception as e: 3620 except Exception as e:
3617 # print('Error while running pcodedmp: {}'.format(e), file=sys.stderr, flush=True) 3621 # print('Error while running pcodedmp: {}'.format(e), file=sys.stderr, flush=True)