Декомпиляторы для VB.Net
Разговор сегодня пойдет про декомпиляторы для программ, написанных на Visual Basic .Net.
Возможно вы знаете продукты лучше данных - напишите в комментариях.
Напомню декомпиляторы -
[Взято с Википедии]
Декомпилятор — это программа, транслирующая исполняемый модуль (полученный на выходе
компилятора) в относительно эквивалентный исходный код на языке программирования высокого
уровня. Для сравнения, дизассемблер транслирует исполняемый модуль программы в код на
языке
ассемблера.
Удачность декомпиляции зависит от объема информации, представленной в декомпилируемом
коде; байт-код, используемый большинством виртуальных машин (таких как JVM для Java) часто
содержит обширные метаданные, делающие декомпиляцию вполне выполнимой, в то время как
машинный код более скуден и сложен в декомпиляции.
Декомпиляция, в частности, используется при обратной разработке программ.
[/Взято с Википедии]
1. Salamander .Net Decompiler (RemoteSoftware)
2. Decompiler .Net (Jungle Inc)
3. Spice .Net Decompiler (9Rays)
4. Reflector for .NET (Lutz Roeder's)
За основу будет взята простейшая программа с кодом на кнопке скачки файла, написанная на
Visual Basic 2005 .Net Express Edition ее то мы и будем раскомпилировать дабы узнать код. ( В
принципе его можно узнать и просто открыв в блокноте файл )
1. Salamander .Net Decompiler
Features
* support generics introduced by .NET Framework 2.0,
* recognize all .NET language constructs, such as attributes, properties, events, fields, methods and
nested types,
* automitically recognize different compilers, and generate corresponding target languages, such as
C#,
managed C++, Visual Basic.NET,and thus salamander is C# decompiler, VB.NET Decompiler, VC++.NET
Decompiler and J# Decompiler
* support unsafe codes and pointer arithmetics, support fixed statement,
* generate Visual Studio .NET project file for easy recompilation,
* support .h and .cpp file generation for MC++. Advanced dependency analysis enables the correct .h
files
to be included in a .cpp file,
* comments are generated along with the source codes when API documentation is available,
* recognize all CIL instructions, handles address type instructions correctly,
* robust and thoroughly tested against as many .NET assemblies as we can find, more than 10,000
classes have been successfully decompiled,
У меня версия 1.0.5 DotExplorer (это гуи к саламандре) не смогла декомпилировать мой екзешник,
но
смогла его дизассемблировать.
.method private instance void Button2_Click(object sender, class [mscorlib]System.EventArgs e) cil
managed
{
.maxstack 3
.locals (string,string)
IL_0000: ldstr "http://freelansers.ru/news.php"
IL_0005: stloc.0
IL_0006: call class WindowsApplication1.My.MyComputer
WindowsApplication1.My.MyProject::get_Computer()
IL_000b: callvirt instance class
[Microsoft.VisualBasic]Microsoft.VisualBasic.MyServices.FileSystemProxy
[Microsoft.VisualBasic]Microsoft.VisualBasic.Devices.ServerComputer::get_FileSystem()
IL_0010: callvirt instance string
[Microsoft.VisualBasic]Microsoft.VisualBasic.MyServices.FileSystemProxy::get_CurrentDirectory()
IL_0015: ldstr "news.php"
IL_001a: call string [mscorlib]System.String::Concat(string, string)
IL_001f: stloc.1
IL_0020: call class WindowsApplication1.My.MyComputer
WindowsApplication1.My.MyProject::get_Computer()
IL_0025: callvirt instance class [Microsoft.VisualBasic]Microsoft.VisualBasic.Devices.Network
[Microsoft.VisualBasic]Microsoft.VisualBasic.Devices.ServerComputer::get_Network()
IL_002a: ldloc.0
IL_002b: ldloc.1
IL_002c: callvirt instance void
[Microsoft.VisualBasic]Microsoft.VisualBasic.Devices.Network::DownloadFile(string, string)
IL_0031: ret
}
2.Decompiler .Net
Decompiler.NET is the first affordable commercially available combination Decompiler, Obfuscator,
Language Translator, and Refactoring Tool for Microsoft .NET managed applications and libraries that
really works! Each release of Decompiler.NET is produced by decompiling, obfuscating and recompiling
itself without the need to manually edit any of the outputted code. This ensures that each release is
fully
tested since Decompiler.NET is a large application that exercises the features required by most
applications. Code generated by Decompiler.NET includes all required metadata for native calls
including
StructLayout attributes, DLLImport attributes, etc. Decompiler.NET requires either the .NET 1.1 or 2.0
Runtime.
For one low price, you will receive a full standard version of the product with unlimited use by one user
on one CPU that includes all current C# Decompilation, Obfuscation, and Optimization features.
You will also receive full integration capabilities with Visual Studio .NET and support for the next
release
of the .NET Framework when it is released by Microsoft. Decompiler.NET now includes a free Visual
Studio Add-In that integrates Decompiler.NET directly into Visual Studio 2003 ir Visual Studio 2005 as a
first-class dockable tool window.
The Refactoring option and other extensions to the core functionality such as automatic language
translation and support for other source languages will be available soon at a nominal additional
licensing fee.
Maintenance releases with bug fixes will always be provided at no additional charge. Please ensure
that
you fully review and agree to the terms and conditions of the Decompiler.NET End User License
Agreeement (EULA) before downloading the software. Read more...
Buy Now... - Price: $550 Per CPU, No Runtime Fees
Download Free Trial Now...
Старая Версия меня послала с Framework 2.0. Скачал Триал версию с сайта.
Вот что получилось: (Кстати не поддерживается декомпиляция в код VB)
private void Button2_Click (object sender, EventArgs e)
{
string a1 = "http://freelansers.ru/news.php";
string b1 = (MyProject.Computer.FileSystem.CurrentDirectory + "news.php");
MyProject.Computer.Network.DownloadFile (a1, b1);
}
Все таки C# мне нравится более чем IL :)).
3. Spice .Net Decompiler
Now Spices.Net Suite includes one internal (system) module and 5 external -
* Spices.Obfuscator (non-compomise protection of .Net assemblies),
* Spices.Decompiler (decompilation/disassembling to 6 languages),
* Spices.Modeler (models and diagrams that reflects various types of assembly members relationships
and structure of .Net assembly) ,
* Spices.Investigator (.Net metadata browser at low level, provides detailed information on tokens)
* Spices.Informer (assembly member information provider and reporter).
Spices.Net not only platform environment, it is a class browser, analyzer and disassembler with
professional look and feel.
For reduction of risk of infringement of the intellectual property, Spices.Net offers the ultimate solution
for
this situation - Spices.Obfuscator.
Spices.Obfuscator also offers antiILDASM feature - prevention from most disassemblers/decompilers
(such as ILDASM, Anakrino, Remotesoft Salamander Decompiler, JungleCreatures Decompiler.Net).
Крякнутую версию данного продукта пока не видел так что слил 4.6.3 версию с оф.сайта. К
сожалению она переводит 50% кода.
Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim txt As String = "http://freelansers.ru/news.php"
Dim txt1 As String =
String.Concat(WindowsApplication1.My.MyProject.Computer.FileSystem.CurrentDirectory, "news.php")
WindowsApplication1.My.MyProject.Computer.Network.DownloadFile(txt, txt1)
End Sub
Зато в VB и очень быстро (поддерживаются также: IL, C#, Delphi, J#, MC++).
Дизайн программы тоже удобный, единственное, что раздражает это то что она каждый раз
спрашивает при декомпиляции, сохранить ли или нет раскомпилированное в файл.
4. Reflector for .NET
Reflector is a class browser for .NET components. It supports assembly and namespace views, type
and
member search, XML documentation, call and callee graphs, IL, Visual Basic, Delphi and C#
decompiler,
dependency trees, base type and derived type hierarchies and resource viewers.
У этой программы 2 отличия:
1 она бесплатная и вроде даже с исходниками,
2 к ней множество модулей.
Сожрав мой Exe она выплюнула (Кстати при загрузке ее первый раз она предлагает выбрать
фреймворк):
private void Button2_Click(object sender, EventArgs e)
{
string text1 = "http://freelansers.ru/news.php";
string text2 = MyProject.Computer.get_FileSystem().get_CurrentDirectory() + @"news.php";
MyProject.Computer.get_Network().DownloadFile(text1, text2);
}
Эх подумал я опять C#, но заметив панельку выбора языков обрадовался (можно выбрать Visal
Basic, C#, Delphi).
И вот:
Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim text1 As String = "http://freelansers.ru/news.php"
Dim text2 As String = (MyProject.Computer.get_FileSystem.get_CurrentDirectory & "news.php")
MyProject.Computer.get_Network.DownloadFile(text1, text2)
End Sub
А вот собственно что было в студии:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button2.Click
Dim a As String
Dim b As String
a = "http://freelansers.ru/news.php"
b = My.Computer.FileSystem.CurrentDirectory & "news.php"
My.Computer.Network.DownloadFile(a, b)
End Sub
Решайте, что вам выбирать, а если вы знаете продукт лучше подскажите.
P.S Есть еще один продукт но он пока не дружит с Framework 2.0. Называется Anarkino.