Пример #1
0
        public static string Process(Context ctx, LogInfo info, LogWarn war, LogErr err)
        {
            try
            {
                string      startobf = "Starting ";
                ModuleDefMD module   = ModuleDefMD.Load(ctx.FileName);
                module.GlobalType.FindOrCreateStaticConstructor();
                foreach (TaskID task in ctx.TasksList)
                {
                    switch (task)
                    {
                    case AntiDebugTask.ID:
                    {
                        info(startobf + "Anti-Debug Task...");
                        AntiDebugTask.Execute(module);
                    } break;

                    case StringEncodingTask.ID:
                    {
                        info(startobf + "String encoding Task...");
                        StringEncodingTask.Execute(module);
                    } break;

                    case ControlFlowTask.ID:
                    {
                        info(startobf + "Control Flow Task...");
                        ControlFlowTask.Execute(module);
                    } break;

                    case InvalidMDTask.ID:
                    {
                        info(startobf + "Invalid Metadata Task...");
                        InvalidMDTask.Execute(module);
                    } break;

                    case RenameTask.ID:
                        RenameTask.IsObfuscationActive = true; break;
                    }
                }
                info(startobf + "Rename Task..." + Environment.NewLine);
                RenameTask.Execute(module);
                module.Write(ctx.NewPath, new ModuleWriterOptions()
                {
                    Listener = NETUtils.listener
                });
                return(ctx.NewPath);
            }
            catch (Exception ex)
            {
                err(ex.Message);
                return("");
            }
        }
Пример #2
0
 internal SqlTask(ControlFlowTask callingTask, string sql) : base(callingTask, sql)
 {
 }
Пример #3
0
 internal XmlaTask(ControlFlowTask callingTask, string xmla) : base(callingTask, xmla)
 {
     Init();
 }
Пример #4
0
        private void Button1_Click(object sender, EventArgs e)
        {
            ModuleDefMD module = ModuleDefMD.Load(textBox1.Text);

            if (checkBox1.Checked)
            {
                StringEncPhase.Execute(module);
            }

            /*    if (checkBox2.Checked)
             *  { OnlinePhase.Execute(module); }  */
            if (checkBox3.Checked)
            {
                ProxyString.Execute(module);
            }
            if (checkBox5.Checked)
            {
                Anti_Debug.Execute(module);
            }
            if (checkBox6.Checked)
            {
                Anti_Tamper.Execute(module);
            }
            if (checkBox8.Checked)
            {
                AddIntPhase.Execute(module);
            }
            if (checkBox4.Checked)
            {
                ProxyINT.Execute(module);
            }
            if (checkBox12.Checked)
            {
                ProxyMeth.Execute(module);
            }
            if (checkBox10.Checked)
            {
                RenamerPhase.Execute(module);
            }
            if (checkBox7.Checked)
            {
                controlflow.process(module); ControlFlowTask.Execute(module);
            }
            if (checkBox11.Checked)
            {
                JumpCFlow.Execute(module);
            }
            if (checkBox9.Checked)
            {
                InvalidMDPhase.process(module.Assembly);
            }
            string text2 = Path.GetDirectoryName(textBox1.Text);

            if (!text2.EndsWith("\\"))
            {
                text2 += "\\";
            }
            string path = text2 + Path.GetFileNameWithoutExtension(textBox1.Text) + "_protected" +
                          Path.GetExtension(textBox1.Text);
            var opts = new ModuleWriterOptions(module);

            opts.PEHeadersOptions.NumberOfRvaAndSizes        = 13;
            opts.MetaDataOptions.TablesHeapOptions.ExtraData = 0x1337;
            opts.Logger = DummyLogger.NoThrowInstance;
            module.Write(path, opts);
            if (checkBox6.Checked)
            {
                Anti_Tamper.Md5(path);
            }
        }
Пример #5
0
 internal ReadLoadProcessTableTask(ControlFlowTask callingTask, long?loadProcessId) : this(loadProcessId)
 {
     this.CopyLogTaskProperties(callingTask);
     this.ConnectionManager = callingTask.ConnectionManager;
 }