static void Main(string[] args) { PS4RPC ps4 = new PS4RPC("192.168.1.107"); ps4.Connect(); ProcessList pl = ps4.GetProcessList(); foreach (Process p in pl.processes) { Console.WriteLine(p.name); } Process p = pl.FindProcess("SceShellCore"); ProcessInfo pi = ps4.GetProcessInfo(p.pid); ulong executable = 0; for (int i = 0; i < pi.entries.Length; i++) { MemoryEntry me = pi.entries[i]; if (me.prot == 5) { Console.WriteLine("executable base " + me.start.ToString("X")); executable = me.start; break; } } byte[] b = ps4.ReadMemory(p.pid, executable, 256); Console.Write(HexDump(b)); ulong stub = ps4.InstallRPC(p.pid); ProcessInfo pi = ps4.GetProcessInfo(p.pid); MemoryEntry vme = pi.FindEntry("libSceLibcInternal.sprx", true); // dissasemble libSceLibcInternal.sprx to get these offsets (4.05) int sys_getpid = (int)ps4.Call(p.pid, stub, vme.start + 0xE0); Console.WriteLine("sys_getpid: " + sys_getpid); int time = (int)ps4.Call(p.pid, stub, vme.start + 0x4430, 0); Console.WriteLine("time: " + time); ps4.Disconnect(); Console.ReadKey(); }
public static Boolean initPS4RPC(String ipAddress) { try { mutex.WaitOne(); if (ps4RPC != null) { ps4RPC.Disconnect(); } ps4RPC = new PS4RPC(ipAddress); ps4RPC.Connect(); } catch { } finally { mutex.ReleaseMutex(); } return(ps4RPC != null); }
static void Main(string[] args) { PS4RPC ps4 = new PS4RPC("192.168.1.107"); ps4.Connect(); ProcessList pl = ps4.GetProcessList(); foreach (string a in pl.procnames) { Console.WriteLine(a); } int pid = pl.GetPidContainsName("SceShellCore"); ProcessInfo pi = ps4.GetProcessInfo(pid); ulong executable = 0; for (int i = 0; i < pi.entries.Length; i++) { ProcessInfo.VirtualMemoryEntry vme = pi.entries[i]; if (vme.prot == 5) { Console.WriteLine("executable base " + vme.start.ToString("X")); executable = vme.start; break; } } byte[] b = ps4.ReadMemory(pid, executable, 256); Console.Write(HexDump(b)); ps4.Disconnect(); Console.ReadKey(); }