Was simply asking about encrypting builds.
Sorted now, thanks all<3
Was simply asking about encrypting builds. Sorted now, thanks all<3
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Managed assemblies are relatively easy to reverse engineer, predominantly because the IL code omitted by the compiler is already very readable but you can read more about that elsewhere.
A common approach to preventing, or rather attempting to prevent, somebody from reverse engineering a managed assembly is obfuscation. An obfuscator will load meaningful data from the assembly and then make it difficult to read by using a variety of techniques such as scrambling identifiers and replacing string literals with verbose arithmetic functions.
The best obfuscator that I have come across, and I deem it the best because it is the obfuscator that I see reverse engineers complaining about the most, is Confuser (open source).
The Confuser UI is based on a somewhat pluggable core API that you can reference from your application to confuse the assembly that your program ommits. I suppose you could copy and credit some of the code in order to obfuscate your string of code in memory but as far as I know you will need to parse the code so that you can identify members and such as where Mono.Cecil
(also open source and used by confuser) will be able to identify members and such in your code using the assembly metadata.
Obfuscation is okay and will likely protect your assembly from a rookie or lazy reverse engineer if the obfuscator is up to date. Open source tools like de4dot make light work of reversing the effects of popular obfuscators.
But remember "protection through obfuscation is no protection at all"
Update
In order to obfuscate the code before the assembly is built, you will need a parser that will present to you all of the identifiers and expressions in your code. From there you can work to generate random meaningless names for identifiers and amend the expressions to make as little sense as possible.
For example
Console.Writeline("Hi")becomes:Console.WriteLine("{0}{1}", (char) (36 << 1), (char) ((26 << 2) + 1));which is very difficult to read. I made that up on the spot and obviously doesn’t conform to any algorithm because the bit shifting will likely lose important bits. But like I said before, go check out some other sources for algorithms you can copy and credit.