Retrieve C# code out of EXE Assembly

31 Jul

I lost some of my applications code coz of PC format, one of these applications is a C# Console Application, I managed to get the exe output of this application but I was not able to retrieve the code files so I used (.NET Reflector) to do this:


1-     Download the .NET Reflector.


2-     Download the Reflector.FileDisassembler.


3-     Extract the .Net Reflector


4-     Extract the Reflecter.FileDisaembler


5-     Copy the Reflector.FileDisassembler.dll to the .Net Relector Folder


6-     Start Relector.EXE


7-     From the View menu select Add-Ins



8-     In the Add-Ins Screen select Add and select Reflector.FileDisassembler.dll then close the Add-Ins screen



9-     From File menu select Open and select the exe file you want to retrieve its code



10- The reflector will load the file Assembly in the Assemblies section



11- Select the required file and from the Tools menu select File Disassembler




12- Click Generate and you will get your code




 Finally I would like to thank Siderite for his help


Posted by on July 31, 2008 in General, Photography


Tags: , , , , , ,

20 responses to “Retrieve C# code out of EXE Assembly

  1. vipin gangwar

    August 28, 2008 at 10:09 am

    Is it working for all the dlls and exes like exe of C#

  2. malakablog

    August 28, 2008 at 11:55 am


    I used it for exe of C# application and it worked very well with me

  3. Ramesh

    February 7, 2009 at 10:30 am

    This is a really great useful article and it is working fine. Thank you very much for publishing this article.

  4. sree

    February 7, 2009 at 3:38 pm

    Thanks for taking time to put the page together with detailed instructions and screenshots of how to use the tools. Great Help!!! I was so frustrated when I lost my source code due to HD crash. This saved me lot of rework.


  5. sree

    July 27, 2009 at 2:50 am

    Hai…… I lost my aspx.cs code. All I have now is sln file and dll files. Can I retrieve my code using above method.

  6. malakablog

    July 27, 2009 at 12:22 pm

    Hi I do not think it will work… it will only return back to you the source of the dll files.. Let us know if it worked for the aspx pages

  7. Vincent

    August 28, 2009 at 5:56 pm

    Hi! This article saved my life!!! Thank you very much, I don’t know what could I have done whithout this guide (oh yeah, could have worked another month to recreate everything). So all in all, you’re the best! 🙂

  8. sophia

    September 2, 2009 at 11:46 pm

    You are my hero. I just accident overwrite my source code by source safe. Luckily still got compiled dll.

    You saved my day. Thanks.

  9. Wrox

    September 24, 2009 at 5:16 am

    This so awsome, saved a lot of time 🙂 You are rocking buddy

  10. Amol Choudhari

    July 1, 2010 at 7:38 am

    I have lost my windows application source code I have used your technique but didn’t work out for me. Any other solution possible ):

  11. luisone

    July 25, 2010 at 2:52 pm

    MALAKABLOG, you are the best, I replace a project by mistake, but I still have the executable and with this I could obtain the code again, thanks a lot!!!!

  12. Rajini

    August 17, 2010 at 12:27 am

    Wow…!!! Awesome tool. You guys really saved me a whole week effort.

  13. Aseem Marwaha

    September 1, 2010 at 5:53 am

    This post is a great post for all the young freshers.
    But i have one problem, i could not get the designer form after decompiling. The visual studio gives various errors when opened.
    Please look into this issue and help me in resolving the same.

    • gainaco

      September 14, 2010 at 1:28 pm

      Thanks a lot for putting together this wonderful step by step guide. It help me recover the source to a program that i lost due to a system crash. However I also ran into similar difficulties when loading the Windows Forms Application in the designer as mention by Aseem above but manage to resolve the problem with the following steps:

      1. In the InitializeComponent method all references to windows components and enums need to be following qualified with the assembly name otherwise the designer is not able to load the form. For example instead of ComponentResourceManager manager use System.ComponentModel.ComponentResourceManager manager and instead of AutoScaleMode.Font use System.Windows.Forms.AutoScaleMode.Font etc.

      2. My system would not accept the name manager for ComponentResourceManager it keeps coming out with errors. I renamed it to resources instead.

      I hope it helps.

      • malakablog

        September 14, 2010 at 1:31 pm


  14. jason

    January 30, 2011 at 12:43 pm

    Thanks bro
    It’s really work~~ thanks a lot!!

  15. Shrikant

    May 2, 2011 at 9:27 am

    Thanks a lot.

  16. Prabhu Somu

    March 14, 2012 at 1:41 am

    tis s amazing!!

  17. Aya

    November 15, 2012 at 7:37 am

    I don’t know how could I thank you. You really helped me after I lost hope to retrieve my code. Thank you so much.

    • Mr Dublin

      November 15, 2012 at 9:04 am

      Thank you for ur comment 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: