binsync / libbs

A library for writing plugins in any decompiler: includes API lifting, common data formatting, and GUI abstraction!
BSD 2-Clause "Simplified" License
63 stars 4 forks source link

Support native Python3 in Ghidra with Pyhidra #73

Closed mahaloz closed 2 months ago

mahaloz commented 3 months ago

Using Pyhidra, we should be able to run 99% of all libbs code inside Ghidra natively, which will give us a HUGE speed improvement.

Tasks

chf0x commented 3 months ago

As part of this refactoring, please add the capability to load an existing project without re-running the ghidra analysis on it (in headless mode). Since we have many projects cached, this would save a significant amount of time

mahaloz commented 3 months ago

@chf0x would you happen to know if there is a way to start a normal Ghidra headless instance without re-running analysis? If not, it's fine I'll find it eventually :).

chf0x commented 3 months ago

You mean with pyhidra, right? You can just set analyze=False.

with pyhidra.open_program("file.exe", analyze=False) as flat_api:
    do_stuff

To open a project, specify the project_name and project_location, and binary_path = None

https://github.com/dod-cyber-crime-center/pyhidra/blob/c878e91b53498f65f2eb0255e22189a6d172917c/pyhidra/core.py#L178