This IDA script does two things:
- it renames and retype every panics found in your target executable:
- it comments decompiler output with matching code, giving you the exact panic location in source code:

# create a python venv with the tool of your choice and activate it
pip install -r requirements.txt
Then, in IDA: File -> Script File... and run venv/bin/activate and rust_metadata_finder.py.
You can implement your own disassembler class to extend this script to binary ninja or else. To do so, create a class that herits from ./rusthelper/impl/generic.py, and use it instead of the default IDAImpl.
This is based on Cindy Xiao's blog and Binary ninja plugin.
