Skip to content

Commit

Permalink
Always make a ghidra_scripts path
Browse files Browse the repository at this point in the history
  • Loading branch information
mahaloz committed Feb 21, 2024
1 parent 4cc47ae commit f44e112
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libbs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.22.1"
__version__ = "0.23.0"

import logging
logging.getLogger("libbs").addHandler(logging.NullHandler())
Expand Down
7 changes: 6 additions & 1 deletion libbs/plugin_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,13 @@ def install_ida(self, path=None, interactive=True):
else default_path

def install_ghidra(self, path=None, interactive=True):
potential_path = self._home.joinpath('ghidra_scripts').expanduser()
if self._home.exists() and not potential_path.exists():
self.info(f"Creating Ghidra Scripts directory at {potential_path}...")
potential_path.mkdir()

default_path, skip_ask = self._get_path_without_ask(
path, default_path=self._home.joinpath('ghidra_scripts').expanduser(), interactive=interactive
path, default_path=potential_path, interactive=interactive
)
return self.ask_path("Ghidra", "Ghidra Scripts Path", default=default_path) if not skip_ask \
else default_path
Expand Down

0 comments on commit f44e112

Please sign in to comment.