I have a source that i get from my website, from this source i dynamically compiled form. My exe is protected and it's on C#, but when i use memory dumper i can easy get source code of my dynamically compiled form. Any way to protect it?
P.S. This is not duplicated thread. I have a good protector and my main program is well protected, so with dotPeek i can get only this dynamically compiled form source code that i load and compile in my main program, so my question is how to protect it? I can only obfuscate form source? Or there other ways?
This is how i compile my form
using System;
using System.CodeDom.Compiler;
using System.IO;
using Microsoft.CSharp;
namespace myForm
{
class Program
{
static void Main(string[] args)
{
using (var foo = new CSharpCodeProvider())
{
var parameters = new CompilerParameters
{
GenerateInMemory = true,
GenerateExecutable = false
};
parameters.ReferencedAssemblies.Add("System.dll");
parameters.ReferencedAssemblies.Add("System.Core.dll");
parameters.ReferencedAssemblies.Add("System.Drawing.dll");
parameters.ReferencedAssemblies.Add("System.Windows.Forms.dll");
var source = File.ReadAllText("form.txt");
CompilerResults results = foo.CompileAssemblyFromSource(parameters, source);
Type type = results.CompiledAssembly.GetType("radarHack.mainForm");
}
}
}
}