Extracting Flash Games: Difference between revisions

From Flashpoint Datahub
Jump to navigation Jump to search
m (Updated swf.py link)
 
(21 intermediate revisions by 6 users not shown)
Line 1: Line 1:
This page is intended as reference for anyone who wants to extract Flash games on their own. Things to know:
This page is intended as reference for anyone who wants to extract Flash games on their own. Things to know:


* SWF: The compiled Flash application. Can only run on browsers or Macromedia's Flash Player. Browser support is set to end soon.
* SWF: The compiled Flash movie. Can run in the Flash plugin or projector. Since the end of 2020, Adobe no longer supports Flash Player: see [[Flash EOL]].
* EXE: Projector executables that have the Flash application working without needing a browser.
* EXE: Projector executables packaged with an SWF. A convenient way to run Flash games on Windows, but only works for simple games.
* FLA: The project file of the Flash application. The source file the author used to generate the SWF, can be freely edited with Flash.
* FLA: The project file of the Flash application. The source file the author used to generate the SWF, can be edited with Flash.
* ActionScript: Programming scripting language for Flash applications.
* ActionScript: Programming language for Flash applications.


 
==Downloading SWF Files==
==Extracting==
* Use a dedicated browser extension. Some recommendations:
* Use a dedicated browser extension. Some recommendations: (TODO)
** [[Game Saver Extension|Game Saver Chrome extension]]
* Use the Developer Tools in either Firefox or Chrome to find the swfs. Sometimes it's as simple as copy pasting a direct link to a file with the swf extension from the page's source. But sometimes the search will be more involved and require combing through the browser cache for files with content type <code>/x.shockwave</code>.
** [https://chrome.google.com/webstore/detail/flash-video-downloader/aiimdkdngfcipjohbjenkahhlhccpdbc Flash Video Downloader] Chrome extension
* [http://www.free-decompiler.com/flash/JPEXS-Decompiler] can download swf files already loaded into browser memory.
* Use the Developer Tools in either Firefox or Chrome to find the SWFs.
** Right-click the page and click "View Page Source." Press Ctrl-F and search for ".swf"
** Right-click the page and click "Inspect Element." Click the element picker on the top-left of the developer tools and select the Flash game. This may bring up an embed code which includes a .swf link.
** Right-click the page and click "Inspect Element." Click the Network tab and reload the page. Use the search bar to find the SWF files that are loaded. If the game loads additional resources, they should be visible here too.
* [https://github.com/jindrapetrik/jpexs-decompiler JPEXS Free Flash Decompiler] can extract SWF files already loaded into browser memory. See the [[#SWF Decompiling|Decompiling]] section.
* A solid method to access the main .swf file for a game, is to save the entire webpage where the game resides using your browser.
* A solid method to access the main .swf file for a game, is to save the entire webpage where the game resides using your browser.
  Select "File > Save Page As..." then, under the "save as type" section, choose "Web Page, complete".
*# Select "File > Save Page As..." then, under the "save as type" section, choose "Web Page, complete".
  Search the newly saved website directory (and sub directories if required), and you should find the game's main .swf loader.
*# Search the newly saved website directory (and sub directories if required), and you should find the game's main .swf loader.


Some websites require specific methods:
For some websites, a custom solution can be easier:
* [http://pastebin.com/GX4dMN0G ArmorGamesSwfFinder.py] - Python script for ArmorGames
* [http://pastebin.com/GX4dMN0G ArmorGamesSwfFinder.py] - Python script for ArmorGames
* The [https://github.com/FlashpointProject/fpcurator/ fpcurator] and [http://web.archive.org/web/20230815220905/https://cdn.discordapp.com/attachments/441713444694261760/617110942563696650/AutoCurator.zip AutoCurator] tools can automatically download games from many sites.


==SWF Modding==
==SWF Decompiling==
Many SWF files will run once extracted, however some have DRM to run always online, from specific sites, and/or making use of external files. Those won't work directly or will only extract partially. Those will need modding to extract in full and to be made to work offline.
Many SWF files will run immediately in a projector, but some have sitelocks, require an internet connection, and/or need external files. The latter types of Flash games need Flashpoint's technology. It is also possible to decompile SWFs to modify them or understand how they work.


[http://www.free-decompiler.com/flash/ JPEXS-Decompiler] can:
[https://github.com/jindrapetrik/jpexs-decompiler/releases JPEXS Free Flash Decompiler] can:
* Convert SWF to FLA
* Convert SWF to FLA
* Decompile ActionScript
* Decompile ActionScript
* Extract sound/image/misc assets from the SWF
* Extract sound/image/misc assets from the SWF


This isn't always straightforward because of some obfusciation methods used.
This isn't always straightforward because of some obfuscation methods used.


Some games rely on compression to extract a fuller SWF, which you can grab from your RAM using SWF Memory Dumper: https://drive.google.com/open?id=1uVZDTznTB6m-NiEo5sYhveyXa217UsPb
Some games rely on compression to extract a fuller SWF, which you can grab from your RAM using JPEXS's "Search SWFs in memory" function, or using the standalone [https://web.archive.org/web/20130614204347/http://www.forceprojectx.com/SWFMemoryDumper.zip SWF Memory Dumper tool].


==SWF Playback==
==SWF Playback==
 
Use the official Adobe Flash Player Projector, available [https://web.archive.org/web/20200818023027/https://www.adobe.com/support/flashplayer/debug_downloads.html here]. This is the method that Flashpoint uses, along with the rest of our technology stack.
Use the official Adobe Flash Player Projector, available here: https://www.adobe.com/support/flashplayer/debug_downloads.html


Some fixes for browsers (TBA):
Some fixes for browsers (TBA):
* Firefox: Type <code>about:config</code> and change <code>plugins.http_https_only</code> to <code>false</code>
* Firefox: Type <code>about:config</code> and change <code>plugins.http_https_only</code> to <code>false</code>


==Convert SWF to EXE==
==Extract SWFs from EXEs==
Flash swf files can be converted to autonomous executables that will always work.  
Some executables are just Flash projectors bundled with an SWF file. To extract the SWF for use on another operating system or in Flashpoint, you can use [https://web.archive.org/web/20190717135116/http://www.northcode.com/blog/Extract-SWF-files-from-Flash-Executables exe2swf].
 
JPEXS Flash Decompiler can also be used to extract SWFs from EXEs. Open the FFDEC program, then drag the EXE into the program window. Any SWFs contained in the EXE will appear on the left sidebar. To save the SWF, select it on the sidebar and click the "Save as.." button in the top menu bar.
 
Another method is to use the [https://gist.githubusercontent.com/einstein95/1fc993764ec65820706d39c55c375f8d/raw/swf.py swf.py script]. [https://www.python.org/ Install Python] if you haven't already, download and extract the ZIP file, and run <code>python swf.py application.exe</code> in your Command Prompt or Terminal.
 
==Convert SWFs to EXEs==
Flash SWF files can be converted to standalone executables. However, this will only work for simpler Flash games that are not sitelocked. We recommend that you add games to Flashpoint instead.
 
* JPEXS Flash Decompiler can create EXEs from SWFs. Click File -> Save as EXE.
* Older Macromedia Flash projectors provide the menu option File/Create Projector.
* The SWF to EXE tool works, but the included projector should be replaced with the newest version: http://swftools.sourceforge.net/swf-to-exe.html
* [http://web.archive.org/web/20230815220756/https://cdn.discordapp.com/attachments/432708847304704013/597185878443556866/Create_Projector_Windows.swf This SWF can be used to create EXEs]


* Macromedia's Flash Player 8 can do that from File/Create Projector.
<noinclude>
* BlueMaxima can confirm that this tool works as expected, although you'll want to replace the included projector with the newest version: http://swftools.sourceforge.net/swf-to-exe.html
[[Category:Other Guides]]
</noinclude>

Latest revision as of 21:08, 16 November 2023

This page is intended as reference for anyone who wants to extract Flash games on their own. Things to know:

  • SWF: The compiled Flash movie. Can run in the Flash plugin or projector. Since the end of 2020, Adobe no longer supports Flash Player: see Flash EOL.
  • EXE: Projector executables packaged with an SWF. A convenient way to run Flash games on Windows, but only works for simple games.
  • FLA: The project file of the Flash application. The source file the author used to generate the SWF, can be edited with Flash.
  • ActionScript: Programming language for Flash applications.

Downloading SWF Files

  • Use a dedicated browser extension. Some recommendations:
  • Use the Developer Tools in either Firefox or Chrome to find the SWFs.
    • Right-click the page and click "View Page Source." Press Ctrl-F and search for ".swf"
    • Right-click the page and click "Inspect Element." Click the element picker on the top-left of the developer tools and select the Flash game. This may bring up an embed code which includes a .swf link.
    • Right-click the page and click "Inspect Element." Click the Network tab and reload the page. Use the search bar to find the SWF files that are loaded. If the game loads additional resources, they should be visible here too.
  • JPEXS Free Flash Decompiler can extract SWF files already loaded into browser memory. See the Decompiling section.
  • A solid method to access the main .swf file for a game, is to save the entire webpage where the game resides using your browser.
    1. Select "File > Save Page As..." then, under the "save as type" section, choose "Web Page, complete".
    2. Search the newly saved website directory (and sub directories if required), and you should find the game's main .swf loader.

For some websites, a custom solution can be easier:

SWF Decompiling

Many SWF files will run immediately in a projector, but some have sitelocks, require an internet connection, and/or need external files. The latter types of Flash games need Flashpoint's technology. It is also possible to decompile SWFs to modify them or understand how they work.

JPEXS Free Flash Decompiler can:

  • Convert SWF to FLA
  • Decompile ActionScript
  • Extract sound/image/misc assets from the SWF

This isn't always straightforward because of some obfuscation methods used.

Some games rely on compression to extract a fuller SWF, which you can grab from your RAM using JPEXS's "Search SWFs in memory" function, or using the standalone SWF Memory Dumper tool.

SWF Playback

Use the official Adobe Flash Player Projector, available here. This is the method that Flashpoint uses, along with the rest of our technology stack.

Some fixes for browsers (TBA):

  • Firefox: Type about:config and change plugins.http_https_only to false

Extract SWFs from EXEs

Some executables are just Flash projectors bundled with an SWF file. To extract the SWF for use on another operating system or in Flashpoint, you can use exe2swf.

JPEXS Flash Decompiler can also be used to extract SWFs from EXEs. Open the FFDEC program, then drag the EXE into the program window. Any SWFs contained in the EXE will appear on the left sidebar. To save the SWF, select it on the sidebar and click the "Save as.." button in the top menu bar.

Another method is to use the swf.py script. Install Python if you haven't already, download and extract the ZIP file, and run python swf.py application.exe in your Command Prompt or Terminal.

Convert SWFs to EXEs

Flash SWF files can be converted to standalone executables. However, this will only work for simpler Flash games that are not sitelocked. We recommend that you add games to Flashpoint instead.