Skip to content

Commit

Permalink
Fix VarBERT bug (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahaloz authored Sep 9, 2024
1 parent d76a69c commit 6af8740
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 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__ = "3.4.6"
__version__ = "3.5.0"

from .api import AIAPI, LiteLLMAIAPI
from libbs.api import DecompilerInterface
Expand Down
17 changes: 12 additions & 5 deletions dailalib/daila_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,20 @@ def create_plugin(*args, **kwargs):
import subprocess
from libbs_vendored.ghidra_bridge_server import GhidraBridgeServer
from distutils.spawn import find_executable
cmd = shell_library_command.split(" ") if shell_library_command else python_library_command.split(" ")
cmd = shell_library_command.split(" ")
if not find_executable(cmd[0]):
# fallback to doing a python command
cmd = python_library_command.split(" ")

# fallback to doing python style module call
python_end = ["-m"] + python_library_command.split(" ")
python_exec = "python" if find_executable("python") else "python3"
cmd = [python_exec] + python_end

GhidraBridgeServer.run_server(background=True)
process = subprocess.Popen(cmd)
print("[+] Starting the backend now...")
try:
process = subprocess.Popen(cmd)
except Exception as e:
print("[!] Failed to run the backend command", cmd, "because", e)

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
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install_requires =
litellm
tiktoken
Jinja2
libbs>=1.20.1
libbs>=1.21.0

python_requires = >= 3.10
include_package_data = True
Expand All @@ -29,4 +29,4 @@ console_scripts =

[options.extras_require]
full =
varbert>=2.1.1
varbert>=2.3.0

0 comments on commit 6af8740

Please sign in to comment.