You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/decompilers/ghidra.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,19 +5,26 @@ sidebar_position: 3
5
5
# Ghidra
6
6
7
7
## 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
- IDA Pro: **>= 8.4** (if you have an older version, use [BinSync v4.10.1](https://github.com/binsync/binsync/commit/bac7b9d4a6cca64810bb07428391415702765cd4))
33
32
- Binary Ninja: **>= 2.4**
34
33
- 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))
36
35
37
36
All versions require **Python >= 3.10** and **Git** installed on your system.
Copy file name to clipboardExpand all lines: docs/quickstart/install.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,10 @@ sidebar_position: 1
4
4
5
5
# Installation
6
6
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.
8
9
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.**
10
11
11
12
## Installation via Script
12
13
@@ -39,11 +40,10 @@ If you are not able to find the `binsync` command, you might be able to access i
39
40
please jump to the [Manual Install](#manual-install) section.
40
41
41
42
42
-
## Manual Install
43
+
## Manual Install (optional)
43
44
If you were able to use a plugin manager or the built-in Python script, skip this.
44
45
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:
47
47
1. Install the core with the Python version associated with your decompiler: `pip3 install binsync`
48
48
2. Install the decompiler stub directly into your decompilers `plugin` folder.
49
49
@@ -65,7 +65,9 @@ A [Git credential helper](https://git-scm.com/doc/credential-helpers) can secure
65
65
You'll need to use this method if you cloned your BinSync repo via HTTPS.
66
66
67
67
## 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.
69
71
You can find a tutorial to validate this install, with some basic usage, in the [Install Validation](./install-validation) section.
70
72
71
73
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