示例#1
0
        public override bool MethodNeedSkip(MethodDefinition method)
        {
            bool isIEnumerator = method.ReturnType.FullName == "System.Collections.IEnumerator";

            if (WhiteList.IsSkipMethod(method) || method.IsVirtual || isIEnumerator || method.IsConstructor || method.Name.StartsWith(".") || method.Name.Contains("<"))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#2
0
        public override void Init(ObfuscateType obfuscateType)
        {
            this.obfuscateType = obfuscateType;

            Dictionary <WhiteListType, string> whiteListPathDic     = new Dictionary <WhiteListType, string>();
            Dictionary <WhiteListType, string> obfuscateListPathDic = new Dictionary <WhiteListType, string>();

            whiteListPathDic.Add(WhiteListType.Namespace, string.Format(Const.WhiteList_NamespacePath, Symbol));
            whiteListPathDic.Add(WhiteListType.Class, string.Format(Const.WhiteList_ClassPath, Symbol));
            whiteListPathDic.Add(WhiteListType.Method, string.Format(Const.WhiteList_MethodPath, Symbol));

            obfuscateListPathDic.Add(WhiteListType.Namespace, string.Format(Const.ObfuscateList_NamespacePath, Symbol));
            obfuscateListPathDic.Add(WhiteListType.Class, string.Format(Const.ObfuscateList_ClassPath, Symbol));
            obfuscateListPathDic.Add(WhiteListType.Method, string.Format(Const.ObfuscateList_MethodPath, Symbol));



            whiteList         = new WhiteList(whiteListPathDic);
            obfuscateList     = new WhiteList(obfuscateListPathDic);
            codeInjectInfoDic = new Dictionary <string, string>();
            injectMethodList  = new List <string>();
        }
示例#3
0
        public override void Init(ObfuscateType obfuscateType)
        {
            this.obfuscateType = obfuscateType;

            Dictionary <WhiteListType, string> whiteListPathDic     = new Dictionary <WhiteListType, string>();
            Dictionary <WhiteListType, string> obfuscateListPathDic = new Dictionary <WhiteListType, string>();

            whiteListPathDic.Add(WhiteListType.Namespace, string.Format(Const.WhiteList_NamespacePath, Symbol));
            whiteListPathDic.Add(WhiteListType.NameSpcaceNameOnly, string.Format(Const.WhiteList_NamespaceNameOnlyPath, Symbol));
            whiteListPathDic.Add(WhiteListType.Class, string.Format(Const.WhiteList_ClassPath, Symbol));
            whiteListPathDic.Add(WhiteListType.ClassNameOnly, string.Format(Const.WhiteList_ClassNameOnlyPath, Symbol));
            whiteListPathDic.Add(WhiteListType.Method, string.Format(Const.WhiteList_MethodPath, Symbol));
            whiteListPathDic.Add(WhiteListType.Member, string.Format(Const.WhiteList_MemberPath, Symbol));

            obfuscateListPathDic.Add(WhiteListType.Namespace, string.Format(Const.ObfuscateList_NamespacePath, Symbol));
            obfuscateListPathDic.Add(WhiteListType.NameSpcaceNameOnly, string.Format(Const.ObfuscateList_NamespaceExceptNamespaceNamePath, Symbol));
            obfuscateListPathDic.Add(WhiteListType.Class, string.Format(Const.ObfuscateList_ClassPath, Symbol));
            obfuscateListPathDic.Add(WhiteListType.ClassNameOnly, string.Format(Const.ObfuscateList_ClassExceptClassNamePath, Symbol));
            obfuscateListPathDic.Add(WhiteListType.Method, string.Format(Const.ObfuscateList_MethodPath, Symbol));
            obfuscateListPathDic.Add(WhiteListType.Member, string.Format(Const.ObfuscateList_MemberPath, Symbol));

            whiteList     = new WhiteList(whiteListPathDic);
            obfuscateList = new WhiteList(obfuscateListPathDic);
        }