Reverse Engineering A PokeWalker

The PokeWalker is part of Nintendo’s long quest to get children (and likely some adults) walking and exercising. There’s the PokeWalker, Pokemon Pikachu, PokeBall Plus, Pokemon Pikachu 2, Pokemon mini, and of course Pokemon Go. Despite being out a decade, there wasn’t a ROM dump for the device and there was minimal documentation on the communication protocol. [Dmitry Grinberg] took it upon himself to change all that and crack the PokeWalker open.

At its heart, the PokeWalker is just a pedometer with an IR port and a 96×64 grayscale screen. It came out in 2009 to accompany the new Pokemon release for the Nintendo DS. Cracking open the device revealed a 64KB EEPROM, a Renesas H8/38606R CPU, a Bosch BMA150 accelerometer, and a generic IR transceiver. The CPU is particularly interesting as in addition to being quite rare, it has a mix of 8, 16, and 32 bits with 24-bit pointers. This gives it a 64K address space. While the CPU is programmable, any attempt to do so erases the onboard flash. The communication protocol packets have an 8-bit header that precedes each packet. The header has a checksum, a command byte, and four bytes of session id, and an unused byte. Curiously enough, every byte is XOR’d with 0xAA before being broadcast.

One command is an EEPROM write, which uses back-referencing compression. Each chunk of data to be written is packaged into 128-byte chunks, though 128 bytes likely won’t be sent thanks to the compression. The command can theoretically reference 4k bytes back, but in practice, it can only reference 256 bytes back. It was this command that laid the foundation for the exploit. By carefully crafting the command to send, the command can overflow the decompression buffer and into executable code. Only a few bytes can be overflowed so the payload needs to be carefully crafted. This allowed for an exploit that reads the system ROM and broadcasts it out the IR port. Only 22k bytes can be dumped before the watchdog reboots the device. By changing the starting address, it was easy to do multiple passes.

After the ROM was stitched together from the different passes, the different IR commands were analyzed. In particular, a command was found that allows direct writes into RAM. This makes for a much easier exploit as you can write your exploit, then override a pointer in the event table, then have the exploit revert the event table once the system naturally jumps to your exploit.

[Dmitry] finishes off this amazing exploit by writing a PalmOS app to dump the ROM from a PokeWalker as well as modify the system state. PalmOS was chosen as it is an easy and cheap way to have a programmable IR transciever. All in all, a gorgeous hack with a meticulous writeup. This isn’t the first video game accessory that’s been reverse engineered with a scrupulous writeup, and we’re sure it won’t be the last.

Continue reading “Reverse Engineering A PokeWalker”

Playing Doom On Keysight Oscilloscope Via Windows CE

We all know the drill when buying a digital oscilloscope: buy the most hackable model. Some choose to void the warranty right away and access features for which the manufacturer has kindly provided all the hardware and software but has disabled through licensing. Few of us choose to tap into the underlying embedded OS, though, which seems a shame.

When [Jason Gin]’s scope started giving him hints about its true nature, he decided to find a way in. The result? An oscilloscope with a Windows desktop that plays Doom. The instrument is a Keysight DSOX1102G which [Jason] won during the company’s “Scope Month” giveaway. Relatively rare system crashes showed the familiar UI trappings of Windows CE.

Try as he might, [Jason] couldn’t get the scope to crash on cue — at least not until he tried leaving an external floppy drive plugged into the USB port on startup. But in order to use the desktop thus revealed, a keyboard and mouse were needed too. So he whipped up a custom USB switch cable, to rapidly toggle in the keyboard and mouse after the crash. This gave him the keys to the kingdom, but he still had a long way to go. We won’t spoil the story, but suffice it to say that it took [Jason] a year and a half, and he learned a lot along the way.

It was nice to hear that our review of the 1000X series scopes helped [Jason] accomplish this exploit. This hack’s great for bragging rights, as one way to prove you’ve owned a system is telling people it runs Doom!