Skip to content

Commit

Permalink
Revert "GP-5298: PyGhidra can now find modules that live in directori…
Browse files Browse the repository at this point in the history
…es specified by the Bundle Manager"

This reverts commit c5d4444.
  • Loading branch information
ghidra1 committed Feb 5, 2025
1 parent e840596 commit 1bccb8a
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions Ghidra/Features/PyGhidra/src/main/py/src/pyghidra/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,6 @@ def create_module(self, spec):
def exec_module(self, fullname):
pass

class _GhidraBundleFinder(importlib.machinery.PathFinder):
""" (internal) Used to find modules in Ghidra bundle locations """

def find_spec(self, fullname, path=None, target=None):
from ghidra.app.script import GhidraScriptUtil
GhidraScriptUtil.acquireBundleHostReference()
for directory in GhidraScriptUtil.getEnabledScriptSourceDirectories():
spec = super().find_spec(fullname, [directory.absolutePath], target)
if spec is not None:
return spec
return None

@contextlib.contextmanager
def _plugin_lock():
Expand Down Expand Up @@ -401,9 +390,8 @@ def _setup_java(self, **jpype_kwargs):
**jpype_kwargs
)

# Install hooks into python importlib
# Install hook into python importlib
sys.meta_path.append(_PyGhidraImportLoader())
sys.meta_path.append(_GhidraBundleFinder())

imports.registerDomain("ghidra")

Expand Down

0 comments on commit 1bccb8a

Please sign in to comment.