Is there an unofficial Flash .FLA spec?
Asked Answered
R

4

5

Is there an unofficial spec anywhere that explains how to reverse engineer a Flash .FLA file?

I'm specifically interested in creating an application that can "auto-scene plan" a Flash document programmatically, pulling in content from other files, arranging that content into layers, without needing the Flash IDE open. Animators would then be able to take these pre-assembled FLA's and begin animating them. I've already built a JSFL script that does this, but it runs very slowly, is difficult to debug or re-purpose.

Rhiamon answered 29/9, 2009 at 20:2 Comment(7)
Note for modernity: as of version CS5, the FLA format is now a known entity, a zip containing media assets along with an XML-based document describing the FLA content. Info here: blog.theflashblog.com/?p=1986Libertarian
It's not a zip file, or if it is it's a corrupt or proprietary version of a zip file. Every "fla" produced by Flash Professional, when renamed to "zip" cannot be opened at all by 7-zip, and although WinRAR will open it as an archive, list the files, and even allow you to extract files, it will report that the archive is corrupted. Futhermore, if you attempt to edit resources in the archive and recreate the archive, Flash will no longer be able to open it.Magdaleno
@Triynko, it IS a zip file, in that it has been created using standard ZIP compression. Windows has no trouble opening and extracting the archive to the XML folder structure. It is also well documented that decompressing the archive is a one-way process.Rhiamon
If it is supposed to be a standard zip archive, then there is obviously some kind of bug in Flash CS6, because it's producing corrupt archives. A fresh new AS3 project with a rectangle on the stage, saved as a FLA produces a clean, uncorrupted archive, but the project I'm working on, when saved, produces an archive that can be extracted, but has some corruption.Magdaleno
It also had multiple XFL files in its root folder (one with the old filename after performing a save-as, and one with the new name), as well as duplicate and presumably abandoned library objects that differ only in case (e.g. "nextpage.xml" and "nextPage.xml"), which is apparent when you extract the archive to a new folder and you get messages asking you to replace files, which occurs because Windows does not use case-sensitive file names. Even after removing those extra files that shouldn't be there, when I re-zip, open in Flash, and save it... the resulting zip archive still has corruption.Magdaleno
As for the compression being one-way, I think we were both wrong, because it's not one-way. After decompressing it (WinRAR reports two corruption errors, but it otherwise seems to be intact), I can modify the XML files, re-zip them with WinRAR, and open it in Flash CS6 just fine.Magdaleno
"Why can't 7-Zip open some ZIP archives? In 99% of these cases it means that the archive contains incorrect headers. Other ZIP programs can open some archives with incorrect headers, since these programs just ignore errors. If you have such archive, please don't call the 7-Zip developers about it. Instead try to find the program that was used to create the archive and inform the developers of that program that their software is not ZIP-compatible."Magdaleno
M
6

I've spent days looking around the internet, to see if there is anyway in to, do a reverse engineer but nought really. I don't there is a .FLA spec floating about. I've spent the last couple of days looking. If there was one, and you were using it, you would receive a cease and desist letter from Adobe, followed by the Canadian equivalent of the DMCA take down notice.

According to Wikipedia, the format is a binary format, which is based on a Microsoft Binary compound file format specification, described here on Wikipedia. Compound File Format. But strangely because of, I think, the European anti trust settlements forcing Microsoft to publish their specs means you can download the MS Compound File Format, here by typing Microsoft compound file format into Google. The first entry is the download link.

Once you have studied it, then you need to get a tool set together. It may be possible, there is a decompiler available for that format from MS. If not, your looking at maybe 3-6 months of work to get a basic spec together.

In the early 90's I reversed engineered the Novell IPX protocol and the NCP stack, which was a case of sending messages to the server, and getting a reply. So it fairly mechanical and tedious, after a few months we had a really good idea what was needed, and we built up a map of the IPX protocol calls, and replies. Same with NCP. We eventually were contacted by Novell who sent us a cease and desist and eventually wanted to sue us. But at the end of the day, they crapped out because we were using Clean Room techniques Wikipedia Clean Rooms explained. We pretty much took it apart from a server product in Binary, using a packet analyser, and rebuilt it using C++. But that was protocol reverse engineering. Much easier that what you are reflecting on.

So the first thing you need, is a disassembler. I can't give you any advice on what one to use, but there is many out there. Once you get the format, and you disassemble the file, you have to try and identify file headers, footers, constants, things like special symbol sequences, so you can start to create a map. For example on page 6 of the Windows Compound Binary File Format, it says in _absig has a signature format of DOCF 11E0 A1B1 1AE1. If you can find that kind of info in a the file, you start the map.

But before you go to that length, see if their is a decompiler about. I think most of the decompilers you find in Google will perhaps be lightweight. Go to hacker groups like these. CrackZ. That IDA product is a disassembler. This may help. Introduction to Reverse Engineering. Reverse Engineering Community

Hope that help. If you do, do it. It will take months. Persevere!

Monochromat answered 5/10, 2009 at 23:22 Comment(4)
I wonder about the cease and desist since several companies make SWF-to-FLA decompilers. They have clearly figured out the FLA spec enough to turn SWFs back into editable FLAs. I was wondering if they were working from some sort of published spec or if their research is proprietary.Rhiamon
I don't know, as I couldn'f find anything specific, not even outlines or any intial work done, or even discussions. I suspect it has been well protected, as its the defacto standard for web movies. If a commercial did do the work, I suspect they would view it as proprietry and they would protect it. Maybe some hacker groups have something available. Might be worth visiting, if you have the time, black hat hacker conferences, ask about, see if you get a lead. It might also be the case that you off load the work, if you go down that route. Off shore it. Give it to the russians perhaps.Monochromat
I was just reading the new porposed interoperability guidelines that MS has pulblished as part of the European anitrust commission agreement, and it looks like the full spec for that Binary Compound File format will be published, instead of the field name.Monochromat
You don't need to create/find special tools to work with MS compound documents. There are Win32 functions built in.Drifter
R
3

It should be noted that all FLA files saved in CS5 or later are now technically ZIP files that use the open XFL format. You can actually rename a FLA file to ZIP and decompress it. Subsequently, Flash supports saving directly to the XFL format.

The XFL format is a folder structure consisting of files and folders that correspond to the typical Flash file. These include a folders for the library and binary data (images, audio, etc.), as well as XML files which describe geometry, animation, etc. There are also XML files that keep track of global project settings such as linkages and export settings.

Finally, there is a .XFL file which acts as the entry point for the entire structure. This is what Flash looks for when it scans folders to determine if they're Flash XFL projects.

I would strongly recommend this format for anyone operating at an animation studio who needs to scene plan files externally from Flash. The library, scenes and other connections can all be created programmatically in the XFL format using whatever external programming language or tools you wish.

Rhiamon answered 14/11, 2012 at 10:8 Comment(5)
Interesting. And it really works. I could extract the FLA file with 7zip and get the bunch of files, one of them named Contents, and some other files with weird-looking names, like S 931 1354134895, lots of them. But what now? They all seem to be binary files, nothing similar to strings inside. I'm interested in extracting vector graphics data out of them to convert it somehow to SVG.Dorwin
Ideally, you'd want to re-open the project in Flash and save it back out in the XFL format. That will produce the most human-readable file structure.Rhiamon
If I had Flash... And Windows... No. This would be a nightmare :s I'm trying to do that on my Linux box, without Windows and Flash. I just have those FLA files to start with.Dorwin
The FLA files need to be authored in CS5 or later (I've clarified this in my answer). I just did a test in CS6, saved an FLA file with some library elements, renamed it to a zip file then extracted it. The library was all named correctly and in their proper structure. So you're probably dealing with older FLA files.Rhiamon
So if you really want to convert them, you're going to have to bite the bullet, get a Flash license, write a simple JSFL script to open and save the documents in the latest version. Not incredibly convenient, but not impossible either; I built these sort of converting services all the time at the animation studio I used to work at. You could even get them to run as needed on an Amazon EC2 instance running Windows; Spin up a cloud server, convert a batch of files, then tear it down all with an automated script. I'm sure you have no qualms writing rickety batch scripts, this is no different.Rhiamon
B
0

Although there is no official documentation, this guy tried at least in some primary analysis

The fla format | benjaminwolsey.de http://benjaminwolsey.de/node/49

Ba answered 5/3, 2010 at 10:49 Comment(0)
A
-1

You might wanna check the swf file specification: http://www.adobe.com/devnet/swf/

Alburga answered 25/1, 2010 at 4:4 Comment(2)
I know the SWF spec is available, I'm more interested in the FLA format so that I can pre-populate scenes that our animators then need to work on.Rhiamon
Well, I might be speculating here; But I think that this kind of things are something you have to pay for. sothink decompiler (swf-decompiler.com) can decomplile a file into fla and flex ; I believe there is kind of an agreement between them and adobe for the fla file structure as I can't see it anywhere else. P.S.: I'm also interested in fla file structure as I'm sick of the flash's AS IDE and want to develop some tools I need to make my life easier :)Alburga

© 2022 - 2024 — McMap. All rights reserved.