Пример #1
0
        private string Mount2(SceSaveDataMount2 mount, SceSaveDataMountResult mountResult)
        {
            var mountAddr       = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataMount2)));
            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.sceSaveDataMount2, mountAddr, mountResultAddr);

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

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

                return(mountResult.mountPoint.data);
            }

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

            return("");
        }
Пример #2
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");
            }
        }
Пример #3
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");
            }
        }