Skip to content

Commit

Permalink
GUI: Documentation, no code changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-carciofini committed Jan 23, 2025
1 parent dafda1e commit ee23176
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
24 changes: 6 additions & 18 deletions pate_binja/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PATE Verifier Plugin for Binary Ninja
# PATE Verifier Binary Ninja Plugin

This is an early release of the PATE plugin for Binary Ninja (Binja). At this time, there is no interface to specify PATE run parameters. You must create a run configuration file in json format. For example:
```json
Expand Down Expand Up @@ -44,23 +44,11 @@ export PATE_BINJA_MODE=BUILD
Once Binary Ninja is running, you can run PATE from the "Plugins" menu. An open file dialog will open. By defualt it will be looking for a PATE Run Configuration file (*.run-config.json). If you want to run a replay file, select "PATE Replay (*.json)" in the file type drop down menu.


## Developer Notes (macOS with PyCharm)
## MCAD Intigration

To run demos in tty mode, you need to define an environment variable to point at the clone of the [PATE Binja Demos repo](https://gitlab-ext.galois.com/pate/pate-binja-demos):
```bash
export PATE_BINJA_DEMOS=<demos dir>
```

To install the Binja api for completion in PyCharm:

- Setup project with venv (Python 3.11 or newer)
- Go to python console (runs within venv)
- python /Applications/Binary\ Ninja.app/Contents/Resources/scripts/install_api.py
MCAD provides timing analysis for instruction traces. To enable this integration you need to do two things:

To set up debugging under Binary Ninja (requires PyCharm Pro):
1. Install the MCAD docker image. See the Docker section here:
https://github.com/securesystemslab/LLVM-MCA-Daemon?tab=readme-ov-file#docker. Use the `broker-improvements` branch.
2. In the Binary Ninja UI, got to Preferences. In the PATE section set name the MCAD docker image.

- See https://docs.binary.ninja/dev/plugins.html#remote-debugging-with-intellij-pycharm
- In Binja settings specify python interpreter and site package dir to point at your Pycharm project venv installs.
- Create the run config. Note "pip install ..." command line for next step. Pick a port.
- In Pycharm python console (venv) execute the "pip install ..." command.
- May also need/want to set python interpreter and site packages in Binary Ninja settings to the venv for the pyCharm project.
4 changes: 4 additions & 0 deletions pate_binja/mcad/PateMcad.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright 2023-2025, Galois Inc. All rights reserved.
#
# Python code wrapping the MCAD GRPC communications.

from __future__ import annotations

import os
Expand Down
2 changes: 2 additions & 0 deletions pate_binja/mcad/binja.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// GRPC proto specification for communications between MCAD and the PATE Verifier Binary Ninja Plugin

syntax = "proto3";

service Binja {
Expand Down
5 changes: 4 additions & 1 deletion pate_binja/pate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Copyright 2023-2024, Galois Inc. All rights reserved.
# Copyright 2023-2025, Galois Inc. All rights reserved.
#
# Wrapper for the PATE verifier. Handles startup, shutdown and I/O with the PATE Verifier. This code is independent of
# the GUI and can be run standalone in tty mode.

from __future__ import annotations
import abc
Expand Down
2 changes: 2 additions & 0 deletions pate_binja/run_pate_demo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Run the PATE Verifier Binary Ninja Plugin in tty mode, independently of Binary Ninja.

import pate

pate.run_pate_demo()
4 changes: 3 additions & 1 deletion pate_binja/view.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright 2023-2024, Galois Inc. All rights reserved.
# Copyright 2023-2025, Galois Inc. All rights reserved.
#
# The GUI code for the PATE Verifier Binary Ninja Plugin.

from __future__ import annotations
import io
Expand Down

0 comments on commit ee23176

Please sign in to comment.