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