← Read More

Playing Flash Games Until the End of Time

Published on 2020-12-28

On December 31st 2020 flash will reach the end of it's life. Flash games were an integral part of my childhood and if you grew up in the late 90s/early 00s, like me, they might have been integral to your childhood too. I have happy memories of sneaking into my schools computer lab and getting around the content block so I could play. After this year all of those wonderful nostalgic games will be rendered unplayable (mostly). But this doesn't have to be the end. Enterprising and selfless developers have done the work to keep these games alive forever.

Disclaimer: I am not a lawyer. I am not sure what the legal status is of these games, so this guide is for instructional purposes only. If anything in here constitutes piracy I must encourage you not to do it. The fact that these games are set to become unavailable forever is no excuse. You wouldn't download a car, would you? 🤨 Hm?

anchor link Flash is Bad Though

My inner child weeps for Flash's passing but Flash had to go. The unfortunate truth is that Flash is and always will be a security nightmare. In fact, please don't enable or use Flash.

Flash has been replaced by better and more open things leading to a a brighter new age of browser games. No longer does one proprietary platform dominate the browser game world. With stuff like HTML 5 Canvas, WebGL, and Web Assembly browser games are bigger, faster, and higher-resolution than ever before, even on the same hardware. There are now tons of game engines that support the browser so browser game developers have more choices than ever. I am glad Flash is gone, it's just the games I'll miss.

anchor link Ruffle to the Rescue

ruffle logo

Ruffle is an open source Flash emulator written in Rust. Ruffle allows you to play Flash games securely and it is still receiving updates so it will continue to work on newer and newer systems. I am not part of the project at all, these people did all the hard work; I am just writing about it for internet points. If you like them please consider getting involved.

To get Ruffle, download the binary from it's releases page. You can use the browser versions to keep playing games in the browser. You could be done right now if that is enough for you but if you are curious about taking game preservation a bit further I also recommend getting the desktop versions and reading on. If you are using a *nix system, once you've downloaded and unzipped Ruffle, make it executable:

chmod +x ruffle

On windows ruffle.exe should work as is though you may see a warning that it's from an unknown publisher.

To use ruffle, you can either click the binary and select an swf file when prompted if you are not into the terminal or run ./ruffle path/to/file.swf / ./ruffle.exe path/to/file.swf. But what are these swf files and where would one get one?

anchor link The Doomsday Bunker

Having the tools to run Flash games is all well and good but when the public doesn't have access to Flash anymore, most websites will probably take them down. For example, miniclip (one of my all time favorites) will take down all of it's Flash games the day Flash reaches it's end of life. If a theoretical person wanted to have these games forever, they would need to download copies of these games and save them on their own computers. These hypothetical game copies are swf files.

Luckily for our theoretical person, the way Flash works is by sending your computer a complete copy of the game every time you play it. To find this, one needs to right click on the game, then click Inspect Element, then type .swf into the SearchHTML box that pops up, locate the URL to the swf file ending in .swf, right click that, select Copy Link Address, and enter that address into their browser to start the download. Here is an artist's rendition of what someone doing that may look like:

swf-search

Note: If the Flash plugin is installed the browser may try to play the game instead. The easiest way to get around this is to disable the plugin or use a different browser if the site requires you to have the plugin to load the game. If you are comfortable with the terminal you can use curl instead.

Once the swf file has been downloaded it can be played locally with no internet connection (usually) with Ruffle.

Note: Ruffle is still in early stages of development so this won't work for certain games. Ruffle is under active development though so it may be possible to download broken games now and play them eventually as Ruffle improves.

anchor link Help, the game won't let me play it

This section is a bit more advanced and assumes you have some degree of coding knowledge

Some games have added stuff to prevent lowlife scoundrels from playing their games away from the game's original site. But these miscreants have found a way around those road blocks. Enter the JPEXS Free Flash Decompiler. This is another tool I have nothing to do with, I can't see any way to support them other than contributing though.

A decompiler takes a program and turns it back into the code that was used to make it. Someone can then modify this decompiled code and re-compile the modified version with their changes. This is usually pretty difficult to do because a lot of information is lost when a program goes from code to a finished program. However, with Flash it's easy! Variable names and file structure are preserved so it is easy to search for names that may be related to your problem and change stuff, hypothetically of course.

I would recommend a hypothetical user of this decompiler download the ZIP version from their latest release, unpack it, and run the .jar file with jdk-10. I have heard that certain people have trouble running it with later versions of Java. Once it's running it is possible to open swf files in it, search them, modify them, and save them.

The language these Flash games are written in is called ActionScript and it is extremely similar to JavaScript. Someone who knows a bit of JavaScript should be able to do some minor modifications to Flash games without much difficulty.

So let's say someone has encountered an unsupported location screen. They could decompile the code and search for the text that appears on the unsupported location screen, then find out that that frame is called something like unsupportedLocationFrame. Then, they could search the code for anywhere that sends the player to this unsupportedLocationFrame and see a valid location check. Something that may look a bit like like:

locationValid=false

// ... some logic

if (!locationValid) { goTo('unsupportedLocationFrame') }

Now if this code just happened to become something like:

locationValid=true

// ... some logic

if (!valid) { goTo('unsupportedLocationFrame') }

Certain players may find the game quite a bit more accessible.

Tip: It is more reliable to change the p-code rather than the ActionScript code. Changing the ActionScript code is an experimental feature of JPEXS. Sometimes it won't work. P-code is a sort of intermediate code between human-friendly code and machine code. An interpreter reads this p-code and translates it to machine code while you run the program/game. The p-code isn't super readable but JPEXS will show display the line of p-code associated with the ActionScript code next to the ActionScript code. This makes it pretty easy to make small p-code changes directly. For example, in the change above, changing the default value from false to true is a trivial p-code change. From the perspective of the ActionScript code it makes more sense to just delete the check entirely, or even the whole file, but it is often safest to change things by making the smallest possible p-code change.

Warning: Editing and saving a decompiled game in the decompiler will change the original file in place. This may result in the edit breaking the only copy of the game file. To avoid this it is recommended to either use git or save an original copy of the file elsewhere.

Beyond getting around exclusivity measures it is also possible to use the decompiler to fix broken games. For example, if certain features are not supported by Ruffle, it may be possible to disable them or work around them. You could also use this to modify a game to your heart's content. Too hard? Make it a bit easier. One enemy you really hate? Delete it. The sky's the limit.

anchor link Time is Running Out

Hope you enjoyed and maybe learned something. If you are not up for dealing with any of this stuff remember to at least give your favorite games one last play before it's too late! Happy New Year!

← Read More