Skip to content

Commit

Permalink
Always search for python and python3 in Path for plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mahaloz committed Jan 15, 2024
1 parent 6ee9792 commit 54a43c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dailalib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.2.3"
__version__ = "2.2.4"

from .api import AIAPI, OpenAIAPI
from libbs.api import DecompilerInterface
Expand Down
13 changes: 12 additions & 1 deletion dailalib/daila_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,18 @@ def create_plugin(*args, **kwargs):
full_command = "python3 -m " + library_command

GhidraBridgeServer.run_server(background=True)
process = subprocess.Popen(full_command.split(" "))

failed_py3 = False
try:
process = subprocess.Popen(full_command.split(" "))
except:
failed_py3 = True

if failed_py3:
print("Couldn't find python3 in your path. Trying python...")
full_command = full_command.replace("python3", "python")
process = subprocess.Popen(full_command.split(" "))

if process.poll() is not None:
raise RuntimeError(
"Failed to run the Python3 backed. It's likely Python3 is not in your Path inside Ghidra.")
Expand Down

0 comments on commit 54a43c0

Please sign in to comment.