Ejemplo n.º 1
0
        // Token: 0x06000CED RID: 3309 RVA: 0x00041B18 File Offset: 0x0003FD18
        public bool ConnectTarget(string TargetName)
        {
            if (TMAPI.AssemblyLoaded)
            {
                this.PS3TMAPI_NET();
            }
            TMAPI.AssemblyLoaded = false;
            bool flag = PS3TMAPI.SUCCEEDED(PS3TMAPI.InitTargetComms());

            if (flag)
            {
                flag = PS3TMAPI.SUCCEEDED(PS3TMAPI.GetTargetFromName(TargetName, out TMAPI.Target));
                flag = PS3TMAPI.SUCCEEDED(PS3TMAPI.Connect(TMAPI.Target, null));
            }
            return(flag);
        }
Ejemplo n.º 2
0
        public ConnectionStatus Connect()
        {
            PS3TMAPI.SNRESULT result = PS3TMAPI.InitTargetComms();
            if (PS3TMAPI.FAILED(result))
            {
                throw new DevkitNotFoundException();
            }

            result = PS3TMAPI.Connect(this.TargetIndex, null);
            if (PS3TMAPI.FAILED(result))
            {
                throw new DevkitConnectFailedException();
            }

            return(this.ConnectionStatus = ConnectionStatus.Connected);
        }
Ejemplo n.º 3
0
 public static string GetGame()
 {
     PS3TMAPI.ProcessInfo processInfo = new PS3TMAPI.ProcessInfo();
     PS3TMAPI.GetProcessInfo(0, ProcessID, out processInfo);
     string str = processInfo.Hdr.ELFPath.Split(new char[] { '/' })[3];
     try
     {
         WebClient client = new WebClient();
         ServicePointManager.ServerCertificateValidationCallback = (param0, param1, param2, param3) => true;
         return client.DownloadString("https://a0.ww.np.dl.playstation.net/tpl/np/" + str + "/" + str + "-ver.xml").Replace("<TITLE>", ";").Split(new char[] { ';' })[1].Replace("</TITLE>", ";").Split(new char[] { ';' })[0];
     }
     catch
     {
         return str;
     }
 }
Ejemplo n.º 4
0
        public string GetCurrentGame()
        {
            PS3TMAPI.ProcessInfo processInfo = new PS3TMAPI.ProcessInfo();
            PS3TMAPI.GetProcessInfo(0, ProcessID(), out processInfo);
            string GameCode = processInfo.Hdr.ELFPath.Split('/')[3];

            try {
                WebClient client = new System.Net.WebClient();
                ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); };
                string content = client.DownloadString(String.Format("https://a0.ww.np.dl.playstation.net/tpl/np/{0}/{1}-ver.xml", GameCode, GameCode)).Replace("<TITLE>", ";");
                return(content.Split(';')[1].Replace("</TITLE>", ";").Split(';')[0].Replace("Â", ""));
            }
            catch {
                return("Unknown Game");
            }
        }
            // Token: 0x06000D03 RID: 3331 RVA: 0x000421C4 File Offset: 0x000403C4
            public string GetStatus()
            {
                string result;

                if (TMAPI.AssemblyLoaded)
                {
                    result = "NotConnected";
                }
                else
                {
                    TMAPI.Parameters.connectStatus = PS3TMAPI.ConnectStatus.Connected;
                    PS3TMAPI.GetConnectStatus(TMAPI.Target, out TMAPI.Parameters.connectStatus, out TMAPI.Parameters.usage);
                    TMAPI.Parameters.Status = TMAPI.Parameters.connectStatus.ToString();
                    result = TMAPI.Parameters.Status;
                }
                return(result);
            }
Ejemplo n.º 6
0
        public bool Connect(string TargetName)
        {
            bool result = false;

            if (AssemblyLoaded)
            {
                PS3TMAPI_NET();
            }
            AssemblyLoaded = false;
            result         = PS3TMAPI.SUCCEEDED(PS3TMAPI.InitTargetComms());
            if (result)
            {
                result = PS3TMAPI.SUCCEEDED(PS3TMAPI.GetTargetFromName(TargetName, out Target));
                result = PS3TMAPI.SUCCEEDED(PS3TMAPI.Connect(Target, null));
            }
            return(result);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Connect the target by is name.
        /// </summary>
        /// <param name="TargetName"></param>
        /// <returns></returns>
        public bool ConnectTarget(string TargetName)
        {
            if (AssemblyLoaded)
            {
                PS3TMAPI_NET();
            }
            AssemblyLoaded = false;
            bool result = PS3TMAPI.SUCCEEDED(PS3TMAPI.InitTargetComms());

            if (result)
            {
                PS3TMAPI.SUCCEEDED(PS3TMAPI.GetTargetFromName(TargetName, out Target));
                result    = PS3TMAPI.SUCCEEDED(PS3TMAPI.Connect(Target, null));
                IPAddress = result ? GetConnectionInfo().IPAddress : "127.0.0.1";
            }
            IsConnected = result;
            return(result);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Connect the default target and initialize the dll. Possible to put an int as arugment for determine which target to connect.
        /// </summary>
        /// <param name="TargetIndex"></param>
        /// <returns></returns>
        public bool ConnectTarget(int TargetIndex = 0)
        {
            if (AssemblyLoaded)
            {
                PS3TMAPI_NET();
            }
            AssemblyLoaded = false;
            Target         = TargetIndex;
            bool result = PS3TMAPI.SUCCEEDED(PS3TMAPI.InitTargetComms());

            if (result)
            {
                PS3TMAPI.SUCCEEDED(PS3TMAPI.Connect(TargetIndex, null));
                IPAddress = result ? GetConnectionInfo().IPAddress : "127.0.0.1";
            }
            IsConnected = result;
            return(result);
        }
Ejemplo n.º 9
0
 /// <summary>Reset target to XMB , Sometimes the target restart quickly.</summary>
 public void ResetToXMB(ResetTarget flag)
 {
     if (flag == ResetTarget.Hard)
     {
         resetParameter = PS3TMAPI.ResetParameter.Hard;
     }
     else if (flag == ResetTarget.Quick)
     {
         resetParameter = PS3TMAPI.ResetParameter.Quick;
     }
     else if (flag == ResetTarget.ResetEx)
     {
         resetParameter = PS3TMAPI.ResetParameter.ResetEx;
     }
     else if (flag == ResetTarget.Soft)
     {
         resetParameter = PS3TMAPI.ResetParameter.Soft;
     }
     PS3TMAPI.Reset(Target, resetParameter);
 }
Ejemplo n.º 10
0
        public bool AttachProcess()
        {
            PS3TMAPI.GetProcessList(Target, out Parameters.ProcessIDs);

            if (Parameters.ProcessIDs.Length > 0)
            {
                ulong uProcess = Parameters.ProcessIDs[0];
                Parameters.ProcessID = Convert.ToUInt32(uProcess);

                PS3TMAPI.GetModuleList(Target, Parameters.ProcessID, out Parameters.ModuleIDs);
                PS3TMAPI.ProcessAttach(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID);
                PS3TMAPI.ProcessContinue(Target, Parameters.ProcessID);

                GetThreadInfo();

                Parameters.Info = "The Process 0x" + Parameters.ProcessID.ToString("X8") + " Has Been Attached!";
                return(true);
            }

            return(false);
        }
Ejemplo n.º 11
0
        public bool SetPowerState(PowerState state, bool isForce = false)
        {
            if (this.ConnectionStatus != ConnectionStatus.Connected)
            {
                return(false);
            }

            PS3TMAPI.SNRESULT result = PS3TMAPI.SNRESULT.SN_E_COMMS_ERR;
            switch (state)
            {
            case PowerState.Off:
                result = PS3TMAPI.PowerOff(this.TargetIndex, isForce);
                break;

            case PowerState.On:
                result = PS3TMAPI.PowerOn(this.TargetIndex);
                break;
            }

            return(PS3TMAPI.SUCCEEDED(result));
        }
Ejemplo n.º 12
0
        public static void GetThreadInfo()
        {
            PS3TMAPI.GetProcessInfo(Target, Parameters.ProcessID, out PS3TMAPI.ProcessInfo processInfo);

            if (processInfo.ThreadIDs.Length <= 0)
            {
                return;
            }

            for (int i = 0; i < processInfo.ThreadIDs.Length; i++)
            {
                PS3TMAPI.GetPPUThreadInfo(Target, Parameters.ProcessID, processInfo.ThreadIDs[i], out Parameters.threadInfo);

                if (Parameters.threadInfo.ThreadName == null)
                {
                    continue;
                }
                if (Parameters.threadInfo.ThreadName.Contains("EBOOT"))
                {
                    break;
                }
            }
        }
Ejemplo n.º 13
0
        /// <summary>Attach and continue the current process from the target.</summary>
        public bool AttachProc()
        {
            bool isOK = false;

            PS3TMAPI.GetProcessList(Target, out Parameters.processIDs);
            if (Parameters.processIDs.Length > 0)
            {
                isOK = true;
            }
            else
            {
                isOK = false;
            }
            if (isOK)
            {
                ulong uProcess = Parameters.processIDs[0];
                Parameters.ProcessID = Convert.ToUInt32(uProcess);
                PS3TMAPI.ProcessAttach(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID);
                PS3TMAPI.ProcessContinue(Target, Parameters.ProcessID);
                Parameters.info = "The Process 0x" + Parameters.ProcessID.ToString("X8") + " Has Been Attached !";
            }
            return(isOK);
        }
Ejemplo n.º 14
0
        public bool AttachProcess()
        {
            if (this.ConnectionStatus != ConnectionStatus.Connected)
            {
                return(false);
            }

            PS3TMAPI.SNRESULT result = PS3TMAPI.GetProcessList(this.TargetIndex, out Params.processIDs);
            if (PS3TMAPI.FAILED(result))
            {
                throw new DevKitAttachProcessFailedException($"{Enum.GetName(typeof(PS3TMAPI.SNRESULT), result)}");
            }

            if (Params.processIDs.Length > 0)
            {
                Params.processID = Convert.ToUInt32(Params.processIDs[0]);
                PS3TMAPI.ProcessAttach(this.TargetIndex, UNIT, Params.processID);
                Console.WriteLine(Params.processID);

                return(PS3TMAPI.SUCCEEDED(PS3TMAPI.ProcessContinue(this.TargetIndex, Params.processID)));
            }

            return(false);
        }
Ejemplo n.º 15
0
        public bool GetThreadByName(string name, ref PS3TMAPI.PPUThreadInfo LocalthreadInfo)
        {
            PS3TMAPI.GetProcessInfo(Target, Parameters.ProcessID, out PS3TMAPI.ProcessInfo processInfo);

            if (processInfo.ThreadIDs.Length <= 0)
            {
                return(false);
            }

            for (int i = 0; i < processInfo.ThreadIDs.Length; i++)
            {
                PS3TMAPI.GetPPUThreadInfo(Target, Parameters.ProcessID, processInfo.ThreadIDs[i], out LocalthreadInfo);

                if (LocalthreadInfo.ThreadName == null)
                {
                    continue;
                }
                if (LocalthreadInfo.ThreadName.Contains(name))
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 16
0
        public bool AttachProcess()
        {
            try
            {
                PS3TMAPI.GetProcessList(Target, out Parameters.processIDs);

                if (Parameters.processIDs.Length > 0)
                {
                    ulong uProcess = Parameters.processIDs[0];
                    Parameters.ProcessID = Convert.ToUInt32(uProcess);

                    PS3TMAPI.GetModuleList(Target, Parameters.ProcessID, out Parameters.ModuleIDs);
                    PS3TMAPI.ProcessAttach(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID);
                    PS3TMAPI.ProcessContinue(Target, Parameters.ProcessID);

                    GetThreadInfo();

                    Parameters.info = $"The Process 0x{Parameters.ProcessID:X8} Has Been Attached!";
                    return(true);
                }
            }
            catch { }
            return(false);
        }
 // Token: 0x06000CF7 RID: 3319 RVA: 0x00041D3C File Offset: 0x0003FF3C
 public string GetString(uint Address, uint lengthString)
 {
     byte[] bytes = new byte[lengthString];
     PS3TMAPI.ProcessGetMemory(TMAPI.Target, PS3TMAPI.UnitType.PPU, TMAPI.Parameters.ProcessID, 0uL, (ulong)Address, ref bytes);
     return(TMAPI.Hex2Ascii(TMAPI.ReplaceString(bytes)));
 }
Ejemplo n.º 18
0
 /// <summary>Get a bytes array with the length input.</summary>
 public byte[] GetBytes(uint Address, uint lengthByte)
 {
     byte[] Longueur = new byte[lengthByte];
     PS3TMAPI.ProcessGetMemory(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID, 0, Address, ref Longueur);
     return(Longueur);
 }
Ejemplo n.º 19
0
 /// <summary>Get memory from the address.</summary>
 public void GetProcMem(uint Address, byte[] Bytes)
 {
     PS3TMAPI.ProcessGetMemory(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID, 0, Address, ref Bytes);
 }
Ejemplo n.º 20
0
 /// <summary>Set memory to the address (byte[]).</summary>
 public void SetProcMem(uint Address, ulong value)
 {
     byte[] b = BitConverter.GetBytes(value);
     Array.Reverse(b);
     PS3TMAPI.ProcessSetMemory(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID, 0, Address, b);
 }
Ejemplo n.º 21
0
 public void InitComms()
 {
     PS3TMAPI.InitTargetComms();
 }
Ejemplo n.º 22
0
 public void ContinueThreadByID(ulong ID)
 {
     PS3TMAPI.ThreadContinue(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID, ID);
 }
Ejemplo n.º 23
0
 /// <summary>Power off selected target.</summary>
 public void PowerOff(bool Force)
 {
     PS3TMAPI.PowerOff(Target, Force);
 }
Ejemplo n.º 24
0
 /// <summary>Disconnect the target.</summary>
 public void Disconnect()
 {
     PS3TMAPI.Disconnect(Target);
 }
Ejemplo n.º 25
0
 public uint ProcessID()
 {
     PS3TMAPI.GetProcessList(Target, out Parameters.ProcessIDs);
     Parameters.ProcessID = Parameters.ProcessIDs[0];
     return(Parameters.ProcessID);
 }
Ejemplo n.º 26
0
 public uint[] ProcessIDs()
 {
     PS3TMAPI.GetProcessList(Target, out Parameters.ProcessIDs);
     return(Parameters.ProcessIDs);
 }
 // Token: 0x06000CF6 RID: 3318 RVA: 0x00041D08 File Offset: 0x0003FF08
 public byte[] GetBytes(uint Address, uint lengthByte)
 {
     byte[] result = new byte[lengthByte];
     PS3TMAPI.ProcessGetMemory(TMAPI.Target, PS3TMAPI.UnitType.PPU, TMAPI.Parameters.ProcessID, 0uL, (ulong)Address, ref result);
     return(result);
 }
 // Token: 0x06000CF5 RID: 3317 RVA: 0x00041CEB File Offset: 0x0003FEEB
 public void GetMemory(uint Address, byte[] Bytes)
 {
     PS3TMAPI.ProcessGetMemory(TMAPI.Target, PS3TMAPI.UnitType.PPU, TMAPI.Parameters.ProcessID, 0uL, (ulong)Address, ref Bytes);
 }
 // Token: 0x06000CF3 RID: 3315 RVA: 0x00041C78 File Offset: 0x0003FE78
 public void SetMemory(uint Address, ulong value)
 {
     byte[] bytes = BitConverter.GetBytes(value);
     Array.Reverse(bytes);
     PS3TMAPI.ProcessSetMemory(TMAPI.Target, PS3TMAPI.UnitType.PPU, TMAPI.Parameters.ProcessID, 0uL, (ulong)Address, bytes);
 }
Ejemplo n.º 30
0
        public uint[] ModuleIds()
        {
            PS3TMAPI.GetModuleList(Target, Parameters.ProcessID, out Parameters.ModuleIDs);

            return(Parameters.ModuleIDs);
        }