public GameInfo(PS4DBG PS4) { string procName = "SceCdlgApp"; string entryName = "libSceCdlgUtilServer.sprx"; string uProcName = "SceShellUI"; string uEntryName = "SceLoginMgrSmallStackJobQueue"; ulong _userName = 0xEA494; ulong _titleId = 0xA0; ulong _version = 0xC8; int prot = 3; string[] result = new string[3]; try { 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); } } } if (p.name == uProcName) { ProcessInfo p2 = PS4.GetProcessInfo(p.pid); for (int i = 0; i < p2.entries.Length; i++) { MemoryEntry m = p2.entries[i]; if (m.prot == prot && m.name == uEntryName) { result[2] = PS4.ReadString(p.pid, m.start + _userName); } } } } } catch (Exception ex) { //MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Error); } titleID = result[0]; version = result[1]; username = result[2]; }
private void AttachButton_Click(object sender, EventArgs e) { if (this.ProcessComboBox.Text.Contains(":")) { string[] strArray = this.ProcessComboBox.Text.Split(':'); int int32 = Convert.ToInt32(strArray[0], 10); this.ps4.AttachDebugger(int32, new PS4DBG.DebuggerInterruptCallback(this.DebuggerInterruptCallback)); this.attachpid = int32; this.mapview = new MemoryMapView(ps4.GetProcessInfo(attachpid), this.ps4.GetProcessMaps(attachpid)); this.ps4.Notify(222, "attached to " + strArray[1]); this.MainPanel.Enabled = true; this.AttachButton.Enabled = false; this.DetachButton.Enabled = true; } else { int num = (int)MessageBox.Show("Please select a process in the list! Or press refresh then select!", "Debug Watch", MessageBoxButtons.OK, MessageBoxIcon.Hand); } }