cws2fws is a short Perl script I wrote to convert CWS compressed Flash v. >= 6 files to FWS files. Motivation for this was to be able to use the SWF::Search module which currently does not open compressed CWS files.
it is as simple as it can get.
cws2fws FILENAME.swf reads the first 8 bytes of FILENAME.swf substituting the CWS header for FWS. it then reads from byte 9 to EOF decompressing the stream via the zlib uncompress interface. the resulting decompressed stream and the new FWS header are then concatenated to output a FILENAME.fws.swf
the Adobe license states that, as long as the purpose of studying the SWF format is to make it work with the Flash Player, then it is legal to produce uncompressed SWF files. What is not allowed is to produce a player based on the file format. the files produced by cws2fws are therefore meant to be viewed in the Flash players distributed by Adobe Inc exclusively
DMCA: the DMCA has a court precedent set such that any type of reverse engineering meant to promote interoperability of technology is perfectly legal. all the information obtained to develop this small tool is publicly available on the web or can obtained through simple observation. i would not go as far as calling this trivial script a result of reverse engineering, but you never know...i'm not a lawyer!
DISCLAIMER: i offer no guarantee as to the usability of this program, it is provided "as is" for your personal use. Licensed under the MIT license, see deed below.
author: Jose M. A. Fonseca (jfonseca [a@t] zefonseca.com)
Copyright (c) 2012 Jose Fonseca (jfonseca@zefonseca.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.