Ghidra Notebook is a Jupyter kernel that combines the flexibility of Ghidra's API with the Jupyter notebook system to create reproducable, scriptable notes.
This allows you to create notes that can also be run to show both your thinking and your work.
This project depends on the (excellent) ghidra-bridge project. You'll need to install Ghidra Bridge before you can use ghidra-notebook.
# Install the package
pip3 install --user .
# Install the iPython kernel
python3 -m ghidra-notebook.install
You can use any Jupyter notebook client you like! See install Jupyter for setting these up.
Start the ghidra-bridge server. When you start the Ghidra kernel in Jupyter it will connect to ghidra-bridge and you'll have access to the Ghidra API in whatever context the bridge was started in.
Once ghidra-bridge is started, you can launch a Jupyter Lab and select "Ghidra" to start the kernel, and connect to ghidra-bridge.
To run Jupyter lab:
pip install jupyterlab
jupyter-lab
Or launch directly in the terminal
jupyter console --kernel ghidra
Once you're in the Jupyter shell, try something like:
print(currentProgram)
print(currentAddress)
You'll have access to the FlatAPI along with the rest of the Ghidra API, just as you would in the normal Ghidra python terminal, except thanks to Ghidra Bridge you'll have Python3.