如何从 SWF 文件中提取图像?
我的 SWF 文件中有一个 Flash 对象。它包含我需要提取的图像,因此我可以直接将其用于不支持Flash的设备。
如何从 SWF 中提取图像?我应该使用什么工具?
I have a Flash object in a SWF file. It contains an image that I need to extract, so I can use it directly for devices not supporting Flash.
How can I extract the image from the SWF? What tools should I use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
有一个开源工具包非常适合这项工作。在 Windows 上,您需要以管理员身份运行安装程序,否则安装程序就会终止。然后将该文件夹添加到您的路径(或不添加),您就可以提取 jpeg 了。第一:
它将列出文件中的所有资产。在这种情况下,请注意 JPEG 部分中的 id。然后对于每个 id,运行
There's an open source toolkit that works fairly well for the job. On Windows you'll need to run the installer as Administrator or it dies. Then add the folder to your PATH (or not) and you can pull jpegs out. First:
which will list all of the assets in the file. In this case, pay attention to the ids in the JPEG section. Then for each id, run
我同意使用 Tom 回答的开源工具包。
要构建工具并在 linux/mac 上安装,请使用 wiki 中指定的这些命令:
以下是提取的命令所有资产:
swfextract --outputformat "extract_%06d.%s" -a 1- test.swf
如本
I agree with using the open source toolkit as answered by Tom.
To build the tools and install on linux/mac, use these commands as specified in the wiki:
Here is the command to extract all assets:
swfextract --outputformat "extract_%06d.%s" -a 1- test.swf
As specified in this wiki page.
嗯,这取决于具体情况,无论如何,您都需要一种方法来识别文件中的图像(也称为符号)。
案例 1. 嵌入
案例 2. 运行时
(此代码在加载器加载您的 swf 源文件后执行)
希望有帮助
Well it depends on the situation, at any case you'll need a way to identify that image inside the file aka a symbol.
Case 1. Embed
Case 2. Runtime
(this code is executed once the loader has loaded your swf source file)
Hope it helps
SWFTools(在上面的答案中提到)的替代品是 JPEXS FFDec,一个 SWF 反编译器和编辑。它的主要优点是您可以在提取图像之前预览图像。作为一个 GUI 工具,它也更容易使用。
在 FFDec 中加载文件后,单击侧树中的“图像”部分。要提取图像,请右键单击它并选择“导出选择”,然后选择“确定”。您可以选择多个项目(在图库视图和侧树中)并同时提取它们。要提取所有图像,请右键单击侧树中的“图像”,然后使用“导出选择”。结果将位于新创建的“图像”文件夹中。
An alternative to SWFTools (mentioned in the answers above) is JPEXS FFDec, a SWF decompiler and editor. Its main advantage is that you can preview images before extracting them. It is also slightly easier to use, being a GUI tool.
Once you have loaded a file in FFDec, click the "images" section in the side tree. To extract an image, right-click it and choose "Export selection", then "OK". You can select multiple items (in both the gallery view and the side tree) and extract them at the same time. To extract all images, right-click "images" in the side tree and use "Export selection" on that. The results will be in a newly-created "images" folder.