Convert DLL to source code

Is it possible to convert DLL back to the original VB source code ?

Tks
AXISHKAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
let's say; partially yes, and there are  some tools around that claim to be able to do it;
https://www.google.com/search?q=reverse+engineering+of+dll+into+vb.net&ie=utf-8&oe=utf-8

however, you will not get the exact code back, for example the names of the variables etc may likely not be restored.
Julian HansenCommented:
Any compiled application can be converted back to source code of one sort or another - at the very least you can get an assembler dump of the binary code.

The question is - can you decompile the DLL back into source code that is meaningful or easily used?

It depends on what created the DLL - whether it includes debugging information etc - but generally what you are going to get is the source code that the compiler generated as part of the compile. Compilers employ various mechanisms to create a binary file including code optimisation, symbol table conversions etc - so what comes out the other end is not an exact correlation to what went in.

Understanding the source code of an application or library depends on the skill of the observer and the extent to which the source code has been written and structured in a logical fashion. Meaningful names for variables and functions, break up of code into logical statements and the inclusion of comments are all crucial for the understanding of the intention and functioning of the code. In most cases the above are removed or obfiscated during the compile so that even in cases where a reverse engineering of the file is possible the resulting code bears little resemblance to the original source and would require significantly more skill and time to interpret.

The question to ask is why do you need to decompile the DLL in the first place?
Prakash SamariyaIT ProfessionalCommented:
Yes, you can convert DLL back to the original source code almost upto 80 to 90% with excluding variable naming-convention. Like if your original source code has variable name "FirstName", it might be represent as "Variable1" after decompiling!!

There are several and complex way to decompile it, however there are couple of Free and Trial based tool to do that work like below:
http://ilspy.net/
http://www.jetbrains.com/decompiler/
http://www.devextras.com/decompiler/
http://www.red-gate.com/products/dotnet-development/reflector/

.NET Reflector is the good one (but trial)!!
ste5anSenior DeveloperCommented:
In short: No.

Because the compilation process from the original source to IL and , when it's a machine code DLL, from IL to machine code uses optimization logic which is not reversible.

For example: you declare all your variables at the beginning of a large method. The IL optimizer may rearrange this to reduce the memory consumption. There will be no information in the IL that this happened and where the original declaration was.

So, the only thing you'll get is a functional equivalent piece of code. In some cases it may be the same as your original code, in some note.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AXISHKAuthor Commented:
Tks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.