swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] Re: any way to batch protect?


From: Matthias Kramm
Subject: [Swftools-common] Re: any way to batch protect?
Date: Sun, 30 Nov 2003 12:00:01 +0100
User-agent: Mutt/1.4i

On Mon, Nov 24, 2003 at 07:22:17PM -0700, michael geary wrote:
> Thanks again for such cool tools. Is there any way to use these tools 
> to batch protect swfs? I know that there are tools out there to batch 
> UN-protect swfs, but my client would still like to have the swfs that 
> we are generating be protected.

Hm. Are you able to compile the Python extension in the current SWFTools CVS
version?
(./configure;make;cd lib/python/;make)

If yes it's easy- just place something like the following script
in ${SWFTOOLS}/lib/python:

-----------------------------------------------------------------------
#!/usr/bin/python2.2

import SWF

swf = SWF.load("file.swf")
swf.tags += SWF.Protect() # or: SWF.Protect("password")
swf.save(name="file_protected.swf")

-----------------------------------------------------------------------

If you run it will create a protected version of "file.swf" and name
it "file_protected.swf" (You could also name the destination file
"file.swf", too, so you don't need a new file).

So, in order to make this a proper command-line tool, you could
write something like the following:

-----------------------------------------------------------------------
#!/usr/bin/python2.2
import SWF
import sys

for f in sys.argv[1:]:
    print "Protecting f..."
    swf = SWF.load(f)
    swf.tags += SWF.Protect()
    swf.save(f)
-----------------------------------------------------------------------

If you now name this protect.py, you can now do e.g.:
    ./protect.py file1.swf file2.swf file3.swf 

Is this what you wanted?

Greetings

Matthias

PS: The Protect() code is still somewhat beta, especially the password
    encryption (which I can't test myself because I don't have the
    Flash authoring software)- so I'll be very interested in feedback
    on this one.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]