Esempio n. 1
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);
        }
Esempio n. 2
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);
        }