Exemplo n.º 1
0
        private void unmountButton_Click(object sender, EventArgs e)
        {
            if (!ps4.IsConnected)
            {
                SetStatus("Not connected to ps4");
                return;
            }
            if (mp == "")
            {
                SetStatus("No save mounted");
                return;
            }
            SceSaveDataMountPoint mountPoint = new SceSaveDataMountPoint
            {
                data = mp,
            };

            Unmount(mountPoint);
            mp = null;
            SetStatus("Save Unmounted");
            unmountButton.Enabled  = false;
            setupButton.Enabled    = true;
            userComboBox.Enabled   = true;
            getGamesButton.Enabled = true;
            gamesComboBox.Enabled  = true;
            searchButton.Enabled   = true;
            dirsComboBox.Enabled   = true;
            mountButton.Enabled    = true;
        }
Exemplo n.º 2
0
        public void TryDirtyUnmount()
        {
            if (!ps4.IsConnected)
            {
                SetStatus("Not connected to ps4");
                return;
            }

            if (dirsComboBox.Items.Count == 0)
            {
                SetStatus("No save selected");
                return;
            }

            if (selectedGame == null)
            {
                SetStatus("No game selected");
                return;
            }

            for (var i = 0; i < 18; i++)
            {
                SceSaveDataMountPoint mountPoint = new SceSaveDataMountPoint
                {
                    data = $"/savedata{i}",
                };

                Unmount(mountPoint);
            }

            dirsComboBox.BorderColor = Color.LightGray;
            SetStatus("All save unmounted");
        }
Exemplo n.º 3
0
        private void unmountButton_Click(object sender, EventArgs e)
        {
            if (!ps4.IsConnected)
            {
                SetStatus("Not connected to ps4");
                return;
            }
            if (currentMountPointList.Count == 0)
            {
                SetStatus("No save mounted");
                return;
            }

            var currentSaveDirectory = ((SearchEntry)dirsComboBox.SelectedItem).dirName;

            if (!currentMountPointList.ContainsKey(currentSaveDirectory))
            {
                SetStatus("Current selected save not mounted");
                return;
            }

            currentMountPointList.TryGetValue(currentSaveDirectory, out var currentMountPoint);
            SceSaveDataMountPoint mountPoint = new SceSaveDataMountPoint
            {
                data = ((MountPointStruct)currentMountPoint).MountPoint,
            };

            Unmount(mountPoint);
            dirsComboBox.BorderColor = Color.LightGray;
            currentMountPointList.Remove(currentSaveDirectory);
            SetStatus("Save Unmounted");
        }
Exemplo n.º 4
0
        private void Unmount(SceSaveDataMountPoint mountPoint)
        {
            var mountPointAddr = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataMountPoint)));

            ps4.WriteMemory(pid, mountPointAddr, mountPoint);
            var ret = ps4.Call(pid, stub, libSceSaveDataBase + offsets.sceSaveDataUmount, mountPointAddr);

            WriteLog($"sceSaveDataUmount ret = 0x{ret:X}");
            ps4.FreeMemory(pid, mountPointAddr, Marshal.SizeOf(typeof(SceSaveDataMountPoint)));
        }
Exemplo n.º 5
0
        private void createButton_Click(object sender, EventArgs e)
        {
            if (pid == 0)
            {
                SetStatus("No Process Selected");
                return;
            }
            var pm = ps4.GetProcessMaps(pid);

            if (pm.FindEntry("(NoName)clienthandler") == null)
            {
                SetStatus("RPC Stub Not Found");
                return;
            }
            if (nameTextBox.Text == "")
            {
                SetStatus("No Save Name");
                return;
            }
            var dirNameAddr            = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataDirName)));
            SceSaveDataDirName dirName = new SceSaveDataDirName
            {
                data = nameTextBox.Text
            };

            SceSaveDataMount2 mount = new SceSaveDataMount2
            {
                userId    = GetUser(),
                dirName   = dirNameAddr,
                blocks    = (ulong)sizeTrackBar.Value,
                mountMode = 4 | 2 | 8,
            };
            SceSaveDataMountResult mountResult = new SceSaveDataMountResult
            {
            };

            ps4.WriteMemory(pid, dirNameAddr, dirName);
            var mp = Mount2(mount, mountResult);

            ps4.FreeMemory(pid, dirNameAddr, Marshal.SizeOf(typeof(SceSaveDataDirName)));
            if (mp != "")
            {
                SetStatus("Save Created");
                SceSaveDataMountPoint mountPoint = new SceSaveDataMountPoint
                {
                    data = mp,
                };
                Unmount(mountPoint);
            }
            else
            {
                SetStatus("Save Creation Failed");
            }
        }
Exemplo n.º 6
0
        private void tUnmountButton_Click(object sender, EventArgs e)
        {
            if (mp == "")
            {
                SetStatus("No save mounted");
                return;
            }
            SceSaveDataMountPoint mountPoint = new SceSaveDataMountPoint
            {
                data = mp,
            };

            Unmount(mountPoint);
            mp = null;
            SetStatus("Save Unmounted");
        }
        private void OnApplicationExit(object sender, EventArgs e)
        {
            if (!ps4.IsConnected)
            {
                return;
            }
            if (mp == "")
            {
                return;
            }
            SceSaveDataMountPoint mountPoint = new SceSaveDataMountPoint
            {
                data = mp,
            };

            Unmount(mountPoint);
            mp = null;
        }
        private void unmountButton_Click(object sender, EventArgs e)
        {
            if (!ps4.IsConnected)
            {
                SetStatus("Not connected to PS4.");
                return;
            }
            if (mp == "")
            {
                SetStatus("No save mounted.");
                return;
            }
            SceSaveDataMountPoint mountPoint = new SceSaveDataMountPoint
            {
                data = mp,
            };

            Unmount(mountPoint);
            mp = null;
            SetStatus("Save Unmounted.");
        }
Exemplo n.º 9
0
        public void TryUnmountExists()
        {
            if (!ps4.IsConnected)
            {
                SetStatus("Not connected to ps4");
                return;
            }

            if (dirsComboBox.Items.Count == 0)
            {
                SetStatus("No save selected");
                return;
            }

            if (selectedGame == null)
            {
                SetStatus("No game selected");
                return;
            }

            if (currentMountPointList.Count == 0)
            {
                SetStatus("No have mounted save on this session");
                return;
            }

            foreach (var currentMountPoint in currentMountPointList.Values)
            {
                SceSaveDataMountPoint mountPoint = new SceSaveDataMountPoint
                {
                    data = ((MountPointStruct)currentMountPoint).MountPoint,
                };

                Unmount(mountPoint);
            }

            dirsComboBox.BorderColor = Color.LightGray;
            SetStatus("All save unmounted");
        }
Exemplo n.º 10
0
        private void createButton_Click(object sender, EventArgs e)
        {
            if (!ps4.IsConnected)
            {
                SetStatus("Not connected to ps4");
                return;
            }
            if (pid == 0)
            {
                SetStatus("Don't forget to setup");
                return;
            }
            if (nameTextBox.Text == "")
            {
                SetStatus("No Save Name");
                return;
            }
            if (selectedGame == null)
            {
                SetStatus("No game selected");
                return;
            }
            var pm = ps4.GetProcessMaps(pid);

            if (pm.FindEntry("(NoName)clienthandler") == null)
            {
                SetStatus("RPC Stub Not Found");
                return;
            }

            var dirNameAddr     = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataDirName)) + 0x10 + 0x41);
            var titleIdAddr     = dirNameAddr + (uint)Marshal.SizeOf(typeof(SceSaveDataDirName));
            var fingerprintAddr = titleIdAddr + 0x10;

            ps4.WriteMemory(pid, fingerprintAddr, "0000000000000000000000000000000000000000000000000000000000000000");
            ps4.WriteMemory(pid, titleIdAddr, selectedGame);
            SceSaveDataDirName dirName = new SceSaveDataDirName
            {
                data = nameTextBox.Text
            };

            SceSaveDataMount mount = new SceSaveDataMount
            {
                userId      = GetUser(),
                dirName     = dirNameAddr,
                blocks      = (ulong)sizeTrackBar.Value,
                mountMode   = 4 | 2 | 8,
                titleId     = titleIdAddr,
                fingerprint = fingerprintAddr
            };
            SceSaveDataMountResult mountResult = new SceSaveDataMountResult
            {
            };

            ps4.WriteMemory(pid, dirNameAddr, dirName);
            var mp = Mount(mount, mountResult);

            ps4.FreeMemory(pid, dirNameAddr, Marshal.SizeOf(typeof(SceSaveDataDirName)) + 0x10 + 0x41);
            if (mp != "")
            {
                SetStatus("Save Created");
                SceSaveDataMountPoint mountPoint = new SceSaveDataMountPoint
                {
                    data = mp,
                };
                Unmount(mountPoint);
            }
            else
            {
                SetStatus("Save Creation Failed");
            }
        }
Exemplo n.º 11
0
        private void mountButton_Click(object sender, EventArgs e)
        {
            if (!ps4.IsConnected)
            {
                SetStatus("Not connected to PS4.");
                return;
            }
            if (dirsComboBox.Items.Count == 0)
            {
                SetStatus("No save selected.");
                return;
            }
            if (selectedGame == null)
            {
                SetStatus("No game selected.");
                return;
            }
            if (mp != "")
            {
                SceSaveDataMountPoint mountPoint = new SceSaveDataMountPoint
                {
                    data = mp,
                };
                Unmount(mountPoint);
                mp = null;
            }
            var dirNameAddr     = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataDirName)) + 0x10 + 0x41);
            var titleIdAddr     = dirNameAddr + (uint)Marshal.SizeOf(typeof(SceSaveDataDirName));
            var fingerprintAddr = titleIdAddr + 0x10;

            ps4.WriteMemory(pid, titleIdAddr, selectedGame);
            ps4.WriteMemory(pid, fingerprintAddr, "0000000000000000000000000000000000000000000000000000000000000000");
            SceSaveDataDirName dirName = new SceSaveDataDirName
            {
                data = dirsComboBox.Text
            };
            SceSaveDataMount mount = new SceSaveDataMount
            {
                userId      = GetUser(),
                dirName     = dirNameAddr,
                blocks      = 32768,
                mountMode   = 0x8 | 0x2,
                titleId     = titleIdAddr,
                fingerprint = fingerprintAddr
            };
            SceSaveDataMountResult mountResult = new SceSaveDataMountResult
            {
            };

            ps4.WriteMemory(pid, dirNameAddr, dirName);
            mp = Mount(mount, mountResult);
            ps4.FreeMemory(pid, dirNameAddr, Marshal.SizeOf(typeof(SceSaveDataDirName)) + 0x10 + 0x41);
            if (mp != "")
            {
                SetStatus($"Save Mounted under /mnt/pfs/");
            }
            else
            {
                SetStatus("Mounting failed.");
            }
        }