コード例 #1
0
ファイル: MemoryHelper.cs プロジェクト: caesarlzh/PS4_Cheater
 public static byte[] ReadMemory(ulong address, int length)
 {
     mutex.WaitOne();
     byte[] buf = ps4.ReadMemory(ProcessID, address, length);
     mutex.ReleaseMutex();
     return(buf);
 }
コード例 #2
0
 private void button7_Click(object sender, EventArgs e)
 {
     if (selectedProcess != null && pList != null)
     {
         try {
             Process process = pList.FindProcess(selectedProcess);
             MemoryData = PS4.ReadMemory(process.pid, Convert.ToUInt64(textBox3.Text, 16), Convert.ToInt32(textBox4.Text, 16));
             MemoryStream            stream       = new MemoryStream(MemoryData);
             DynamicFileByteProvider byteProvider = new DynamicFileByteProvider(stream);
             hexBox1.ByteProvider = byteProvider;
         }
         catch (Exception) {
             label1.Text = "Error";
             MessageBox.Show("Unable to Peek Memory");
         }
     }
     else
     {
         MessageBox.Show("Select a Process First");
     }
 }
コード例 #3
0
ファイル: Example.cs プロジェクト: kx001001/jkpatch
        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();
        }
コード例 #4
0
 public static Byte[] readByteArray(Int32 procId, UInt64 address, Int32 size)
 {
     Byte[] returnBuf = null;
     try {
         mutex.WaitOne();
         returnBuf = ps4RPC.ReadMemory(procId, address, size);
     } catch (Exception ex) {
         Console.WriteLine("Error during ReadByteArray:\r\nAddress: {0}, Size: {1}\r\n{2}",
                           address.ToString("X"), size, ex.ToString());
     } finally {
         mutex.ReleaseMutex();
     }
     return(returnBuf ?? new Byte[1]);
 }
コード例 #5
0
ファイル: example.cs プロジェクト: KG5RKI/jkpatch
        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();
        }