Exemplo n.º 1
0
        private void Mount_Button_Click(object sender, EventArgs e)
        {
            if (Dirs_ComboBox.Items.Count == 0)
            {
                return;
            }
            var dirNameAddr            = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataDirName)));
            SceSaveDataDirName dirName = new SceSaveDataDirName
            {
                data = Dirs_ComboBox.Text
            };

            SceSaveDataMount2 mount = new SceSaveDataMount2
            {
                userId    = InitialUser(),
                dirName   = dirNameAddr,
                blocks    = 32768,
                mountMode = mm,
            };
            SceSaveDataMountResult mountResult = new SceSaveDataMountResult
            {
            };

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

            ps4.FreeMemory(pid, dirNameAddr, Marshal.SizeOf(typeof(SceSaveDataDirName)));
        }
Exemplo n.º 2
0
        private string Mount(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);

            if (ps4.Call(pid, stub, libSceSaveDataBase + offsets.sceSaveDataMount2, mountAddr, mountResultAddr) == 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("");
        }