How do you extract classes' source code from a dll file?

136,326

Solution 1

You cannot get the exact code, but you can get a decompiled version of it.

The most popular (and best) tool is Reflector, but there are also other .Net decompilers (such as Dis#). You can also decompile the IL using ILDASM, which comes bundled with the .Net Framework SDK Tools.

Solution 2

Only managed Languages like c# and Java can be decompiled completely.You can view complete source code. For Win32 dll you cannot get source code.

For CSharp dll Use DotPeek becoz it free and works same as ReDgate .Net Compiler

Have fun.

Solution 3

Use dotPeek

enter image description here

Select the .dll to decompile

enter image description here

That's it

Solution 4

Use .NET reflector.

Solution 5

Use Refractor. Download from here.

  1. Open the software after installing.
  2. Press Ctrl + O and select your DLL File.
  3. Dll will be shown in left pane.
  4. Right click on Dll and select Export Source Code.
  5. Select the folder in which you want to export your files
  6. Wait for a while it may take 2-3 minutes

enter image description here

Share:
136,326
ILoveMusic
Author by

ILoveMusic

Updated on November 17, 2021

Comments

  • ILoveMusic
    ILoveMusic over 2 years

    Is there any software to do this? I didn't find any useful information on the internet so I am asking here.

  • MasterMastic
    MasterMastic over 11 years
    These days you should probably use ILSpy or dotPeek. Both are free and doing an excellent job. I find dotPeek better because of navigation, and also it takes a long time for ILSpy to start. Also, I once decompiled an assembly that was I obfuscated (for testing tools) and Redgate's .NET reflector crashes immediately from the simplest obfuscation. ILSpy and dotPeek had no problem and have loaded it instantly. They also highlight selection so you can somehow manage the obfuscation.
  • Mister SirCode
    Mister SirCode over 4 years
    Im just going to say, you should probably edit this and include DnSpy instead of ilspy, ildasm, or reflector. In my honest opinion, nowadays reflector is the Worst of all of them. DnSpy seems to be the easiest to setup, is minimal, and has all the features of all the other programs. @adrianbanks
  • Muaath
    Muaath almost 4 years
    there is some problems, what is DoProcess method, and what is @helperRoot and add explan for code.