示例#1
0
        private void MarkType(ModuleDefinition mod, TypeDefinition type, Marking mark, List <MemberSetting> settings)
        {
            MemberSetting ret = MarkType(mod, type, mark);

            ret.Parameters = mark.CurrentConfusions;

            using (mark.Level())
            {
                List <MemberSetting>     memSettings = new List <MemberSetting>();
                TypeDefinition           typeDef     = ret.Object as TypeDefinition;
                List <IMemberDefinition> mems        = new List <IMemberDefinition>(typeDef.Methods.OfType <IMemberDefinition>().Concat(
                                                                                        typeDef.Fields.OfType <IMemberDefinition>()).Concat(
                                                                                        typeDef.Properties.OfType <IMemberDefinition>()).Concat(
                                                                                        typeDef.Events.OfType <IMemberDefinition>()));
                foreach (var i in mems)
                {
                    using (mark.Level())
                        MarkMember(ret, i, mark, memSettings);
                }

                foreach (var i in typeDef.NestedTypes)
                {
                    using (mark.Level())
                        MarkType(mod, i, mark, memSettings);
                }

                ret.Members = memSettings.ToArray();
            }
            settings.Add(ret);
        }
示例#2
0
        public virtual MarkerSetting MarkAssemblies(Confuser cr, Logger logger)
        {
            this.cr   = cr;
            this.proj = cr.param.Project;
            MarkerSetting ret = new MarkerSetting();

            ret.Assemblies = new AssemblySetting[proj.Count];

            InitRules();

            Marking setting = new Marking();

            using (setting.Level())
            {
                for (int i = 0; i < proj.Count; i++)
                {
                    using (setting.Level())
                        ret.Assemblies[i] = _MarkAssembly(proj[i], setting);
                    logger._Progress(i + 1, proj.Count);
                }
                if (proj.Packer != null)
                {
                    ret.Packer           = Packers[proj.Packer.Id];
                    ret.PackerParameters = Clone(proj.Packer);
                }
            }

            return(ret);
        }
示例#3
0
        private void MarkModule(AssemblySetting parent, ModuleDefinition mod, Marking mark, List <ModuleSetting> settings)
        {
            ModuleSetting ret = MarkModule(parent, mod, mark);

            ret.Parameters = mark.CurrentConfusions;

            using (mark.Level())
            {
                List <MemberSetting> typeSettings = new List <MemberSetting>();
                foreach (var t in ret.Module.Types)
                {
                    using (mark.Level())
                        MarkType(mod, t, mark, typeSettings);
                }
                ret.Types = typeSettings.ToArray();
            }
            settings.Add(ret);
        }
示例#4
0
        private AssemblySetting _MarkAssembly(ProjectAssembly asm, Marking mark)
        {
            AssemblySetting ret = MarkAssembly(asm, mark);

            ret.GlobalParameters = mark.CurrentConfusions;

            using (mark.Level())
            {
                List <ModuleSetting> modSettings = new List <ModuleSetting>();
                foreach (var m in ret.Assembly.Modules)
                {
                    using (mark.Level())
                        MarkModule(ret, m, mark, modSettings);
                }
                ret.Modules = modSettings.ToArray();
                return(ret);
            }
        }