Пример #1
0
        private string TransferMount(SceSaveDataTransferringMount mount, SceSaveDataMountResult mountResult)
        {
            var mountAddr       = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataTransferringMount)));
            var mountResultAddr = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataMountResult)));

            ps4.WriteMemory(pid, mountAddr, mount);
            ps4.WriteMemory(pid, mountResultAddr, mountResult);
            var ret = ps4.Call(pid, stub, libSceSaveDataBase + offsets.sceSaveDataTransferringMount, mountAddr, mountResultAddr);

            WriteLog($"sceSaveDataTransferringMount ret = 0x{ret:X}");
            if (ret == 0)
            {
                mountResult = ps4.ReadMemory <SceSaveDataMountResult>(pid, mountResultAddr);

                ps4.FreeMemory(pid, mountAddr, Marshal.SizeOf(typeof(SceSaveDataTransferringMount)));
                ps4.FreeMemory(pid, mountResultAddr, Marshal.SizeOf(typeof(SceSaveDataMountResult)));

                return(mountResult.mountPoint.data);
            }

            ps4.FreeMemory(pid, mountAddr, Marshal.SizeOf(typeof(SceSaveDataTransferringMount)));
            ps4.FreeMemory(pid, mountResultAddr, Marshal.SizeOf(typeof(SceSaveDataMountResult)));

            return("");
        }
Пример #2
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;
            }
            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 in {mp}");
            }
            else
            {
                SetStatus("Mounting Failed");
            }
        }
Пример #3
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");
            }
        }
Пример #4
0
        private void tMountButton_Click(object sender, EventArgs e)
        {
            if (tDirsComboBox.Items.Count == 0)
            {
                return;
            }
            var dirNameAddr            = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataDirName)));
            var fingerprintAddr        = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataFingerprint)));
            var titleidAddr            = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataTitleId)));
            SceSaveDataDirName dirName = new SceSaveDataDirName
            {
                data = tDirsComboBox.Text
            };
            SceSaveDataFingerprint fingerprint = new SceSaveDataFingerprint
            {
                //verify keystone patch is applied
                data = "0000000000000000000000000000000000000000000000000000000000000000"
            };
            SceSaveDataTitleId titleid = new SceSaveDataTitleId
            {
                data = titleIdTextBox.Text
            };
            SceSaveDataMount mount = new SceSaveDataMount
            {
                userId      = GetUser(),
                titleId     = titleidAddr,
                dirName     = dirNameAddr,
                fingerprint = fingerprintAddr,
                mountMode   = 0x01,
            };

            SceSaveDataMountResult mountResult = new SceSaveDataMountResult();

            ps4.WriteMemory(pid, dirNameAddr, dirName);
            ps4.WriteMemory(pid, fingerprintAddr, fingerprint);
            ps4.WriteMemory(pid, titleidAddr, titleid);
            mp = Mount(mount, mountResult);

            ps4.FreeMemory(pid, dirNameAddr, Marshal.SizeOf(typeof(SceSaveDataDirName)));
            ps4.FreeMemory(pid, fingerprintAddr, Marshal.SizeOf(typeof(SceSaveDataFingerprint)));
            ps4.FreeMemory(pid, titleidAddr, Marshal.SizeOf(typeof(SceSaveDataTitleId)));
            if (mp != "")
            {
                SetStatus($"Save Mounted in {mp}");
            }
            else
            {
                SetStatus("T Mounting Failed");
            }
        }
Пример #5
0
        private void mountButton_Click(object sender, EventArgs e)
        {
            if (dirsComboBox.Items.Count == 0)
            {
                return;
            }
            var dirNameAddr            = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataDirName)));
            SceSaveDataDirName dirName = new SceSaveDataDirName
            {
                data = dirsComboBox.Text
            };

            SceSaveDataMount2 mount = new SceSaveDataMount2
            {
                userId    = GetUser(),
                dirName   = dirNameAddr,
                blocks    = 32768,
                mountMode = 0x8 | 0x2,
            };
            SceSaveDataMountResult mountResult = new SceSaveDataMountResult
            {
            };

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

            ps4.FreeMemory(pid, dirNameAddr, Marshal.SizeOf(typeof(SceSaveDataDirName)));
            if (mp != "")
            {
                SetStatus($"Save Mounted in {mp}");
            }
            else
            {
                SetStatus("Mounting Failed");
            }
        }
Пример #6
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");
            }
        }
Пример #7
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;
            }
            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);
            var mountPointLocation = Mount(mount, mountResult);

            ps4.FreeMemory(pid, dirNameAddr, Marshal.SizeOf(typeof(SceSaveDataDirName)) + 0x10 + 0x41);
            if (mountPointLocation != "")
            {
                currentMountPointList?.Add(((SearchEntry)dirsComboBox.SelectedItem).dirName, new MountPointStruct()
                {
                    Directory  = dirsComboBox.SelectedItem,
                    Title      = selectedGame,
                    MountPoint = mountPointLocation
                });

                dirsComboBox.BorderColor = Color.LimeGreen;

                WriteLog($"Current Mount Point list: {currentMountPointList}");
                SetStatus($"Save Mounted in {mountPointLocation}");
            }
            else
            {
                SetStatus("Mounting Failed");
            }
        }