diff --git a/CHANGELOG.md b/CHANGELOG.md index 723b3317..1b457cf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,9 @@ - fix: remove unreachable backports.functools_lru_cache fallback and dead dependency @williballenthin - fix: Scopes.from_dict uses cls instead of self so subclasses return the correct type @williballenthin - fix: correct wrong dict key in VMRay _compute_monitor_threads assertion (used thread_id instead of process_id) @williballenthin +fix: replace assert with isinstance guard in get_callee for invalid MethodSpec tokens @williballenthin +- fix: replace assert with isinstance guard in get_callee for invalid MethodSpec tokens @williballenthin +- fix: initialize f=None before try block in load_capa_function_results to prevent UnboundLocalError in except handler @williballenthin (SURF-61) - fix: fix unreachable elif for NOT CompoundStatement so NOT rules render children in IDA plugin tree view @williballenthin (SURF-60) - fix: use next(iter(addrs)) instead of addrs.pop() to avoid mutating the feature cache in parse_features_for_tree @williballenthin (SURF-59) - fix: use integer division in get_printable_len for UTF-16 LE operands @williballenthin (SURF-58) diff --git a/capa/ida/plugin/form.py b/capa/ida/plugin/form.py index 8c076cc6..19f7960d 100644 --- a/capa/ida/plugin/form.py +++ b/capa/ida/plugin/form.py @@ -1011,12 +1011,14 @@ class CapaExplorerForm(idaapi.PluginForm): update_wait_box("extracting features") # resolve function selected in disassembly view + f = None try: f = idaapi.get_func(idaapi.get_screen_ea()) if f is not None: self.rulegen_current_function = self.rulegen_feature_extractor.get_function(f.start_ea) except Exception as e: - logger.exception("Failed to resolve function at address 0x%X (error: %s)", f.start_ea, e) + addr = f.start_ea if f else idaapi.get_screen_ea() + logger.exception("Failed to resolve function at address 0x%X (error: %s)", addr, e) return False if ida_kernwin.user_cancelled():