public static string[] GameInfoArray() { PS4 = main.PS4; string procName = "SceCdlgApp"; string entryName = "libSceCdlgUtilServer.sprx"; ulong titleId = 0xA0; ulong version = 0xC8; int prot = 3; string[] result = new string[2]; try { PS4.Connect(); ProcessList pl = PS4.GetProcessList(); foreach (Process p in pl.processes) { if (p.name == procName) { ProcessInfo pi = PS4.GetProcessInfo(p.pid); for (int i = 0; i < pi.entries.Length; i++) { MemoryEntry me = pi.entries[i]; if (me.prot == prot && me.name == entryName) { result[0] = PS4.ReadString(p.pid, me.start + titleId); result[1] = PS4.ReadString(p.pid, me.start + version); return(result); } } } } return(new string[] { null, null }); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Error); return(new string[] { null, null }); } }
public static String readString(Int32 procId, UInt64 address) { String returnStr = String.Empty; try { mutex.WaitOne(); returnStr = ps4RPC.ReadString(procId, address); } catch (Exception ex) { Console.WriteLine("Error during ReadString:\r\nEncoding: {0}, Address: {1}\r\n{2}", "UTF8", address.ToString("X"), ex.ToString()); } finally { mutex.ReleaseMutex(); } return(returnStr); }