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.

Was it helpful?

Solution

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 :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top