13.03.2013 Views

Hacking the Xbox

Hacking the Xbox

Hacking the Xbox

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 8 - Reverse Engineering <strong>Xbox</strong> Security 131<br />

The correct polarity of <strong>the</strong> eight data signals was determined by observing<br />

<strong>the</strong> idle bus data bit pattern. The HyperTransport bus spends most of<br />

its time in an idle state, so this is not difficult. If <strong>the</strong> idle pattern is<br />

supposed to be all 0s, <strong>the</strong>n any bit position that shows up as a 1 has its<br />

polarity inverted. This was corrected in hardware by inserting an inversion<br />

term in <strong>the</strong> FPGA on <strong>the</strong> appropriate wire.<br />

Determining <strong>the</strong> correct bit ordering is much more difficult, however.<br />

Operating under <strong>the</strong> assumption that data coming across <strong>the</strong><br />

HyperTransport bus must in large part come from <strong>the</strong> FLASH ROM, a 1’s<br />

count was performed on a byte by byte basis. The <strong>the</strong>ory is that <strong>the</strong> bus<br />

ordering is a pure permutation, meaning that <strong>the</strong> number of binary 1’s in a<br />

byte is preserved between <strong>the</strong> FLASH ROM data and <strong>the</strong> data captured by<br />

<strong>the</strong> logger. Patterns of 1’s counts were lined up against each o<strong>the</strong>r to identify<br />

candidate regions of correspondence between FLASH ROM and logged<br />

data. Fortunately, <strong>the</strong> first few words to come across <strong>the</strong> HyperTransport<br />

bus are some chipset-specific initializations that are located near <strong>the</strong> bottom<br />

of FLASH memory, so finding a set of patterns that lined up correctly did<br />

not take too long. A set of bytes from each ROM and <strong>the</strong> logger were<br />

tabulated, and, with <strong>the</strong> aid of a short C program, columns of bits were<br />

transposed until an ordering was found that made all of <strong>the</strong> row values<br />

match up.<br />

Making Sense of <strong>the</strong> Captured Data<br />

Now that valid data traces have been extracted, <strong>the</strong> problem remains of<br />

deciphering <strong>the</strong> meaning of it all. Before doing so, let us recap what we<br />

know about <strong>the</strong> data we have collected thus far.<br />

• Temporal correlation. The logged data, on a macroscopic scale,<br />

should have a strong time correlation to <strong>the</strong> expected sequence of<br />

initialization events: jam table initialization, followed by a decryption<br />

step, followed by execution from RAM. The regions of <strong>the</strong> log traces<br />

that correspond to each of <strong>the</strong>se events can be determined by just<br />

observing when large bursts of activity happen, followed by regions<br />

of silence.<br />

• Transaction lengths. Since <strong>the</strong> Pentium processor has both a<br />

data and an instruction cache, all fetches on <strong>the</strong> HyperTransport bus<br />

to FLASH ROM or <strong>the</strong> hidden boot ROM should come in evenlength<br />

bursts of traffic.<br />

• Guaranteed ordering. The collected data is time stamped and<br />

chronologically correct, so if <strong>the</strong> first instruction fetched in <strong>the</strong> reset<br />

vector can be identified in <strong>the</strong> data logs, <strong>the</strong> position and structure<br />

of <strong>the</strong> remainder of <strong>the</strong> instructions can be deduced.<br />

Initially, I neglected to check <strong>the</strong> macroscopic organization of data coming<br />

across <strong>the</strong> HyperTransport bus, and this caused me some problems. The<br />

simplified block diagram of <strong>the</strong> logging machine in Figure 8-7 would have<br />

<strong>the</strong> log FIFO resetting each time <strong>the</strong> HyperTransport bus is reset. This

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!