none
Decompiling a .DLL file to view Source Code

    Question

  • Hi guys,

    I have a DLL file which I would like to decompile in order to edit the source code... Does anyone have any idea of  how I come go about doing this?

    I don not have the original solution (The person who wrote it has left the company)

    Thanks

    Neefy

    Friday, April 23, 2010 11:43 AM

Answers

  • Hi,

    I think you have downloaded the .NET Reflector & this FileGenerator plugin , If you do,

    1. Open up the Reflector.exe,
    2. Go to View and click Add-Ins,
    3. In the Add-Ins window click Add...,
    4. Then find the dll you have downloaded FileGenerator.dll (witch came wth the FileGenerator plugin),
    5. Then close the Add-Ins window.
    6. Go to File and click Open and choose the dll that you want to decompile,
    7. After you have opend it, it will appear in the tree view,
    8. Go to Tools and click Generate Files (Crtl+Shift+G),
    9. select the output directory and select appropriate settings as your wish,
    10. Click generate files.

    Reply if success,

    Thanks & Good luck!

    • Marked as answer by Neefy Wednesday, May 12, 2010 10:55 AM
    Monday, May 03, 2010 3:50 PM
  • Hi,

    Try .NET Reflector, It will decompile your dll into C# or VB.

    Thanks for the post,

    Reply if success.

    Good luck !

    Friday, April 23, 2010 12:17 PM
  • Reflector indeed with the FileGenerator plugin should do the trick nicely.
    Friday, April 23, 2010 3:09 PM

All replies

  • Hi,

    Try .NET Reflector, It will decompile your dll into C# or VB.

    Thanks for the post,

    Reply if success.

    Good luck !

    Friday, April 23, 2010 12:17 PM
  • Reflector indeed with the FileGenerator plugin should do the trick nicely.
    Friday, April 23, 2010 3:09 PM
  • Thanks guys,

     

    I got tyhe .NET Refletor and the FileGenerator but can't seem to "use" them together properly. Tried adding the "FileGenerator" DLL to the .NET Reflector, still not able to generate the source files!

    Any ideas?

    Monday, May 03, 2010 10:31 AM
  • Hi,

    I think you have downloaded the .NET Reflector & this FileGenerator plugin , If you do,

    1. Open up the Reflector.exe,
    2. Go to View and click Add-Ins,
    3. In the Add-Ins window click Add...,
    4. Then find the dll you have downloaded FileGenerator.dll (witch came wth the FileGenerator plugin),
    5. Then close the Add-Ins window.
    6. Go to File and click Open and choose the dll that you want to decompile,
    7. After you have opend it, it will appear in the tree view,
    8. Go to Tools and click Generate Files (Crtl+Shift+G),
    9. select the output directory and select appropriate settings as your wish,
    10. Click generate files.

    Reply if success,

    Thanks & Good luck!

    • Marked as answer by Neefy Wednesday, May 12, 2010 10:55 AM
    Monday, May 03, 2010 3:50 PM
  • Hi Rukshan,

    Thanks a mill. The above was a GREAT Success... :-)

    Regards

    Neefy

    Wednesday, May 12, 2010 10:55 AM
  • Hi, Neefy...

    You are most welcome !.

    Wednesday, May 12, 2010 12:58 PM
  • Hello,

    I am in the same situation as Neefy was. I followed everyones advice and went to get .Net Reflector. Sadly you have to pay $35 for it now. I am  not sure if the company wants to buy this if it does not work how we want. I noticed they have a beta version out for free. I downloaded this and then FileGenerator plugin from the link provided. I started following Rukshan's steps. I get to step 4. After I click add and locate the plugin I get an error saying that it failed to to load the add-in.

     

    Does anyone know if this is because the plugin is not compatible with the beta? Or is it that the plugin does not even work with their newest version, version 7 because when this thread was created I believe they were not using version 7.

     

    I have tried downloading older versions off of .cnet, but when you run the reflector.exe a message pops up saying newer version available would you like to download it. If you choose no it removes the .exe if you choose yes it says you must visit the website to download (to pay) and then it deletes the .exe.

     

     

    Thanks for any help on this

    Rob

     

    *Edit*

    Something else I am wondering:

    I believe the .dll that I want to view the source code was in C or C++ with a slight chance of being C#. If I use .NET Reflector and it was written in C/C++ will it successfully create a C# file?

     

    *edit edit*

    Seems there is actual error output:

     

    Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. (ReflectionTypeLoadException)

    LoaderExceptions:
    Could not load file or assembly 'Reflector, Version=5.0.0.0, Culture=neutral, PublicKeyToken=18ca6bb8dd6a03c3' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (FileLoadException)

    That error message repeats 7 more times.

     

    *edit edit edit*

    couple of hours of searching I found free stable version 6.5

    Here:

    http://www.brothersoft.com/red-gate-.net-reflector-284053.html

    I downloaded it and tried to use the plugin. Seems to be working. I think the problem might be the fact that version 7 is in beta. Hopefully the problem doesn't exist in final production of version 7.

     

    Cheers! Hope this helps someone else

     

    *edit edit edit edit*

    So I think it worked. It generated 2000 files(mostly System.XXXXXX.XXXXX etc..). Does anyone know where I would be able to actually find the code written by programmer who wrote the .dll not the .NET files. Thanks!

    Wednesday, March 09, 2011 2:04 PM
  • Dear Rukshan,

     I am dcompiling exe using Reflector,it decompile exe successfully but windows form is not successfully decompiling. I can view the form.cs code but form and control is not generated.Please help me.

    Regards

    Mahesh

    Saturday, February 11, 2012 12:03 PM
  • Dear developers! HELP!!!

    For an unknown issue, my Windows 8 os freezed when I was working on a project using Visual Studio 11, now one of my files is corrupt and VS is not able to build because of classes I lost, but I have the last working exe file which makes it possible to recover the lost file using decompiling it. I tried IL Spy 2 but it seems the exe files made by VS 2011 cannot be decompiled using ILSpy. please help me.

    Sincerely yours,

    Peyman Mortazavi


    PK DEVELOPER

    Tuesday, May 29, 2012 4:28 PM
  • thnx alot really helpful 

    but when i decomplied i got the other files but i could not get the solution of the project

    how can i get the solution file splz suggest

    thnxx


    • Edited by SSmadhu Sunday, July 22, 2012 5:58 AM
    Wednesday, July 18, 2012 10:51 AM
  • Neefy how did you put the changed code into the dll?

    SPTroller

    Monday, January 21, 2013 10:08 AM
  • I did this procedure above (with one small correction) and it was as easy as could be to get the source code from the DLL. .NET Reflector is an awesome product.  Small correction to above the Add-ins is under the Tools menu not View .... minor issue/typo. Hope this helps others
    Wednesday, September 25, 2013 4:34 PM
  • It gives me an error msge that says " The following assembly name can not be resolved automatically: Please select the assembly file manually"

    What file is it looking for??

    Cheers


    • Edited by Tohwe Friday, February 14, 2014 11:39 AM
    Friday, February 14, 2014 11:36 AM
  • Same for me also..

    " The following assembly name can not be resolved automatically: Please select the assembly file manually"

    Please help.

    Wednesday, July 16, 2014 3:11 PM
  • It works in Win8.1 and visual studio 2013 through reflector 8.3v
    Wednesday, July 23, 2014 7:59 AM