Users browsing this thread: 1 Guest(s)
Some General Flash-Ripping Advice
#3
Last major issue (at least, that can be solved) is the embedded asset file, typical of flex-based Flash games.
basically, you open a .swf in a decompiler, and...NO ASSETS. Misc tags will have definebinarydata tags, and the source code will include references to something called a "ByteArrayAsset"

I have recently discovered this one, and it's simple, first de-compress the .swf file using 7zip (first check that the header says "CWS" , indicating it's compressed. To do this, right-click > 7zip > extract archive. This produces a new folder with <yourswfname>~.swf

Now that it's decompressed, you can either manually hex-edit the file (long and tedious) to extract assets
To do this, for .swf, you open it in a hex-editor, and search for the text string "CWS" or "FWS"
After finding this, select 8 bytes, starting at the "C" or "F" , now, take note of the last four bytes in that selection. These represent the filesize, in bytes. This value is written in little-endian order, so smallest value first. Simply take those bytes... so, say... ff c7 00 00 and enter them into any calculator/program capable of converting between hex and decimal in reverse , so 00 00 c7 ff or 0000c7ff , and convert to decimal. Or, just write that hex value somewhere, and select everything from the "C" or "F" until the block size matches the file size value. Then copy-paste that hex to a new file, and save as .swf With any luck, you've gotten a legit .swf If you see a filesize of ff ff ff ff, which is approximately four gigabytes, you probably should skip it!)

With png, you search for "%PNG" or "‰PNG" , select all of that hex , up until you encounter "IEND" , make sure you copy the four bytes after IEND as well, or the .png file could be considered invalid by some programs. As you did with .swf, copy-paste to a new file and save as .png

You can search for xml data by searching for the first few characters in a valid xml header "<?xml"
copy that hex up till the last tag (some hex editors will ruin the formatting, and effectively corrupt the file if you copy the plaintext) and , well... save to a new file as .xml

Alternatively, you can use a new utility I had a friend program for me, called "PwnFlashEmbeddedAssets" .
Basically, this does the same thing as listed above, with the exception it's many times faster, and it only provides hints to where an xml may be tucked-away. (due to the potential complications of detecting an entire xml document)

http://crystalien-redux.com/dev/PwnFlash...ets_v1.zip

This program has enabled me to get assets from Age of war 2 and Enchanted Cave 2, which I also call dibs on!
However, I am holding them off presently for assorted reasons.

That is all for now!
Reply
Thanked by: supersmashball, sutinoer


Messages In This Thread
RE: Some General Flash-Ripping Advice - by DarkGrievous7145 - 09-01-2015, 02:20 PM
RE: Some General Flash-Ripping Advice - by Dazz - 09-08-2015, 04:01 AM

Forum Jump: