
Binary Ninja plugin for reverse engineering PTX -- the virtual instruction set architecture of CUDA-based GPUs.
Author: Nicolò Altamura
Explore PTX code through Binary Ninja
ptxNinja is an architecture plugin for Binary Ninja targeting PTX, the language for the virtual architecture of CUDA-based GPU. This allows you to:
The plugin can be installed using Binary Ninja's plugin manager.
For a manual installation, follow these steps in Binary Ninja's plugin folder:
git clone https://github.com/seekbytes/ptxninja.git
cd ptxninja
# optionally: use a virtual environment
python -m venv ptxninja-env
source ptxninja-env/bin/activate
# install requirements
pip install ptx-parser
If you use a virtual environment, you'll need to manually set the site-packages path in the Binary Ninja settings.
If you are not sure where to start, or you have never seen a PTX file, you may want to checkout some toy kernels under the examples/ directory. These include:
PTX is based on a text format language and the output of the nvdisasm/cuobjdump has already plenty of information that are inserted into the binaries. Dealing with text requires to build a precise grammar for testing the parser, however there are some limits:
atom) are fully supportedcuobjdump/cufilt beautification is not yet appliedFor more information, contact Nicolò Altamura (@nicolodev).