diff --git a/libbs/api/decompiler_interface.py b/libbs/api/decompiler_interface.py index e06aba74..d2fce314 100644 --- a/libbs/api/decompiler_interface.py +++ b/libbs/api/decompiler_interface.py @@ -5,6 +5,7 @@ from collections import defaultdict from functools import wraps from typing import Dict, Optional, Union, Tuple, List +from pathlib import Path import libbs from libbs.api.artifact_lifter import ArtifactLifter @@ -62,6 +63,8 @@ def __init__( supports_undo: bool = False, # these will be changed often by public API use headless: bool = False, + headless_binary_path: Optional[Path] = None, + binary: Optional[Path] = None, init_plugin: bool = False, plugin_name: str = f"generic_libbs_plugin", # [category/name] = (action_string, callback_func) @@ -75,6 +78,8 @@ def __init__( self.supports_undo = supports_undo self.qt_version = qt_version self._error_on_artifact_duplicates = error_on_artifact_duplicates + self.headless_binary_path = headless_binary_path + self.binary = binary # GUI things self.headless = headless @@ -101,6 +106,7 @@ def __init__( kwargs = ui_init_kwargs or {} self._init_ui_components(*args, **kwargs) + # # Decompiler GUI API # diff --git a/libbs/decompilers/ghidra/interface.py b/libbs/decompilers/ghidra/interface.py index 7cf35021..e35880f0 100644 --- a/libbs/decompilers/ghidra/interface.py +++ b/libbs/decompilers/ghidra/interface.py @@ -49,7 +49,7 @@ def __init__(self, loop_on_plugin=True, **kwargs): # connect to the remote bridge, assumes Ghidra is already running! if self.headless: #TODO: Generalize this for all users - subprocess.Popen(["/home/flipout/.local/bin/ghidra_10.4_PUBLIC/support/analyzeHeadless", + subprocess.Popen([self.headless_binary_path, "/home/flipout/", "ci", "-import", "/home/flipout/Downloads/fauxware", "-scriptPath", "/home/flipout/ghidra_scripts/",