Flash decompilation note

Source: Internet
Author: User

Recently, I was asked to help make an online flash game into a single-host hard drive version to play on my computer, and there were some decompilation requirements for other SWF files, as a result, it was very unprofessional. The idea is confusing. Just remember it. Flash talents please directly float.

Today's flash is not like a single SWF in the past, and it's time to download it directly. In as3, you can use loader, urlloader, and sound to load different external content data as needed to reduce the size of each download. Through the firebug network panel, you can easily know which secondary data requests are generated during the interaction process. Of course, it is easy to save these necessary external files to the local device simultaneously.

However, the stored content may not be all the materials required by the entire application, because you may not trigger all the possibilities during an access. Therefore, the most thorough method is to decompile the saved SWF file and use global search to find all the calling content.

For me, The Decompilation tool sothink SWF decompiler is good and can basically restore the FLA file. However, this tool has a very serious problem. Many errors may occur when the as class library file is decompiled and restored, for example, some variables are replaced incorrectly, some comments are incorrectly assigned to variables, and so on (I am using v4.4. I don't know if this problem persists in the latest V5.0 ). If Flash CS3/cs4 is used to open the decompiled project, a lot of compiler errors may be reported! Therefore, you also need to use another tool, Action Script viewer 6 (versions earlier than asv6 do not support as3 script decompilation), and use ASV's "Export rebuild data (jsfl) "Although the rebuild script exported by the function sometimes cannot completely recreate the project, the source code of the exported as library file is complete.

Copy the as library file generated by ASV to overwrite the project folder generated by sothink, and then open the compile project file generated by sothink to compile, there shouldn't be a bunch of inexplicable compiler errors. At first, I believed sothink's decompilation results too much. At one time, I had a hard time wondering why the source code had so many compilation errors that could generate SWF and interact normally, I thought it was another CS3 problem with the compatibility of Flash cs4.

The easy-to-use version available on the ASV network seems to be only available in asv6 alpha4, because it is not a relase version, during the decompilation, the system will prompt that The Decompilation is not necessarily complete-as a result of this prompt, I once gave up using asv6, it was not until later that the source code produced by asv6 was compared with that produced by sothink that the original declaration was not necessarily complete but was accurate and available.

It is best not to look for any green Chinese version with backdoors for these two tools. If there are regular children's shoes with similar decompilation requirements, it is worth spending money to buy a genuine copy for use.

The ghost project file generated by sothink is for Flash CS3. To open the ghost file in cs4, choose Window> Other Panel> project to open the project panel; on the "project" Panel, select "open project" from the "project" pop-up menu. In the "Browse folder" dialog box, navigate to the folder containing the Browse File, click OK.

In order to complete the decompilation and modification, we finally unmounted the flash8 that had been dusty on the machine for a long time and replaced it with Flash cs3. At the beginning, I made a lite version. As a result, I checked the as source code syntax and reported "An error occurred during Java Runtime Environment initialization. You may need to reinstall flash ". In the original Lite version, the JVM was simplified and a JRE environment needs to be installed (or check whether the JRE environment directory already exists on the machine ), copy the content under JRE to the JVM folder under the Flash Installation Directory (if not, create one ).

Of course, it is better to find an original image, otherwise there will always be a variety of strange problems (for example, when the font files used in Flash projects are not found in your local environment, the lite version will directly crash the program, so I once had to go online and find the font used in the project ). Sometimes concentration is not necessarily the essence.

"5003: an unknown error occurred when generating byte code" occurs during project release ". Possible solutions: 1. Do not select "reduce file size and improve performance" in the "file-> release Settings" text box in "event 3.0 Settings" (This menu item is not available for publishing settings at ordinary times, you must open the default FLA file of the Project. Why is this release setting not displayed when you right-click the FLA file on the project panel ...); 2. "control-> Delete Aso Files"; 3. Add a system environment variable.Java_tool_options, Set the variable value-Xmx512m(Note that the number 512 needs to be adjusted according to the actual situation. Different computer configurations can be set with different values, which can be changed from 1024 to small. I have to change my current version to 400. A number greater than 400 will cause another 'java runtime environment initialization error '. After modifying the environment variable, you can open a command line window and enter the commandSet java_tool_options = anythingMake the new environment variables take effect immediately and re-open the Flash CS program ).

When the "omitted Trace Action" check box is removed from the release settings option, the "verifyerror: Error #1030: stack depth asymmetry" error will be output during the test project. Why, you have to check this option again.

Urlloader loads local files. If the relative path is written ". /data /...... "If there is no problem with the test project, it is okay to use some players that support SWF after the project is generated, but when running the generated SWF with Flash Player, it will throw something similar to" Error #2044: unprocessed ioerror :. TEXT = Error #2032: stream error "ioerror, you need to set ". /"Remove and directly write" Data /...... "In this way, the relative directory can be normally read.

One word: Tired. Maybe the early flash IDE's support for as scripting is so weak that I have been reluctant to flash, even now. Maybe HTML 5 can really make people look forward to it. Originally, browser-based things are based. Why don't they be provided to developers in the simplest way?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.