Exemplo n.º 1
0
		public File(Filesystem parent, Directory parentDir, string name, int id)
		{
			this.parentP = parent;
			this.parentDirP = parentDir;
			this.nameP = name;
			this.idP = id;
		}
Exemplo n.º 2
0
 public File(Filesystem parent, Directory parentDir, string name)
 {
     this.parent = parent;
     this.parentDirP = parentDir;
     this.nameP = name;
     this.isSystemFile = true;
 }
Exemplo n.º 3
0
 public BannerFile(Filesystem parent, Directory parentDir, File headerFile)
     : base(parent, parentDir, -8, "banner.bin", headerFile, 0x68, 0, true)
 {
     endFile = null;
     fileSizeP = 0x840;
     refreshOffsets();
 }
Exemplo n.º 4
0
 public BannerFile(Filesystem parent, Directory parentDir, File headerFile)
     : base(parent, parentDir, -9, "banner.bin", headerFile, 0x68, 0, true)
 {
     endFile   = null;
     fileSizeP = 0x840;
     refreshOffsets();
 }
Exemplo n.º 5
0
 public File(Filesystem parent, Directory parentDir, string name, int id)
 {
     this.parentP    = parent;
     this.parentDirP = parentDir;
     this.nameP      = name;
     this.idP        = id;
 }
Exemplo n.º 6
0
 public Directory(Filesystem parent, Directory parentDir, bool system, string name, int id)
 {
     this.parent          = parent;
     this.parentDirP      = parentDir;
     this.isSystemFolderP = system;
     this.nameP           = name;
     this.idP             = id;
 }
Exemplo n.º 7
0
 public Directory(Filesystem parent, Directory parentDir, bool system, string name, int id)
 {
     this.parent = parent;
     this.parentDirP = parentDir;
     this.isSystemFolderP = system;
     this.nameP = name;
     this.idP = id;
 }
Exemplo n.º 8
0
 public File(Filesystem parent, Directory parentDir, string name)
 {
     this.parent = parent;
     this.parentDirP = parentDir;
     this.nameP = name;
     this.fileBegin = 0;
     this.fileSize = (int)parent.s.Length;
     this.isSystemFile = true;
 }
Exemplo n.º 9
0
 public File(Filesystem parent, Directory parentDir, string name)
 {
     this.parent       = parent;
     this.parentDirP   = parentDir;
     this.nameP        = name;
     this.fileBegin    = 0;
     this.fileSize     = (int)parent.s.Length;
     this.isSystemFile = true;
 }
Exemplo n.º 10
0
 public PhysicalFile(Filesystem parent, Directory parentDir, int id, string name, File alFile, int alBeg, int alEnd)
     : base(parent, parentDir, name, id)
 {
     this.beginFile   = alFile;
     this.endFile     = alFile;
     this.beginOffset = alBeg;
     this.endOffset   = alEnd;
     refreshOffsets();
 }
Exemplo n.º 11
0
 public PhysicalFile(Filesystem parent, Directory parentDir, int id, string name, int alBeg, int alSize)
     : base(parent, parentDir, name, id)
 {
     this.fileBeginP      = alBeg;
     this.fileSizeP       = alSize;
     this.canChangeOffset = false;
     this.canChangeSize   = false;
     refreshOffsets();
 }
Exemplo n.º 12
0
 public PhysicalFile(Filesystem parent, Directory parentDir, int id, string name, int alBeg, int alSize)
 	:base(parent, parentDir, name, id)
 {
     this.fileBeginP = alBeg;
     this.fileSizeP = alSize;
     this.canChangeOffset = false;
     this.canChangeSize = false;
     refreshOffsets();
 }
Exemplo n.º 13
0
 public PhysicalFile(Filesystem parent, Directory parentDir, int id, string name, File alFile, int alBeg, int alEnd)
 	:base(parent, parentDir, name, id)
 {
     this.beginFile = alFile;
     this.endFile = alFile;
     this.beginOffset = alBeg;
     this.endOffset = alEnd;
     refreshOffsets();
 }
        public FilesystemBrowserDialog(Filesystem fs)
        {
            InitializeComponent();
            this.MdiParent = MdiParentForm.instance;
            LanguageManager.ApplyToContainer(this, "FilesystemBrowserDialog");

            this.fs = fs;
            filesystemBrowser1.Load(fs);

            this.Icon = Properties.Resources.nsmbe;
        }
Exemplo n.º 15
0
 public File(Filesystem parent, Directory parentDir, bool systemFile, int id, string name, int alBeg, int alSize)
 {
     this.parent       = parent;
     this.parentDirP   = parentDir;
     this.isSystemFile = systemFile;
     this.idP          = id;
     this.nameP        = name;
     this.fileBegin    = alBeg;
     this.fileSize     = alSize;
     refreshOffsets();
 }
        public FilesystemBrowserDialog(Filesystem fs)
        {
            InitializeComponent();
            this.MdiParent = MdiParentForm.instance;
            LanguageManager.ApplyToContainer(this, "FilesystemBrowserDialog");

            this.fs = fs;
            filesystemBrowser1.Load(fs);

            this.Icon = Properties.Resources.nsmbe;
        }
Exemplo n.º 17
0
        public new void Load(Filesystem fs)
        {
            this.fs = fs;

            TreeNode main = new TreeNode(fs.mainDir.name, 0, 0);
            main.Tag = fs.mainDir;

            loadDir(main, fs.mainDir);

            fileTreeView.Nodes.Clear();
            fileTreeView.Nodes.Add(main);
        }
Exemplo n.º 18
0
 public File(Filesystem parent, Directory parentDir, bool systemFile, int id, string name, File alFile, int alBeg, int alEnd)
 {
     this.parent       = parent;
     this.parentDirP   = parentDir;
     this.isSystemFile = systemFile;
     this.idP          = id;
     this.nameP        = name;
     this.beginFile    = alFile;
     this.endFile      = alFile;
     this.beginOffset  = alBeg;
     this.endOffset    = alEnd;
     refreshOffsets();
 }
Exemplo n.º 19
0
        private void run(Filesystem fs)
        {
            ROM.load(fs);

            SpriteData.Load();
            if (Properties.Settings.Default.mdi)
                new MdiParentForm().Show();
            else
                new LevelChooser().Show();

            close = false;
            Close();
        }
Exemplo n.º 20
0
 public File(Filesystem parent, Directory parentDir, bool systemFile, int id, string name, File alFile, int alBeg, int alEnd)
 {
     this.parent = parent;
     this.parentDirP = parentDir;
     this.isSystemFile = systemFile;
     this.idP = id;
     this.nameP = name;
     this.beginFile = alFile;
     this.endFile = alFile;
     this.beginOffset = alBeg;
     this.endOffset = alEnd;
     refreshOffsets();
 }
Exemplo n.º 21
0
        public new void Load(Filesystem fs)
        {
            this.fs = fs;

            TreeNode main = new TreeNode(fs.mainDir.name, 0, 0);

            main.Tag = fs.mainDir;

            loadDir(main, fs.mainDir);

            fileTreeView.Nodes.Clear();
            fileTreeView.Nodes.Add(main);
        }
Exemplo n.º 22
0
        public new void Load(Filesystem fs)
        {
            this.fs = fs;

            extractFileDialog.Filter = LanguageManager.Get("Filters", "all");
            replaceFileDialog.Filter = LanguageManager.Get("Filters", "all");

            TreeNode main = new TreeNode(fs.mainDir.name, 0, 0);
            main.Tag = fs.mainDir;

            loadDir(main, fs.mainDir);

            fileTreeView.Nodes.Clear();
            fileTreeView.Nodes.Add(main);
        }
Exemplo n.º 23
0
        public new void Load(Filesystem fs)
        {
            this.fs = fs;

            extractFileDialog.Filter = LanguageManager.Get("Filters", "all");
            replaceFileDialog.Filter = LanguageManager.Get("Filters", "all");

            TreeNode main = new TreeNode(fs.mainDir.name, 0, 0);

            main.Tag = fs.mainDir;

            loadDir(main, fs.mainDir);

            fileTreeView.Nodes.Clear();
            fileTreeView.Nodes.Add(main);
        }
Exemplo n.º 24
0
        public static void load(Filesystem fs)
        {
            filename = fs.getRomPath();
            FS = fs;
            if(fs is NitroROMFilesystem)
                romfile = new System.IO.FileInfo(filename);

			arm9binFile = FS.getFileByName("arm9.bin");			
			arm9ovFile = FS.getFileByName("arm9ovt.bin");	
			arm9ovs = loadOvTable(arm9ovFile);
			arm7binFile = FS.getFileByName("arm7.bin");			
			arm7ovFile = FS.getFileByName("arm7ovt.bin");			
			arm7ovs = loadOvTable(arm7ovFile);
			rsaSigFile = FS.getFileByName("rsasig.bin");			
			headerFile = FS.getFileByName("header.bin");

            arm9RAMAddress = headerFile.getUintAt(0x28);
			
            ByteArrayInputStream header = new ByteArrayInputStream(headerFile.getContents());
            romInternalName = header.ReadString(12);
            romGamecode = header.ReadString(4);

            if (romGamecode == "A2DE")
                Region = Origin.US;
            else if (romGamecode == "A2DP")
                Region = Origin.EU;
            else if (romGamecode == "A2DJ")
                Region = Origin.JP;
            else if (romGamecode == "A2DK")
                Region = Origin.KR;
            else
            {
                isNSMBRom = false;
                Region = Origin.UNK;
            }

            if (isNSMBRom)
            {
                UserInfo = new ROMUserInfo(filename);
                LoadOverlay0();
            }
        }
Exemplo n.º 25
0
        public OverlayFile(Filesystem parent, Directory parentDir,
            int id,  File alFile, int alBeg, int alEnd,
            File ovTableFile, uint ovTableOffs)
            : base(parent, parentDir, true, id, ":::", alFile, alBeg, alEnd)
        {
            this.nameP = string.Format(LanguageManager.Get("NitroClass", "OverlayFile"),
                id, ramAddr.ToString("X"), ramSize.ToString("X"));

            this.ovTableFile = ovTableFile;
            this.ovTableOffs = ovTableOffs;

            ovId = ovTableFile.getUintAt((int)ovTableOffs + 0x00);
            ramAddr = ovTableFile.getUintAt((int)ovTableOffs + 0x04);
            ramSize = ovTableFile.getUintAt((int)ovTableOffs + 0x08);
            bssSize = ovTableFile.getUintAt((int)ovTableOffs + 0x0C);
            staticInitStart = ovTableFile.getUintAt((int)ovTableOffs + 0x10);
            staticInitEnd = ovTableFile.getUintAt((int)ovTableOffs + 0x14);

            nameP = String.Format("{0:X8} - {1:X8}, OV {2}, FILE {3}", ramAddr, ramAddr + ramSize - 1, ovId, id);
        }
Exemplo n.º 26
0
        public HeaderFile(Filesystem parent, Directory parentDir)
            : base(parent, parentDir, -8, "header.bin", 0, 0x4000)
        {

        }
Exemplo n.º 27
0
 public File(Filesystem parent, Directory parentDir, bool systemFile, int id, string name, int alBeg, int alSize)
 {
     this.parent = parent;
     this.parentDirP = parentDir;
     this.isSystemFile = systemFile;
     this.idP = id;
     this.nameP = name;
     this.fileBegin = alBeg;
     this.fileSize = alSize;
     refreshOffsets();
 }
Exemplo n.º 28
0
 public PhysicalFile(Filesystem parent, Directory parentDir, string name)
 	:base(parent, parentDir, name, -1)
 {
 }
Exemplo n.º 29
0
 public FileWithLock(Filesystem parent, Directory parentDir, string name, int id)
     : base(parent, parentDir, name, id)
 {
 }
Exemplo n.º 30
0
		public FileWithLock(Filesystem parent, Directory parentDir, string name, int id)
			: base(parent, parentDir, name, id)
		{
			
		}
Exemplo n.º 31
0
 public HeaderFile(Filesystem parent, Directory parentDir)
     : base(parent, parentDir, -8, "header.bin", 0, 0x4000)
 {
 }
Exemplo n.º 32
0
        public void makeBinBackup(int file)
        {
            System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(ROM.romfile.Directory.FullName+"/bak");
            //Console.Out.WriteLine("Backing up " + file + " "+dir.FullName);
            if (!dir.Exists)
                dir.Create();

            dir = ROM.romfile.Directory;
            System.IO.FileStream fs;

            string filename;
            if (file == -1)
                filename = dir.FullName + "/bak/" + "main.bin";
            else
                filename = dir.FullName + "/bak/" + file + ".bin";

            if(System.IO.File.Exists(filename)) return;

            fs = new System.IO.FileStream(filename, System.IO.FileMode.CreateNew);

            File f = ROM.arm9binFile;
            if (file != -1)
            {
                f = ROM.arm9ovs[file].f;
                ROM.arm9ovs[file].decompress();
            }

            fs.Write(f.getContents(), 0, f.fileSize);
            fs.Close();
        }
Exemplo n.º 33
0
 public Arm9BinaryHandler()
 {
     f = ROM.arm9binFile;
     this.fs = ROM.FS;
 }
Exemplo n.º 34
0
 public PhysicalFile(Filesystem parent, Directory parentDir, string name)
     : base(parent, parentDir, name, -1)
 {
 }