Skip to content

Commit 2493200

Browse files
committed
Update the docs for the new Ghidra support
1 parent 6059699 commit 2493200

3 files changed

Lines changed: 31 additions & 23 deletions

File tree

docs/decompilers/ghidra.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,26 @@ sidebar_position: 3
55
# Ghidra
66

77
## Extra Install Steps
8-
You must install using `pip3 install binsync[ghidra]` for the extra dependencies. After doing this, continue with [installation via Script](/quickstart/install#installation-via-script).
9-
- Install extra dependencies using `pip3 install binsync[ghidra]`
10-
- Continue with [installation via Script](/quickstart/install#installation-via-script)
11-
- From the main window, go to Edit -> Plugin Path and make sure the plugin path created by BinSync is included
12-
- From CodeBrowser, go to Window -> Script Manager -> find `binsync_plugin.py` and tick the "In Tool" box in its line
13-
- Start BinSync in CodeBrowser via Tools -> BinSync -> Start UI
14-
15-
## Extra Info
16-
BinSync is written in Python 3, however, Ghidra only has a Python 2 backend.
17-
To deal with this, we use a vendored version of [ghidra_bridge](https://github.com/justfoxing/ghidra_bridge).
18-
We copy a BinSync stub, along with Ghidra Bridge code, into the `ghidra_scripts` folder, which is Python 2.
19-
Inside Ghidra, when you start BinSync, we use the Python 2 side to start the Python 3 GUI in another thread.
20-
We use Ghidra Bridge to make change requests to the Ghidra UI.
8+
After doing the traditional install, you must activate the BinSync script in Ghidra.
9+
Note, you should have launched in [PyGhidra mode](https://github.com/NationalSecurityAgency/ghidra/blob/stable/GhidraDocs/GettingStarted.md#pyghidra-mode), which can be done using the Ghidra `support/pyghidraRun` script.
10+
Once launched, open any binary, then:
11+
12+
1. On the top menu bar, click `Window->Script Manager`
13+
2. Using the `Filter` search bar on the bottom of that window, search for `binsync`
14+
3. Check the box next to the found `binsync_plugin.py`
15+
4. Close the script manager
16+
5. BinSync can now be started on the top menu bar `Tools->BinSync->Connect`
17+
18+
## Useful Info
19+
Ghidra's GUI engine is written in Java, but BinSync's GUI is written in Python.
20+
To make BinSync's GUI reusable in Ghidra, we run a Python server in Ghidra that exposes BinSync APIs.
21+
Then, in another Python process, we connect to that server with the GUI window (which is the client).
22+
This gives us the speed of native Python 3 execution in Ghidra, with the bottleneck being GUI operations.
23+
24+
The technicals go like this when you click `Connect` in Ghidra:
25+
1. We start `DecompilerServer` [in Ghidra's Python process](https://github.com/binsync/binsync/blob/b032aeff37155867f76042c721d4da164b630145/binsync/interface_overrides/ghidra.py#L83)
26+
2. We subprocess out the command `binsync -s ghidra`, which [starts the GUI in a new process](https://github.com/binsync/binsync/blob/b032aeff37155867f76042c721d4da164b630145/binsync/interface_overrides/ghidra.py#L83).
27+
3. The user uses the new GUI, which is a client, to their server
2128

2229
## Support Progress
2330

docs/intro.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,17 @@ center of BinSync's syncing ability. Here are the supported REAs:
2121
- Enums
2222
- Comments
2323

24-
Note: all types support user-created types like structs. In short, with BinSync you can track, manage, and sync
25-
changes you make in your decompiler with any decompiler supported by BinSync.
24+
Note: all types support user-created types like structs.
2625

27-
For synchronous help, or a more vocal discussion, join our discord:
26+
**Join our discord below for more online help**:
2827

2928
[![Discord](https://img.shields.io/discord/900841083532087347?label=Discord&style=plastic)](https://discord.gg/wZSCeXnEvR)
3029

3130
## Supported Platforms
3231
- IDA Pro: **>= 8.4** (if you have an older version, use [BinSync v4.10.1](https://github.com/binsync/binsync/commit/bac7b9d4a6cca64810bb07428391415702765cd4))
3332
- Binary Ninja: **>= 2.4**
3433
- angr-management: **>= 9.0**
35-
- Ghidra: **>= 10.1**
34+
- Ghidra: **>= 12.0** (launched in [PyGhidra mode](https://github.com/NationalSecurityAgency/ghidra/blob/stable/GhidraDocs/GettingStarted.md#pyghidra-mode))
3635

3736
All versions require **Python >= 3.10** and **Git** installed on your system.
3837

docs/quickstart/install.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ sidebar_position: 1
44

55
# Installation
66

7-
There are two main ways to install BinSync: via pip and an installation script, or via pip and manual configuration.
7+
Installing BinSync on most decompilers is a two step process: first you install the binsync library which
8+
provides functionality, than you copy (automated or manual) as stub into the decompiler to call that code.
89

9-
**Before proceeding, please see specific instructions for [Binary Ninja](/decompilers/binja) and [Ghidra](/decompilers/ghidra)**
10+
**Before proceeding, please see specific instructions for [Binary Ninja](/decompilers/binja) if you are using it.**
1011

1112
## Installation via Script
1213

@@ -39,11 +40,10 @@ If you are not able to find the `binsync` command, you might be able to access i
3940
please jump to the [Manual Install](#manual-install) section.
4041

4142

42-
## Manual Install
43+
## Manual Install (optional)
4344
If you were able to use a plugin manager or the built-in Python script, skip this.
4445

45-
If you are unable to install using the earlier method, you are probably on Windows. In that case, installing
46-
BinSync is a two-step process:
46+
If you are unable to install using the earlier method, you are probably on Windows. In that case:
4747
1. Install the core with the Python version associated with your decompiler: `pip3 install binsync`
4848
2. Install the decompiler stub directly into your decompilers `plugin` folder.
4949

@@ -65,7 +65,9 @@ A [Git credential helper](https://git-scm.com/doc/credential-helpers) can secure
6565
You'll need to use this method if you cloned your BinSync repo via HTTPS.
6666

6767
## Install Validation and Usage
68-
After you are done installing BinSync with the steps above, you should validate that the install works by syncing data from an example repo we have setup.
68+
If you are using Ghidra, follow the extra steps needed to finish the install [here](/decompilers/ghidra.md#extra-install-steps).
69+
70+
After you are done installing BinSync with the steps above, you should validate that the install works by syncing data from an example repo we have set up.
6971
You can find a tutorial to validate this install, with some basic usage, in the [Install Validation](./install-validation) section.
7072

7173
After validating your installation, it's **highly** recommended that you read the [Usage Guide](/ui-guide), since BinSync can be rather complicated to

0 commit comments

Comments
 (0)