private void tSearchButton_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; } titleIdTextBox.Text = titleIdTextBox.Text.ToUpper().Replace("-", "").Replace(" ", ""); if (titleIdTextBox.Text.Length != 9) { SetStatus("Invalid Title"); return; } var dirNameAddr = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataDirName)) * 1024); var paramAddr = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataParam)) * 1024); var titleidAddr = ps4.AllocateMemory(pid, Marshal.SizeOf(typeof(SceSaveDataTitleId))); SceSaveDataTitleId titleid = new SceSaveDataTitleId { data = titleIdTextBox.Text }; SceSaveDataDirNameSearchCond searchCond = new SceSaveDataDirNameSearchCond { userId = GetUser(), titleId = titleidAddr }; SceSaveDataDirNameSearchResult searchResult = new SceSaveDataDirNameSearchResult { dirNames = dirNameAddr, dirNamesNum = 1024, param = paramAddr, }; ps4.WriteMemory(pid, titleidAddr, titleid); tDirsComboBox.DataSource = Find(searchCond, searchResult); ps4.FreeMemory(pid, dirNameAddr, Marshal.SizeOf(typeof(SceSaveDataDirName)) * 1024); ps4.FreeMemory(pid, paramAddr, Marshal.SizeOf(typeof(SceSaveDataParam)) * 1024); ps4.FreeMemory(pid, titleidAddr, Marshal.SizeOf(typeof(SceSaveDataTitleId))); if (tDirsComboBox.Items.Count > 0) { SetStatus($"Found {tDirsComboBox.Items.Count} Save Directories :D"); } else { SetStatus("Found 0 Save Directories :("); } }
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"); } }