Optimization and acceleration of the decompiler, as well as many improvements for .NET in VB Decompiler 11.8
A lot of work has been done in new version of the decompiler. We extremely speed up code analyzer and optimizer. This is the function that you can find in the main program window. This feature optimizing the conditional 100 lines of code to the conditional 25, combining step-by-step processing of strings, numbers, and so on. The same function changes the If ... GoTo X ... End If lines to the If ... Else ... End If blocks. Removes the service code for creating objects and checking their existence. Removes declarations of temporary variables. In general, it cleans the output as much as possible, making the code clearer and more compact.
But all this things works fine and fast exactly until there are functions that are under a hundred kilobytes of binary code and several megabytes in decompiled form. Naturally, no professional programmer will write such code, but will divide it into dozens, or even hundreds of functions and classes. But alas, not only professionals write in Visual Basic, but the compiler allows you to compile any code. Also, compiler can generate code blocks from a series of step-by-step array filling with several thousand strings. On such code, the decompiler (or rather, the function of the code analyzer and optimizer) could work for a very long time. Each of the many lines is evaluated by its influence for the previous code. And if there are several thousand previous lines, then processing takes quite a long time.
Many elements of the analyzer have been optimized in the new version. Faster string search and replacement functions are used, calls to dynamic arrays and objects are reduced to a minimum. This made it possible to achieve a significant increase in speed when processing complex and large code blocks.
.NET Disassembler Improvement
In parallel with the decompilation of Native Code and P-Code Visual Basic 6.0, a lot of work is being done on the decompilation of .NET applications. VB Decompiler supports structure decompilation and CIL disassembly of all .NET family languages (C#, Visual Basic, F#, Delphi .NET and other Common Intermediate Language compilers). Unlike Visual Basic 5.0 and 6.0, whose compilers have not been updated for many years, the .NET Framework is constantly evolving, expanding the sets of internal tables and opcodes. And you have to keep an eye on it all the time.
In the new version of VB Decompiler expanded support for .NET constructs and fixed many incompatibilities.
VB Decompiler is probably the only decompiler that supports not only CIL managed code in .NET, but also unmanaged machine code. Moreover, the disassembler supports not only Intel x86 32-bit code, but also 64-bit Intel x64 assembler. And new version also supports different types of alignment of 64-bit functions and correctly determine the end of such functions if they are an API call wrapper or for other reasons do not return control to the calling function.
Handling string data
Probably one of the most useful features of the VB Decompiler after Analytics is the collection of all program lines into a single list with the ability to jump to the code that works with the selected line on click. Not so long ago, a lot of work was done to ensure that string analysis was performed without a complete decompilation of the entire code, but only with superficial disassembly. This significantly speeded up the work, making it possible to access the list of strings using the Fast decompilation mode in the settings.
In the new version of VB Decompiler, the processing and storage of large strings has been seriously changed. This gave a significant increase in the speed of work.
And of course, as always, all the errors founded by us and our users were fixed and a number of improvements were added to the decompiler.
May 2, 2022
(C) Sergey Chubchenko, VB Decompiler's main developer