Merge pull request #146 from c-goes/lief_integrity_exception

Make FileObject creation work if lief parsing fails
pull/147/head
Raphaël Vinot 2017-12-04 18:57:52 +01:00 committed by GitHub
commit 1d190cdf50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -62,8 +62,20 @@ def make_binary_objects(filepath=None, pseudofile=None, filename=None):
logger.warning('Bad format: {}'.format(e))
except lief.bad_file as e:
logger.warning('Bad file: {}'.format(e))
except lief.conversion_error as e:
logger.warning('Conversion file: {}'.format(e))
except lief.builder_error as e:
logger.warning('Builder file: {}'.format(e))
except lief.parser_error as e:
logger.warning('Parser error: {}'.format(e))
except lief.integrity_error as e:
logger.warning('Integrity error: {}'.format(e))
except lief.pe_error as e:
logger.warning('PE error: {}'.format(e))
except lief.type_error as e:
logger.warning('Type error: {}'.format(e))
except lief.exception as e:
logger.warning('Lief exception: {}'.format(e))
except FileTypeNotImplemented as e: # noqa
logger.warning(e)
if not HAS_LIEF: