[TUT] C# and PS3Lib v4.3

  • Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

Infremo

Member
May 24, 2014
23
2
63
Hey ConsoleCrunch. For the people that would like to know how to program an RTM tool in C# with CEX (CCAPI) and DEX (TMAPI) compatibility, I present to you a written tutorial. (Note that this tutorial is for beginners - intermediate users so the process will be somewhat slow)

THIS WILL BE FOR MODERN WARFARE 2 TO REDUCE RISK OF YOUR BAN!

Requirements:
-Visual Studio
-PS3Lib v4.3 (RECOMENDED)

Alright lets start off. First things first, create a new C# windows forms application in Visual Studio (File > New > Project > C# > Windows Forms Application)

Once you have done that you want to go to the top menus and select: Project > Add Reference > Browse) Then search for PS3Lib.dll wherever you downloaded it to. Then press "Add" and then "Okay".

Now, you can resize the Form however you like! well make it moderately small for the sake of the tutorial..to do that, click the form and drag out using the anchors like so:

http://gyazo.com/bc9d8a6ff302632f250d2f2e0c6662f5

Now what you want to do is give the form some personalization. And NO I don't mean using DevComponents or any other UI framework! I mean changing the name up top^.^
-To do this, you want to click on your form to select it. Then there will be a panel on the lower right part of the Application(default VS layout). Now search for the tab that says "Text". Change that to whatever you want the application name to be.
Example: http://gyazo.com/234a610bffa45df4fac92ba634144e70
you can also change the start up position to CenterScreen for easier going design ^.^

Now that we have that out of the way, lets start coding :) First double click the form to open up the code for the form.


Now that we've done that and have our code open, we want to go to the way top of the for and include PS3Lib in our project! to do that all we have to do is type the following into our project below the other "using" statements. Like this:

Code:
using PS3Lib.dll

It's now included in our project! What we want to do now is create some new instances for CCAPI and PS3API. To do that were going to want to type "public static PS3API API = new PS3API();" as well as "CCAPI CC = new CCAPI();" below where it says "publicpartialclassForm1.
it should look something like this:

Code:
publicpartialclassForm1 : Form
{
publicstaticPS3API API = newPS3API();
CCAPI CC = newCCAPI();
this will make things easier for us.

Now on your form, you want to add the following: (you do this by clicking on toolbox and dragging and dropping onto form)
2 Radiobuttons(CCAPI, TMAPI) <-Text
3 buttons (Connect, Attach, Disconnect) <-Text
1 Textbox
1 Label
1 timer
to name the buttons, click on the button and go to the lower right window in VS(default) find text and change to the button names listed above.

It should look something similar to this: http://gyazo.com/a3f7f35279e4bbe7b4209c6e54dcefc8

What you want to do now is double click the radio button with the text "TMAPI" on it. Now it should have opened code where the action for the radio button is placed. inside of the curlybraces for the radio button action, you want to type the following:

Code:
privatevoid tmapirbtn_CheckedChanged(object sender, EventArgs e) //<--TMAPI Radio button clicked action
{
API.ChangeAPI(SelectAPI.TargetManager); //Code inside of the action
}

You now want to go back to your form and double click on "CCAPI" radio button.
Under the action you want to type something similar to the TMAPI radio button code:

Code:
privatevoid CEXrbtn_CheckedChanged(object sender, EventArgs e) //CCAPI Radio Button clicked action
{
API.ChangeAPI(SelectAPI.ControlConsole); //Code inside of the action
}
What we just did is prepare for when we connect. When we code the connect button, it will connect to the selected API(TMAPI or CCAPI).

Now go back to your form and double click on the connect button.(You should now be at the code for the connect button)
What you want to type for the connect button is as follows:

Code:
privatevoid connectbtn_Click(object sender, EventArgs e) //CONNECT Button clicked
{

try  //Actions
{
       API.ConnectTarget();
        API.CCAPI.Notify(CCAPI.NotifyIcon.CAUTION, "Connected...");
      MessageBox.Show("Connected");
}
    catch
    {
        MessageBox.Show("Failure to Connect");
    }
}
What we just did was make the code to connect to our PS3! Nice!
The "try" and the "catch" statements work like this. It will "try" to perform the code inside the curlybraces below it, and if the code is un successful it will spit out whatevers in the curlybraces for the "catch" statement. MessageBox is a notification on your PC screen. The line that says "API.CCAPI.Notify....."Displays the words "Connected..." on your PS3 Screen(Where it shows when friends are online).

Now lets try to Attach to our PS3! Go back to your form and double click on the attach button now...
inside the code for the attach button, you will put the following:

Code:
privatevoid attachbtn_Click(object sender, EventArgs e) // ATTACH BUTTON/FUNCTIONS
{
   try
    {
            
      API.CCAPI.Notify(CCAPI.NotifyIcon.ARROWRIGHT, "Connected and Attached!");
     MessageBox.Show("Attached! Enjoy!");

    }
   catch
    {

     MessageBox.Show("Error attaching!");
      API.CCAPI.Notify(CCAPI.NotifyIcon.WRONGWAY, "Failed to attach!");
      API.CCAPI.RingBuzzer(CCAPI.BuzzerMode.Double);

    }
}
What we just did was attach to our PS3! The only new thing we've incorporated here was the line API.CCAPI.RingBuzzer.."
What that does is ring the buzzer on your PS3! as you can see its in the "catch" statement so if it fails to attach it'll make that noise..just a nifty feature I thought I'd put in there for you lot :D

Now lets code the Disconnect button! So as you probably already guessed, go back to our form and double click on the "Disconnect" button :p
in the button, the code should look like this:

Code:
privatevoid disconnectbtn_Click(object sender, EventArgs e) // DISCONNECT BUTTON
{
  try
  {

   MessageBox.Show("Disconnected succesfully!");       
   API.CCAPI.Notify(CCAPI.NotifyIcon.CAUTION, "Disconnected!");
   API.CCAPI.RingBuzzer(CCAPI.BuzzerMode.Single);
   API.DisconnectTarget();
  }
  catch
  {
      MessageBox.Show("Cannot Disconnect")
   }
}
That is the code to disconnect. The reason we put a try/catch is if the PS3 is not connected, then you can't disconnect. (Im not sure if that code will work because I haven't tested it for the reason being it wont interfere with the tool)


YAY THE CONNECTION PART IS DONE!
But the tool isn't ;)

Alright, this will just be a simple name changer (auto update, messagebox, whatever)
It will automatically change your name in a pre-game lobby on party.
so NOW what we want to do is click on the timer icon at the bottom of the screen(form tab) and the go to the panel in the lower right side of VS(default) and change two things. Firstly, put enabled set to false and Interval anywhere from 50-100.
now, double click on the timer icon at the bottom of the screen and type the code for the timer as follows:

Code:
privatevoid timer1_Tick(object sender, EventArgs e)
  {
     byte[] buffer = Encoding.ASCII.GetBytes(textBox1.Text); //Gets bytes from the textbox
     Array.Resize(ref buffer, buffer.Length + 1); //Adds on to the bytes of the textbox
     API.SetMemory(0x01F9F11C, buffer); //sends the modified memory to the PS3
  }
[/COLOR]
What we just did was send modified memory to mw2. Now we just have to enable the timer and we will be finished :)

Now, go back to the form, and double click on the textbox. in the code all you have to type is :
Code:
privatevoid textBox1_TextChanged(object sender, EventArgs e)
   {
       timer1.Start();
   }

Congrats everyone, you just made your first RTM tool using PS3Lib. In order to change your game from mw2 to another COD(or game) simply change the offset to the name offset of another COD. I hope this helped you guys on your quest of coding :)


ALSO always remember to press connect before attach otherwise youll get an error.
To more experienced coders I understand all the things I could've fixed in this but its for the sake of learning and for beginners! So don't correct me I know what I'm doing! If I made a mistake please tell me :p

If you need ANY help at all , want a request, or just do not understand something, don't hesitate to ask :) Happy Modding! :)
 
General chit-chat
Help Users
  • @ EMRR:
    Can you help me?
  • @ QM|T_JinX:
    het bro nice work man
  • @ QM|T_JinX:
    with ?
  • @ EMRR:
    What do you mean? I can't understand "with ?"
  • @ QM|T_JinX:
    you ask can you help me and i said with what can i help you out
  • @ EMRR:
    Can you help me about share my generated CID's? Where can i share it on this website?
  • @ QM|T_JinX:
    you can put it in cid section or ps3 section in general
  • @ EMRR:
    Ok, thanks :)
  • @ QM|T_JinX:
    np bro
  • Chat Bot:
    EMRR has started a new thread called "Working Console ID" in Console ID's.
  • Chat Bot:
    EMRR has started a new thread called "Console ID 1" in Console ID's.
  • Chat Bot:
    wadu is our newest member. Welcome!
  • Chat Bot:
    EMRR has started a new thread called "Console ID 2" in Console ID's.
  • Chat Bot:
    QM|T_JinX has posted a new reply in the thread "Console ID 2".
  • @ lurch6661:
    gold hen out soon
  • Chat Bot:
    Christo has joined the room.
  • @ lurch6661:
    zap
  • @ lurch6661:
    trying to figure out how to run a rpf files
  • @ lurch6661:
    on gta5
  • @ lurch6661:
    i guess there is a way were you can upload real cars \
  • @ QM|T_JinX:
    rpf is a update like / update.rpf
  • @ lurch6661:
    also i cant find dmz
  • @ lurch6661:
    is that not warzone
    @ lurch6661: is that not warzone