User blog:Martirsadota/A Rapid-fire Tutorial on Flash Decompiling (JPEXS-focused)

(This builds on my previous post.)

=Intro=

For most files, like images or audio files, you can just use them as soon as you grab them off the Kancolle servers. Flash files (those with the extension .swf ), however, need some extra treatment before they reveal their goodies.

For this, we need a program called a Flash decompiler. What it does is it takes in a Flash file, breaks it apart (decompiles it), and shows all the goodies contained in it—not just images and audio, but also whatever code contained in it (which should entertain any geek who knows ActionScript for hours).

So far, you have two choices for a Flash decompiler program:

I personally use JPEXS, despite the Java woes. The rest of this section will use this program for a quick walkthrough regarding resource extraction (i.e, the instructions below are for JPEXS); if you did end up paying for Sothink's decompiler, kindly consult its help file to help with translating this process for that program.

If you haven't installed your decompiler of choice, do so now. Once done, read on.

=The Quick Walkthrough Regarding Resource Extraction=

For this walkthrough, I'm going to assume you already grabbed an SWF file to break apart. If you haven't, do so now.

Open the file in JPEXS (via the File > Open... menu item, right-click, drag-and-drop, whatever works for you).



Much of your work here will involve the left pane, which I'd call the Navigation Pane. You can call the larger, right pane the Viewing Pane.

The contents of the Navigation Pane change depending on what kind of assets JPEXS found inside the Flash file. For instance, you might see an images folder when it finds images, sounds when it finds sounds, etc.

What you want to do here is click the folder you're interested in. Since our example file contains images, let's click, well, images:



Bam. So that's where they're hiding!

Now, come to think of it, this is like navigating a typical Windows Explorer window. And when we see rows of thumbnails and we want to open one, what do we do? That's right, double-click!

So let's double-click one of the image thumbnails in the Viewing Pane.



There we are, Bucky in all her glory. You'll also notice that the Navigation Pane morphs a bit and highlights the row of the file for us. Right-click the highlighted row, and...



There we are! Click Export Selection.



A little Export... box will appear. Just ignore it and hit OK.



This deserves a bit of discussion. JPEXS needs a folder, not a file, in this dialog box. I'd recommend you create one folder for each Flash file you're disassembling; you'll see why in a bit.

So let's create a folder to house Bucky's assets, choose that folder as our destination...



And then hit (as strange as it may seem) Open.

Now try navigating to the folder we saved the assets in.



As you can see, JPEXS created an images folder for us. (If we exported an audio file [more on this later], we'd have a sounds folder, etc.)

Open that folder, and the prize is yours.

Extra Note: Audio Files
Getting at the audio files is a bit different, since you can't use the "click-the-thumbnail-in-the-Viewing-Pane" technique for them. Instead, do this:
 * 1) Expand the sounds folder by double-clicking it (or clicking the [+] button to the left of it).
 * 2) Preview a sound by clicking its respective row. The Viewing Pane will change into a basic media player where you can play/pause, stop or enable/disable looping of the sound.
 * 3) Once you found a sound you'd like to export, right-click it, click Export Selection, and proceed with the steps above.

=Afterthoughts=

Easy, isn't it? It's always nice to have a program that does the heavy lifting for you. If you poke around a bit more, once in a blue moon, you might find something interesting (like an icon that isn't even used in-game)—you just found an Easter Egg!