Пример #1
0
        /// <summary>
        /// Runs the specified cloaking task.
        /// </summary>
        /// <param name="context">The running context of this cloak job.</param>
        public void RunTask(ICloakContext context)
        {
            //Optimization on it's own will screw up our original changes so let's fix it up first
            context.ReloadAssemblyDefinitions();

            //Now get the dictionary and optimize
            var dictionary = context.GetAssemblyDefinitions();
            foreach (AssemblyDefinition assembly in dictionary.Values)
            {
                //We'll search methods only at this point
                foreach (ModuleDefinition moduleDefinition in assembly.Modules)
                {
                    //Go through each type
                    foreach (TypeDefinition typeDefinition in moduleDefinition.GetAllTypes())
                    {
                        //Go through each method
                        foreach (MethodDefinition methodDefinition in typeDefinition.Methods)
                        {
                            if (methodDefinition.HasBody)
                            {
                                OutputHelper.WriteMethod(typeDefinition, methodDefinition);
                                methodDefinition.Body.OptimizeMacros();
                            }
                        }
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Runs the specified cloaking task.
        /// </summary>
        /// <param name="context">The running context of this cloak job.</param>
        public void RunTask(ICloakContext context)
        {
            //Optimization on it's own will screw up our original changes so let's fix it up first
            context.ReloadAssemblyDefinitions();

            //Now get the dictionary and optimize
            var dictionary = context.GetAssemblyDefinitions();

            foreach (AssemblyDefinition assembly in dictionary.Values)
            {
                //We'll search methods only at this point
                foreach (ModuleDefinition moduleDefinition in assembly.Modules)
                {
                    //Go through each type
                    foreach (TypeDefinition typeDefinition in moduleDefinition.GetAllTypes())
                    {
                        //Go through each method
                        foreach (MethodDefinition methodDefinition in typeDefinition.Methods)
                        {
                            if (methodDefinition.HasBody)
                            {
                                OutputHelper.WriteMethod(typeDefinition, methodDefinition);
                                methodDefinition.Body.OptimizeMacros();
                            }
                        }
                    }
                }
            }
        }
Пример #3
0
 /// <summary>
 /// Runs the specified cloaking task.
 /// </summary>
 /// <param name="context">The running context of this cloak job.</param>
 public void RunTask(ICloakContext context)
 {
     foreach (AssemblyDefinition assembly in context.GetAssemblyDefinitions().Values)
     {
         Simplify(assembly);
     }
     context.ReloadAssemblyDefinitions();
 }
Пример #4
0
 /// <summary>
 /// Runs the specified cloaking task.
 /// </summary>
 /// <param name="context">The running context of this cloak job.</param>
 public void RunTask(ICloakContext context)
 {
     foreach (AssemblyDefinition assembly in context.GetAssemblyDefinitions().Values)
     {
         Simplify(assembly);
     }
     context.ReloadAssemblyDefinitions();
 }