Euskal16 Logo Creative Commons License

Wii: Hardware, security, hacking, and homebrew

Héctor Martín, <hector@marcansoft.com>

Euskal Encounter 16, BEC (Barakaldo), Julyio de 2008

Introduction

Our goals:

Manufacturers try to make it difficult for us...

In this conference we'll cover:

¿What's a Wii?

After the GameCube's underwhelming sales, Nintendo decided to reinvent the console:

From GameCube to Wii

Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1 Diagrama hardware 1

Things get messy...

On the GameCube, running homebrew was easy

Nintendo seems to have learned the lesson with the Wii

Or that's the theory anyway...

The Wii's software

There are a bunch of independent software modules:

Except for the boot stages, they are all titles and share a common installation, signing, and execution subsystem

Titltes

A title is a software package, composed of:

The TMD

The TMD is the base file that is used to sign the contents, and contains:

TMDs are signed using 2048-bit RSA

The eTicket

The eTicket gives us access to a specific title, possibly with restrictions. Contains:

eTickets are also signed using 2048-bit RSA

There are two variants:

Keys, keys, keys (too lazy to translate this)

En la Wii se utilizan varias claves criptográficas. Algunas son comunes a todas las consolas:

Y otras son privadas y cambian de consola a consola:

IOS

IOS is the operating system that runs on the Starlet during normal operation of the Wii:

There are several versions of IOS installed on the console, since each title always uses the same version. Each version is a different title, and we call them IOS21, IOS30, IOS37, etc.

IOS (continued)

Some important parts of IOS:

The boot process

The boot process is designed to guarantee that any software running on the console is officially signed by Nintendo:

This interesting system lets Nintendo change boot1 in new consoles whenever they want, without having to trash already manufactured Hollywood chips.

boot2 can be updated via software (this is the first part of the boot process that can be upgraded or modified after the factory)

So now what?

So far, it looks like a pretty secure system

There are several kinds of exploits that have been used to break the system's security:

Twiizer Attack (blah blah you know this part)

En el modo de GameCube, pronto se pudo usar homebrew gracias a los chips

Podemos atacar el hardware para conseguir información interesante

Nace el Twiizer Attack, que nos permitió extraer todas las claves importantes, incluyendo la clave común, gracias a la cual podemos:

Fakesigning (ninty fails at hash comparisons)

Ahora que podemos ver un IOS en claro, podemos desensamblarlo y analizarlo

Se encontró un curioso problema en la comprobación de firmas de IOS:

Una grave metedura de pata: se comprueba dicho hash ¡como si fuera texto! Entonces:

Con este fallo podemos generar firmas que la Wii considerará válidas. Se conocen como firmas trucha ya que el primer programa en hacer uso de ellas fue Trucha Signer.

Twilight Hack (we've got the save keys so we can exploit games)

Nos queda el problema de conseguir meter nuestro código en algún sitio para que la Wii lo ejecute

Sin embargo, gracias al Twiizer Attack tenemos las claves privadas de nuestra consola

Gracias a un fallo en el conocido juego The Legend of Zelda: Twilight Princess, podemos ejecutar código en el PowerPC

Con esto nace el Twilight Hack: un save del juego que, explotando el bug, carga un ejecutable desde la tarjeta SD.

Counterattacks

Nintendo ha ido solucionando algunos de los problemas:

Es muy dificil que consigan cerrar todo en actualizaciones futuras:

Current homebrew state

Tenemos un control casi total sobre la consola:

Sin embargo, todavía dependemos mucho del software de Nintendo:

Project: recovery firmware

La idea: un código personalizado delante de boot2 que implemente un sistema de recuperación

Nos daría inmunidad contra cualquier actualización, siempre y cuando no se toque boot2

Estamos desarrollando una alternativa básica a IOS que de acceso directo a todo el hardware de la Wii, sin restricciones, para usarse en programas tales como:

Future: intelligent IOS patcher

Un parcheador que dinámicamente parchee IOS desde boot2

Con esto ya tendríamos un control prácticamente total sobre la consola y sus actualizaciones

Homebrew

Tenemos librerías para acceder a casi todo el hardware de Wii

Herramientas de desarrollo:

Cargadores:

Demo

Demo

Links