예제 #1
0
파일: Loader.cs 프로젝트: Tamely/PlatoV2
        private void timer1_Tick(object sender, EventArgs e)
        {
            _holder += 4;
            var adv = new List <string> {
                ".", "..", "..."
            };
            var random = new Random();
            var i      = random.Next(adv.Count);
            var strg   = adv[i];

            label1.Text = @"Getting data from Plato's API" + strg;
            label2.Text = _holder + @"%";
            if (_holder != 100)
            {
                return;
            }
            timer1.Enabled = false;
            Hide();

            JObject json = JObject.Parse(new WebClient().DownloadString(Vars.BASEENDPOINT + "/api/v1/ProjectPlatoV2/blacklistedprograms"));

            foreach (var obj in json["blacklistedPrograms"])
            {
                Utilities.Programs.Add(obj.ToString());
            }

            json = JObject.Parse(Vars.Endpoint(Vars.BASEENDPOINT + "/api/v1/ProjectPlatoV2/loading"));
            Utilities.OpenBrowser(Vars.DiscordLink);
            if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Key.txt"))
            {
                string key = File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Key.txt");
                if (key == json["key"]?.ToString())
                {
                    var open = new Main();
                    open.Closed += (_, _) => Close();
                    open.Show();
                }
                else
                {
                    var open = new Key();
                    open.Closed += (_, _) => Close();
                    open.Show();
                }
            }
            else
            {
                if (Vars.IsEarly())
                {
                    var open = new Main();
                    open.Closed += (_, _) => Close();
                    open.Show();
                }
                else
                {
                    var open = new Key();
                    open.Closed += (_, _) => Close();
                    open.Show();
                }
            }
        }
예제 #2
0
파일: Options.cs 프로젝트: Tamely/PlatoV2
        private void Options_Load(object sender, EventArgs e)
        {
            var jsonArray = JArray.Parse(Vars.Endpoint($"{Vars.BASEENDPOINT}/api/v1/ProjectPlatoV2/items/possibleswaps?to={Vars.Item}"));

            foreach (var json in jsonArray)
            {
                var imageControl = new SiticonePictureBox
                {
                    Width    = 110,
                    Height   = 110,
                    Name     = json["name"]?.ToString(),
                    Cursor   = Cursors.Hand,
                    SizeMode = PictureBoxSizeMode.StretchImage
                };
                imageControl.Click        += buttonOn_Click;
                imageControl.ImageLocation = json["icon"]?.ToString();

                Flow.Controls.Add(imageControl);
                new ToolTip().SetToolTip(imageControl, imageControl.Name);
            }
        }
예제 #3
0
        public PluginSwapper()
        {
            InitializeComponent();

            // Need to set this up here so the next item you open doesnt have this items note
            Vars.Note = "";

            var cpObject = JObject.Parse(Vars.Endpoint($"{Vars.BASEENDPOINT}/api/v1/ProjectPlatoV2/items/characterparts"));

            foreach (var file in Directory.EnumerateFiles(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "//PlatoPlugins"))
            {
                JObject cosmetics = JObject.Parse(File.ReadAllText(file));
                if (cosmetics["name"]?.ToString() == Vars.Item)
                {
                    try
                    {
                        Vars.Early = bool.Parse(cosmetics["early"]?.ToString() ?? string.Empty);
                    }
                    catch
                    {
                        //ignored
                    }

                    try
                    {
                        pictureBox2.ImageLocation = cosmetics["icon"]?.ToString();
                        Vars.Iconurl = pictureBox2.ImageLocation;
                    }
                    catch
                    {
                        // ignored
                    }

                    try
                    {
                        Vars.Note = cosmetics["extrainfo"]?.ToString();
                    }
                    catch
                    {
                        // ignored
                    }

                    try
                    {
                        Vars.Malesearch       = cpObject["malesearch"]?.ToString();
                        Vars.Malereplace      = cpObject["malereplace"]?.ToString();
                        Vars.Maleasset        = cpObject["maleasset"]?.ToString();
                        Vars.Femalesearch     = cpObject["femalesearch"]?.ToString();
                        Vars.Femalereplace    = cpObject["femalereplace"]?.ToString();
                        Vars.Femaleasset      = cpObject["femaleasset"]?.ToString();
                        Vars.Defaultgame      = cpObject["defaultgame"]?.ToString();
                        Vars.Bodysearch       = cpObject["bodysearch"]?.ToString();
                        Vars.Bodysearchsingle = cpObject["bodysinglesearch"]?.ToString();
                        Vars.Headsearch       = cpObject["headsearch"]?.ToString();
                        Vars.Headsearchsingle = cpObject["headsinglesearch"]?.ToString();
                        Vars.LengthSearch     = cpObject["lengthsearch"]?.ToString();
                        Vars.LengthReplace    = cpObject["lengthreplace"]?.ToString();
                    }
                    catch
                    {
                        // ignored
                    }
                }
            }


            if (Vars.Note != "" && !string.IsNullOrEmpty(Vars.Note))
            {
                new Alert(Vars.Note, 7, Vars.Iconurl);
            }
        }
예제 #4
0
        private void bunifuFlatButton3_Click(object sender, EventArgs e)
        {
            if (!_pressed)
            {
                if (Vars.Early && !Vars.IsEarly())
                {
                    new Alert("This item is early access only for the time being!", 7);
                }
                else
                {
                    _pressed           = true;
                    richTextBox2.Text  = "";
                    richTextBox2.Text += $@"[LOG]: Starting...{Environment.NewLine}";

                    if (Utilities.Disposed)
                    {
                        Utilities.InitProvider(Vars.Aes());
                    }

                    var jsonArray = JArray.Parse(Vars.Endpoint($"{Vars.BASEENDPOINT}/api/v1/ProjectPlatoV2/items?itemName={Vars.Item}"))[0];
                    if (Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
                                         $"//TAMELYBACKUP//{Vars.Item}"))
                    {
                        richTextBox2.Text += @"ERROR: ITEM ALREADY CONVERTED!" + Environment.NewLine;
                    }
                    else
                    {
                        if ((ItemType)int.Parse(jsonArray["type"].ToString()) != ItemType.CharacterPart) //Swapper handles swapping in two ways, mesh and cp
                        {
                            foreach (var assets in jsonArray["assets"])                                  //All FModel paths have their own swaps
                            {
                                var parentasset = assets["parentAsset"]?.ToString();
                                Utilities.ExportCompressed(parentasset + ".uasset",
                                                           Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));

                                string        searchtype = null;
                                List <string> Searches   = assets["searches"].Select(swap => swap["value"].ToString()).ToList();
                                List <string> Replaces   = assets["replaces"].Select(swap => swap["value"].ToString()).ToList();

                                var i = 0;
                                foreach (var swap in Searches)
                                {
                                    searchtype = swap.Contains("hex=") ? "hex" : "string";

                                    switch (searchtype)
                                    {
                                    case "string":
                                        Utilities.Convert(swap, Replaces[i],
                                                          Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                                          "/" +
                                                          assets["parentAsset"] + ".uasset", 0);
                                        break;

                                    case "hex":
                                        Utilities.ConvertHex(swap.Replace("hex=", ""), Replaces[i].Replace("hex=", ""),
                                                             Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                                             "/" +
                                                             assets["parentAsset"] + ".uasset", 0);
                                        break;

                                    default:
                                        Utilities.Convert(swap, Replaces[i],
                                                          Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                                          "/" +
                                                          assets["parentAsset"] + ".uasset", 0);
                                        break;
                                    }

                                    i++;
                                }

                                try
                                {
                                    File.Move(
                                        Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                        assets["parentAsset"] + ".uasset",
                                        Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                        "/Temp/" +
                                        Path.GetFileName(assets["parentAsset"] + ".uasset"));
                                }
                                catch
                                {
                                    Directory.CreateDirectory(
                                        Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                        "/Temp/");
                                    File.Copy(
                                        Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                        assets["parentAsset"] + ".uasset",
                                        Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                        "/Temp/" +
                                        Path.GetFileName(assets["parentAsset"] + ".uasset"));
                                }
                            }

                            Directory.CreateDirectory(
                                Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
                                $"//TAMELYBACKUP//{Vars.Item}");
                            foreach (var file in Directory.EnumerateFiles(
                                         Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                         "//CompressedOutput"))
                            {
                                File.Move(file,
                                          Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
                                          $"//TAMELYBACKUP//{Vars.Item}//{Path.GetFileName(file)}");
                            }

                            Directory.Delete(
                                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/FortniteGame",
                                true);

                            foreach (var file in Directory.GetFiles(
                                         Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Temp/"))
                            {
                                Oodle.Compress(file, file + ".compressed");
                            }

                            foreach (var assets in jsonArray["assets"])
                            {
                                foreach (var file in Directory.EnumerateFiles(
                                             Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
                                             $"//TAMELYBACKUP//{Vars.Item}//"))
                                {
                                    if (file.Contains(Path.GetFileName(assets["parentAsset"]?.ToString())))
                                    {
                                        var data = File.ReadAllBytes(
                                            Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                            "/Temp/" + Path.GetFileName(assets["parentAsset"]?.ToString()) +
                                            ".uasset.compressed");

                                        var newfile = Path.GetFileName(file);

                                        var asset = newfile.Split(".uasset").First() + ".uasset";
                                        newfile = newfile.Replace(asset + " ", "");

                                        var offset  = long.Parse(newfile.Split(" in ").First());
                                        var pakfile = newfile.Split(" in ").Last();
                                        pakfile = pakfile.Replace("10_", "100_");

                                        Utilities.OutdatedResearcher(Vars.PakPath + "//" + pakfile, offset, data);

                                        richTextBox2.Text += $@"[LOG]: Added Asset to Fortnite in {pakfile}" + Environment.NewLine;
                                    }
                                }
                            }

                            Directory.Delete(
                                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Temp/", true);

                            new Alert("Successfully Completed!", 3, pictureBox2.ImageLocation);
                        }
                        else
                        {
                            Utilities.ExportCompressed(Vars.Defaultgame,
                                                       Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));

                            Utilities.ExportCompressed(Vars.Femaleasset,
                                                       Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));

                            Utilities.ExportCompressed(Vars.Maleasset,
                                                       Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));

                            Utilities.ConvertHex(
                                Vars.Femalesearch,
                                Vars.Femalereplace,
                                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                Vars.Femaleasset, 0);

                            Utilities.ConvertHex(
                                Vars.Malesearch,
                                Vars.Malereplace,
                                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                Vars.Maleasset, 0);

                            Utilities.Convert(
                                Vars.Bodysearchsingle,
                                "",
                                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                Vars.Defaultgame, 0);

                            Utilities.Convert(
                                Vars.Headsearchsingle,
                                "",
                                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                Vars.Defaultgame, 0);

                            Utilities.ConvertHex(Vars.LengthSearch,
                                                 Vars.LengthReplace,
                                                 Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                                 Vars.Defaultgame, 0);

                            Utilities.Convert(
                                Vars.Bodysearch,
                                jsonArray["bodyCp"]?.ToString(),
                                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                Vars.Defaultgame, 0);
                            richTextBox2.Text += "[LOG]: Swapped Body Character Part" + Environment.NewLine;

                            Utilities.Convert(
                                Vars.Headsearch,
                                jsonArray["headCp"]?.ToString(),
                                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                Vars.Defaultgame, 0);
                            richTextBox2.Text += "[LOG]: Swapped Head Character Part" + Environment.NewLine;

                            try
                            {
                                File.Move(
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                    Vars.Defaultgame,
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Temp/" +
                                    Path.GetFileName(Vars.Defaultgame));

                                File.Move(
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                    Vars.Femaleasset,
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Temp/" +
                                    Path.GetFileName(Vars.Femaleasset));

                                File.Move(
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                    Vars.Maleasset,
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Temp/" +
                                    Path.GetFileName(Vars.Maleasset));
                            }
                            catch
                            {
                                Directory.CreateDirectory(
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Temp/");
                                File.Move(
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                    Vars.Defaultgame,
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Temp/" +
                                    Path.GetFileName(Vars.Defaultgame));

                                File.Move(
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                    Vars.Femaleasset,
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Temp/" +
                                    Path.GetFileName(Vars.Femaleasset));

                                File.Move(
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" +
                                    Vars.Maleasset,
                                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Temp/" +
                                    Path.GetFileName(Vars.Maleasset));
                            }

                            Directory.CreateDirectory(
                                Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
                                $"//TAMELYBACKUP//{Vars.Item}");
                            foreach (var file in Directory.EnumerateFiles(
                                         Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                         "//CompressedOutput"))
                            {
                                File.Move(file,
                                          Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
                                          $"//TAMELYBACKUP//{Vars.Item}//{Path.GetFileName(file)}");
                            }

                            Directory.Delete(
                                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/FortniteGame",
                                true);

                            foreach (var file in Directory.GetFiles(
                                         Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Temp/"))
                            {
                                Oodle.Compress(file, file + ".compressed");
                            }


                            foreach (var file in Directory.EnumerateFiles(
                                         Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
                                         $"//TAMELYBACKUP//{Vars.Item}//"))
                            {
                                if (file.Contains(Path.GetFileName(Vars.Defaultgame) ?? string.Empty))
                                {
                                    var data = File.ReadAllBytes(
                                        Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                        "/Temp/DefaultGameDataCosmetics.uasset.compressed");

                                    var newfile = Path.GetFileName(file);

                                    var asset = newfile.Split(".uasset").First() + ".uasset";
                                    newfile = newfile.Replace(asset + " ", "");

                                    var offset  = long.Parse(newfile.Split(" in ").First());
                                    var pakfile = newfile.Split(" in ").Last();
                                    pakfile = pakfile.Replace("10_", "100_");

                                    Utilities.OutdatedResearcher(Vars.PakPath + "//" + pakfile, offset, data);
                                    richTextBox2.Text += @"[LOG]: Added Asset to Fortnite in {pakfile}" + Environment.NewLine;
                                }

                                if (file.Contains(Path.GetFileName(Vars.Maleasset) ?? string.Empty))
                                {
                                    var data = File.ReadAllBytes(
                                        Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                        "/Temp/CP_Athena_Body_M_RebirthSoldier.uasset.compressed");

                                    var newfile = Path.GetFileName(file);

                                    var asset = newfile.Split(".uasset").First() + ".uasset";
                                    newfile = newfile.Replace(asset + " ", "");

                                    var offset  = long.Parse(newfile.Split(" in ").First());
                                    var pakfile = newfile.Split(" in ").Last();
                                    pakfile = pakfile.Replace("10_", "100_");

                                    Utilities.OutdatedResearcher(Vars.PakPath + "//" + pakfile, offset, data);
                                    richTextBox2.Text += @"[LOG]: Made Male Invalid" + Environment.NewLine;
                                }

                                if (file.Contains(Path.GetFileName(Vars.Femaleasset) ?? string.Empty))
                                {
                                    var data = File.ReadAllBytes(
                                        Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                        "/Temp/CP_Body_Commando_F_RebirthDefaultA.uasset.compressed");

                                    var newfile = Path.GetFileName(file);

                                    var asset = newfile.Split(".uasset").First() + ".uasset";
                                    newfile = newfile.Replace(asset + " ", "");

                                    var offset  = long.Parse(newfile.Split(" in ").First());
                                    var pakfile = newfile.Split(" in ").Last();
                                    pakfile = pakfile.Replace("10_", "100_");

                                    Utilities.OutdatedResearcher(Vars.PakPath + "//" + pakfile, offset, data);
                                    richTextBox2.Text += @"[LOG]: Made Female Invalid" + Environment.NewLine;
                                }
                            }

                            Directory.Delete(
                                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Temp/",
                                true);

                            new Alert("Successfully Completed!", 3, pictureBox2.ImageLocation);
                        }
                    }
                }
            }

            _pressed = false;
        }
예제 #5
0
        public SkinSwapper()
        {
            InitializeComponent();

            // Need to set this up here so the next item you open doesnt have this items note
            Vars.Note = "";

            var jsonArray = JArray.Parse(Vars.Endpoint($"{Vars.BASEENDPOINT}/api/v1/ProjectPlatoV2/items?itemName={Vars.Item}"))[0];
            var cpObject  = JObject.Parse(Vars.Endpoint($"{Vars.BASEENDPOINT}/api/v1/ProjectPlatoV2/items/characterparts"));

            if (jsonArray["displayName"]?.ToString() == Vars.Item)
            {
                try
                {
                    Vars.Early = bool.Parse(jsonArray["isEarly"]?.ToString() ?? string.Empty);
                }
                catch
                {
                    //ignored
                }

                try
                {
                    pictureBox2.ImageLocation = jsonArray["overrideIconURi"]?.ToString();
                    Vars.Iconurl = pictureBox2.ImageLocation;
                }
                catch
                {
                    // ignored
                }

                try
                {
                    Vars.Note = jsonArray["description"]?.ToString();
                }
                catch
                {
                    // ignored
                }

                try
                {
                    Vars.Malesearch       = cpObject["malesearch"]?.ToString();
                    Vars.Malereplace      = cpObject["malereplace"]?.ToString();
                    Vars.Maleasset        = cpObject["maleasset"]?.ToString();
                    Vars.Femalesearch     = cpObject["femalesearch"]?.ToString();
                    Vars.Femalereplace    = cpObject["femalereplace"]?.ToString();
                    Vars.Femaleasset      = cpObject["femaleasset"]?.ToString();
                    Vars.Defaultgame      = cpObject["defaultgame"]?.ToString();
                    Vars.Bodysearch       = cpObject["bodysearch"]?.ToString();
                    Vars.Bodysearchsingle = cpObject["bodysinglesearch"]?.ToString();
                    Vars.Headsearch       = cpObject["headsearch"]?.ToString();
                    Vars.Headsearchsingle = cpObject["headsinglesearch"]?.ToString();
                    Vars.LengthSearch     = cpObject["lengthsearch"]?.ToString();
                    Vars.LengthReplace    = cpObject["lengthreplace"]?.ToString();
                }
                catch
                {
                    // ignored
                }
            }

            if (Vars.Note != "" && !string.IsNullOrEmpty(Vars.Note))
            {
                new Alert(Vars.Note, 7, Vars.Iconurl);
            }
        }