Click to See Complete Forum and Search --> : Re-Write that works but doesn't

10-25-2000, 10:47 AM
I have written a perl parser for swf files which seems to work fairly well. It is used to rewrite links. However I have encountered a flash file which when rewritten with my program "breaks" in IE5.5 and NN4.7 and yet works perfectly in FlashPlayer and SWF Browser.... any ideas how this dual (and oposite behavior) can be explained.....?

Thanks, Jason

01-11-2002, 05:35 PM
I know it's been quite some time since this was posted - but has anybody found a solution?

It seems to be something about an incorrect file size AFTER the changes have been made.

SWF signature not found, SWF version greater than 5, Incorrect file size in SWF header....

Am I missing something - some preceeding characters??
[Edited by VAYKENT on 01-11-2002 at 04:38 PM]

01-11-2002, 10:32 PM
Hi there,

my car does not work...
I might be able to help, if I had some facts (like the original swf and the converted version).
Just guessing what might be wrong does not seem to help - I believe the script in question works most of the time, so it is a problem of finding the boundary condition either from reading the script or analyzing the sample file.


01-12-2002, 01:24 AM
Hehehe - good point. Hard to believe I've forgotten how to ask a question!

Here's the two SWF's:



I'm using Perl to do the switch.. I don't know if that helps to solve the problem.

Let me know if I can give you any more information.

01-12-2002, 02:22 PM

original movie is 362 bytes, changed one only 273 bytes.
Changing the link worked, but then the movie ends in the middle of an actionscript tag


01-12-2002, 05:27 PM
So... Is there something in particular that I'm missing that I can just 'add' to the shorter version to get it working - or is that not possible??

I'm thinking - header/footer - file definition - file size... am I missing something in the rewrite of the SWF?

Any ideas as to why Perl is doing this? I'm wondering if I could just perform my own binary->hex conversion, find the string to replace, replace it, and convert hex->binary and be done with it. That's what I'd like to do in the end... am I on a good track? - or is this a bad idea?

I first had this idea to tinker around with SWF's when I opened a SWF in a Hex editor. Some of it translated to 'plain english', and switching the plain english in the hex editor, rewriting the SWF, and viewing it worked. So I turned to Perl hoping I could do the same thing... so far... no such luck. I'm still hoping though.