I paid a freelancer programmer for an app to tun my clinic. He got about 95% of the project done, but then got a job elsewhere and vanished into thin air, along with my source code... So, I have a semi-working program and I need to finish it. How can I recover the source code (Visual Studio, C#) to a point I can finish what I need and then recompile it again? Is this possible? I'm willing to buy/pay...
-
1.NET Reflector is the best. I've used ILSpy to a similar degree of success before as well.– FewmitzJun 17, 2016 at 20:00
-
2Have you considered asking him for the source code? I know you said he vanished in thin air but you may have a chance considering you paid him, depending on what you agreed for him to build.– BrandonJun 18, 2016 at 2:39
-
No. He's off the radar. I haven't been able to even locate him or a phone number.– Raul MoralesJun 20, 2016 at 6:32
-
My question: with Reflector, can I end up with the original source code in a way I can finish the coding of the missing items and recompile again?– Raul MoralesJun 20, 2016 at 6:33
-
you can't recover "the original source code" (e.g. comments and often variable names are lost completely during compilation) but for C# it should be possible to recover "equivalent code" which should let you add the missing functionality yourself.– Igor Skochinsky ♦Jun 9, 2017 at 17:19
5 Answers
As far as free and open source tools go, I'd recommend dnSpy. It is the best tool I've used for .NET reverse engineering.
You might also want to try out ILSpy, which is free and open source as well.
-
My question: with Reflector, can I end up with the original source code in a way I can finish the coding of the missing items and recompile again? Jun 20, 2016 at 6:33
-
dnSpy allows you to edit the code. So you should be able to add what you need. I never did try to get the entire source as files, though.– tmr232Jun 20, 2016 at 9:18
Consider also JetBrains dotPeek that is free, decompiles .NET 1.0-4.5 assemblies to C#.
Has support for .dll, .exe, .zip, .vsix, .nupkg, and .winmd files.
To answer your question "Can I end up with the original source code in a way I can finish the coding of the missing items and recompile again?": if it runs on your system, it means you have all the dependencies needed and you'll be able to decompile to a state where you can edit and recompile at will.
I don't know about Reflector, but with ILSpy, you have the option in the File menu to "Save as..." and you can save a .csproj or a .vbproj (this can be done because the intermediate language of .Net can round-trip to both languages; so even if coding was in C#, you can roundtrip to VB if you wanted).
There are many free and paid utilities out there that aim to decompile .NET applications.
Personally I use .NET Reflector - which is a commercial application with a 14-day free evaluation version.
-
My question: with Reflector, can I end up with the original source code in a way I can finish the coding of the missing items and recompile again? Jun 20, 2016 at 6:33
-
Yes, assuming the code wasn't packed or obfuscated. (It probably wasn't)– user15338Jun 20, 2016 at 12:49
There are multiple free/Trial tools available Personally i used .NET Reflector and JustDecompile With JustDecompile you can Edit your source code as well