// Token: 0x0600000A RID: 10 RVA: 0x00004030 File Offset: 0x00002230
 private void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, TypeDef type)
 {
     if (AnalyzePhase.IsVisibleOutside(context, parameters, type))
     {
         service.SetCanRename(type, false);
     }
     else if (type.IsRuntimeSpecialName || type.IsGlobalModuleType)
     {
         service.SetCanRename(type, false);
     }
     else if (type.FullName == "ConfusedBy")
     {
         service.SetCanRename(type, false);
     }
     if (parameters.GetParameter <bool>(context, type, "forceRen", false))
     {
         return;
     }
     if (type.InheritsFromCorlib("System.Attribute"))
     {
         service.ReduceRenameMode(type, RenameMode.ASCII);
     }
     if (type.InheritsFrom("System.Configuration.SettingsBase"))
     {
         service.SetCanRename(type, false);
     }
 }
 // Token: 0x0600000D RID: 13 RVA: 0x00004230 File Offset: 0x00002430
 private void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, PropertyDef property)
 {
     if (property.DeclaringType.IsVisibleOutside(true) && AnalyzePhase.IsVisibleOutside(context, parameters, property))
     {
         service.SetCanRename(property, false);
         return;
     }
     if (property.IsRuntimeSpecialName)
     {
         service.SetCanRename(property, false);
         return;
     }
     if (parameters.GetParameter <bool>(context, property, "forceRen", false))
     {
         return;
     }
     if (property.DeclaringType.Implements("System.ComponentModel.INotifyPropertyChanged"))
     {
         service.SetCanRename(property, false);
         return;
     }
     if (property.DeclaringType.Name.String.Contains("AnonymousType"))
     {
         service.SetCanRename(property, false);
     }
 }
示例#3
0
		public void Analyze(IDnlibDef def) {
			if (analyze == null)
				analyze = context.Pipeline.FindPhase<AnalyzePhase>();

			SetOriginalName(def, def.Name);
			if (def is TypeDef) {
				GetVTables().GetVTable((TypeDef)def);
				SetOriginalNamespace(def, ((TypeDef)def).Namespace);
			}
			analyze.Analyze(this, context, ProtectionParameters.Empty, def, true);
		}
 // Token: 0x0600000E RID: 14 RVA: 0x000020EF File Offset: 0x000002EF
 private void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, EventDef evt)
 {
     if (evt.DeclaringType.IsVisibleOutside(true) && AnalyzePhase.IsVisibleOutside(context, parameters, evt))
     {
         service.SetCanRename(evt, false);
         return;
     }
     if (evt.IsRuntimeSpecialName)
     {
         service.SetCanRename(evt, false);
     }
 }
示例#5
0
		public bool CanRename(object obj) {
			if (obj is IDnlibDef) {
				if (analyze == null)
					analyze = context.Pipeline.FindPhase<AnalyzePhase>();

				var prot = (NameProtection)analyze.Parent;
				ProtectionSettings parameters = ProtectionParameters.GetParameters(context, (IDnlibDef)obj);
				if (parameters == null || !parameters.ContainsKey(prot))
					return false;
				return context.Annotations.Get(obj, CanRenameKey, true);
			}
			return false;
		}
示例#6
0
        public bool CanRename(object obj)
        {
            if (obj is IDnlibDef)
            {
                if (this.analyze == null)
                {
                    this.analyze = this.context.Pipeline.FindPhase <AnalyzePhase>();
                }

                var prot = (NameProtection)this.analyze.Parent;
                ProtectionSettings parameters = ProtectionParameters.GetParameters(this.context, (IDnlibDef)obj);
                return(parameters == null || !parameters.ContainsKey(prot) ? false : this.context.Annotations.Get(obj, CanRenameKey, true));
            }
            return(false);
        }
        public void Analyze(IDnlibDef def)
        {
            if (analyze == null)
            {
                analyze = context.Pipeline.FindPhase <AnalyzePhase>();
            }

            StoreNames(def);
            if (def is TypeDef typeDef)
            {
                GetVTables().GetVTable(typeDef);
            }

            analyze.Analyze(this, context, ProtectionParameters.Empty, def, true);
        }
        public string GetParam(IDnlibDef def, string name)
        {
            var param = ProtectionParameters.GetParameters(context, def);

            if (param == null)
            {
                return(null);
            }
            if (analyze == null)
            {
                analyze = context.Pipeline.FindPhase <AnalyzePhase>();
            }
            if (!param.TryGetValue(analyze.Parent, out var nameParam))
            {
                return(null);
            }
            return(nameParam.GetValueOrDefault(name));
        }
 // Token: 0x0600000C RID: 12 RVA: 0x0000417C File Offset: 0x0000237C
 private void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, FieldDef field)
 {
     if (field.DeclaringType.IsVisibleOutside(true) && (field.IsFamily || field.IsFamilyOrAssembly || field.IsPublic) && AnalyzePhase.IsVisibleOutside(context, parameters, field))
     {
         service.SetCanRename(field, false);
         return;
     }
     if (field.IsRuntimeSpecialName)
     {
         service.SetCanRename(field, false);
         return;
     }
     if (parameters.GetParameter <bool>(context, field, "forceRen", false))
     {
         return;
     }
     if (field.DeclaringType.IsSerializable && !field.IsNotSerialized)
     {
         service.SetCanRename(field, false);
         return;
     }
     if (field.IsLiteral && field.DeclaringType.IsEnum)
     {
         service.SetCanRename(field, false);
     }
 }
 // Token: 0x0600000B RID: 11 RVA: 0x000040CC File Offset: 0x000022CC
 private void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, MethodDef method)
 {
     if (method.DeclaringType.IsVisibleOutside(true) && (method.IsFamily || method.IsFamilyOrAssembly || method.IsPublic) && AnalyzePhase.IsVisibleOutside(context, parameters, method))
     {
         service.SetCanRename(method, false);
         return;
     }
     if (method.IsRuntimeSpecialName)
     {
         service.SetCanRename(method, false);
         return;
     }
     if (parameters.GetParameter <bool>(context, method, "forceRen", false))
     {
         return;
     }
     if (method.DeclaringType.IsComImport() && !method.HasAttribute("System.Runtime.InteropServices.DispIdAttribute"))
     {
         service.SetCanRename(method, false);
         return;
     }
     if (method.DeclaringType.IsDelegate())
     {
         service.SetCanRename(method, false);
     }
 }