Wednesday, January 7, 2015

Code Insertion via Buffer Overlow on Nintendo Systems

I saw this today for the first time and thought it was pretty cool. Some people figured out a way to insert code into Nintendo games (Super Nintendo and Game Boy).

http://arstechnica.com/gaming/2014/01/how-an-emulator-fueled-robot-reprogrammed-super-mario-world-on-the-fly/


The above link shows this happening in Super Mario World on the SNES.

This years attempts have been just as neat:

http://arstechnica.com/gaming/2015/01/pokemon-plays-twitch-how-a-robot-got-irc-running-on-an-unmodified-snes/


From watching, these are tool-assisted speed runs where precise inputs are made at just the exact frames to make it appear that magical things are happening. A bot is used as human players could not input the controls fast enough on said frames. These frame manipulations are made in a way to alter the memory in a sort of buffer overflow so that code can be sent to the ROM.

In very easy terms, a buffer overflow occurs when a buffer runs out of storage room and adjacent memory becomes overwritten  to try and store everything.

So you do these things and put code into the ROM and then jump to that specific memory location and the code that has been placed there will run. Really neat stuff.


No comments:

Post a Comment