Advertisement
BaSs_HaXoR

How to CONNECT and ATTACH to PS3 C#

Aug 13th, 2014
925
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.03 KB | None | 0 0
  1. //This is a tutorial how to connect and attach, and setmemory in C#.
  2. //IMPORT your libraries needed...
  3.  
  4. /*Make sure you have this in your project
  5.  
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Threading.Tasks;
  14. using System.Windows.Forms;
  15. using System.IO;
  16. using System.Reflection;
  17. using System.Management;
  18.  
  19. */
  20.  
  21. using PS3Lib; //Makes PS3Lib available... Also make sure to add it to references!!
  22. public partial class Form1 : Form
  23.     {
  24.         public Form1()
  25.         {
  26.             InitializeComponent();
  27.         }
  28.  
  29. public PS3Lib.PS3API PS3 = new PS3Lib.PS3API(PS3Lib.SelectAPI.ControlConsole);//Sets Current API to Control Console
  30.        
  31. //Make a label, and name it "connectionlabel" (without quotes)
  32. //Make 2 radiobuttons.
  33.  
  34. //Your two radio buttons should look like this:
  35.  
  36. private void radioButton1_CheckedChanged(object sender, EventArgs e)
  37.         {
  38.             PS3.ChangeAPI(PS3Lib.SelectAPI.ControlConsole);
  39.         }
  40.  
  41.         private void radioButton2_CheckedChanged(object sender, EventArgs e)
  42.         {
  43.             PS3.ChangeAPI(PS3Lib.SelectAPI.TargetManager);
  44.         }
  45. //Put the text on radio button1 as "CEX"
  46. //Put the text on radio button2 as "DEX"
  47.  
  48.  
  49.  
  50.  private void button1_Click(object sender, EventArgs e)
  51.         {
  52.             string API = PS3.GetCurrentAPIName();//This will get your current API... Whether its Control Console or TMAPI
  53.             if (API == "Control Console")
  54.             {
  55. //Make a textbox & name it "ipaddress" (without quotes)
  56.                 if (Convert.ToBoolean(PS3.ConnectTarget(ipaddress.Text)) == true)
  57.                 {
  58.                     PS3.AttachProcess();
  59.                     PS3.CCAPI.RingBuzzer(PS3Lib.CCAPI.BuzzerMode.Single);
  60.                     PS3.CCAPI.Notify(PS3Lib.CCAPI.NotifyIcon.FRIEND, "Connected and attached!");
  61.                     connectionlabel.Text = "Connected and Attached.";
  62.                     connectionlabel.ForeColor = Color.Black;
  63.                 }
  64.                 else
  65.                 {
  66.                     connectionlabel.Text = "Failed to Connect and Attach!";
  67.                     connectionlabel.ForeColor = Color.Red;
  68.                 }
  69.             }
  70.             else
  71.             {
  72.                 if (Convert.ToBoolean(PS3.ConnectTarget()) == true)//This is for DEX to connect & attach
  73.                 {
  74.                     PS3.AttachProcess();
  75.                     connectionlabel.Text = "Connected and Attached.";
  76.                     connectionlabel.ForeColor = Color.Black;
  77.                 }
  78.                 else
  79.                 {
  80.                     connectionlabel.Text = "Failed to Connect and Attach!";
  81.                     connectionlabel.ForeColor = Color.Red;
  82.                 }
  83.             }
  84.         }
  85.  
  86. //Make a button
  87.  
  88. private void button5_Click(object sender, EventArgs e)
  89.         {
  90.         PS3.SetMemory(0x000000, 0x00);
  91.         //MW3 name example
  92.         PS3.Extension.WriteString(0x1BBBC2C, "^2BaSs^5_^2HaXoR");
  93.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement