Пример #1
0
        static magic_split_enum SearchMagicSplitLow()
        {
            PatchUtil.PatchTableSt[] table = new PatchUtil.PatchTableSt[] {
                new PatchUtil.PatchTableSt {
                    name = "FE8NMAGIC", ver = "FE8J", addr = 0x2a542, data = new byte[] { 0x30, 0x1C }
                },
                new PatchUtil.PatchTableSt {
                    name = "FE7UMAGIC", ver = "FE7U", addr = 0x68DE0, data = new byte[] { 0x38, 0x18, 0x01, 0x78 }
                },
                new PatchUtil.PatchTableSt {
                    name = "FE8UMAGIC", ver = "FE8U", addr = 0x2BB44, data = new byte[] { 0x01, 0x4B, 0xA5, 0xF0, 0xC1, 0xFE }
                },
                new PatchUtil.PatchTableSt {
                    name = "FE8UMAGIC", ver = "FE8U", addr = 0x17E5C, data = new byte[] { 0x01, 0x4B, 0xB9, 0xF0, 0x35, 0xFD }
                },                                                                                                                                   //魔力分離パッチ FE8U 2022年以降
            };

            if (Program.ROM == null)
            {
                return(magic_split_enum.NO);
            }

            string version = Program.ROM.RomInfo.VersionToFilename;

            foreach (PatchUtil.PatchTableSt t in table)
            {
                if (t.ver != version)
                {
                    continue;
                }

                byte[] data = Program.ROM.getBinaryData(t.addr, t.data.Length);
                if (U.memcmp(t.data, data) != 0)
                {
                    continue;
                }
                if (t.name == "FE8NMAGIC")
                {
                    return(magic_split_enum.FE8NMAGIC);
                }
                if (t.name == "FE7UMAGIC")
                {
                    return(magic_split_enum.FE7UMAGIC);
                }
                if (t.name == "FE8UMAGIC")
                {
                    return(magic_split_enum.FE8UMAGIC);
                }
            }
            return(magic_split_enum.NO);
        }
Пример #2
0
        static magic_split_enum SearchMagicSplitLow()
        {
            PatchUtil.PatchTableSt[] table = new PatchUtil.PatchTableSt[] {
                new PatchUtil.PatchTableSt {
                    name = "FE8NMAGIC", ver = "FE8J", addr = 0x2a542, data = new byte[] { 0x30, 0x1C }
                },
                new PatchUtil.PatchTableSt {
                    name = "FE7UMAGIC", ver = "FE7U", addr = 0x68DE0, data = new byte[] { 0x38, 0x18, 0x01, 0x78 }
                },
            };

            string version = Program.ROM.RomInfo.VersionToFilename();

            foreach (PatchUtil.PatchTableSt t in table)
            {
                if (t.ver != version)
                {
                    continue;
                }

                byte[] data = Program.ROM.getBinaryData(t.addr, t.data.Length);
                if (U.memcmp(t.data, data) != 0)
                {
                    continue;
                }
                if (t.name == "FE8NMAGIC")
                {
                    return(magic_split_enum.FE8NMAGIC);
                }
                if (t.name == "FE7UMAGIC")
                {
                    return(magic_split_enum.FE7UMAGIC);
                }
            }
            return(magic_split_enum.NO);
        }