Skip to content

Commit

Permalink
attempt to fix linter violations-6
Browse files Browse the repository at this point in the history
  • Loading branch information
Atlas-64 committed Mar 17, 2024
1 parent 6ca2252 commit 01bb31b
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions capa/ghidra/capa_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,24 @@ def create_label(ghidra_addr, name, capa_namespace):
# assign new match overlay label to capa-generated namespace
cmd.getSymbol().setNamespace(capa_namespace)
return


def run(self):
user_choice = self.askChoices("Choose b/w bookmarks & comments", "Preferred action:", ["bookmarks", "comments", "none", "both"], "both")
if user_choice == "bookmarks":
for item in parse_json(self.capa_data):
item.bookmark_functions()
elif user_choice == "comments":
for item in parse_json(self.capa_data):
item.label_matches()
elif user_choice == "both":
for item in parse_json(self.capa_data):
item.bookmark_functions()
item.label_matches()
else:
pass
user_choice = self.askChoices(
"Choose b/w bookmarks & comments", "Preferred action:", ["bookmarks", "comments", "none", "both"], "both"
)
if user_choice == "bookmarks":
for item in parse_json(self.capa_data):
item.bookmark_functions()
elif user_choice == "comments":
for item in parse_json(self.capa_data):
item.label_matches()
elif user_choice == "both":
for item in parse_json(self.capa_data):
item.bookmark_functions()
item.label_matches()
else:
pass


class CapaMatchData:
Expand Down Expand Up @@ -378,7 +382,6 @@ def main():
popup("capa explorer found no matches.") # type: ignore [name-defined] # noqa: F821
return capa.main.E_EMPTY_REPORT


logger.info("capa explorer analysis complete")
popup("capa explorer analysis complete.\nPlease see results in the Bookmarks Window and Namespaces section of the Symbol Tree Window.") # type: ignore [name-defined] # noqa: F821
return 0
Expand Down

0 comments on commit 01bb31b

Please sign in to comment.