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 #2
0
 public static void writeString(Int32 procId, UInt64 address, String str)
 {
     try {
         mutex.WaitOne();
         ps4RPC.WriteString(procId, address, str);
     } catch (Exception ex) {
         Console.WriteLine("Error during WriteString:\r\nEncoding: {0}, Address: {1}, String: {2}\r\n{3}",
                           "UTF8", address.ToString("X"), str, ex.ToString());
     } finally {
         mutex.ReleaseMutex();
     }
 }