We've got dozens of versions of an SWF modified for different customers of a big Flash project, and now would have to replace some strings embedded in scripts in each copy. The FLA file for some of these is very difficult to locate or even missing (I inherited this mess and refactoring it is currently not an option).
Is there a (free) tool to replace strings used inside ActionScript? I tried swfmill to convert the files to XML and back but it can't handle international characters contained in the strings so I could get them only partially converted. Most of the strings were correctly extracted so another tool might do the job.
You could try Burak's URL Action Editor -- it says URL, but I'm pretty sure it lets you edit any text in a SWF. I haven't used it, but I have used his ActionScript Viewer, which works wonderfully.
You can use Apparat for this kind of task. It allows you to alter ActionScript 3 bytecode in SWF and SWC files.
I would prefer the Scala source branch for your task. Basically the code would look like this:
val swf = Swf from "in.swf"
for(tag <- swf.tags) {
(Abc fromTag tag) match {
case Some(abc) => {
val strings = abc.cpool.strings
for(i <- 1 until strings.length) {
if(strings(i) == 'search) {
strings(i) = 'replacement
}
}
abc write tag
}
case None =>
}
swf write "out.swf"
Well the only advice I can come up with is to fix swfmill to support international characters. You might want to ask in swfmill mailing list ([email protected] as far as I know) for a best way how to do it, shouldn't be too difficult if you know C/C++ a bit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With