示例#1
0
 public MKDSEditor(
     NARC.DirectoryEntry Root1,
     NARC.DirectoryEntry Root2,
     NARC.DirectoryEntry RomRoot)
 {
     this.Root1    = Root1;
     this.Root2    = Root2;
     this.RomRoot  = RomRoot;
     this.nkm      = new MKDS_Course_Modifier.MKDS.NKM(Root1.GetFileByPath("\\course_map.nkm").Content);
     this.Main     = NARC.Unpack(Compression.LZ77Decompress(RomRoot.GetFileByPath("\\data\\Main\\MapObj.carc").Content));
     this.MainRace = NARC.Unpack(Compression.LZ77Decompress(RomRoot.GetFileByPath("\\data\\MainRace.carc").Content));
     this.nsbmd    = new MKDS_Course_Modifier.G3D_Binary_File_Format.NSBMD(Root1.GetFileByPath("\\course_model.nsbmd").Content);
     if (this.nsbmd.TexPlttSet == null)
     {
         try
         {
             this.nsbmd.TexPlttSet = new MKDS_Course_Modifier.G3D_Binary_File_Format.NSBTX(Root2.GetFileByPath("\\course_model.nsbtx").Content).TexPlttSet;
         }
         catch
         {
         }
     }
     if (Root1.GetFileByPath("\\course_model_V.nsbmd") != null)
     {
         this.nsbmd2 = new MKDS_Course_Modifier.G3D_Binary_File_Format.NSBMD(Root1.GetFileByPath("\\course_model_V.nsbmd").Content);
         if (this.nsbmd2.TexPlttSet == null)
         {
             this.nsbmd2.TexPlttSet = new MKDS_Course_Modifier.G3D_Binary_File_Format.NSBTX(Root2.GetFileByPath("\\course_model_V.nsbtx").Content).TexPlttSet;
         }
     }
     this.InitializeComponent();
     if (Root1.GetDirectoryByPath("\\MissionRun") != null)
     {
         foreach (NARC.FileEntry file in Root1.GetDirectoryByPath("\\MissionRun").Files)
         {
             this.toolStripSplitButton1.DropDownItems.Add(file.Name, (Image)null, new EventHandler(this.NKMClick));
         }
     }
     this.simpleOpenGlControl1.MouseWheel += new MouseEventHandler(this.simpleOpenGlControl1_MouseWheel);
 }
示例#2
0
        private static bool Open(ByteFileInfo file, Form1 Owner, object Parameter = null, bool filedialog = false)
        {
            switch (FileHandler.GetType(file))
            {
            case "NARC":
                NARC.DirectoryEntry Root = NARC.Unpack(file.Data);
                if (FileHandler.OpenedArchives.Count != 0 && !FileHandler.OpenedArchives[0].FileName.EndsWith(".nds"))
                {
                    FileHandler.OpenedArchives.RemoveAt(FileHandler.OpenedArchives.Count - 1);
                }
                Owner.OpenNarc(Root);
                return(true);

            case "NCGR":
                NCGR Graphic = new NCGR(file.Data);
                switch (FileHandler.OpenDialog)
                {
                case MKDS_Course_Modifier.UI.BNCL _:
                    ((MKDS_Course_Modifier.UI.BNCL)FileHandler.OpenDialog).SetNCGR(Graphic);
                    break;

                case MKDS_Course_Modifier.UI.NCER _:
                    ((MKDS_Course_Modifier.UI.NCER)FileHandler.OpenDialog).SetNCGR(Graphic, FileHandler.OpenedFiles.Count);
                    return(true);
                }
                return(false);

            case "NCLR":
                MKDS_Course_Modifier.G2D_Binary_File_Format.NCLR nclr = new MKDS_Course_Modifier.G2D_Binary_File_Format.NCLR(file.Data);
                switch (FileHandler.OpenDialog)
                {
                case null:
                    FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.NCLR(nclr);
                    FileHandler.OpenDialog.Show((IWin32Window)Owner);
                    FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                    return(true);

                case MKDS_Course_Modifier.UI.BNCL _:
                    ((MKDS_Course_Modifier.UI.BNCL)FileHandler.OpenDialog).SetNCLR(nclr);
                    break;

                case MKDS_Course_Modifier.UI.NCER _:
                    ((MKDS_Course_Modifier.UI.NCER)FileHandler.OpenDialog).SetNCLR(nclr);
                    break;
                }
                return(false);

            case "NSCR":
                MKDS_Course_Modifier.G2D_Binary_File_Format.NSCR nscr = new MKDS_Course_Modifier.G2D_Binary_File_Format.NSCR(file.Data);
                return(false);

            case "NSBMD":
                MKDS_Course_Modifier.G3D_Binary_File_Format.NSBMD nsbmd = new MKDS_Course_Modifier.G3D_Binary_File_Format.NSBMD(file.Data);
                if (FileHandler.OpenDialog is MKDS_Course_Modifier.UI.NSBMD)
                {
                    FileHandler.OpenedFiles.RemoveAt(FileHandler.OpenedFiles.Count - 1);
                    ((MKDS_Course_Modifier.UI.NSBMD)FileHandler.OpenDialog).SetNSBMD(nsbmd);
                    return(true);
                }
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.NSBMD(nsbmd);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "NSBTX":
                MKDS_Course_Modifier.G3D_Binary_File_Format.NSBTX Btx = new MKDS_Course_Modifier.G3D_Binary_File_Format.NSBTX(file.Data);
                if (FileHandler.OpenDialog is MKDS_Course_Modifier.UI.NSBMD)
                {
                    ((MKDS_Course_Modifier.UI.NSBMD)FileHandler.OpenDialog).SetNSBTX(Btx);
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.NSBTX(Btx);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "NSBCA":
                NSBCA Bca1 = new NSBCA(file.Data);
                if (!(FileHandler.OpenDialog is MKDS_Course_Modifier.UI.NSBMD))
                {
                    return(false);
                }
                ((MKDS_Course_Modifier.UI.NSBMD)FileHandler.OpenDialog).SetNSBCA(Bca1);
                return(false);

            case "NSBTA":
                MKDS_Course_Modifier.G3D_Binary_File_Format.NSBTA nsbta = new MKDS_Course_Modifier.G3D_Binary_File_Format.NSBTA(file.Data);
                int num = (int)MessageBox.Show("Due to problems with texture matrices, is nsbta temporary disabled.");
                return(false);

            case "NSBMA":
                NSBMA Bma = new NSBMA(file.Data);
                if (!(FileHandler.OpenDialog is MKDS_Course_Modifier.UI.NSBMD))
                {
                    return(false);
                }
                ((MKDS_Course_Modifier.UI.NSBMD)FileHandler.OpenDialog).SetNSBMA(Bma);
                return(false);

            case "NSBVA":
                NSBVA Bva = new NSBVA(file.Data);
                if (!(FileHandler.OpenDialog is MKDS_Course_Modifier.UI.NSBMD))
                {
                    return(false);
                }
                ((MKDS_Course_Modifier.UI.NSBMD)FileHandler.OpenDialog).SetNSBVA(Bva);
                return(false);

            case "NSBTP":
                NSBTP Btp = new NSBTP(file.Data);
                if (!(FileHandler.OpenDialog is MKDS_Course_Modifier.UI.NSBMD))
                {
                    return(false);
                }
                ((MKDS_Course_Modifier.UI.NSBMD)FileHandler.OpenDialog).SetNSBTP(Btp);
                return(false);

            case "KCL":
                KCL KCL = new KCL(file.Data);
                if (FileHandler.OpenDialog is MKDS_Course_Modifier.UI.MKDS.NKM)
                {
                    ((MKDS_Course_Modifier.UI.MKDS.NKM)FileHandler.OpenDialog).SetKCL(KCL);
                }
                return(false);

            case "MR":
                MKDS_Course_Modifier.MKDS.MR Mission = new MKDS_Course_Modifier.MKDS.MR(file.Data);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.MKDS.MR(Mission);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "NKM":
                MKDS_Course_Modifier.MKDS.NKM File1 = new MKDS_Course_Modifier.MKDS.NKM(file.Data);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.MKDS.NKM(File1);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "NCG.BIN":
                return(false);

            case "NCL.BIN":
                return(false);

            case "NSC.BIN":
                return(false);

            case "SPA":
                MKDS_Course_Modifier.Particles.SPA Spa = new MKDS_Course_Modifier.Particles.SPA(file.Data);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.SPA(Spa);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "SSEQ":
                MKDS_Course_Modifier.Sound.SSEQ file1 = new MKDS_Course_Modifier.Sound.SSEQ(file.Data);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.SSEQ(file1, FileHandler.m);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "SBNK":
                SBNK k = new SBNK(file.Data);
                if (FileHandler.OpenDialog != null && FileHandler.OpenDialog is MKDS_Course_Modifier.UI.SSEQ)
                {
                    SBNK s = SBNK.InitDLS(k, (SWAR[])Parameter);
                    ((MKDS_Course_Modifier.UI.SSEQ)FileHandler.OpenDialog).SetDLS(SBNK.ToDLS(s));
                }
                return(false);

            case "SDAT":
                SDAT SDAT = new SDAT(file.Data);
                Owner.OpenSDAT(SDAT);
                return(true);

            case "SSAR":
                MKDS_Course_Modifier.Sound.SSEQ file2 = new MKDS_Course_Modifier.Sound.SSEQ(file.Data, (int)Parameter);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.SSEQ(file2, FileHandler.m);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "NDS":
                NDS Rom = new NDS(file.Data);
                FileHandler.OpenedArchives.Clear();
                Owner.OpenNDS(Rom);
                return(true);

            case "NCER":
                MKDS_Course_Modifier.G2D_Binary_File_Format.NCER Cell = new MKDS_Course_Modifier.G2D_Binary_File_Format.NCER(file.Data);
                if (FileHandler.OpenDialog == null)
                {
                    FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.NCER(Cell);
                    FileHandler.OpenDialog.Show((IWin32Window)Owner);
                    FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                    return(true);
                }
                if (FileHandler.OpenDialog is MKDS_Course_Modifier.UI.BNCL)
                {
                    ((MKDS_Course_Modifier.UI.BNCL)FileHandler.OpenDialog).SetNCER(Cell);
                }
                return(false);

            case "BMG":
                MKDS_Course_Modifier.Misc.BMG File2 = new MKDS_Course_Modifier.Misc.BMG(file.Data);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.BMG(File2);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "SM64BMD":
                MKDS_Course_Modifier.SM64DS.BMD bmd = new MKDS_Course_Modifier.SM64DS.BMD(file.Data);
                if (FileHandler.OpenDialog is MKDS_Course_Modifier.UI.BMD)
                {
                    ((MKDS_Course_Modifier.UI.BMD)FileHandler.OpenDialog).SetBMD(bmd);
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.BMD(bmd);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "SM64BCA":
                MKDS_Course_Modifier.SM64DS.BCA Bca2 = new MKDS_Course_Modifier.SM64DS.BCA(file.Data);
                if (!(FileHandler.OpenDialog is MKDS_Course_Modifier.UI.BMD))
                {
                    return(false);
                }
                ((MKDS_Course_Modifier.UI.BMD)FileHandler.OpenDialog).SetBCA(Bca2);
                return(true);

            case "BNCL":
                MKDS_Course_Modifier.Misc.BNCL Bncl = new MKDS_Course_Modifier.Misc.BNCL(file.Data);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.BNCL(Bncl);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "GCNBMD":
                MKDS_Course_Modifier.GCN.BMD file3 = new MKDS_Course_Modifier.GCN.BMD(file.Data);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new J3D1(file3);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "HBDF":
                HBDF hbdf = new HBDF(file.Data);
                if (hbdf.MDLFBlocks.Length > 0)
                {
                    if (FileHandler.OpenDialog is MDLF)
                    {
                        ((MDLF)FileHandler.OpenDialog).SetHBDF(hbdf);
                    }
                    else
                    {
                        FileHandler.OpenDialog = (Form) new MDLF(hbdf);
                        FileHandler.OpenDialog.Show((IWin32Window)Owner);
                        FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                        return(true);
                    }
                }
                return(false);

            case "GCNBOL":
                BOL bol = new BOL(file.Data);
                return(false);

            case "PAZ":
                PAZ Arc = new PAZ(file.Data);
                Owner.OpenPAZ(Arc);
                return(true);

            case "TEX":
                TEX tex = new TEX(file.Data);
                return(false);

            case "GRPCONF":
                Grpconf grpconf = new Grpconf(file.Data);
                return(false);

            case "OBJ":
                MKDS_Course_Modifier._3D_Formats.OBJ obj = new MKDS_Course_Modifier._3D_Formats.OBJ(file.Path);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.OBJ(obj, obj.MLTName == null ? (MLT)null : new MLT(obj.MLTName));
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "GCNBLO":
                MKDS_Course_Modifier.GCN.BLO Layout = new MKDS_Course_Modifier.GCN.BLO(file.Data, file.Path);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.BLO(Layout);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "3DSCGFX":
                MKDS_Course_Modifier._3DS.CGFX cgfx = new MKDS_Course_Modifier._3DS.CGFX(file.Data);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.CGFX(cgfx);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            case "FMVVideo":
                MKDS_Course_Modifier.Misc.FMV Video = new MKDS_Course_Modifier.Misc.FMV(file.Data);
                if (FileHandler.OpenDialog != null)
                {
                    return(false);
                }
                FileHandler.OpenDialog = (Form) new MKDS_Course_Modifier.UI.FMV(Video);
                FileHandler.OpenDialog.Show((IWin32Window)Owner);
                FileHandler.OpenDialog.FormClosed += new FormClosedEventHandler(FileHandler.OpenDialog_FormClosed);
                return(true);

            default:
                return(false);
            }
        }
示例#3
0
        public NDS(byte[] file)
        {
            EndianBinaryReader er = new EndianBinaryReader((Stream) new MemoryStream(file), Endianness.LittleEndian);

            this.GameTitle            = er.ReadString(Encoding.ASCII, 12).Replace("\0", "");
            this.GameCode             = er.ReadString(Encoding.ASCII, 4).Replace("\0", "");
            this.MakerCode            = er.ReadString(Encoding.ASCII, 2).Replace("\0", "");
            this.Unitcode             = er.ReadByte();
            this.EncryptionSeedSelect = er.ReadByte();
            this.Devicecapacity       = er.ReadByte();
            er.ReadBytes(9);
            this.ROMVersion                        = er.ReadByte();
            this.InternalFlags                     = er.ReadByte();
            this.ARM9RomOffset                     = er.ReadUInt32();
            this.ARM9EntryAddress                  = er.ReadUInt32();
            this.ARM9LoadAddress                   = er.ReadUInt32();
            this.ARM9Size                          = er.ReadUInt32();
            this.ARM7RomOffset                     = er.ReadUInt32();
            this.ARM7EntryAddress                  = er.ReadUInt32();
            this.ARM7LoadAddress                   = er.ReadUInt32();
            this.ARM7Size                          = er.ReadUInt32();
            this.FileNameTableOffset               = er.ReadUInt32();
            this.FileNameTableLength               = er.ReadUInt32();
            this.FileAllocationTableOffset         = er.ReadUInt32();
            this.FileAllocationTableLength         = er.ReadUInt32();
            this.ARM9OverlayOffset                 = er.ReadUInt32();
            this.ARM9OverlayLength                 = er.ReadUInt32();
            this.ARM7OverlayOffset                 = er.ReadUInt32();
            this.ARM7OverlayLength                 = er.ReadUInt32();
            this.NormalCardControlRegisterSettings = er.ReadUInt32();
            this.SecureCardControlRegisterSettings = er.ReadUInt32();
            this.IconBannerOffset                  = er.ReadUInt32();
            this.SecureAreaCRC                     = er.ReadUInt16();
            this.SecureTransferTimeout             = er.ReadUInt16();
            this.ARM9Autoload                      = er.ReadUInt32();
            this.ARM7Autoload                      = er.ReadUInt32();
            this.SecureDisable                     = er.ReadUInt32();
            this.NTRRegionROMSize                  = er.ReadUInt32();
            this.HeaderSize                        = er.ReadUInt32();
            er.ReadBytes(56);
            this.NintendoLogo    = er.ReadBytes(156);
            this.NintendoLogoCRC = er.ReadUInt16();
            this.HeaderCRC       = er.ReadUInt16();
            er.ReadBytes(160);
            if (this.IconBannerOffset != 0U)
            {
                er.BaseStream.Position = (long)this.IconBannerOffset;
                this.Banner            = new NDS.IconBanner(er);
            }
            this.Root = new NARC.DirectoryEntry("root", 0);
            er.BaseStream.Position = (long)this.FileNameTableOffset;
            uint          num1     = er.ReadUInt32();
            ushort        num2     = er.ReadUInt16();
            ushort        num3     = er.ReadUInt16();
            List <string> source1  = new List <string>();
            List <string> source2  = new List <string>();
            List <int>    intList1 = new List <int>();
            List <ushort> source3  = new List <ushort>();
            List <int>    intList2 = new List <int>();
            int           id1      = 0;

            NARC.DirectoryEntry directoryEntry = this.Root;
            er.BaseStream.Position = (long)(num1 + this.FileNameTableOffset);
            for (int index = 0; (long)index < (long)(this.FileAllocationTableLength / 8U - (uint)num2) + (long)((int)num3 - 1); ++index)
            {
                byte num4 = er.ReadByte();
                if (num4 < (byte)128 && num4 > (byte)0)
                {
                    source1.Add(er.ReadString(Encoding.ASCII, (int)num4));
                    intList1.Add(id1);
                    directoryEntry.Files.Add(new NARC.FileEntry(source1.Last <string>(), intList1.Count - 1));
                }
                else if (num4 > (byte)128 && num4 < (byte)176)
                {
                    byte num5 = (byte)((uint)num4 - 128U);
                    source2.Add(er.ReadString(Encoding.ASCII, (int)num5));
                    source3.Add((ushort)((uint)er.ReadUInt16() - 61440U));
                    intList2.Add(id1);
                    directoryEntry.Subdirs.Add(new NARC.DirectoryEntry(source2.Last <string>(), (int)source3.Last <ushort>()));
                }
                else
                {
                    ++id1;
                    directoryEntry = this.Root.GetDirById(id1);
                    if (directoryEntry != null)
                    {
                        --index;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            er.BaseStream.Position = (long)this.FileAllocationTableOffset;
            er.ReadBytes((int)num2 * 8);
            for (int id2 = 0; (long)id2 < (long)(this.FileAllocationTableLength / 8U - (uint)num2); ++id2)
            {
                uint num4     = er.ReadUInt32();
                uint num5     = er.ReadUInt32();
                long position = er.BaseStream.Position;
                er.BaseStream.Position = (long)num4;
                int count = (int)num5 - (int)num4;
                this.Root.SetFile(er.ReadBytes(count), id2);
                er.BaseStream.Position = position;
            }
            er.BaseStream.Position = (long)this.ARM9RomOffset;
            this.Arm9 = er.ReadBytes((int)this.ARM9Size);
            er.BaseStream.Position = (long)this.ARM7RomOffset;
            this.Arm7 = er.ReadBytes((int)this.ARM7Size);
            er.BaseStream.Position = (long)this.ARM9OverlayOffset;
            this.ARM9Overlay       = er.ReadBytes((int)this.ARM9OverlayLength);
            er.BaseStream.Position = (long)this.ARM7OverlayOffset;
            this.ARM7Overlay       = er.ReadBytes((int)this.ARM7OverlayLength);
            er.Close();
        }