Get source from pre-compiled ASP.NET website? [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Long story short, VSS decided I wasn't allowed to have some code changes. I am missing a decent sized feature that I don't want to have to re-write (gave to a co-op as work this past summer). It works great and does what the client wants. However... I don't have the machine and the machine it was developed on has since been paved low!
Do'h!
We published the site into a test environment straight from visual studio and then we copied the files into production. So I have the "compiled" files from the VS publish.
How can I go about getting that back into code? I am sure I can figure out which DLL it is in and I would assume that something like reflector is going to be my best bet? Are the original variable names retained?

I would use .NET reflector. Your original variable names will be preserved (providing you did not run any kind of obfuscator) if you have the PDB files as well as the DLLs.

I would suggest trying to reflect your compiled code and see how readable it comes out.
http://www.red-gate.com/products/reflector/

Reflector all the way. You can't rely on local variable names since they don't really exist (only fields retain their names), but having the matching pdb would go a long way to helping. If you use the pro/EAP version of reflector it will do must of the work for you (generating the full C# disassembly etc, so you don't have to go method-by-method or use a plugin).
You may still need to look at each directory separately, of course.

Best you are going to get is with a decompiler like this http://www.red-gate.com/products/reflector/. You are going to lose variable names and comments, but what you get will compile.
Sucks, but probably a lot better then starting from scratch.

I used Telerik's JustDecompile to get the source code back from a precompiled site. It's free and has done everything I've needed.
http://www.telerik.com/products/decompiler.aspx

Salamander - a .NET decompiler
http://www.remotesoft.com/salamander/index.html
I've never used this tool, but they talked about it on .NET rocks! a while back. http://www.dotnetrocks.com/default.aspx?showNum=194

I had the similar issue and used Reflector to Decompile it. I got the source code, then changed the bit I wanted, and rebuild it. Then I copied that dll again to Production site. It started to reflect my changes. It was very easy and not at all difficult, maybe because Precompiled site had dlls for every page, and was updatable , so had only code-behind file in dll.
For reference: http://www.reflector.net/

Related

protect net 2 code (dll / exe) with a freeware from reverse engineering [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I compiled my program / DLL to NET 2 Code knowing the fact that everyone who gets the executable has also automatically access to my source code if this person uses a (.NET) decompiler. So I ask myself how to hinder someone from seeing all my code in .NET not only because I am ashamed of my simple methods and my beginner coding style :)
I found nothing useful on how to secure source code of a .NET executable. I found "IL Protector" which promised to protect any DLL/EXE 32/64bit.
I installed it, added my DLL to it, recompiled my DLL with it and it appeared a green marker indicating that my assembly shall be now protected. Till here it worked.
Then I added my protected DLL to the folder with the executable which is using it, but from now on I got an internal exception about a "module" or something like "protect64.dll". I cannot fix this nor do I understand what needed. I upgraded my NET 2.0 project to Net 3.5 which didn't helped. I deleted the reference of my DLL and added it new to the project and compiled the project for new, but even the compiled EXE continues to throw me an internal exception.
In this DLL I have one simple method which is being called from the EXE.
In the unprotected version of the DLL it works in the protected version I keep getting inner exceptions, the help of Visual Studio speaks of a "method<>", dunno what that means.
I tried another free protection program (an obfuscator or something alike). It was bad to use and the result was nothing. The decompiler decompiled the protected DLL with my method in one second and created the project folder of my project identical to my original folder.
So how would I protect my code effectively and easy and at no cost from being seen by others?
A step by step guide would be more appreciated than just a download link without explanation.
I know there is a lot of commercial software out, but what I do is private, so why should I pay.
Microsoft had to make the "Visual Studio Compiler" secure like everyone else does in the compiler branch (Borland, Embarcadero), period.
The tl;dr version of the correct answer is: you can't stop someone from looking at your code. Even as an obfuscated PE binary people can still use decompilation and analysis (with IDA, softice, etc).
This is a 'hard problem' that is often not even really needed. If you have a step that users shouldn't be able to see the 'source' for, perhaps open a web API for that step and control the server, etc.
But the icing on this question-cake is that you don't want to reimburse the other developers who have tried to help 'solve' the 'problem' you are facing for their time, but that's just my personal opinion :)

Obfuscating c# code not the assembly [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Is there a way to obfuscate c# code (visual studio solution ) so that if soem one even get the project could not understand it ?
note: I'm not talking bout obfuscating assembly/Executable here..
I've not seen anything commercially, but you could probably write your own application to do this. I actually know someone once did this for some ASPX pages that were being deployed.
You'd have to take similar steps:
Rename all local variables to very similar names B___0, B_0 etc.
Rename all internal and private methods/classes and all their references.
Encode all your strings.
Insert random code/calls that don't do anything.
Consider why you want this though... It means:
You can't ever view your own code. You'll have the original somewhere - why not just password protect it?
You're going to screw with any source control you're running.
You're going to have some crazy "process my entire solution" everytime you save/publish it?
In short it's probably not a good idea, which is why you probably can't find a commercial solution.
Close the door and windows tight.
Disconnect your computer from Internet during the developement.
Obfuscate your assemblies when your done.
Save them a a disk.
Burn down your computer.
Keep hitting your head onto a wall until you fergot why you're doing it.
There, you're safe, nobody will ever have the same exact source.
I hope your application has no bug, though.
A more sensible alternative might be to just encrypt your hard drive using something like
BitLocker or
TrueCrypt.
Obfuscate the dll
Use a decompiler like ILSpy and decompile the dll
This way you get obfuscated C# code.

How to go from published .net project back to original source code project [duplicate]

This question already has answers here:
How do I decompile a .NET EXE into readable C# source code?
(9 answers)
Closed 9 years ago.
I have a deployed .Net project(debug version). It doesn't have any of the code behind files.
What I would like to do is get back the original project including the c# files in the right folders.
You need to use a decompilation toolkit like the free Jetbrains dotPeek.
I see that Chris has recommended Redgate's .Net Reflector - historically this was good but has become slow and bloated as of late not to mention it is no longer free. Would highly recommend dotPeek over it.
You want reflector: http://www.red-gate.com/products/dotnet-development/reflector/
It's purpose is to reverse engineer assemblies. As long as these weren't compiled with an obfuscator you ought to be good. Bear in mind that the last time I had to do this to decompile a website, there was a LOT of work that still needed to occur to get the code back into a usable state.
If this was your fault, use source control next time... If you are picking up from someone else's mess, make sure you charge extra and recommend they use source control. If that someone else had purposely destroyed code, recommend that they be sued.
Note that I've also used the above to dig into LINQ (a few years ago) to locate some interesting bugs. It's a pretty good tool.

Auto-generate documentation for single c# file in asp.net project? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm trying to figure out how to automatically generate documentation for a single c# file in an ASP.NET project. I'm using VS 2010, and I have SandCastle, but I'm starting to get the impression it can only be used for a full project. The problem is that our entire project is huge and nothing but that one file needs documentation (it's the only one with functionality our clients use - everything else is internal)
I could do a batch script, but I'd rather not if there's a better way of going about this!
Does anybody have any ideas? Thanks very much in advance!
(as a side note, I saw this already and it did not help: Generating XML Documentation for single VB Class in WebSite Project )
I recommend using Sandcastle.
http://shfb.codeplex.com/
One thing you could do is have a post build task that pulls that portion of XML from the documentation file and then run Sandcastle or doxygen against your new XML file.
Have you tried StyleCop? It's aimed more at ensuring consistent coding practices, but does provide a little handy tool that allows you to quickly "Document this" on a constructor, method or property, etc. Might be worth a look to see if it's what you're after.
StyleCop
You can try https://www.docify.net/. Their whole thing is exactly this.
I've recently made a simple to use library that generates markdown documentation from C# code. All it takes is a class library dll file.
If you want to give it a try, here's a link on how to start using it with examples of generated documentation.
More informations : https://www.nuget.org/packages/BetaSoftware.AutoDocumentation
Doxygen might help. http://www.doxygen.nl/
At very least you can generate a word or pdf doc and then make a sub set of only the pages you need to provide.

Opensource project setup [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I want to set up an opensource community project in .NET, how do I go about it?
With my project, I started by choosing one of the many open source licenses (went with Apache 2.0). Then I added a LICENSE-file to my project, copy/pasted the license there and did the 'required' headers to each source file.
After that, I chose a project platform (or watchamacallit). I skipped SourceForge and chose Google Code instead, later moved to Assembla + GitHub. I upladed my source to the provided SCM-system (first SVN, later Git).
Alas, the hard part isn't selecting a license, getting your source public, documenting your stuff to a wiki or writing tickets. The hard part is to build the (successful) community around your project. For that you need an interesting project, people that are interested in your interesting project and a platform to connect these dots together. A dash of luck and/or reputation don't hurt, not the very least.
choose which license (bsd, gpl, etc.) you wish to release under
add README.txt, LICENSE.txt
there are many excellent options for free public hosting. You can see a lot of good comments here:
https://stackoverflow.com/questions/29736/what-open-source-hosting-service-should-i-use
www.codeplex.com would be another good starting place.
Go to:
http://code.google.com/hosting/
And follow the directions in the:
Create a new project link.
You can use other portals too.
You want to look create a repository on SourceForge or Github (those are the two I know of, there may be others). That would be the first step.
Setting up a blog, if you already do not have one, and blogging about your progress, frustrations, and everything in between during the journey is also good for few reasons. It will serve as a note to self for you for future projects. It will also be a good thing for others who want to do something similar to look at as a roadmap. Finally, its a great way to get more and more interest in your project.
You also might want to look into Mono Project (http://www.mono-project.com/Main_Page) and use that instead of Visual Studio so that there is not a barrier for entrance for others to join your project. Those Visual Studio licenses are not cheap and Mono is free. While I have not worked with the Mono environment in a while, I have heard a lot of good things about it.
I hope this helps and good luck to you.

Categories