Mar 28 2012
Editing Text within SWF files!
Today I was faced with the problem of changing a string within an SWF file, though I took it more of as an interesting challenge.
A colleague of mine had compiled an SWF using Adobe Captivate – an educational material builder.
Unfortunately, some of the paths were hard-coded and hence it only worked correctly on his own laptop…and I was itching to test something out.
So what does someone do ?
1st Attempt: SWF Decompiler and Options
I opened up the file in SoThink SWF Decompiler and attempted to export as an FLV file.
As there was no actual flash version I decided to manually select the version.
An FLV file was created though the result was poor.
Following I exported the .as files and had a look at the various declarations and parameters for the timeline.
2nd Attempt: Hex editor
I opened the SWF file in the 01 hex editor and searched for the string I wanted to change.
To my surprise I found nothing until I realized SWF files come in two varieties: compressed and uncompressed.
For an intro on the topic have a look at: http://forum.cheatengine.org/viewtopic.php?p=1533490
Searching on the internet I found the CWS to FWS Flash file Decompressor which must be run on a linux install with perl to create an uncompressed SWF file.(http://zefonseca.com/cws2fws/)
Once the swf file was uncompressed suddenly ascii text was visible within the hex editor.
However, changing the number of characters resulted in a broken file.
Hence, I came up with the solution to pad with spaces or other inconsequential characters e.g. “././.” in order to maintain the same number of characters.
This worked as a quick solution. If anyone has found where the checksum or length is recorded it would be nice to know!
Thanks.

March 3, 2013 @ 8:17 am
Does anyone know how to change the string length and not result in a broken file?
March 3, 2013 @ 4:18 pm
Hi, I’d imagine it’s in some kind of header where the variable itself is declared. Additionally, may simply also have to do with a checksum changing.
I’ll have a look at it when I find some time.