Changes

Simulating the XMEGA Target Code

10 bytes added, 13:42, 1 May 2018
no edit summary
This page describes how to simulate the XMEGA target code in order to determine the length of time AES takes. This was designed for the CHES CTF 2016, but may be valuable in other circumstances.
==Required Tools==
You will require the following tools:
* avr-gcc (suggested to use WinAVR, but you can actually build with Atmel Studio)
==Simulating==
The following assumes you have an EXTERNAL build environment (such as WinAVR, or avr-gcc). Building with Atmel Studio is possible, but not documented/supported right now.
=== Opening Object File ===
To begin, we'll be opening the existing .elf file. This file contains all the debug information created during the build process.
Great - now let's look into how we can simulate this project.
=== Simulating ===
# On the tool-bar, there is an open to select the debug interface. It may say "No Tool" as below, if so click to select the tool:
* Set a breakpoint at the higher-level code, as this is where the trigger starts. Check how many cycles it takes to reach the first vulnerable portion of your code.
===Building===
At this time, it is recommended to use WinAVR to build. The version of certain tools provided with Atmel Studio does not directly work with the provided Makefile.
See [[http://wiki.newae.com/CHES2016_CTF#Compiling_Firmware_as_Server_Does]] for brief details. You can use the built ELF-file as above.