diff --git a/CHANGELOG.md b/CHANGELOG.md index f8368d30a..ab5d9ca24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ ### capa Explorer IDA Pro plugin +- fix bug preventing saving of capa results via Save button @mr-tz + ### Development ### Raw diffs diff --git a/capa/ida/plugin/form.py b/capa/ida/plugin/form.py index 0aee6cea2..028ce2078 100644 --- a/capa/ida/plugin/form.py +++ b/capa/ida/plugin/form.py @@ -1309,10 +1309,17 @@ def save_program_analysis(self): s = self.resdoc_cache.model_dump_json().encode("utf-8") - path = Path(self.ask_user_capa_json_file()) - if not path.exists(): + path = self.ask_user_capa_json_file() + if not path: + # dialog canceled + return + + path = Path(path) + if not path.parent.exists(): + logger.warning("Failed to save file: parent directory '%s' does not exist.", path.parent) return + logger.info("Saving capa results to %s.", path) write_file(path, s) def save_function_analysis(self):