Пример #1
0
 private void connectCex_Click(object sender, EventArgs e)
 {
     PS3.ChangeAPI(SelectAPI.ControlConsole);
     if (connectCex.Text == "Connect [ CEX ]")
     {
         if (PS3.ConnectTarget())
         {
             flatLabel2.ForeColor = Color.White;
             flatLabel2.Text      = "Connected";
             connectCex.Text      = "Attach";
         }
         else
         {
             flatLabel2.Text      = "Can't Connect";
             flatLabel2.ForeColor = Color.Red;
         }
     }
     else if (connectCex.Text == "Attach")
     {
         if (PS3.AttachProcess())
         {
             flatLabel3.ForeColor = Color.White;
             flatLabel3.Text      = "Attached";
             RPC.Enable();
         }
         else
         {
             flatLabel3.Text      = "Can't Attach";
             flatLabel3.ForeColor = Color.Red;
         }
     }
 }
Пример #2
0
 private void ConnectButton_Click(object sender, EventArgs e)
 {
     if (PS3.ConnectTarget())
     {
         MessageBox.Show("Connected to target", "Connected", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
     }
     else
     {
         MessageBox.Show("Could not connect to target", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
     }
 }
Пример #3
0
        /// <summary>
        /// Handle PS3 RTE connection
        /// </summary>
        private void pS3CCAPIToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (PS3_CCAPI_CONNECTED)
            {
                PS3.DisconnectTarget();
                connectionToolStripMenuItem.Text = "Connection";
                PS3_CCAPI_CONNECTED = false;
                attachProcessToolStripMenuItem.Enabled     = false;
                initializeGuarderToolStripMenuItem.Enabled = false;
                enableForceHostToolStripMenuItem.Enabled   = false;
                MessageBox.Show("You are now disconnected from PS3 CCAPI", "MW3Guard", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else if (PS3.ConnectTarget())
            {
                string Message = "You are now connected with this API : " + PS3.GetCurrentAPIName();
                MessageBox.Show(Message, "MW3Guard", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);

                connectionToolStripMenuItem.Text = "Disconnect";
                PS3_CCAPI_CONNECTED = true;
                attachProcessToolStripMenuItem.Enabled     = true;
                initializeGuarderToolStripMenuItem.Enabled = false;
            }
            else
            {
                string Message = "Impossible to connect :/";
                MessageBox.Show(Message, "MW3Guard", MessageBoxButtons.OK, MessageBoxIcon.Error);
                PS3_CCAPI_CONNECTED = false;
                connectionToolStripMenuItem.Text           = "Connection";
                attachProcessToolStripMenuItem.Enabled     = false;
                initializeGuarderToolStripMenuItem.Enabled = false;
            }
        }
Пример #4
0
        bool Connection(SelectAPI API)
        {
            PS3.ChangeAPI(API);
            bool state = PS3.ConnectTarget();

            if (state)
            {
                ctext.Text      = state ? "Connected" : "Not Connected";
                ctext.ForeColor = state ? Color.Blue : Color.Red;
                state           = PS3.AttachProcess();
                if (state)
                {
                    atext.Text      = state ? "Attached" : "Not Attached";
                    atext.ForeColor = state ? Color.Blue : Color.Red;
                    MLevel.Enabled  = true;
                    MMoney.Enabled  = true;
                    GOD.Enabled     = true;
                    speed.Enabled   = true;
                    weapons.Enabled = true;
                    physics.Enabled = true;
                    clip.Enabled    = true;
                }
            }
            return(state);
        }
Пример #5
0
        static PS3API ConnectAndAttach(SelectAPI api)
        {
            PS3API PS3 = new PS3API(api);

            try {
                if (!PS3.ConnectTarget())
                {
                    PrintWithColor("[ERROR] Could not connect and attach.", ConsoleColor.Red);
                    return(null);
                }
                if (!PS3.AttachProcess())
                {
                    PrintWithColor("[ERROR] Could not attach to process.", ConsoleColor.Red);
                    return(null);
                }
                string message = string.Format("[INFO] Connected and attached to {0}.", PS3.GetConsoleName());
                PrintWithColor(message, ConsoleColor.Blue);

                return(PS3);
            }
            catch {
                PrintWithColor("[ERROR] Could not connect or attach. Check internet connection.", ConsoleColor.Red);

                return(null);
            }
        }
Пример #6
0
 private void cButton1_Click(object sender, EventArgs e)
 {
     CCAPI.ConsoleInfo Console = Consoles.ElementAt(targetList.SelectedIndex);
     try
     {
         if (PS3.ConnectTarget(Console.Ip))
         {
             label5.Text = PS3.CCAPI.GetFirmwareVersion();
             label6.Text = PS3.CCAPI.GetFirmwareType();
             label9.Text = PS3.CCAPI.GetTemperatureCELL() + " °";
             label4.Text = PS3.CCAPI.GetTemperatureRSX() + " °";
             MessageBox.Show("Votre PS3 est bien connectée !" + teamstring, "Connectée", MessageBoxButtons.OK, MessageBoxIcon.Information);
             //PS3.CCAPI.RingBuzzer(CCAPI.BuzzerMode.Single);
             PS3.CCAPI.Notify(CCAPI.NotifyIcon.INFO, "Connectee !" + teamstring);
         }
         else
         {
             MessageBox.Show("Une erreur est survenue", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Une erreur est survenue", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #7
0
 private void metroButton1_Click(object sender, EventArgs e)
 {
     PS3.ConnectTarget(0);
     PS3.CCAPI.Notify(CCAPI.NotifyIcon.INFO, "PsToolPro est connecter");
     PS3.CCAPI.RingBuzzer(CCAPI.BuzzerMode.Single);
     MessageBox.Show("PSToolPro est connecté avec succès.", "Connecté avec succès.");
     metroLabel1.Text = "Connecter: Oui";
 }
Пример #8
0
 private void monoFlat_Button1_Click(object sender, EventArgs e)
 {
     PS3.ChangeAPI(SelectAPI.ControlConsole);
     PS3.ConnectTarget();
     PS3.AttachProcess();
     MessageBox.Show("Vous éte connecter & attacher ;)");
     monoFlat_Button1.Text = "PS3 connecter";
 }
Пример #9
0
 private void monoFlat_Button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (PS3.ConnectTarget() && PS3.AttachProcess())
         {
             RPC.Enable_RPC();
             byte[] buffer  = new byte[0x530];
             byte[] buffer2 = buffer;
             byte[] buffer3 = new byte[] {
                 0x38, 0x60, 0, 0, 60, 0x80, 2, 0, 0x30, 0x84, 80, 0, 0x4b, 0xf3, 0x35, 9,
                 0x4b, 0xff, 0xfb, 0x7c
             };
             byte[] buffer4 = new byte[] {
                 130, 0xb9, 0, 0, 60, 0xe0, 0, 0xd7, 0x3d, 0x80, 0, 0x92, 0x56, 0xa4, 0x38, 0x30,
                 0x56, 0xbb, 0x18, 0x38
             };
             byte[] buffer5 = new byte[] {
                 0x73, 0x65, 0x74, 0x20, 0x70, 0x61, 0x72, 0x74, 0x79, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x20, 0x31,
                 0x3b, 0x6f, 110, 0x6c, 0x69, 110, 0x65, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x31, 0x3b, 0x6f, 110,
                 0x6c, 0x69, 110, 0x65, 0x67, 0x61, 0x6d, 0x65, 0x61, 110, 100, 0x68, 0x6f, 0x73, 0x74, 0x20,
                 0x31, 0x3b, 0x6f, 110, 0x6c, 0x69, 110, 0x65, 0x75, 110, 0x72, 0x61, 110, 0x6b, 0x65, 100,
                 0x67, 0x61, 0x6d, 0x65, 0x61, 110, 100, 0x68, 0x6f, 0x73, 0x74, 0x20, 0x30, 0x3b, 0x6d, 0x69,
                 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 110, 0x5f, 0x6d, 0x73, 0x67, 0x74, 0x69, 0x6d, 0x65, 0x6f,
                 0x75, 0x74, 0x20, 0x30, 0x3b, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 110, 0x5f, 0x74,
                 0x69, 0x6d, 0x65, 0x42, 0x65, 0x74, 0x77, 0x65, 0x65, 110, 0x20, 0x39, 0x39, 0x39, 0x39, 0x39,
                 0x39, 0x3b, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 110, 80, 0x69, 110, 0x67, 0x54,
                 0x69, 0x6d, 0x65, 0x20, 0x30, 0x3b, 0x70, 0x61, 0x72, 0x74, 0x79, 0x5f, 0x6d, 0x69, 110, 0x70,
                 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x31, 0x3b, 0x70, 0x61, 0x72, 0x74, 0x79, 0x5f, 0x6d,
                 0x61, 0x74, 0x63, 0x68, 0x65, 100, 80, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, 0x75, 110,
                 0x74, 0x20, 0x30, 0x3b, 0x70, 0x61, 0x72, 0x74, 0x79, 0x5f, 0x63, 0x6f, 110, 110, 0x65, 0x63,
                 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x20, 0x31, 0x30, 0x30, 0x30, 0x3b, 0x70, 0x61,
                 0x72, 0x74, 0x79, 0x5f, 0x63, 0x6f, 110, 110, 0x65, 0x63, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f,
                 0x75, 0x74, 0x20, 0x31, 0x22, 0
             };
             buffer = new byte[] { 0x41 };
             byte[] buffer6 = buffer;
             buffer = new byte[] { 0x40 };
             byte[] buffer7 = buffer;
             PS3.SetMemory(0x2005000, buffer5);
             PS3.SetMemory(0x466298, buffer6);
             PS3.SetMemory(0x4667b4, buffer3);
             Thread.Sleep(15);
             PS3.SetMemory(0x466298, buffer7);
             PS3.SetMemory(0x4667b4, buffer4);
             PS3.SetMemory(0x2005000, buffer2);
             MessageBox.Show("Connected !", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("Not Connected !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Not Connected !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #10
0
        private void btnConnect_ClickButtonArea(object Sender, MouseEventArgs e)
        {
            if (PS3.ConnectTarget(0))
            {
                useCCAPI.Enabled = false;
                useTMAPI.Enabled = false;

                if (PS3.AttachProcess())
                {
                    notifyBlackOps2("^2Hooked to Atomic", "Successfully connected and attached", "party_ready");

                    PopupBox.lblStatus.Text = "Successfully connected and attached \nGsc mods restored";
                    PopupBox.Text           = "Success";
                    PopupBox.ShowDialog(this);
                    btnConnectAttach.Text = "Connected && Attached to Black Ops II";

                    btnConnectAttach.Enabled = false;
                    btnSetName.Enabled       = true;
                    txtChangeName.Enabled    = true;

                    btnConnectAttach.ForeColor = Color.DarkGray;
                    btnSetName.ForeColor       = Color.White;

                    lblTitleModMenu.ForeColor   = Color.White;
                    cmboItemsGscMenus.Enabled   = true;
                    lblTitleGameMode.ForeColor  = Color.White;
                    cmboItemsGscModes.Enabled   = true;
                    lblTitleModMenuZM.ForeColor = Color.White;
                    cmboItemsGscMenusZM.Enabled = true;


                    Original     = 0x3045E820;
                    New          = 0x10040000;
                    Pointer      = 0x140C2D0;
                    OriginalByte = new byte[] { 0x30, 0x45, 0xE8, 0x20 };
                    NewByte      = new byte[] { 0x10, 0x04, 0x00, 0x00 };

                    PS3.Extension.WriteUInt32(Pointer, Original);
                }
                else
                {
                    PopupBox.lblStatus.Text = "Unable to attach to game process";
                    PopupBox.Text           = "Error";
                    PopupBox.ShowDialog(this);
                }
            }
            else
            {
                PopupBox.lblStatus.Text = "Unable to connect to PS3";
                PopupBox.Text           = "Error";
                PopupBox.ShowDialog(this);
            }
        }
Пример #11
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (PS3.ConnectTarget())
     {
         MessageBox.Show("Connected");
     }
     else
     {
         string Message = "Connexion Impossible";
         MessageBox.Show(Message, "Error...", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #12
0
        /*---Connection methods---*/

        //Connects the PS3 to the tool using the current API (TMAPI or CCAPI). Will throw an error if using RPCS3 API instead.
        public bool PS3ConnectTarget()
        {
            //A check that the current API is PS3 just in case.
            if (CurrentAPI == SelectAPI.PS3Lib)
            {
                return(PS3API.ConnectTarget());
            }
            else
            {
                MessageBox.Show("The current API must be set to PS3 to use this method!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(false);
        }
Пример #13
0
 private void Connect_Click(object sender, EventArgs e)
 {
     try
     {
         if (PS3.ConnectTarget(0)) //If there is a connection between the PS3 and computer
         {
             MessageBox.Show("Connected", "Successful", MessageBoxButtons.OK);
         }
     }
     catch (Exception) //Handles the exception if the PS3 is not connected
     {
         MessageBox.Show("Unable To Connect To Process", "Unsuccessful", MessageBoxButtons.OK);
     }
 }
Пример #14
0
 private bool targetConnect()
 {
     if (PS3API.ConnectTarget())
     {
         attachButton.IsEnabled = true;
         MessageBox.Show("Connected to target");
         return(true);
     }
     else
     {
         MessageBox.Show("Could not connect to target");
     }
     return(false);
 }
Пример #15
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            // Select API
            SelectAPI API;

            if (tMAPIToolStripMenuItem.Checked)
            {
                API = SelectAPI.TargetManager;
            }
            else if (cCAPIToolStripMenuItem.Checked)
            {
                API = SelectAPI.ControlConsole;
            }
            else
            {
                API = SelectAPI.TargetManager;
            }
            PS3.ChangeAPI(API);

            // Attempt to connect to target
            if (!PS3.ConnectTarget())
            {
                DialogResult dialogResult = MessageBox.Show("Could not connect to target", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                // If the user clicks the retry button
                if (dialogResult == DialogResult.Retry)
                {
                    toolStripButton1_Click(sender, e);
                }

                return;
            }

            // Attempt to attach to process
            if (!PS3.AttachProcess())
            {
                DialogResult dialogResult = MessageBox.Show("Could not attach to process", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                // If the user clicks the retry button
                if (dialogResult == DialogResult.Retry)
                {
                    toolStripButton1_Click(sender, e);
                }

                return;
            }

            // If the user successfully connects and attaches
            tabControl1.Enabled = true;                                      // Enable features of the program
            statusPrint("Successfully connected and attached", Color.Green); // Print success at the bottom of the screen
        }
Пример #16
0
 private void btnConnect_Click(object sender, EventArgs e)
 {
     if (PS3.ConnectTarget())
     {
         EnableOthersBox(true);
         string Message = "You are now connected with this API : " + PS3.GetCurrentAPIName();
         MessageBox.Show(Message, "Connected!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
     else
     {
         EnableOthersBox(false);
         string Message = "Impossible to connect :/";
         MessageBox.Show(Message, "Error...", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #17
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         PS3.ConnectTarget(0);
         label16.Text      = "Connected!";
         label16.ForeColor = Color.Green;
     }
     catch
     {
         MessageBox.Show("Could not connect! Is the PS3 even on? lol", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         label16.Text      = "Failed!";
         label16.ForeColor = Color.Gold;
     }
 }
Пример #18
0
        private void connect_button_Click(object sender, EventArgs e)
        {
            if (PS3.ConnectTarget())
            {
                MessageBox.Show("Target connected!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);

                connect_button.Text      = "Connected";
                connect_button.ForeColor = Color.HotPink;

                attach_button.Enabled = true;
            }
            else
            {
                MessageBox.Show("Could not connect to target", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #19
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (PS3.ConnectTarget(0))
         {
             PS3.AttachProcess();
             MessageBox.Show($"Connected and Attached with {PS3.GetCurrentAPIName()} ");
         }
         else
         {
             MessageBox.Show("Could not Connect/attach");
         }
     }
     catch { MessageBox.Show(e.ToString()); }
 }
Пример #20
0
        private void MetroButton1_Click(object sender, EventArgs e)
        {
            try

            {
                PS3.ConnectTarget(0);

                MessageBox.Show("Successfully Connected to Target!", "Connected", MessageBoxButtons.OK, MessageBoxIcon.Information);
                PS3.CCAPI.Notify(CCAPI.NotifyIcon.WRONGWAY, "Connected to PC");
            }

            catch

            {
                MessageBox.Show("Failed to Connect", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #21
0
 private void button7_Click(object sender, EventArgs e)
 {
     try
     {
         if (!PS3.ConnectTarget())
         {
             label2.Text = "Status: Not Connected || Not Attached";
         }
         else
         {
             label2.Text = "Status: Connected || Not Attached";
         }
     }
     catch (Exception)
     {
         label2.Text = "Status: Not Connected || Not Attached";
     }
 }
Пример #22
0
 private void flatButton1_Click(object sender, EventArgs e)
 {
     try
     {
         if (PS3.ConnectTarget(0))
         {
             int MsgC = (int)MessageBox.Show("PS3 Has Been Connected", "Success", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
         else
         {
             int MsgE = (int)MessageBox.Show("No Ps3 Can Be Connected Try Again...", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
     }
     catch (Exception ex)
     {
         int MsgE = (int)MessageBox.Show("No Ps3 Can Be Connected Try Again...", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
 }
Пример #23
0
 private void firefoxButton1_Click(object sender, EventArgs e)
 {
     try
     {
         if (PS3.ConnectTarget())
         {
             MessageBox.Show("Playstation 3 Connected !", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("An Error As Occured", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("An Error As Occured", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Пример #24
0
        private void skyDarkButton1_Click(object sender, EventArgs e)
        {
            try
            {
                if (PS3.ConnectTarget() && PS3.AttachProcess())
                {
                    if (skyDarkCheck1.Checked)
                    {
                        PS3.SetMemory(0x5bc86c, new byte[1]);
                        PS3.Extension.ReadUInt32(0x5bedc4);
                        PS3.Extension.ReadUInt32(0x5bcdbc);
                        PS3.Extension.ReadUInt32(0x668960);
                        PS3.Extension.ReadUInt32(0x668fa0);
                        PS3.Extension.ReadUInt32(0x7ec434);
                        PS3.Extension.ReadUInt32(0x678f68);
                        PS3.Extension.ReadUInt32(0x5bcd24);
                        PS3.Extension.ReadUInt32(0x79542c);
                        PS3.Extension.ReadUInt32(0x795444);

                        toolStripStatusLabel5.Text      = "Enable !";
                        toolStripStatusLabel5.ForeColor = Color.Lime;
                    }
                    toolStripStatusLabel2.Text      = "Linked !";
                    toolStripStatusLabel2.ForeColor = Color.Lime;
                    byte[] FPSOn = new byte[] { 0x2C, 0x03, 0x01 };
                    PS3.SetMemory(FPSEnable, FPSOn);
                    byte[] FPSXs = new byte[] { 0x43, 0x62 };
                    PS3.SetMemory(FPSX, FPSXs);
                    byte[] FPSYs = new byte[] { 0x41, 0xD8 };
                    PS3.SetMemory(FPSY, FPSYs);
                    WriteText("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n^1-- ^5P^7ress ^2Start Menu ^5T^7o ^5I^7nitialise ^5M^7enu ^1--");
                }
                else
                {
                    toolStripStatusLabel2.Text      = "Failed to link PS3 !";
                    toolStripStatusLabel2.ForeColor = Color.Red;
                }
            }
            catch (Exception)
            {
                toolStripStatusLabel2.Text      = "Failed to link PS3 !";
                toolStripStatusLabel2.ForeColor = Color.Red;
            }
        }
        /// <summary>
        /// Connect and attach to your PlayStation 3.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ConnectAndAttachButton_Click(object sender, RoutedEventArgs e)
        {
            clickSound.Play();

            if (mainPS3.ConnectTarget())
            {
                if (mainPS3.AttachProcess())
                {
                    isConnected = true;
                }

                // Failed to attach.
                else
                {
                    if (currentAPI == SelectAPI.ControlConsole)
                    {
                        MessageBox.Show("Connected, but failed to attach with: \"Control Console API\"", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                    }

                    else if (currentAPI == SelectAPI.TargetManager)
                    {
                        MessageBox.Show("Connected, but failed to attach with: \"Target Manager API\"", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
            }

            // Failed to connect.
            else
            {
                if (currentAPI == SelectAPI.ControlConsole)
                {
                    MessageBox.Show("Failed to connect & attach with: \"Control Console API\"", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                }

                else if (currentAPI == SelectAPI.TargetManager)
                {
                    MessageBox.Show("Failed to connect & attach with: \"Target Manager API\"", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Пример #26
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     try
     {
         if (PS3.ConnectTarget())
         {
             label1.Text           = "PS3 Connected | Not Attached";
             label1.ForeColor      = Color.Lime;
             simpleButton4.Enabled = true;
             simpleButton1.Enabled = false;
         }
         else
         {
             groupControl2.Enabled = false;
             XtraMessageBox.Show("Failed to Connect PS3 !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     catch (Exception)
     {
         XtraMessageBox.Show("Failed to Connect PS3 !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Пример #27
0
 private void elegantThemeButton1_Click(object sender, EventArgs e)
 {
     try
     {
         if (PS3.ConnectTarget() && PS3.AttachProcess())
         {
             toolStripStatusLabel2.Text      = "Linked !";
             toolStripStatusLabel2.ForeColor = Color.Lime;
             WritePPC();
         }
         else
         {
             toolStripStatusLabel2.Text      = "Not Linked !";
             toolStripStatusLabel2.ForeColor = Color.Red;
         }
     }
     catch (Exception)
     {
         toolStripStatusLabel2.Text      = "Not Linked !";
         toolStripStatusLabel2.ForeColor = Color.Red;
     }
 }
Пример #28
0
 public static void Connect1()
 {
     ChangeAPI(SelectAPI.ControlConsole);
     CEX.ConnectTarget();
 }
Пример #29
0
 public static void Connect()
 {
     PS3TMAPI.InitTargetComms();
     PS3TMAPI.Connect(0, null);
     DEX.ConnectTarget();
 }
Пример #30
0
        static void Main(string[] args)
        {
            /*
             * Check and create default files
             */
            // Create _cheat.gsc in working directory if it doesnt exist
            if (!File.Exists("_cheat.gsc"))
            {
                byte[] cheat_buffer = Properties.Resources._cheat;
                File.WriteAllBytes("_cheat.gsc", cheat_buffer);
            }
            // Create config.json in working directory if it doesnt exist
            if (!File.Exists("config.json"))
            {
                Config config = new Config();
                config.API                      = 0;          // 0 = TMAPI, 1 = CCAPI
                config.Hook.Path                = "_cheat.gsc";
                config.Hook.Pointer             = 0x00E92738; // _cheat.gsc pointer address in rawfile table
                config.Hook.Default.Buffer      = 0x30368E40; // Default _cheat.gsc buffer address stored at the pointer
                config.Hook.Default.Length      = 0x0000092E; // Default _cheat.gsc length, not the modified one
                config.Hook.Custom.Buffer       = 0x02000000; // Modified _cheat.gsc buffer address to be set at the pointer
                config.Injection.Pointer        = 0x00E9281C; // _dev.gsc pointer address in rawfile table
                config.Injection.Default.Buffer = 0x3037A8C0; // Default _dev.gsc buffer address stored at the pointer
                config.Injection.Default.Length = 0x00000040; // Default _dev.gsc length, not the modified one
                /*NOTE: There is no custom injection buffer address because we just grab the one for the hook and add the length of the hook script to it*/
                // Write config.json to disk
                WriteConfig(config);
            }
            // Load config and set it for the current session
            _config = JsonConvert.DeserializeObject <Config>(File.ReadAllText("config.json"));

            /*
             * Parameter parsing
             */
            if (args.Length > 0)
            {
                switch (args[0])
                {
                default:     // Inject project dir
                    _project_dir = args[0];
                    // Check if project dir exists
                    if (!Directory.Exists(_project_dir))
                    {
                        Console.WriteLine("ERROR: Directory doesn't exist");
                        return;
                    }
                    // Check if 'main.gsc' exists in dir
                    if (!File.Exists(_project_dir + @"\main.gsc"))
                    {
                        Console.WriteLine("ERROR: 'main.gsc' does not exist in root of project directory");
                        return;
                    }
                    break;

                case "change-api":
                case "api":
                    _config.API = (_config.API == 0) ? 1 : 0;
                    WriteConfig(_config);
                    Console.WriteLine("Changed active API to " + ((_config.API == 0) ? "TMAPI" : "CCAPI"));
                    return;

                case "reset":
                case "r":
                    UpdateRawfileTable(_config.Hook.Pointer, _config.Hook.Default.Buffer, _config.Hook.Default.Length);
                    UpdateRawfileTable(_config.Injection.Pointer, _config.Injection.Default.Buffer, _config.Injection.Default.Length);
                    break;
                }
            }
            else
            {
                Console.WriteLine("ERROR: No project directory defined");
                return;
            }

            /*
             * Connect and attach PS3
             */
            _PS3 = new PS3API(_config.API == 0 ? SelectAPI.TargetManager : SelectAPI.ControlConsole);
            if (!_PS3.ConnectTarget())
            {
                Console.WriteLine("ERROR: Could not connect to target");
                return;
            }

            if (!_PS3.AttachProcess())
            {
                Console.WriteLine("ERROR: Could not attach to process");
                return;
            }

            /*
             * Project creation
             */
            _project = Directory.GetFiles(_project_dir, "*.gsc", SearchOption.AllDirectories).ToList();
            // Iterate through each file in project
            for (int i = 0; i < _project.Count; i++)
            {
                /*Syntax check*/
                // File is not empty
                string data = File.ReadAllText(_project[i]);
                if (!string.IsNullOrWhiteSpace(data))
                {
                    // Check if any errors were returned
                    string err = GSCGrammar.CheckSyntax(File.ReadAllText(_project[i]));
                    if (!string.IsNullOrWhiteSpace(err))
                    {
                        Console.WriteLine("ERROR: Syntax on line " + err + " in " + _project[i]);
                        return;
                    }
                }
                // Move 'main.gsc' to top of project list
                if (_project[i] == _project_dir + @"\main.gsc")
                {
                    string pop = _project[i];
                    _project.RemoveAt(i);
                    _project.Insert(0, pop);
                }
            }
            foreach (string element in _project)
            {
                Console.WriteLine(element.Replace(_project_dir, ""));
            }

            /*
             * Plaintext buffer creation
             */
            string ptbuffer = string.Join("\n", _project.Select(x => File.ReadAllText(x)));

            /*
             * Compression and injection
             */
            byte[] hook_buffer = CompileScript(File.ReadAllBytes(_config.Hook.Path));
            byte[] inj_buffer  = CompileScript(Encoding.ASCII.GetBytes(ptbuffer));
            // Inject files
            InjectScript(_config.Hook.Pointer, _config.Hook.Custom.Buffer, hook_buffer);
            InjectScript(_config.Injection.Pointer, _config.Hook.Custom.Buffer + (uint)inj_buffer.Length, inj_buffer);

            /*
             * Done
             */
            Console.WriteLine("Successfully injected scripts");
        }