-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Python3 in Ghidra, drop ghidra_bridge #82
Conversation
Two separate issues may have killed this attempt: No Subclassing Java ClassesThis affects the following line(s): libbs/libbs/decompilers/ghidra/hooks.py Line 185 in 40bc932
This would mean libbs can no longer be used at all to make GUI callback classes unless we can find a workaround. Implementing Java Classes is Thread Dependent (?)It's possible there is a workaround for this. If not, then we no longer can do this: libbs/libbs/decompilers/ghidra/hooks.py Line 17 in 40bc932
That would mean we can no longer detect when any Artifact is changed, which means no caching or special change handling. This also makes the approach dead for BinSync proper. I'll wait for a response from the Pyhidra dev's to see if this PR is dead in the water. |
Based on the current commit, the following works in UI mode: from libbs.api import DecompilerInterface
deci = DecompilerInterface.discover()
print(deci.functions.values()) It currently takes about 2 seconds to collect all the functions in light mode! |
7c7bfa0
to
c4ea7b4
Compare
Headless mode now works: from libbs.api import DecompilerInterface
deci = DecompilerInterface.discover(headless=True, force_decompiler="ghidra", binary_path="./posix_syscall")
for addr, light_func in deci.functions.items():
print(light_func)
print(deci.functions[addr]) # decompilation! After headless is initiated, it takes only |
Headless mode now works with project loading: from libbs.api import DecompilerInterface
# load from a project should be 5x faster on this binary after loading once.
deci = DecompilerInterface.discover(
headless=True, force_decompiler="ghidra", binary_path="./posix_syscall"
project_location=".", project_name="posix_syscall_ghidra", analyze=False
)
for addr, light_func in deci.functions.items():
print(light_func)
print(deci.functions[addr]) # decompilation! This is also on CI: libbs/tests/test_decompilers.py Line 154 in 104cd93
|
Summary of PRThis pull request was closed and replaced by #84 since we were unable to fully replace
from PySide6.QtWidgets import QApplication
QApplication() This caused a segfault. Since libbs is used by other downstream plugins for decompilers, which rely on Qt being available, 2 was the real killer. I will leave this branch alive since, in its current state, it is usable inside the UI, just without QT and those callbacks being consistent. |
Closes #73 and bumps to the next major version.