From 7f58fa097aa6026fc158c2e17a8a60da1a764511 Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Wed, 22 Apr 2026 20:15:13 +0300 Subject: [PATCH] fix: add explicit import capa.loader in ida plugin form.py capa.loader.compute_layout was called without capa.loader being explicitly imported; it worked only via capa.main's transitive import. Adding the explicit import prevents a future AttributeError if import order changes. --- CHANGELOG.md | 1 + capa/ida/plugin/form.py | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b457cf6..3ea11ac4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ - 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: add explicit import capa.loader in form.py to avoid fragile transitive import dependency @williballenthin (SURF-62) - 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) diff --git a/capa/ida/plugin/form.py b/capa/ida/plugin/form.py index 19f7960d..17443cf3 100644 --- a/capa/ida/plugin/form.py +++ b/capa/ida/plugin/form.py @@ -27,6 +27,7 @@ import ida_settings import capa.main import capa.rules import capa.engine +import capa.loader import capa.version import capa.ida.helpers import capa.render.json