diff --git a/src/patcherex2/components/binary_analyzers/ghidra.py b/src/patcherex2/components/binary_analyzers/ghidra.py index 2e14a6a..e29dcb6 100644 --- a/src/patcherex2/components/binary_analyzers/ghidra.py +++ b/src/patcherex2/components/binary_analyzers/ghidra.py @@ -1,7 +1,5 @@ import logging -import pyhidra - from .binary_analyzer import BinaryAnalyzer logger = logging.getLogger(__name__) @@ -9,6 +7,8 @@ class Ghidra(BinaryAnalyzer): def __init__(self, binary_path: str, **kwargs): + import pyhidra + self.ctx = pyhidra.open_program(binary_path) self.flatapi = self.ctx.__enter__() self.currentProgram = self.flatapi.getCurrentProgram() diff --git a/src/patcherex2/targets/elf_amd64_linux_recomp.py b/src/patcherex2/targets/elf_amd64_linux_recomp.py index 1352856..f56d923 100644 --- a/src/patcherex2/targets/elf_amd64_linux_recomp.py +++ b/src/patcherex2/targets/elf_amd64_linux_recomp.py @@ -18,7 +18,7 @@ def get_compiler(self, compiler): def get_binary_analyzer(self, binary_analyzer, **kwargs): binary_analyzer = binary_analyzer or "angr" if binary_analyzer == "angr": - return Angr(self.binary_path) + return Angr(self.binary_path, **kwargs) if binary_analyzer == "ghidra": return Ghidra(self.binary_path, **kwargs) raise NotImplementedError()