Binary Ninja plugin to find metadata from Rust binaries, including:
- Source file locations from panic unwind metadata (i.e.
core::panic::Locationstructs embedded in the binary)
This plugin provides the following commands:
- Plugins > Rust Metadata Carver > Find Panic Location Paths
- Plugins > Rust Metadata Carver > Recover Panic Location Metadata Structures
First run the Find Panic Location Paths command, then the Recover Panic Location Metadata Structures command.
This command finds all Rust &str string slices in the binary that are also possible Rust source file paths.
The command will create a new &str type in the Types pane.
Note: This will only work if you've run the Find Panic Location Paths command first!
This command recovers all core::panic::Location metadata structures from the binary.
This command also finds all cross-references, inside the code, to each core::panic::Location structure. It creates a new tag (labelled with the emoji 😱) at each code location that references a core::panic::Location structure.
The full list of all found core::panic::Location metadata structures can be found in Binary Ninja's Tags pane. Each core::panic::Location that shares the same original Rust source file path is grouped together.
4689
This plugin is released under an MIT license.
2
To set up a development environment, including setting up a Python virtual environment:
python -m venv .venv && . .venv/bin/activate
python $PATH_TO_BINARY_NINJA_INSTALLATION/scripts/install_api.py
To test the plugin locally in your own Binary Ninja installation during development, create a symbolic link between your development folder, and the Binary Ninja user plugins folder, so that your development folder is loaded by Binary Ninja on startup as a plugin.
-
MacOS:
ln -s `pwd` ~/Library/Application\ Support/Binary\ Ninja/plugins/rust_metadata_carver
-
Linux:
ln -s --relative . ~/.binaryninja/plugins/rust_metadata_carver
-
Windows (Powershell):
New-Item -ItemType Junction -Value $(Get-Location) -Path "$env:APPDATA\Binary Ninja\plugins\rust_metadata_carver"
You should then change the values of the following Python settings in Binary Ninja to point to inside your development folder's virtual environment:
python.binaryOverride: Set this to the path of the Python interpreter inside your development virtual environment, e.g.$DEVELOPMENT_FOLDER/rust_metadata_carver/.venv/bin/python/python.virtualenv: Set this to the path of thesite-packagesdirectory inside your development virtual environment, e.g.$DEVELOPMENT_FOLDER/rust_metadata_carver/.venv/lib/python3.11/site-packages




