As3.0 decompiler anti-Compiler
19:01:12 Author: molay Source: webstudio text size: large | medium | small
Introduction:For reprinted Chinese characters, please specify the source. Thanks to the as3.0 article submitted by the WS-Forum moderator molay.
This was originally two articles posted on a French aser blog. Now they are passed to me via radio. So, I will translate them and post them here. This Tamarin tool...
For reprinted Chinese characters, please specify the source. Thanks to the as3.0 article submitted by the WS-Forum moderator molay.
This was originally two articles posted on a French aser blog. Now they are passed to me via radio. So, I will translate them and post them here. This
The Tamarin tool is mainly an anti-compiler for the Action Script Byte encoding (ActionScript byte code, ABC ).
Extract the pseudo code that is easy to read from the ABC file. Then, these pseudo codes can be converted into as3 source code through a series of programs. This is terrible, isn't it?
Let's take a look at what the article has said. First, the author explains how to build your own compiler. Then you can directly download the previously constructed compiler. Finally, I personally comment on this article.
Create an executable file through the Tamarin Project
You can download Tamarin from CVS. The CVS information is as follows:
Code:
CVS-D: pserver: Anonymous: anonymous@cvs-mirror.mozilla.org:/cvsroot Co Mozilla/JS/Tamarin
Follow the instructions in the readme.txt file to install it. The project can be compiled using the Microsoft C compiler. Of course, if you do not have VC. Net express 2005, you can download one for free.
The Tamarin project contains a lot of interesting things. You can view the "util" folder, which contains an anti-compiler for ABC, SwF, and SWC files. Now you can only get the as3 pseudo code through it, but don't worry. It's just the beginning of a good movie.
When compiling a similar "abcdump. As" file, you need to compile the core built-in components used in the compilation process of Tamarin into ABC. You can use the flex 2 SDK to compile
Code:Java-jar ASC. Jar builtin.
In this way, you get a "builtin. ABC" file. In addition, bytearray class is also required. You can find it in the command line interpreter Folder:
Code:Java-jar ASC. Jar bytearray.
Now, we can prepare to compile abcdump:
Code:Java-jar ASC. Jar import builtin. ABC-import bytearray. ABC abcdump.
Now we get the abcdump. ABC file. You can run it in the AVM virtual machine or use the anti-compiler to decompile any accidental. ABC file. Take the playerglobal. ABC file as an example:
Code:Avmplus abcdump. ABC playerglobal. ABC
With the ASC compiler, we can use the-EXE compilation parameter to create the EXE file, just like this:
Code:Java-jar ASC. jar-EXE avmplus.exe-import builtin. ABC-import bytearray. ABC abcdump.
In this case, we have completed a reusable, command line-mode anti-compiler called “abcdump.exe. Cool? Tamarin also contains many other interesting things, such as file IO operations and other incredible materials.
First ActionScript anti-Compiler
We can use the Tamarin file IO module to dump the output file of the anti-compiler. The prototype of the abcdump anti-compiler has been completed. You can use it as follows:
Code:D:/ASC> abcdump
Abcdump
Usage:
Abcdump <FILENAME>
My comments
Take "amfphp service"
And get a 7 MB servicebrowser. Il file. This file is a bit file with fuzzy meanings. Even so, it can still be understood by us.
^_^. For example, the source file content of rawamfservice class is similar to the following:
Code:Public class rawamfservice extends eventdispatcher
{
Public var gatewayurl: String = "";
VaR Loader: urlloader;
Public Function rawamfservice ()
{
Loader = new urlloader ();
Loader. addeventlistener ('complete', readdata );
}
...
}
The decompiled class file is:
Code:Class rawamfservice extends flash. Events: eventdispatcher
{
VaR gatewayurl: String = ""/* slot_id 0 */
VaR Loader: flash.net: urlloader/* slot_id 0 */
Function rawamfservice (): */* disp_id-1 */
{
// Local_count = 1 max_scope = 1 max_stack = 3 code_len = 40
0 getlocal0
1 pushscope
2 findproperty gatewayurl
5 pushstring ""
7 initproperty gatewayurl
10 getlocal0
11 constructsuper (0)
13 findproperty Loader
16 findpropstrict flash.net: urlloader
19 constructprop flash.net: urlloader (0)
23 initproperty Loader
26 getlex Loader
29 pushstring "complete"
32 getlex readdata
35 callpropvoid addeventlistener (2)
39 returnvoid
}
...
}
Interestingly, I found that the value of the "gatewayurl" parameter in the constructor seems to be set to its default value. The next step is to start translating the. Il file and turning it into
It is easier for us to recognize what is written in a language. On iteratif.net, This guy said he was working in this area. Of course, I am not very sure about the current situation. If
If you are very interested and want to work with him, you can contact him in the "contact at" section of iteratif dot net.
Glossary
Tamarin
Adobe
Virtual Machine
2 (avm2)'s core source code is donated to the Mozilla organization and becomes an open-source project called Tamarin. As a standard ES4 engine, Tamarin only has
Avm2 and spidermonkey are based on it, but it is enough to form a strong strategic alliance-improvements made by the Adobe or Mozilla community to Tamarin will make both sides at the same time
Benefits.
CVSCVS (concurrent version
System) version control system is a gnu software package, which is mainly used to maintain the source code in a multi-person development environment. In fact, cvs can maintain the development and use of any document, such as editing shared files.
Modification, not limited to program design. The file type maintained by cvs can be text or binary. CVS uses copy-Modify-Merge (copy, modify, and combine)
And) change tables support simultaneous file access and modification. It explicitly isolates the storage of source files from the user's workspace and enables parallel operations. CVS makes it more accommodating Based on Client/Server Behavior
Users. This feature makes CVS the preferred choice when people in different locations process data files (especially program source code) at the same time.
AMF
AMF (Action Message
Format) is a binary format data type, through AMF over
The HTTP Method encodes the flash data and sends it back to the server. The remoting
After receiving the information, the adaptor decodes the correct native object and submits it to the correct program for processing.
In addition to flash
Remoting is also widely used in local connection and Flash Communication.
Server, which can directly convert flash native objects, such as object, array, date,
XML, Which is returned to the server and automatically translated into appropriate objects on the server. For example, when the flash array is returned to PhP, it is automatically converted
Associative array; the biggest benefit to developers is that they do not need to manually process serialization and
The complex work of deserialization not only improves the accuracy, but also saves time for development.
Because AMF is binary
Format and the encoding is highly compressed, so it is very suitable for transferring a large amount of data, according to The flashorb website test (mainly for Web Service and flash
The higher the data volume, the higher the transmission efficiency of Flash remoting.
Therefore, we can also learn the use of Plaine text, such as XML, loadvars, and loadvariables.
The format transmission method is incomparable.