Esempio n. 1
0
        protected override void SetMitm()
        {
            var basePath = Path.GetDirectoryName(ROM.RomFS);
            var redirect = Path.Combine(basePath, TitleID);

            FileMitm.SetRedirect(basePath, redirect);
        }
Esempio n. 2
0
 protected void OpenBinary(string path)
 {
     path   = FileMitm.GetRedirectedReadPath(path);
     Stream = new FileStream(path, FileMode.Open);
     Reader = new BinaryReader(Stream);
     Initialize();
 }
Esempio n. 3
0
        public void EditTM()
        {
            var path = Path.Combine(ROM.PathExeFS, "main");
            var data = FileMitm.ReadAllBytes(path);
            var list = new TMEditorGG(data);

            if (!list.Valid)
            {
                WinFormsUtil.Alert("Not able to find tm data in ExeFS.");
                return;
            }

            var moves   = list.GetMoves();
            var allowed = Legal.GetAllowedMoves(ROM.Game, ROM.Data.MoveData.Length);
            var names   = ROM.GetStrings(TextName.MoveNames);

            using var editor = new TMList(moves, allowed, names);
            editor.ShowDialog();
            if (!editor.Modified)
            {
                return;
            }

            list.SetMoves(editor.FinalMoves);
            data = list.Write();
            FileMitm.WriteAllBytes(path, data);
        }
Esempio n. 4
0
        public void EditShinyRate()
        {
            var path = Path.Combine(ROM.PathExeFS, "main");
            var data = FileMitm.ReadAllBytes(path);
            var nso  = new NSO(data);

            var shiny = new ShinyRateGG(nso.DecompressedText);

            if (!shiny.IsEditable)
            {
                WinFormsUtil.Alert("Not able to find shiny rate logic in exefs.");
                return;
            }

            var editor = new ShinyRate(shiny);

            editor.ShowDialog();
            if (!editor.Modified)
            {
                return;
            }

            nso.DecompressedText = shiny.Data;
            FileMitm.WriteAllBytes(path, nso.Write());
        }
Esempio n. 5
0
        protected override void SetMitm()
        {
            var basePath = Path.GetDirectoryName(ROM.RomFS);
            var tid      = ROM.ExeFS != null ? TitleID : "0100ABF008968000"; // no way to differentiate without exefs, so default to Sword
            var redirect = Path.Combine(basePath, tid);

            FileMitm.SetRedirect(basePath, redirect);
        }
Esempio n. 6
0
        protected override void SetMitm()
        {
            var basePath = Path.GetDirectoryName(ROM.RomFS);
            var tid      = ROM.ExeFS != null ? TitleID : "arceus";
            var redirect = Path.Combine(basePath, tid);

            FileMitm.SetRedirect(basePath, redirect);
        }
Esempio n. 7
0
        protected override void SetMitm()
        {
            var basePath = Path.GetDirectoryName(ROM.RomFS);

            ActualGame = !IsSword ? GameVersion.SH : GameVersion.SW;
            var redirect = Path.Combine(basePath, TitleID);

            FileMitm.SetRedirect(basePath, redirect);
        }
Esempio n. 8
0
        protected override void SetMitm()
        {
            var        basePath = Path.GetDirectoryName(ROM.RomFS);
            const bool shield   = false; // todo

            ActualGame = shield ? GameVersion.SH : GameVersion.SW;
            var redirect = Path.Combine(basePath, TitleID);

            FileMitm.SetRedirect(basePath, redirect);
        }
Esempio n. 9
0
        protected override void SetMitm()
        {
            var basePath = Path.GetDirectoryName(ROM.RomFS);
            // unlike SWSH, LGPE has a unique opening movie in romfs to differentiate between versions
            bool eevee = Directory.Exists(Path.Combine(PathRomFS, "bin", "movies", "EEVEE_GO"));

            ActualGame = eevee ? GameVersion.GE : GameVersion.GP;
            var redirect = Path.Combine(basePath, TitleID);

            FileMitm.SetRedirect(basePath, redirect);
        }
Esempio n. 10
0
        protected override void SetMitm()
        {
            var basePath = Path.GetDirectoryName(ROM.RomFS);
            // todo var eeveevidpath = Path.Combine(ROM.RomFS, Path.Combine("bin", "movies", "EEVEE_GO"));
            bool shield = false; // todo Directory.Exists(eeveevidpath);

            ActualGame = shield ? GameVersion.SH : GameVersion.SW;
            var redirect = Path.Combine(basePath, TitleID);

            FileMitm.SetRedirect(basePath, redirect);
        }
Esempio n. 11
0
        public GameManagerGG(GameLocation rom, int language) : base(rom, language)
        {
            var  basePath     = Path.GetDirectoryName(rom.RomFS);
            var  eeveevidpath = Path.Combine(rom.RomFS, Path.Combine("bin", "movies", "EEVEE_GO"));
            bool eevee        = Directory.Exists(eeveevidpath);

            ActualGame = eevee ? GameVersion.GE : GameVersion.GP;
            var redirect = Path.Combine(basePath, TitleID);

            // get pikachu vs eevee
            FileMitm.SetRedirect(basePath, redirect);
        }
Esempio n. 12
0
        protected override void SetMitm()
        {
            var  basePath     = Path.GetDirectoryName(ROM.RomFS);
            var  eeveevidpath = Path.Combine(ROM.RomFS, Path.Combine("bin", "movies", "EEVEE_GO"));
            bool eevee        = Directory.Exists(eeveevidpath);

            ActualGame = eevee ? GameVersion.GE : GameVersion.GP;
            var redirect = Path.Combine(basePath, TitleID);

            // get pikachu vs eevee
            FileMitm.SetRedirect(basePath, redirect);
        }
Esempio n. 13
0
        private void PopWildEdit(string file)
        {
            var winner = Path.Combine(ROM.PathRomFS, "bin", "field", "param", "encount", file);
            var obj    = FlatBufferConverter.DeserializeFrom <EncounterArchive7b>(winner);

            using var form = new GGWE(ROM, obj);
            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var data = FlatBufferConverter.SerializeFrom(obj);

            FileMitm.WriteAllBytes(winner, data);
        }
Esempio n. 14
0
        public void EditTypeChart()
        {
            var path = Path.Combine(ROM.PathExeFS, "main");
            var data = FileMitm.ReadAllBytes(path);
            var nso  = new NSO(data);

            byte[] pattern = // N2nn3pia9transport18UnreliableProtocolE
            {
                0x4E, 0x32, 0x6E, 0x6E, 0x33, 0x70, 0x69, 0x61, 0x39, 0x74, 0x72, 0x61, 0x6E, 0x73, 0x70, 0x6F, 0x72,
                0x74, 0x31, 0x38, 0x55, 0x6E, 0x72, 0x65, 0x6C, 0x69, 0x61, 0x62, 0x6C, 0x65, 0x50, 0x72, 0x6F, 0x74,
                0x6F, 0x63, 0x6F, 0x6C, 0x45, 0x00
            };
            int ofs = CodePattern.IndexOfBytes(nso.DecompressedRO, pattern);

            if (ofs < 0)
            {
                WinFormsUtil.Alert("Not able to find type chart data in ExeFS.");
                return;
            }
            ofs += pattern.Length + 0x24; // 0x5B4C0C in lgpe 1.0 RO

            var cdata = new byte[18 * 18];
            var types = ROM.GetStrings(TextName.Types);

            Array.Copy(nso.DecompressedRO, ofs, cdata, 0, cdata.Length);
            var chart = new TypeChartEditor(cdata);

            using var editor = new TypeChart(chart, types);
            editor.ShowDialog();
            if (!editor.Modified)
            {
                return;
            }

            chart.Data.CopyTo(nso.DecompressedRO, ofs);
            data = nso.Write();
            FileMitm.WriteAllBytes(path, data);
        }