Skip to content

Commit

Permalink
fix bug preventing save of capa results
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tz committed Oct 11, 2024
1 parent 69190df commit bc91171
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

### capa Explorer IDA Pro plugin

- fix bug preventing saving of capa results via Save button @mr-tz

### Development

### Raw diffs
Expand Down
11 changes: 9 additions & 2 deletions capa/ida/plugin/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit bc91171

Please sign in to comment.