示例#1
0
文件: KoiInfo.cs 项目: hmyit/KoiVM-1
        internal static void Init()
        {
            lock (typeof(KoiInfo)) {
                if (inited)
                {
                    return;
                }

                AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve;
                KoiDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                settings     = new KoiSettings();

                inited = true;
            }
        }
示例#2
0
        internal static void Init(ConfuserContext ctx)
        {
            lock (typeof(KoiInfo))
            {
                if (inited)
                {
                    return;
                }

                AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve;
                KoiDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                settings     = new KoiSettings();

                // Check if not yet processed.
                if (Assembly.GetExecutingAssembly().ManifestModule.GetType("KoiVM.Confuser.Internal.Fish") != null)
                {
                    return;
                }

                if (ctx != null)
                {
                    var packPath = Path.Combine(KoiDirectory, "koi.pack");

                    if (!File.Exists(packPath))
                    {
                        RetrieveKoi(ctx);
                    }

                    else if (!settings.NoCheck)
                    {
                        CheckUpdate(ctx);
                    }

                    InitKoi();
                }
                inited = true;
            }
        }