コード例 #1
0
ファイル: ConfuserProject.cs プロジェクト: nereva/ConfuserEx
        /// <summary>
        ///     Clones this instance.
        /// </summary>
        /// <returns>A duplicated rule.</returns>
        public Rule Clone()
        {
            var ret = new Rule
            {
                Preset  = Preset,
                Pattern = Pattern,
                Inherit = Inherit
            };

            foreach (var i in this)
            {
                var item = new SettingItem <Protection>
                {
                    Id     = i.Id,
                    Action = i.Action
                };
                foreach (var j in i.Keys)
                {
                    item.Add(j, i[j]);
                }

                ret.Add(item);
            }
            return(ret);
        }
コード例 #2
0
        /// <summary>
        ///     Clones this instance.
        /// </summary>
        /// <returns>A duplicated rule.</returns>
        public Rule Clone()
        {
            var ret = new Rule();

            ret.Preset  = Preset;
            ret.Pattern = Pattern;
            ret.Inherit = Inherit;
            foreach (var i in this)
            {
                var item = new SettingItem <Protection>();
                item.Id     = i.Id;
                item.Action = i.Action;
                foreach (string j in i.Keys)
                {
                    item.Add(j, i[j]);
                }
                ret.Add(item);
            }
            return(ret);
        }
コード例 #3
0
        public Rule Clone()
        {
            Rule ret = new Rule();

            ret.Preset  = this.Preset;
            ret.Pattern = this.Pattern;
            ret.Inherit = this.Inherit;
            foreach (var i in this)
            {
                var item = new SettingItem <IConfusion>();
                item.Id     = i.Id;
                item.Action = i.Action;
                foreach (var j in i.AllKeys)
                {
                    item.Add(j, i[j]);
                }
                ret.Add(item);
            }
            return(ret);
        }
コード例 #4
0
        private void thirteenButton6_Click(object sender, EventArgs e)
        {
            if (thirteenTextBox1.Text == "")
            {
                MessageBox.Show("Pick a file first goofball.");
            }
            else
            {
                ConfuserProject proj = new ConfuserProject();
                proj.PluginPaths.Add(Directory.GetCurrentDirectory() + "\\KoiVM.Confuser.exe");
                proj.BaseDirectory   = Path.GetDirectoryName(thirteenTextBox1.Text);
                proj.OutputDirectory = Path.Combine(Path.GetDirectoryName(thirteenTextBox1.Text) + @"\Confused"); //output directory

                //add a module to the project
                ProjectModule module = new ProjectModule();                 //create a instance of ProjectModule
                module.Path = Path.GetFileName(thirteenTextBox1.Text);      //sets the module name]
                proj.Add(module);                                           //adds module to project
                Rule rule = new Rule("true", ProtectionPreset.None, false); //creates a Global Rule, with no preset and "true" patern, without inherit
                if (groupBox1.Enabled == true)
                {
                    if (antiTamper.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("anti tamper", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (antiDebug.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("anti debug", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (calli.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("Calli Protection", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (constants.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("constants", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (controlFlow.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("ctrl flow", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (invalidMetadat.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("invalid metadata", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (renamer.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("rename", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (refProxy.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("ref proxy", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (mildRefProxy.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("Clean ref proxy", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (moduleFlood.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("module flood", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (fakeNative.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("Fake Native", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (renameAssembly.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("Rename Module", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (renameAssembly.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("Mutations", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (local2field.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("local to field", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (hideMethods.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("Hide Methods", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (md5Checksum.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("MD5 Hash Check", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    if (eraseHeaders.Checked)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>("erase headers", SettingItemAction.Add);
                        rule.Add(protection);
                    }
                    proj.PluginPaths.Clear();
                }
                else if (fastVirt.Checked)
                {
                    string[] array = { "MD5 Hash Check", "erase headers", "virt", "Rename Module" };
                    foreach (string a in array)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>(a, SettingItemAction.Add);

                        rule.Add(protection);
                    }
                }
                else if (strongVirt.Checked)
                {
                    string[] array = { "MD5 Hash Check", "erase headers", "virt", "constants", "Clean ref proxy", "Rename Module", "anti tamper" };
                    foreach (string a in array)
                    {
                        SettingItem <Protection> protection = new SettingItem <Protection>(a, SettingItemAction.Add);

                        rule.Add(protection);
                    }
                }

                proj.Rules.Add(rule);          //add our Global rule to the project

                XmlDocument doc = proj.Save(); //convert our project to xml document
                doc.Save("temp.crproj");       //save the xml document as a file


                Process.Start("Confuser.CLI.exe", "-n temp.crproj").WaitForExit();
                File.Delete("temp.crproj");
            }
        }
コード例 #5
0
        private void ThirteenButton12_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length < 2)
            {
                MessageBox.Show("Title of the projects need to be > than 2 letters.");
            }
            else
            {
                listBox1.Items.Add(textBox1.Text + ".rzyproj");
                ConfuserProject proj = new ConfuserProject();
                try
                {
                    proj.BaseDirectory   = Path.GetDirectoryName(thirteenTextBox1.Text);
                    proj.OutputDirectory = Path.Combine(Path.GetDirectoryName(thirteenTextBox1.Text) + @"\RzyProtector");
                }
                catch { }
                ProjectModule module = new ProjectModule();
                module.Path = Path.GetFileName(thirteenTextBox1.Text);
                proj.Add(module);

                Rule rule = new Rule("true", ProtectionPreset.None, false);



                if (antivmcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("avm"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antiildasmcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("ildasm"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antide4dot.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("de4dot"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antidnspy.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("dnspy"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antitampercheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("tamper"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antidumpcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("preventdump"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antidebugcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("preventdebug"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antimemoryeditcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("memory"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antiwatermarkcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("watermark"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (callicheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("calliprot"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (constantscheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("const"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (ctrlflowcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("control flow"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (junkcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("addjunk"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (refproxycheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("proxy"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (resourcescheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("resources"), SettingItemAction.Add);
                    rule.Add(protection);
                }

                if (erasecheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("erase"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (fakenativecheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("native"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (lcltofieldscheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("local to field"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (modulerenamercheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("modulerenamer"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (stackunderflowcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("stack"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (admincheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("forceadmin"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (hidemethodscheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("methodshide"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (invalidmetadatacheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("metadata"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (md5check.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("checksum"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (modulefloodcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("floodmodule"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (fakeobfuscatorcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("fakeobf"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (renamercheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("renamer"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antifiddlercheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("preventfiddler"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antihttpcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("preventhttp"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (processmonitorcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("processmonitor"), SettingItemAction.Add);
                    rule.Add(protection);
                }


                proj.PluginPaths.Clear();
                proj.Rules.Add(rule);

                XmlDocument doc = proj.Save();
                doc.Save($"{Directory.GetCurrentDirectory()}\\Projects\\{textBox1.Text}.rzyproj");
            }
        }
コード例 #6
0
        private void ThirteenButton4_Click(object sender, EventArgs e)
        {
            if (thirteenTextBox1.Text == "")
            {
                MessageBox.Show("You need to select a file to protect !", "RzyObfuscator");
            }
            else
            {
                string path = Directory.GetCurrentDirectory() + "\\Configs\\CustomRenamer.rzy";
                string dir  = Path.GetDirectoryName(path);
                if (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }

                string path2 = Directory.GetCurrentDirectory() + "\\Configs\\CustomModule.rzy";
                string dir2  = Path.GetDirectoryName(path2);
                if (!Directory.Exists(dir2))
                {
                    Directory.CreateDirectory(dir2);
                }

                ConfuserProject proj = new ConfuserProject();
                proj.BaseDirectory   = Path.GetDirectoryName(thirteenTextBox1.Text);
                proj.OutputDirectory = Path.Combine(Path.GetDirectoryName(thirteenTextBox1.Text) + @"\RzyProtector");
                ProjectModule module = new ProjectModule();
                module.Path = Path.GetFileName(thirteenTextBox1.Text);
                proj.Add(module);

                Rule rule = new Rule("true", ProtectionPreset.None, false);



                if (antivmcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("avm"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antiildasmcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("ildasm"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antide4dot.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("de4dot"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antidnspy.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("dnspy"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antitampercheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("tamper"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antidumpcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("preventdump"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antidebugcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("preventdebug"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antimemoryeditcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("memory"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antiwatermarkcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("watermark"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (callicheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("calliprot"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (constantscheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("const"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (ctrlflowcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("control flow"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (junkcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("addjunk"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (refproxycheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("proxy"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (resourcescheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("resources"), SettingItemAction.Add);
                    rule.Add(protection);
                }

                if (erasecheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("erase"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (fakenativecheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("native"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (lcltofieldscheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("local to field"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (modulerenamercheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("modulerenamer"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (stackunderflowcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("stack"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (admincheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("forceadmin"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (hidemethodscheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("methodshide"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (invalidmetadatacheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("metadata"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (md5check.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("checksum"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (modulefloodcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("floodmodule"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (fakeobfuscatorcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("fakeobf"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (renamercheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("renamer"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antifiddlercheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("preventfiddler"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antihttpcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("preventhttp"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (processmonitorcheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>(TrinitySeal.Seal.Var("processmonitor"), SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (mutateconstantscheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("Mutate Constants", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (weakcallicheck.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("Weak Calli", SettingItemAction.Add);
                    rule.Add(protection);
                }
                //SettingItem<Protection> protectionR = new SettingItem<Protection>("Lite Calli", SettingItemAction.Add);
                //rule.Add(protectionR);


                proj.PluginPaths.Clear();



                proj.Rules.Add(rule);

                XmlDocument doc = proj.Save();
                doc.Save("temp.crproj");


                Process.Start("RzyProtector.CLI.exe", "-n temp.crproj").WaitForExit();
                File.Delete("temp.crproj");
            }
        }
コード例 #7
0
        private void thirteenButton6_Click(object sender, EventArgs e)
        {
            if (thirteenTextBox1.Text == "")
            {
                MessageBox.Show("Pick a file first goofball.");
            }
            else
            {
                filelocation = thirteenTextBox1.Text;

                ConfuserProject project = new ConfuserProject();                                            //create a project
                project.BaseDirectory   = Path.GetDirectoryName(filelocation);
                project.OutputDirectory = Path.Combine(Path.GetDirectoryName(filelocation) + @"\Confused"); //output directory

                //add a module to the project
                ProjectModule module = new ProjectModule();                 //create a instance of ProjectModule
                module.Path = Path.GetFileName(filelocation);               //sets the module name]
                project.Add(module);                                        //adds module to project

                Rule rule = new Rule("true", ProtectionPreset.None, false); //creates a Global Rule, with no preset and "true" patern, without inherit

                if (antiTamper.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("anti tamper", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antiDebug.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("anti debug", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (antiDump.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("anti dump", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (calli.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("Calli Protection", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (constants.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("constants", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (controlFlow.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("ctrl flow", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (invalidMetadat.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("invalid metadata", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (renamer.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("rename", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (refProxy.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("ref proxy", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (mildRefProxy.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("Clean ref proxy", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (moduleFlood.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("module flood", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (fakeNative.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("Fake Native", SettingItemAction.Add);
                    rule.Add(protection);
                }
                if (renameAssembly.Checked)
                {
                    SettingItem <Protection> protection = new SettingItem <Protection>("Rename Module", SettingItemAction.Add);
                    rule.Add(protection);
                }


                project.Rules.Add(rule);          //add our Global rule to the project

                XmlDocument doc = project.Save(); //convert our project to xml document
                doc.Save("temp.crproj");          //save the xml document as a file


                Process.Start("Confuser.CLI.exe", "-n temp.crproj").WaitForExit();
                File.Delete("temp.crproj");
                label2.ForeColor = Color.LimeGreen;
                label2.Text      = "Protection complete, check log tab!";
            }
        }