diff --git a/pate_binja/README.md b/pate_binja/README.md index c5ad878d..6a1550ee 100644 --- a/pate_binja/README.md +++ b/pate_binja/README.md @@ -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 @@ -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= -``` - -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. diff --git a/pate_binja/mcad/PateMcad.py b/pate_binja/mcad/PateMcad.py index 410f7fc9..73d95c39 100644 --- a/pate_binja/mcad/PateMcad.py +++ b/pate_binja/mcad/PateMcad.py @@ -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 diff --git a/pate_binja/mcad/binja.proto b/pate_binja/mcad/binja.proto index b6a0f20d..a205924f 100644 --- a/pate_binja/mcad/binja.proto +++ b/pate_binja/mcad/binja.proto @@ -1,3 +1,5 @@ +// GRPC proto specification for communications between MCAD and the PATE Verifier Binary Ninja Plugin + syntax = "proto3"; service Binja { diff --git a/pate_binja/pate.py b/pate_binja/pate.py index 15569eb8..e342a94b 100644 --- a/pate_binja/pate.py +++ b/pate_binja/pate.py @@ -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 diff --git a/pate_binja/run_pate_demo.py b/pate_binja/run_pate_demo.py index c0c37766..6521cdca 100644 --- a/pate_binja/run_pate_demo.py +++ b/pate_binja/run_pate_demo.py @@ -1,3 +1,5 @@ +# Run the PATE Verifier Binary Ninja Plugin in tty mode, independently of Binary Ninja. + import pate pate.run_pate_demo() \ No newline at end of file diff --git a/pate_binja/view.py b/pate_binja/view.py index cc5bbd56..88de9620 100644 --- a/pate_binja/view.py +++ b/pate_binja/view.py @@ -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