PyPANDA is a Python 3 interface to PANDA. With PyPANDA, you can quickly develop plugins to analyze behavior of a running system, record a system and analyze replays, or do nearly anything you can do using PANDA's C/C++ APIs.
Autogenerated pypanda documentation is available at docs.panda.re.
-
Build the regular C/C++ binaries for PANDA according to the documentation. If using build.sh, run
build.sh --python
to automatically complete the subsequent steps. -
Install pypanda dependencies with:
apt-get install -y genisoimage wget libffi-dev
Note CFFI is a build dependency for pypanda and your protobuf version needs to match your system version.
- Build and install the
pandare
Python package
$ cd panda/panda/python/core
$ python setup.py install
See detailed installation, usage and example programs here.
Also, given the major protobuf update, you may see this message.
TypeError: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
Using export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
so far was the easiest work around and the performance was still reasonable.
Examples are provided in the examples directory.