Reprint Address: http://www.cnblogs.com/yangmingming/archive/2010/02/03/1662546.html
A: Ildasm.exe introduction
This Microsoft vs self-contained tool, in the Last Post, "The first Knowledge Ildasm.exe--il anti-compilation utility" has been described in detail, here is no longer a statement;
Two: Reflector.exe introduction
At this point (10.02.03), the latest version downloaded from Http://www.aisto.com/roeder/dotnet is latest version:5.1.6.0, which is also the classic "Hello World" in the above article. As an example, when opening an executable file with Reflector.ext, the main interface is as follows:
Visible Reflect.exe is stronger than Ildasm.exe, it can decompile IL, C #, Visual Basic, Delphi, mc++, and even Chrome, and its interface is more friendly, so he is known as the best tool for deep il !
Let's start by looking at what the IL code that it's anti-compiles looks like. Is it the same as the Ildasm.exe effect? This is illustrated below:
After comparison, the Reflector.exe has an easier to understand interface (without the numerous identifiers in the Ildasm.exe, see the MSDN Help for the previous blog post).
Of course, the reason to call Reflector.exe as the best tool for deep il is that it can decompile the Il language, as well as the C # language! This way we: the assembly can be used without the source code in the case of the application of the assembly!!! as shown in the example diagram above, we found that it was compiled for the source code and was completely correct, which is amazing, and its role must be far-reaching!
use IL to reveal the nature of the interface:
One: Interface Nature
Let's look at a common interface definition: The following:
The IL code, which is Reflector.exe-compiled, is:
The visible interface is essentially compiled into an abstract class , where the method in the interface is compiled into an abstract virtual method , without the implementation body.
Two: The abstract implementation principle of the interface
Let's look at some examples of the most basic class-inheriting interfaces, such as:
and its corresponding IL code, compiled with Reflector.exe as:
This allows you to see the function of the corresponding interface in the class, where "overwrite" is implemented--override! Therefore, the abstract mechanism of the interface, using polymorphic to achieve!
In this review, more IL anti-compilation tools are learned through the application of Reflect.exe examples. At the same time, through the IL code, it realizes the revelation of the interface essence, and realizes that it maintains the interface uniqueness (not to roll out the discussion here). ), the implementation mechanism of abstract class and its polymorphism are abstracted.
Reprint article----IL anti-compilation Sharps--ildasm.exe and Reflector.exe: