Preserving arcade games
Ange Albertini - 31c3
not everyone understands hardware
not everyone understands software
but everyone understand that it's a (good) game!
that's the cool part of emulation:
it brings games to everyone !
(games that might be lost forever)
This talk is about arcade games,
the games where you put money to play.
That money would go in the operator's pocket,
no s...
Let's go back in time:
This is Night Driver (Atari 1976)...
It's based on the first racing game,
Nürburgring (1975) made of 28 PCBs.
Berzerk was one of the first game with digitized speech.
It cost 1000 USD / word to be digitized
(it contained 16 words!)....
...they also made a german version !
same price per word ? ;)
Battlezone, the first FPS, in 1980...
...was turned into a military trainer.
Dragon's Lair, an ‘interactive’ cartoon in 1983,
at a time where HDs were 10 Mb and graphics in 16 colors.
...was using the very recent Laser Disc technology (from 1981).
But LD drives were quickly worn out, because of frequent s...
Outrun (Sega 1986), awesome racing game!
...uses 2 main CPUs at 10 Mhz (an Amiga 500 runs at 7 Mhz)
the 2nd CPU's only task is to display the roads.
(they're drawn...
Hard Drivin (1989), a 3d simulation way before modern GPUs existed...
...used 3 PCBs.
They made a triple screen version of the sequel:
6 PCBs, 4 CPUs, 9 DSPs !!!!
It’s emulated since last mont...
Sometimes, it was the arcade cabinet that was awesome.
Hang gliding, bike, car... ass poking ?!?
Sega's R360 rotates the player on all axis, even upside down !
Sometimes, the screen was the awesome part: almost half spherical...
triple CRT screen (with mirrors) or double widescreen...
...and with awesome games came awesome piracy!
As long as a game was good enough and its hardware not too extreme,
bootlegs would be made. A few of them were 'creative'.
Space Invaders (text) <> Darth Vader (gfx)
Metal Slug 3 <> Metal Slug 6 (!!)
They went further and were taking a good game,
then hacking gfx & sound to create a 'new' game
With awesome piracy came awesome protections.
once again, dedicated stuff, sometimes
tightly integrated with the game inte...
In Bee Storm, if the protected CPU is missing,
the game works, but the enemies don't shoot anymore.
In Hang-on, if the 2nd CPU (sometimes encrypted) is missing,
then roads are straight.
in S.P.Y., collisions are handled by a custom chip:
without it, you can't hurt and cannot be hurt.
to store protected data, they went further:
store data on battery-powered RAM.
the battery dies, the game dies.
the manual...
so you're not supposed to open the game,
yet all games will eventually die once all batteries are empty.
Hacking these gam...
it also enables the IP to be re-used commercially later.
Arcade games had to be awesome. They were often using dedicated parts.
they were heavily pirated. they were heavily protec...
Let's look at the Capcom Play System, known as CPS1.
known mostly for Street Fighter II
and many other good games
the complete list...
including the least known,
only emulated in June 2014.
It's SF2-based, but it's a mole
hitting game !!
CPS1 was increasingly protected:
Yet it was completely hacked.
SF2 bootlegs were common.
a final fight bootleg, adding extra characters to control.
an original CPS1… (3 PCBs)
and a CPS1 bootleg (nothing in common)
the latest CPS1 generation had custom chip+suicide battery,..
...but it was defeated nonetheless:
weak encryption+encrypted data made plaintext attack easy.
CPS1 was great.
It was protected.
It was completely hacked.
Capcom released its evolution, the CPS2
it started with this...
from Super SF2 (1993)
to Hyper SF2 (2003)
(how original !)
CPS2 was awesome...
...really awesome!
...plenty of great games...
the real successor to the CPS1
the last successful hardware from Capcom.
here is the complete list of bootlegs, hacks, swaps...
(absolutely NOTHING)
they were so desperate that they couldn't hack that...
that they hacked a console version into an arcade game (with typo)
A CPS2 is a sandwich of 2 PCBs
(sometimes only 1, sometimes 3)
the game PCB contains code+data+protection
what's in green is in clear,
in red is encrypted.
Code and Data are together.
Code is crypted, data isn't.
decryption is made on the fly,
during memory fetch.
read standard memory? as is.
read for execution? decrypt.
patch an opcode (unknown encryption)
→ black screen. game over. retry ?
CPS2 was really awesome.
it was well protected.
it was absolutely unscathed for 6 years.
Capcom had a major competitor.
the Neo-Geo is known
for many games...
an exceptional success and longevity !
a success in arcade AND as an expensive console
So Capcom created something
that made the NeoGeo look small and cheap.
It was a commercial failure...
as a last effort, they backported a recent CPS2 game.
the first decrypted CPS2 port !!!
but nothing happened. the dragon was still alive.
to defeat a dragon, you need adventurers:
Razoola, Charles MacDonald, Andreas Naive, Nicola Salmoria, David Haywood, and m...
In November 1999, Razoola re-enabled SFZ’s internal debugger (first working CPS2 patch !)
→ not blind anymore !
in spring 2000, he found that some specific memory ranges were not using encryption!
why ? no reason - just a big facepalm...
when reading relatively to code (PC),
memory fetches are actually decrypted !
Sega prevented that, but Capcom failed.
→ fi...
so, in Summer 2000, I visited Raz, hoping we'd break the algo.
but no success...
in December 2000, Raz noticed that Capcom
leaked the key to keep decryption alive.
→ automated dump is now possible !
we dumped by connecting the CPS2 to the joystick port of the PC.
ugly, clumsy, slow, but worked !
Jan 2001: first cps2 emulation
the news didn't get it right, as usual...
game over for CPS2 ?
not fully. encryption still unknown, no possible restoration yet.
recent NeoGeo games also featured better protection
but with 'joystick dumping', that was defeated quickly :p
(decryption done by Nicola Salmoria)
what about dead CPS2 boards ?
if you put back decrypted code on a dead CPS2,
it still doesn't work.
Razoola was donated a working PCB to sacrifice,
then found out why.
video and sound registers had a different address on dead games.
patching these addresses makes them work again !
workflow: decrypt code, merge with data, patch addresses...
Razoola made a universal test ROM,
and 'no more battery' Phoenix versions.
this also made bootlegs possible.
no more battery...
from MegaMan to Gigaman :(
and also some cool all-in-one:
play all games with just one board.
PC, 1999
CPS2, 1994
these 2 games look different...
however, the IP was the same.
Some nice lawyer wrote us a letter...
You see who your friends really are,
in these cases ;)
so now even the most obscure CPS2 games were preserved,
but the encryption was still unknown.
and it would take us 200 yea...
so we needed someone else to continue...
if you can't defeat the ennemy, bring your friends.
In 2005, Charles MacDonald started to work on the CPS2.
Charles MacDonald is an awesome hacker, with special weapons.
Here, his PAL blackboxer.
So, he took the CPS2 PAL, determin...
then he designed his own dedicated device...
to dump CPS2 directly via its expansion port, to USB !!!
He could dump the 8 Gb set in 17h.
He did that for several games....
so someone else needed to continue to break the algo...
that's where Nicola Salmoria and Andreas Naive helped.
they're awesome to determine encryption algorithm.
the algo was fei...
so, from one european decrypted dump of a game,
the key could be determined,
which could then decrypt the rare japanese ve...
Last, Dave Haywood designed an attack to determine
the key just from the ENCRYPTED dump of the game.
So even the rarest CP...
Conclusion
Capcom's mistakes
many people contributed, in various ways
and overall, an awesome victory !
this is the Bubble Memory system.
it’s very fragile.
to work, it needs to warm up to a certain temperature.
to me, this big countdown says:
'all these games are going to disap...
Last Survivor, a System X game from 1989,
was thought to be lost forever.
Someone still had one in working conditions:
it ...
it's one of the first split-screen multiplayer FPS
So, before it’s too late: hacking is the only way to preserve these over-protected yet great games...
CPS2Shock
http://www.cps2shock.com
http://web.archive.org/web/*/http://cps2shock.retrogames.com
Charles MacDonald
http://c...
yes, this is a CPS2 timeline :p
some bonus ?
SFA3 has a time lock: if you let it run long enough,
some special modes are unlocked.
the title background tells how many ...
extra characters, extra playing modes
Hidden in the operator menu,
Razoola found the crazy cheat codes
in the disassembly to turn on this
extras without waiting...
Charles MacDonald also worked on Sega hardware and created his own device for it...
Dumping from a Sega System24’s FD1094 to USB
to preserve games from
System 16, 24 & System X
modern tools show how fighting games engine actually work.
damage areas change from one version to the other.
there are bugs in the official releases !
attack behind you, or be hit for no reason...
tools assisted speedruns abuse games
via standard controls.
Preserving arcade games - 31c3
of 125

Preserving arcade games - 31c3

video https://www.youtube.com/watch?v=2q_qXGIj-jg audio / HD video download http://media.ccc.de/browse/congress/2014/31c3_-_5997_-_en_-_saal_6_-_201412282030_-_preserving_arcade_games_-_ange_albertini.html complete animated presentation + extras (~1Gb): https://archive.org/details/arcade31c3 more infos @ https://code.google.com/p/corkami/wiki/Arcade
Published on: Mar 4, 2016
Published in: Technology      
Source: www.slideshare.net


Transcripts - Preserving arcade games - 31c3

  • 1. Preserving arcade games Ange Albertini - 31c3
  • 2. not everyone understands hardware
  • 3. not everyone understands software
  • 4. but everyone understand that it's a (good) game!
  • 5. that's the cool part of emulation: it brings games to everyone ! (games that might be lost forever)
  • 6. This talk is about arcade games, the games where you put money to play. That money would go in the operator's pocket, no share to the arcade manufacturer. To be successfull, they had to be awesome. "Dedicated" (hardware, controls...) is the key to their success.
  • 7. Let's go back in time: This is Night Driver (Atari 1976)...
  • 8. It's based on the first racing game, Nürburgring (1975) made of 28 PCBs.
  • 9. Berzerk was one of the first game with digitized speech. It cost 1000 USD / word to be digitized (it contained 16 words!)...
  • 10. ...they also made a german version ! same price per word ? ;)
  • 11. Battlezone, the first FPS, in 1980...
  • 12. ...was turned into a military trainer.
  • 13. Dragon's Lair, an ‘interactive’ cartoon in 1983, at a time where HDs were 10 Mb and graphics in 16 colors.
  • 14. ...was using the very recent Laser Disc technology (from 1981). But LD drives were quickly worn out, because of frequent scene skipping.
  • 15. Outrun (Sega 1986), awesome racing game!
  • 16. ...uses 2 main CPUs at 10 Mhz (an Amiga 500 runs at 7 Mhz) the 2nd CPU's only task is to display the roads. (they're drawn at 30 FPS *only*, the rest of the game at 60)
  • 17. Hard Drivin (1989), a 3d simulation way before modern GPUs existed...
  • 18. ...used 3 PCBs. They made a triple screen version of the sequel: 6 PCBs, 4 CPUs, 9 DSPs !!!! It’s emulated since last month (November 14) !
  • 19. Sometimes, it was the arcade cabinet that was awesome. Hang gliding, bike, car... ass poking ?!?
  • 20. Sega's R360 rotates the player on all axis, even upside down !
  • 21. Sometimes, the screen was the awesome part: almost half spherical...
  • 22. triple CRT screen (with mirrors) or double widescreen...
  • 23. ...and with awesome games came awesome piracy!
  • 24. As long as a game was good enough and its hardware not too extreme, bootlegs would be made. A few of them were 'creative'.
  • 25. Space Invaders (text) <> Darth Vader (gfx) Metal Slug 3 <> Metal Slug 6 (!!)
  • 26. They went further and were taking a good game, then hacking gfx & sound to create a 'new' game
  • 27. With awesome piracy came awesome protections. once again, dedicated stuff, sometimes tightly integrated with the game internals
  • 28. In Bee Storm, if the protected CPU is missing, the game works, but the enemies don't shoot anymore.
  • 29. In Hang-on, if the 2nd CPU (sometimes encrypted) is missing, then roads are straight.
  • 30. in S.P.Y., collisions are handled by a custom chip: without it, you can't hurt and cannot be hurt.
  • 31. to store protected data, they went further: store data on battery-powered RAM. the battery dies, the game dies. the manual doesn't even mention it! the warranty is void if you open the game's case!
  • 32. so you're not supposed to open the game, yet all games will eventually die once all batteries are empty. Hacking these games is the only way to preserve them.
  • 33. it also enables the IP to be re-used commercially later.
  • 34. Arcade games had to be awesome. They were often using dedicated parts. they were heavily pirated. they were heavily protected. So protected that it makes them vulnerable (to time)! Hacking is the only way to preserve them.
  • 35. Let's look at the Capcom Play System, known as CPS1.
  • 36. known mostly for Street Fighter II
  • 37. and many other good games
  • 38. the complete list...
  • 39. including the least known, only emulated in June 2014. It's SF2-based, but it's a mole hitting game !!
  • 40. CPS1 was increasingly protected: Yet it was completely hacked. SF2 bootlegs were common.
  • 41. a final fight bootleg, adding extra characters to control.
  • 42. an original CPS1… (3 PCBs)
  • 43. and a CPS1 bootleg (nothing in common)
  • 44. the latest CPS1 generation had custom chip+suicide battery,..
  • 45. ...but it was defeated nonetheless: weak encryption+encrypted data made plaintext attack easy.
  • 46. CPS1 was great. It was protected. It was completely hacked.
  • 47. Capcom released its evolution, the CPS2
  • 48. it started with this...
  • 49. from Super SF2 (1993) to Hyper SF2 (2003) (how original !)
  • 50. CPS2 was awesome...
  • 51. ...really awesome!
  • 52. ...plenty of great games...
  • 53. the real successor to the CPS1 the last successful hardware from Capcom.
  • 54. here is the complete list of bootlegs, hacks, swaps... (absolutely NOTHING)
  • 55. they were so desperate that they couldn't hack that...
  • 56. that they hacked a console version into an arcade game (with typo)
  • 57. A CPS2 is a sandwich of 2 PCBs (sometimes only 1, sometimes 3)
  • 58. the game PCB contains code+data+protection
  • 59. what's in green is in clear, in red is encrypted. Code and Data are together. Code is crypted, data isn't.
  • 60. decryption is made on the fly, during memory fetch. read standard memory? as is. read for execution? decrypt.
  • 61. patch an opcode (unknown encryption) → black screen. game over. retry ?
  • 62. CPS2 was really awesome. it was well protected. it was absolutely unscathed for 6 years.
  • 63. Capcom had a major competitor.
  • 64. the Neo-Geo is known for many games...
  • 65. an exceptional success and longevity !
  • 66. a success in arcade AND as an expensive console
  • 67. So Capcom created something that made the NeoGeo look small and cheap. It was a commercial failure...
  • 68. as a last effort, they backported a recent CPS2 game. the first decrypted CPS2 port !!!
  • 69. but nothing happened. the dragon was still alive.
  • 70. to defeat a dragon, you need adventurers: Razoola, Charles MacDonald, Andreas Naive, Nicola Salmoria, David Haywood, and many others. (I worked with Razoola, and helped him on the PC side)
  • 71. In November 1999, Razoola re-enabled SFZ’s internal debugger (first working CPS2 patch !) → not blind anymore !
  • 72. in spring 2000, he found that some specific memory ranges were not using encryption! why ? no reason - just a big facepalm ! → shellcode execution for a split second.
  • 73. when reading relatively to code (PC), memory fetches are actually decrypted ! Sega prevented that, but Capcom failed. → first CPS2 decryption, word by word
  • 74. so, in Summer 2000, I visited Raz, hoping we'd break the algo. but no success...
  • 75. in December 2000, Raz noticed that Capcom leaked the key to keep decryption alive. → automated dump is now possible !
  • 76. we dumped by connecting the CPS2 to the joystick port of the PC. ugly, clumsy, slow, but worked !
  • 77. Jan 2001: first cps2 emulation
  • 78. the news didn't get it right, as usual...
  • 79. game over for CPS2 ? not fully. encryption still unknown, no possible restoration yet.
  • 80. recent NeoGeo games also featured better protection
  • 81. but with 'joystick dumping', that was defeated quickly :p (decryption done by Nicola Salmoria)
  • 82. what about dead CPS2 boards ?
  • 83. if you put back decrypted code on a dead CPS2, it still doesn't work.
  • 84. Razoola was donated a working PCB to sacrifice, then found out why.
  • 85. video and sound registers had a different address on dead games. patching these addresses makes them work again !
  • 86. workflow: decrypt code, merge with data, patch addresses...
  • 87. Razoola made a universal test ROM, and 'no more battery' Phoenix versions.
  • 88. this also made bootlegs possible. no more battery... from MegaMan to Gigaman :(
  • 89. and also some cool all-in-one: play all games with just one board.
  • 90. PC, 1999 CPS2, 1994 these 2 games look different...
  • 91. however, the IP was the same. Some nice lawyer wrote us a letter... You see who your friends really are, in these cases ;)
  • 92. so now even the most obscure CPS2 games were preserved, but the encryption was still unknown. and it would take us 200 years to dump all possible values for one game...
  • 93. so we needed someone else to continue...
  • 94. if you can't defeat the ennemy, bring your friends. In 2005, Charles MacDonald started to work on the CPS2.
  • 95. Charles MacDonald is an awesome hacker, with special weapons. Here, his PAL blackboxer. So, he took the CPS2 PAL, determine their internal configuration by blackboxing them, replace them with GALs. He now had controls over memory mapping !
  • 96. then he designed his own dedicated device...
  • 97. to dump CPS2 directly via its expansion port, to USB !!! He could dump the 8 Gb set in 17h. He did that for several games. but that wasn't enough to understand the algorithm......
  • 98. so someone else needed to continue to break the algo...
  • 99. that's where Nicola Salmoria and Andreas Naive helped. they're awesome to determine encryption algorithm. the algo was feistel based, and the key was 64 bits.
  • 100. so, from one european decrypted dump of a game, the key could be determined, which could then decrypt the rare japanese version of the game.
  • 101. Last, Dave Haywood designed an attack to determine the key just from the ENCRYPTED dump of the game. So even the rarest CPS2 game was preserved !
  • 102. Conclusion
  • 103. Capcom's mistakes
  • 104. many people contributed, in various ways
  • 105. and overall, an awesome victory !
  • 106. this is the Bubble Memory system. it’s very fragile.
  • 107. to work, it needs to warm up to a certain temperature. to me, this big countdown says: 'all these games are going to disappear if no one hacks or contribute for them'
  • 108. Last Survivor, a System X game from 1989, was thought to be lost forever. Someone still had one in working conditions: it was preserved, 20 years later !
  • 109. it's one of the first split-screen multiplayer FPS
  • 110. So, before it’s too late: hacking is the only way to preserve these over-protected yet great games...
  • 111. CPS2Shock http://www.cps2shock.com http://web.archive.org/web/*/http://cps2shock.retrogames.com Charles MacDonald http://cgfm2.emuviews.com/old2005.php Nicola Salmoria http://mamelife.blogspot.com/2006/01/8gb-2-is-still-4gb.html Andreas Naive http://andreasnaive.blogspot.com/2006_12_01_archive.html Mame (CPS2 encryption source) https://github.com/mamedev/mame/blob/master/src/mame/machine/cps2crpt.c DarkSoft http://64darksoft.blogspot.com
  • 112. yes, this is a CPS2 timeline :p
  • 113. some bonus ?
  • 114. SFA3 has a time lock: if you let it run long enough, some special modes are unlocked. the title background tells how many modes are unlocked.
  • 115. extra characters, extra playing modes
  • 116. Hidden in the operator menu, Razoola found the crazy cheat codes in the disassembly to turn on this extras without waiting weeks.
  • 117. Charles MacDonald also worked on Sega hardware and created his own device for it...
  • 118. Dumping from a Sega System24’s FD1094 to USB
  • 119. to preserve games from System 16, 24 & System X
  • 120. modern tools show how fighting games engine actually work. damage areas change from one version to the other.
  • 121. there are bugs in the official releases !
  • 122. attack behind you, or be hit for no reason...
  • 123. tools assisted speedruns abuse games via standard controls.

Related Documents