From bb2b80d9b09f67859081ff3cd30d118c9d0372f5 Mon Sep 17 00:00:00 2001 From: Brandon Miller Date: Mon, 7 Apr 2025 11:00:27 -0400 Subject: Return None instead of raising in func IL getters Return None instead of raising an ILException in Python Function.llil, mlil, etc to allow these properties to play nice with map and filter --- python/binaryview.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'python/binaryview.py') diff --git a/python/binaryview.py b/python/binaryview.py index 250d69ab..b0ca13ef 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -47,7 +47,7 @@ from .enums import ( TypeClass, BinaryViewEventType, FunctionGraphType, TagReferenceType, TagTypeType, RegisterValueType, DisassemblyOption, RelocationType ) -from .exceptions import RelocationWriteException, ILException, ExternalLinkException +from .exceptions import RelocationWriteException, ExternalLinkException from . import associateddatastore # required for _BinaryViewAssociatedDataStore from .log import log_warn, log_error, Logger @@ -3181,10 +3181,7 @@ class BinaryView: for func in AdvancedILFunctionList( self, self.preload_limit if preload_limit is None else preload_limit, function_generator ): - try: - yield func.mlil - except ILException: - pass + yield func.mlil def hlil_functions( self, preload_limit: Optional[int] = None, @@ -3197,10 +3194,7 @@ class BinaryView: for func in AdvancedILFunctionList( self, self.preload_limit if preload_limit is None else preload_limit, function_generator ): - try: - yield func.hlil - except ILException: - pass + yield func.hlil @property def has_functions(self) -> bool: -- cgit v1.3.1