Exemple #1
0
        private void get_processes_btn_Click(object sender, EventArgs e)
        {
            try
            {
                PS4RPC ps4 = new PS4RPC(ip_box.Text);
                ps4.Connect();
                MemoryHelper memoryHelper = new MemoryHelper(ps4);

                this.processes_comboBox.Items.Clear();
                ProcessList pl = ps4.GetProcessList();
                foreach (Process process in pl.processes)
                {
                    this.processes_comboBox.Items.Add(process.name);
                }

                processManager = new ProcessManager();
                processManager.MemoryHelper = memoryHelper;

                this.processes_comboBox.SelectedIndex = 0;
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, exception.Source, MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
        public static ProcessList GetProcessList()
        {
            mutex.WaitOne();
            ProcessList processList = ps4.GetProcessList();

            mutex.ReleaseMutex();
            return(processList);
        }
        public static void Notify(string text, int type = 222)
        {
            PS4 = main.PS4;
            ulong diff;

            if (version == 405)
            {
                diff = 0x300;
            }
            else if (version == 455)
            {
                diff = 0x350;
            }
            else if (version == 505)
            {
                diff = 0x330;
            }
            else
            {
                diff = 0x330;
            }

            PS4.Connect();

            if (notifyPid == -1)
            {
                ProcessList pl = PS4.GetProcessList();

                foreach (Process p in pl.processes)
                {
                    if (p.name == "SceSysCore.elf")
                    {
                        notifyPid = p.pid;
                    }
                }
            }

            ProcessInfo pi = PS4.GetProcessInfo(notifyPid);

            if (notifyStub == 0)
            {
                notifyStub         = PS4.InstallRPC(notifyPid);
                libSceLibcInternal = pi.FindEntry("libSceLibcInternal.sprx");
            }

            ulong stringbuf = malloc(text.Length + 1);

            PS4.WriteString(notifyPid, stringbuf, text);

            MemoryEntry libSceSysUtil = pi.FindEntry("libSceSysUtil.sprx");

            PS4.Call(notifyPid, notifyStub, libSceSysUtil.start + diff, type, stringbuf);

            free(stringbuf);
        }
Exemple #4
0
        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();
        }
        private void button3_Click(object sender, EventArgs e)
        {
            try {
                comboBox1.Items.Clear();

                pList = PS4.GetProcessList();
                foreach (Process p in pList.processes)
                {
                    comboBox1.Items.Add(p.name);
                }
            }
            catch (Exception) {
                label1.Text = "Error";
                MessageBox.Show("Unable to Grab Processes", "Are you connected?");
            }
        }
Exemple #6
0
        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 });
            }
        }
Exemple #7
0
 void GetProcesses()
 {
     try
     {
         Proccesses_ComboBox.Items.Clear();
         pList = ps4.GetProcessList();
         Process[] processes = pList.processes;
         foreach (Process process in processes)
         {
             Proccesses_ComboBox.Items.Add(process.name);
         }
     }
     catch (Exception)
     {
         CurrentStatus_Label.ForeColor = Color.Red;
         CurrentStatus_Label.Text      = "Unable to grab processes";
     }
 }
Exemple #8
0
        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();
        }
Exemple #9
0
        public static void attachToGame(string processName, string gameName, ref bool att, ref int pid, ref ulong procEntry, ref List <ulong> _entryList, ref ulong stub, ref ulong stringbuf, bool initRpc = false)
        {
            var cusa = GameInfoArray()[0]; var version = GameInfoArray()[1];

            PS4 = main.PS4;
            try
            {
                PS4.Connect();

                ProcessList pl = PS4.GetProcessList();
                ProcessInfo pi;

                foreach (Process p in pl.processes)
                {
                    if (p.name == processName)
                    {
                        pid = p.pid;
                        pi  = PS4.GetProcessInfo(p.pid);
                        _entryList.Clear();

                        for (int i = 0; i < pi.entries.Length; i++)
                        {
                            MemoryEntry me = pi.entries[i];
                            _entryList.Add(me.start);
                        }

                        for (int i = 0; i < pi.entries.Length; i++)
                        {
                            MemoryEntry me = pi.entries[i];
                            if (me.prot == 5)
                            {
                                procEntry = me.start;

                                if (initRpc)
                                {
                                    if (stub == 0)
                                    {
                                        stub = PS4.InstallRPC(pid);
                                        vme  = pi.FindEntry("libSceLibcInternal.sprx");

                                        if (Calling.version == 405)
                                        {
                                            stringbuf = PS4.Call(pid, stub, vme.start + 0x382F0, 0x1000);
                                        }
                                        else if (Calling.version == 455)
                                        {
                                            stringbuf = PS4.Call(pid, stub, vme.start + 0x2C2A0, 0x1000);
                                        }
                                        else if (Calling.version == 505)
                                        {
                                            stringbuf = PS4.Call(pid, stub, vme.start + 0x23D90, 0x1000);
                                        }
                                        else
                                        {
                                            stringbuf = PS4.Call(pid, stub, vme.start + 0x23D90, 0x1000);
                                        }
                                    }
                                }

                                Calling.Notify("PS4 Trainer by TylerMods\n\nAttached to " + gameName + "!\n\n\n\n\n\n", 210);
                                Launching.main.lblAttached.Text = "Attached : True";
                                var result = Regex.Replace(
                                    "Attached : True",        // input
                                    @"Attached",              // word to match
                                    @"<b>$0</b>",             // "wrap match in bold tags"
                                    RegexOptions.IgnoreCase); // ignore case when matching
                                Launching.main.lblCUSA.Text        = $"CUSA : {cusa}";
                                Launching.main.lblGameVersion.Text = $"Version : {version}";
                                Launching.main.lblGame.Text        = $"Game : {gameName}";
                                break;
                            }
                        }
                        //MessageBox.Show("Successfully detected game process.\n\nAttached to process (" + p.name + ", " + pid + ")!", "Game Detected", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        att = true;
                        return;
                    }
                }

                MessageBox.Show("Failed to detect game process.\nMake sure " + gameName + " is running!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                att = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Launching.main.lblAttached.Text    = "Attached : False";
                Launching.main.lblCUSA.Text        = "CUSA : Not Attached";
                Launching.main.lblGameVersion.Text = "Version : Not Attached";
                Launching.main.lblGame.Text        = "Game : Not Attached";
            }
        }