Exemple #1
0
        private void openImageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string xfilez = X360.Other.VariousFunctions.GetUserFileLocale("Open a file", "Binary Image|*.bin|All Files|*.*", true);

            if (xfilez == null)
            {
                return;
            }
            if (par.Files.Contains(xfilez))
            {
                MessageBox.Show("Error: Already opened");
                return;
            }
            FATXDrive xBU = xChosenDrive;

            try { xChosenDrive = new FATXDrive(xfilez); }
            catch (Exception x)
            {
                xChosenDrive = xBU;
                MessageBox.Show(x.Message);
                return;
            }
            xfile        = xfilez;
            DialogResult = DialogResult.OK;
            this.Close();
        }
Exemple #2
0
        public STFSInfo(File f)
        {
            string name = f.Name;

            xFile  = f;
            xDrive = f.Drive;
            m      = new Misc();
            info   = new FATX.Structs.STFSInfo();
        }
Exemple #3
0
 public FATXBrowser(FATXDrive xDriveIn, string file, MainForm parent)
 {
     InitializeComponent();
     CheckForIllegalCrossThreadCalls = false;
     xDrive    = xDriveIn;
     xthisfile = file;
     xparent   = parent;
     setdrive();
 }
Exemple #4
0
 public FATXViewer(FATXDrive drivein, string filein, MainForm par)
 {
     InitializeComponent();
     node1.Text = drivein.DriveName;
     if (drivein.IsDriveIO)
     {
         createDiskImageToolStripMenuItem.Enabled = restoreImageToolStripMenuItem.Enabled = false;
     }
     xDrive    = drivein;
     xthisfile = filein;
     xparent   = par;
     set();
 }
 public void Close()
 {
     if (opened)
     {
         try
         {
             drive.Close();
             drive = null;
         }
         catch { drive = null; }
         opened = false;
     }
 }
Exemple #6
0
 private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listBox1.SelectedIndex >= 0)
     {
         string parse = ((string)listBox1.SelectedItem).Split(new char[] { ':' })[0];
         if (!par.Files.Contains(parse))
         {
             button1.Enabled = true;
             xChosenDrive    = xDrives[listBox1.SelectedIndex];
             return;
         }
     }
     button1.Enabled = false;
     xChosenDrive    = null;
 }
        public bool Open()
        {
            if (!opened)
            {
                try
                {
                    drive = new FATXDrive(device);

                    RefreshPartitions();

                    opened = true;
                    return(true);
                }
                catch { }
            }

            return(false);
        }
Exemple #8
0
        public void Load()
        {
            _index           = 0;
            _fileInjectDirec = new Folder[200];
            cBSaves.Items.Clear();

            FATXDrive Drive = _selectDeviceStep.SelectedDevice;

            Drive.ReadData();
            Folder[] Partitions;
            Folder   contentDirec;

            if (Drive.IsUSB)
            {
                Partitions   = Drive.Partitions;
                contentDirec = Partitions[1];
            }
            else
            {
                Partitions   = Drive.Partitions;
                contentDirec = Partitions[2];   //who uses hdd's for modding gamesaves, are you a f*****g egit?
            }

            SortedList <string, ComboBoxItem> items = new SortedList <string, ComboBoxItem>();

            foreach (Folder content in contentDirec.SubFolders(false))
            {
                if (content.Name == "Content")
                {
                    foreach (Folder profiles in content.SubFolders(false))
                    {
                        if (profiles.Name.StartsWith("E"))
                        {
                            foreach (Folder profileContent in profiles.SubFolders(false))
                            {
                                if (profileContent.Name == "4D53085B" || profileContent.Name == "4D5309B1" ||
                                    profileContent.Name == "4D5307E6" || profileContent.Name == "4D530877" ||
                                    profileContent.Name == "4D530919")
                                {
                                    foreach (Folder reachSub1 in profileContent.SubFolders(false))
                                    {
                                        foreach (File reachSub2 in reachSub1.Files(false))
                                        {
                                            if (reachSub2.Name.StartsWith("s") || reachSub2.Name.StartsWith("personal"))
                                            {
                                                ComboBoxItem cbi = new ComboBoxItem();
                                                reachSub2.ForceSTFSInfo();
                                                string text = reachSub2.STFSInformation.TitleName + " - " + reachSub2.GetPackageName() + " - " + reachSub2.Name;
                                                cbi.Content = text;
                                                cbi.Tag     = reachSub2;
                                                _fileInjectDirec[_index++] = reachSub1;
                                                items.Add(text, cbi);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            foreach (KeyValuePair <string, ComboBoxItem> item in items)
            {
                cBSaves.Items.Add(item.Value);
            }
            cBSaves.SelectedIndex = 0;

            _mainWindow.enableNextButton(cBSaves.Items.Count > 0);
        }
Exemple #9
0
        void ReadFile(string file)
        {
            try
            {
                switch (VariousFunctions.ReadFileType(file))
                {
                case XboxFileType.STFS:
                {
                    LogRecord   x        = new LogRecord();
                    STFSPackage xPackage = new STFSPackage(file, x);
                    if (!xPackage.ParseSuccess)
                    {
                        return;
                    }
                    PackageExplorer xExplorer = new PackageExplorer(this);
                    xExplorer.listBox4.Items.AddRange(x.Log);
                    x.WhenLogged += new LogRecord.OnLog(xExplorer.xAddLog);
                    xExplorer.set(ref xPackage);
                    xExplorer.Show();
                }
                break;

                case XboxFileType.SVOD:
                {
                    SVODPackage hd = new SVODPackage(file, null);
                    if (!hd.IsValid)
                    {
                        return;
                    }
                    HDDGameForm frm = new HDDGameForm(hd, file, this);
                    frm.MdiParent = this;
                    frm.Show();
                }
                break;

                case XboxFileType.Music:
                {
                    MusicFile xfile = new MusicFile(file);
                    MusicView xview = new MusicView(this, file, xfile);
                    xview.MdiParent = this;
                    xview.Show();
                }
                break;

                case XboxFileType.GPD:
                {
                    GameGPD   y = new GameGPD(file, 0xFFFFFFFF);
                    GPDViewer z = new GPDViewer(y, file, this);
                    z.MdiParent = this;
                    z.Show();
                }
                break;

                case XboxFileType.FATX:
                {
                    FATXDrive xdrive = new FATXDrive(file);
                    Files.Add(file);
                    FATXBrowser y = new FATXBrowser(xdrive, file, this);
                    y.MdiParent = this;
                    y.Show();
                }
                break;

                case XboxFileType.GDF:
                {
                    StatsForm x = new StatsForm(0);
                    x.Text = "Select Deviation";
                    if (x.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    GDFImage ximg = new GDFImage(file, x.ChosenID);
                    if (!ximg.Valid)
                    {
                        throw new Exception("Invalid package");
                    }
                    GDFViewer xViewer = new GDFViewer(ximg, this);
                    xViewer.MdiParent = this;
                    xViewer.Show();
                }
                break;

                default: MessageBox.Show("Error: Unknown file"); return;
                }
                Files.Add(file);
            }
            catch (Exception x) { MessageBox.Show(x.Message); }
        }