43 57 53
开头(例如:"CWS"
),甚至以字节46 57 53
开头(例如:"FWS"
)。你的文件以78 DA 00 43 40 BC BF 43 57 53
开始(最后三个字节是正常SWF的期望43 57 53
)。那前两个字节78 DA
表示它有一些ZLib压缩(例如:像一个.zip
文件)。获取库AS3ZLib并将其as3zlib
文件夹复制到Flash项目.as
文件所在的同一位置。(在此处找到文件夹:src/com/wirelust/as3zlib/
)。
将SWF文件的字节加载(或读取)到名为fileBytes
的AS3 bytearray中。
尝试这个代码逻辑:
import Zlib; //do import of API
....
public var zlibdecomp :Zlib; //create instance variable
....
public var fileBytes :ByteArray = new ByteArray;
public var swfBytes :ByteArray = new ByteArray;
//# SWF original file bytes load
fileBytes = ... ; //your loading code here
//# Decompress loaded into new SWF bytes
zlibdecomp = new Zlib; //create new ZLIB instance in variable
swfBytes = zlibdecomp.uncompress( fileBytes ); //update with decompress version
trace("swfBytes length (DEFLATED) : " + swfBytes.length); //is 8,617,377 bytes??
swfBytes
中的字节现在可以保存为文件new.swf
,并且可以在JPEXS中正确打开。使用fileReference API将AS3字节保存到磁盘。
选项2) 使用外部ZLib工具。
使用 OffZip(适用于Windows操作系统),您可以解压SWF。
这是直接的OffZip文件。将Offzip.exe
复制到一个文件夹中,如c:\offzip\
。
现在通过运行cmd.exe
来打开命令行。输入cd\offzip\
(按下enter
)。或者只需按住shift
并右键单击Offzip文件夹,然后选择“在此处打开命令窗口”。
输入offzip -a vpt.swf
(按下enter
)。
C:\offzip>offzip -a vpt.swf
Offzip 0.4
by Luigi Auriemma
e-mail: aluigi@autistici.org
web: aluigi.org
- open input file: vpt.swf
- zip data to check: 32 bytes
- zip windowBits: 15
- seek offset: 0x00000000 (0)
+------------+-----+----------------------------+----------------------+
| hex_offset | ... | zip -> unzip size / offset | spaces before | info |
+------------+-----+----------------------------+----------------------+
0x00000000 .
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
.................................................................... 8496131 ->
8617377 / 0x0081a403 _ 0 8:7:26:0:1:2657f334
- 1 valid compressed streams found
- 0x0081a403 -> 0x00837da1 bytes covering the 100% of the file
00000000.cws
可以在JPEXS中打开。您可以将其重命名为00000000.swf
。
42 55
更改为43 57
。如果可能,请展示更多字节或共享SWF文件的链接。 - VC.One