Esempio n. 1
0
        public void OriginalFileNoLongerExists()
        {
            var task = new RenameTask(_sourceFile, _renameTo, new DotNetPath());

            task.Execute();

            Assert.IsFalse(File.Exists(_sourceFile));
        }
Esempio n. 2
0
        public void RenameFileWorks()
        {
            var task = new RenameTask(_sourceFile, _renameTo, new DotNetPath());

            task.Execute();

            Assert.IsTrue(File.Exists(_renameTo));
        }
Esempio n. 3
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("");
            }
        }
Esempio n. 4
0
        public void RemoteRename()
        {
            var task = new RenameTask(@"\\srvtestwebtpg\E$\FHLB MQApps\BloombergIntegration\bin\des.exe", "hi.exe", new DotNetPath());

            task.Execute();
        }
Esempio n. 5
0
        public void RenameOnTopOfConflictingFile()
        {
            var task = new RenameTask(_sourceFile, _conflictFile, new DotNetPath());

            task.Execute();
        }