Home

Awesome

Pretender: Automatically Emulating Hardware

This is the source code used in the paper 'Toward the Analysis of Embedded Firmware through Automated Re-Hosting'. With the included tools, you can record, model, and emulate peripherals of embedded microcontroller devices.

You can read the paper here: http://subwire.net/publication/pretender/

What's included:

Setup:

A word of caution: The recording phase of Pretender, which relies on Avatar, OpenOCD, and their numerous dependencies, can be rather fragile to set up and deploy. We've noticed small version changes in any of these components can cause various things not to work as expected, or behave intermittently, particularly regarding interrupts. Even the host system's hardware, such as the USB bus controllers (and other devices attached to them) have caused nondeterministic issues during our experiments. While we made an effort to track down these issues and report them to the various parties involved, some bugs in these underlying tools still remain that prevent us from using the latest versions.

We've made the best effort to provide instructions to reproduce our environment exactly, although due to the obvious hardware issues involved, we can't simply ship this all in something like a Docker container. We did make sure the system behaved normally on more than one machine before releasing the code.

We performed all experiments on a system running Ubuntu 16.04.

We recommend installing and configuring Pretender in a virtual environment (using bash)

mkvirtualenv pretender

You will need:

Once your virtual environment is setup, you should be able to install the pretender tools themselves:

cd python-pretender
pip install -e .

You can now use the tools in python-pretender/bin. See the examples folder for some useful examples.