示例#1
0
        /// <summary>
        /// Makes a copy of an Xbox Live profile into a HDD profile
        /// (Works only for profiles and if not a HDD profile already)
        /// </summary>
        /// <param name="xOutLocation"></param>
        /// <returns></returns>
        public bool MakeHDDAccountCopy(string xOutLocation)
        {
            if (!ParseCheck())
            {
                return(false);
            }
            ProfilePackage xPackage = null;

            try
            {
                if (MakeBackup(xOutLocation))
                {
                    xPackage = (ProfilePackage)(new STFSPackage(xOutLocation, null));
                }
                else
                {
                    return(false);
                }
                if (!xPackage.ParseSuccess)
                {
                    throw new Exception(); // Goes to catch
                }
                xPackage.UserFile.ForceIntoHDDAccount();
                xPackage.xSaveAccount();
                xPackage.xIO.Close();
                return(true);
            }
            catch
            {
                xPackage.xIO.Close();
                VariousFunctions.DeleteFile(xPackage.xIO.FileNameLong);
                return(false);
            }
        }
        public void importfromprofile()
        {
            OpenFileDialog dialog = new OpenFileDialog();
            dialog.Title = "Open a xbox 360 profile";
            dialog.Filter = "Xbox 360 profile|*.*";
            DialogResult result = dialog.ShowDialog();
            if (result == DialogResult.OK) // Test result.
            {

                try
                {
                    DJsIO io = new DJsIO(dialog.FileName, DJFileMode.Open, true);


                    io.Position = 0x371;
                    this.Profileid = io.ReadHexString(8);
                    io.Close();

                    //xPackage3.STFS.Package sts = new xPackage3.STFS.Package(dialog.FileName);

                    STFSPackage stfs = new STFSPackage(dialog.FileName, null);
                    ProfilePackage xFile = new ProfilePackage(ref stfs);
                    string gamertag = xFile.UserFile.GetGamertag();
                    this.ProfileName = gamertag;
                    xFile.CloseIO();
                    stfs.CloseIO();
                    //this.Profileid = stfs.Header.Title_Package;
                }
                catch (Exception e) { }
            }
        }
示例#3
0
 public void set(ref STFSPackage x)
 {
     xpack = x;
     Log("Package parsed");
     node1.NodeClick += new EventHandler(xReturn_NodeClick);
     SetNodes();
     node1.SetChecked(true, eTreeAction.Expand);
     Log("Contents loaded");
     if (xPackage.FileNameShort.Length < 30)
         this.Text = "Package - " + xPackage.FileNameShort;
     else this.Text = "Package - " + xPackage.FileNameShort.Substring(0, 30) + "...";
     textBoxX1.Text = xPackage.FileNameLong;
     textBoxX2.Text = xPackage.Header.Title_Display;
     textBoxX3.Text = xPackage.Header.Description;
     try { pictureBox1.Image = xPackage.Header.ContentImage; }
     catch { pictureBox1.Enabled = false; }
     try { pictureBox2.Image = xPackage.Header.PackageImage; }
     catch { pictureBox2.Enabled = false; }
     comboBoxEx1.SelectedIndex = 0;
     numericUpDown5.Value = xPackage.Header.SaveConsoleID;
     numericUpDown6.Value = xPackage.Header.ProfileID;
     textBoxX17.Text = xPackage.Header.DeviceID.HexString();
     numericUpDown9_ValueChanged(null, null);
     if (xPackage.Header.IDTransfer == TransferLock.NoTransfer)
         checkBoxX1.Checked = false;
     else
     {
         checkBoxX2.Checked = ((byte)xPackage.Header.IDTransfer & 1) == 1;
         checkBoxX3.Checked = (((byte)xPackage.Header.IDTransfer >> 1) & 1) == 1;
     }
     labelX8.Text = "Title ID: " + xpack.Header.TitleID.ToString("X");
     if (xPackage.Header.ThisType != PackageType.Profile)
     {
         tabItem4.Visible = false;
         return;
     }
     xprof = new ProfilePackage(ref x);
     xpack = null;
     xprof.RemovePhDAT();
     if (xprof.HasValidAccount)
     {
         if (xprof.UserFile.IsLiveEnabled)
         {
             textBoxX9.Text = VariousFunctions.EndianConvert(BitConverter.GetBytes(xprof.UserFile.XUID)).HexString();
             textBoxX9.Enabled =
             buttonX4.Enabled =
             checkBoxX5.Enabled = true;
             PassCode[] xPass = xprof.UserFile.GetPassCode();
             if (xPass.Length > 0)
             {
                 checkBoxX5.Checked = true;
                 comboBoxEx3.SelectedItem = xPass[0];
                 comboBoxEx4.SelectedItem = xPass[1];
                 comboBoxEx5.SelectedItem = xPass[2];
                 comboBoxEx6.SelectedItem = xPass[3];
             }
         }
         textBoxX8.Text = xprof.UserFile.GetGamertag();
         buttonX5.Enabled = true;
         Log("Account loaded");
     }
     if (xprof.HasDashGPD)
     {
         UserInfo xInfo = xprof.GetUserStrings();
         if (xInfo.Bio != null)
             textBoxX10.Text = xInfo.Bio;
         if (xInfo.Motto != null)
             textBoxX11.Text = xInfo.Motto;
         if (xInfo.Name != null)
             textBoxX12.Text = xInfo.Name;
         if (xInfo.Location != null)
             textBoxX13.Text = xInfo.Location;
         Setting temp = xprof.UserGPD.GetSetting(GPDIDs.GCardZone);
         if (temp != null)
         {
             comboBoxEx7.Enabled = true;
             GamerZone[] zones = (GamerZone[])Enum.GetValues(typeof(GamerZone));
             comboBoxEx7.DataSource = zones;
             if (Enum.IsDefined(typeof(GamerZone), temp.Data))
                 comboBoxEx7.SelectedItem = (GamerZone)((uint)temp.Data);
             else comboBoxEx7.SelectedItem = GamerZone.Unknown;
             has1 = buttonX16.Enabled = true;
         }
         temp = xprof.UserGPD.GetSetting(GPDIDs.GCardRep, SettingType.Float);
         if (temp != null)
         {
             numericUpDown1.Enabled = true;
             numericUpDown1.Value = (decimal)((float)temp.Data);
             has2 = buttonX16.Enabled = true;
         }
         SetList();
         buttonX15.Enabled =
         listBox3.Enabled = true;
         // groupPanel2.Enabled = true;
         SetNmric(GPDIDs.GCardCredit, textBoxX15);
         Log("Profile loaded");
     }
     if (!xprof.IsValidProfile)
     {
         if (xprof.HasValidAccount && !xprof.HasDashGPD)
             MessageBox.Show("This file does not have valid Dash information, therefore achievement modding is disabled");
         else if (!xprof.HasValidAccount && xprof.HasDashGPD)
             MessageBox.Show("This file does not have a valid user account, therefore, account block editing is disabled");
         else
         {
             tabItem4.Visible = false;
             MessageBox.Show("This file has no valid user information, profile - specific editing is disabled");
         }
     }
 }