Post: Basics of C# RTM Tool Coding Tutorial SUPER NOOB FRIENDLY!
02-15-2014, 03:28 AM #1
RatchetBooty
Former Staff
(adsbygoogle = window.adsbygoogle || []).push({}); Part 2 is now available! : You must login or register to view this content.

Hey guys, I've finally thought that I should create a thread about the basics of C# and how to use them into coding a RTM Tool for any game. This is a SUPER NOOB friendly tutorial, meaning people that don't know a thing about C# can learn from this. We will be using the game Call of Duty : Ghosts as a example today. But you can follow my steps and create it for any other game as long as you have the offsets. So lets get started off!

First you will need Visual Studios, you can get any version you want. But if you want to keep up to date get Visual Studios 2013 Ultimate, Click You must login or register to view this content.to download it.

Now while you're waiting for it to download (will take around a hour) you can go to this thread for the Ghosts 1.07 Offsets You must login or register to view this content. Credit to Mango_Knife for posting all of these offsets.There are a couple more offset threads around NGU, or just simply Google Ghosts 1.07 Offsets.

After Visual Studios has downloaded open it up, it should look like this:

You must login or register to view this content.


If you're wondering how I got the color of VS to be dark all you have to do is go to Tools, and click "Options"
Example: You must login or register to view this content.
and you should see the very first option is called "Color Theme", there are 3 different ones, look at them all and see which one you like most.

Alright so now back to the coding, click "New Project" on the top left of Visual Studios and a windows like so shall pop up.
You must login or register to view this content.
Click on "Windows Form Application" and where it says "Name" you can name it anything you want like My First RTM Tool or Ghosts RTM Tool.

Now you should get a form looking like this:
You must login or register to view this content.
You can change it's size to whatever you want simply by dragging the little white squares around the Form.

Now you might of seen other people using TMAPI, we're going to be using PS3Lib. It's a shorter version of TMAPI and its compatible with CCAPI. So you're coding will work for DEX users and CEX users. Click You must login or register to view this content. to download PS3Lib.Dll

Once you have download PS3Lib.Dll you need to add it as a reference, same goes with other dll's. If you ever wanted to make your program have a nice design you use DevComponents, it's a dll, so you would add it as reference. Remember that you can't add CCAPI.dll as a reference but you do need it in the same folder as your program.

To add it as a reference go to: Project on the top of Visual Studios, click on it. Go down to Add a reference. A box should pop up looking like this:
You must login or register to view this content.

Click "Browse" and find the PS3Lib.Dll and add it as a reference.
Now once you have added PS3Lib, double click on the Form and it should look like this:
You must login or register to view this content.

Where it says "using System; using System.Collections.Generic; and so on, under those. Add "using PS3Lib;" without the quotation marks.

Now under "InitializeComponent();" add this code:
    
public static PS3API PS3 = new PS3API();

What this code is doing is declaring the 3 letter word "PS3" as a API. And where it says new PS3API(); If you wanted your tool to be just CCAPI compatible or just DEX compatible you would put either new PS3API(SelectAPI.TargetManager); or new PS3API(SelectAPI.ControlConsole);

So now that we have that out of our way lets go back to the form. The design of your form should be at the top, click Form1.cs[Design]*

Now click on the form once, and you will see a properties windows pop up & and toolbox. If the toolbox isn't there. Go to the top of Visual Studios and click "View" and then click toolbox.

Now drag 2 buttons to the form and size them to however you like. Name one "Connect" and name one "Attach". You can rename them simply by clicking on the button and on the properties windows find "Text" and you can change the text there.
You must login or register to view this content.

Double click on the "Connect" button or whatever you've named it.
And put the following code:

    
try
{
PS3.ConnectTarget(0);
MessageBox.Show("Successfully Connected to Target!", "Connected", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch
{
MessageBox.Show("Failed to Connect", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}


"try" & "catch" is for exception handling meaning that it will try the block of code in the first { } brackets and if it succeeds, in our case if its connects successfully a messagebox will pop up saying we've successfully connected. But if it fails, it will "catch" it, meaning it wont leave the program unresponding. It will catch the error with a messagebox saying it failed.

Now it's same thing for the "Attach" button, use the same code but instead of PS3.ConnectTarget(0); use PS3.AttachProcess();

Your code would look something like this:
    
try
{
PS3.AttachProcess();
MessageBox.Show("Successfully Attached to Proccess!", "Attached", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch
{
MessageBox.Show("Failed to Attached", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}


Now before we continue hit the "Save All" button on the top of Visual Studios just in case Visual Studios crashes.
Click the box circled in grey in the following picture:
You must login or register to view this content.

Ok, now we have to add 2 radio buttons so the user can select weather they want to Connect using "DEX" or "CEX". Go into the toolbox and drag 2 radio buttons and name once "DEX and the other one "CEX". Now double click on "DEX" and add the following code:
    
PS3.ChangeAPI(SelectAPI.TargetManager);

And now go back and double click on the "CEX" radio button and add the following code:
    
PS3.ChangeAPI(SelectAPI.ControlConsole);

You must login or register to view this content.
You're probably getting a error on the "Control Console" bit because it's saying that PS3Lib doesn't contain "Control Console" that's because you have to add CCAPI.Dll to the debug folder. It won't let you add it as a reference. Download CCAPI.Dll You must login or register to view this content.
Now find where your "Visual Studios" folder is located, mine is in my documents folder. Once you have found it, open it. Click "Projects", find your project. Open it. There should be another folder inside it named the same thing so open that folder. Then open the folder "Bin", then open the folder "Debug" and drag the CCAPI.Dll in the debug folder. If you're still getting the error build the solution so it refreshes. Click "Build" at the top of Visual Studios and click "Build Solution"
You must login or register to view this content.
What these codes are doing is changing the API or Kernel the user is connecting to, as specified earlier in the thread, we didn't say weather on load our API method will be TargetManager or Control Console. In this code with the 2 radio buttons you can change between target types.



Now add another 2 buttons to the Form and name one "No Recoil ON" & then other one "No Recoil OFF".
You can still follow the tutorial if you have a different offset for lets say red boxes, or chrome players, or anything like that. So these are the No Recoil ON and OFF bytes including the address.
    
Red Boxes: 0x14492C (On - 0x60, 0x00, 0x00, 0x00 | Off - 0x41, 0x82,0x00, 0x0c)


Double click the "No Recoil ON" button and put the following code:
    
byte[] norecoilon = new byte[] { 0x60, 0x00, 0x00, 0x00 };
PS3.SetMemory(0x14492C, norecoilon);

What you're doing here is declaring a byte named "norecoilon" remember that the name of the byte doesn't really matter, you can name it "34itji43tjj4" because it doesn't really matter. Then the ON bytes for No Recoil are 0x60, 0x00, 0x00, 0x00 so you're putting the bytes into hex format.
Then your setting the memory with the No Recoil address which is 0x14492C, and then beside it your putting the byte norecoilon. So lets conclude this: You've made a byte named norecoilon, that byte has the bytes in hex: 0x60, 0x00, 0x00, 0x00. Then your setting the memory to your PS3 by setting the bytes in "norecoilon" to the offset 0x14492C.

Now you do the same thing for No Recoil OFF but its different bytes. Your code for No Recoil OFF would look like:
    
byte[] norecoiloff = new byte[] { 0x41, 0x82,0x00, 0x0c };
PS3.SetMemory(0x14492C, norecoiloff);


Now you're finally finished, all you have to do now is run the .exe. You can debug it meaning if any random error occurs in the code the program will stop or run it without debugging meaning just running it straight from the .exe. To debug all you have to do is click "Start" at the top of Visual Studios or if you want to run it without debugging click the little arrow beside "Start" and it will drop down with another Start feature, click that start.
You must login or register to view this content.

Now you're finally done, to distribute your file click "Save All" (there was a pic earlier in the thread) and find the Visual Studios 2013 folder. Mine is located in my documents, once you have found it. Click on it, click "Projects" and find the folder with your tool that you've just created. You're tool will be in the debug folder. Remember if you're going to send people the tool remember to send them with the dll's. You can add a lot more non host mods or anything you would like from this offset thread:
You must login or register to view this content.

But some of the offsets like changing name and lobby settings require a bit different kind of coding as coding requires encodings and array reversing. I will be making a part 2 tutorial soon, comment what you guys would like to see.
If you guys want the download for the project we just did. You can see how everything's coded if you're getting a error.
Open Source: You must login or register to view this content.
Last edited by RatchetBooty ; 03-28-2014 at 02:26 AM.

The following 88 users say thank you to RatchetBooty for this useful post:

::iAmDemoN::, /SneakerStreet/, ❇❥⛺Cerberus⛺❤❇, A Friend, A_Gen_Fiasco, AlabamaHit, aleeeex, bearl, CallMeDex, Chirra92, cl_21, delta_12, Deversi, Haley, Dog88Christian, DS, Eat_Ur_Food, eazyb, ExhaleXhale, Exploited, Frank Ryan, Franky, GangDePlot, Hate, Hori_By_Nature, iBuMxURxMuM, ilasthope, Invose, iRnZ, Jayomu, JIewka, joni_djESP, KareraHekku, KING_ZOO, KINGMANI, libra7ry, LizzoOo, LucaTurilli, Luphox, Mauzey, Meshoo_x3, Moreuseinatool, MrMoan, Otaku Modder, OutKast3k, Phreaker, PO10C_, RambosNGU, Rank_One, Deleted-User0000000012210, ResistTheMoon, ResistTheSun, rocketforce, romolo, ryane7, samet2013, ShinigamiUzi, Skonafid, Kronos, Slinky, smoochy1993, Jon Snow, stianrustad, SwaggyLV, Taylors Bish, ThatsWhatLoveIs, The★A1★HAXO_oR, TheLastHelmet, TotalModzHD, Toxic, tunde1992, Vatinj, vhromero, vicious_results, wajdi9, witchery, worrorfight, xDebugKiller, Fatality, xGsc-_-Funzo, XILE_, xKasper, XxBlud23xX, yomen9, zMarcusHD
02-15-2014, 04:03 AM #2
Haley
docters & repco
Great thread! Thanks man.

The following 2 users say thank you to Haley for this useful post:

Father Luckeyy, MrMoan
02-15-2014, 04:07 AM #3
tunde1992
League Champion
OMG . if i had 6 accs it wont be enough to thank this thread
Great tut Awesome face
02-15-2014, 04:08 AM #4
nice interesting
02-15-2014, 05:06 AM #5
RatchetBooty
Former Staff
Originally posted by tunde1992 View Post
OMG . if i had 6 accs it wont be enough to thank this thread
Great tut Awesome face


Aha thanks Smile

I updated the thread as 3 of the images didn't work, now they work!
02-15-2014, 12:56 PM #6
KINGMANI
アニメフリーク
I wasn't rly into C#
But now i gonna give it maybe a try nice tut Winky Winky
02-15-2014, 01:04 PM #7
Uncertain
Climbing up the ladder
Most other tutorials teach basic code and explain what it means where-as the way you presented this I learned nothing, it was basically you putting some code in a box and telling me to copy it and giving a brief explanation on it. Don't get me wrong it's a nice thread but it doesn't really help the reader as they don't learn anything I also got a couple of errors (A likely chance it was because I skipped the CCAPI part as I don't want to add that at this moment in time) Overall your thread didn't really help me, it confused me and had my copying things that I didn't know what did with no explanation. (Not hate just my experiences and some constructive criticism) What would help is breaking down bits of code explaining what they meant and moving to the next bit - it might take a while but it would be worth it also making sure that the tutorial doesn't lead to errors as I encountered a couple and trying to fix them was a fucker to the point I gave up and went back to my old basic code :lol:Thanks for the tut anyways (y)
Last edited by Uncertain ; 02-15-2014 at 01:05 PM. Reason: It was structured wrong and it was confusing as
02-15-2014, 01:05 PM #8
RatchetBooty
Former Staff
Originally posted by Uncertain View Post
Try going in-depth, I can create a tool and add functions but its basic where-as the way you presented this I learned nothing, it was basically you putting some code in a box and telling me to copy it and giving a brief explanation on it. Don't get me wrong it's a nice thread but it doesn't really help the reader as they don't learn anything I also got a couple of errors (A likely chance it was because I skipped the CCAPI part as I don't want to add that at this moment in time) Overall your thread didn't really help me, it confused me and had my copying things that I didn't know what did with no explanation. (Not hate just my experiences and some constructive criticism) What would help is breaking down bits of code explaining what they meant and moving to the next bit - it might take a while but it would be worth it also making sure that the tutorial doesn't lead to errors as I encountered a couple and trying to fix them was a fucker to the point I gave up and went back to my old basic code :lol:Thanks for the tut anyways (y)


Compared to other threads i actually explained stuff. What errors did you encounter I'm pretty sure it was just a small error with namespace or "} expected"
02-15-2014, 01:09 PM #9
Uncertain
Climbing up the ladder
Originally posted by RatchetBooty View Post
Compared to other threads i actually explained stuff. What errors did you encounter I'm pretty sure it was just a small error with namespace or "} expected"

Sorry about the first post it was quite badly written hence why I edited it but I came into the namespace ones expected with some unknown references (I think) after looking over your thread again I seen that you explained some of it but some of it I still didn't understand why it was there if you know what I mean.
02-15-2014, 01:11 PM #10
RatchetBooty
Former Staff
Originally posted by Uncertain View Post
Sorry about the first post it was quite badly written hence why I edited it but I came into the namespace ones expected with some unknown references (I think) after looking over your thread again I seen that you explained some of it but some of it I still didn't understand why it was there if you know what I mean.


The namespace error just means you one to many "}" brackets somewhere.

The following user thanked RatchetBooty for this useful post:

Str8clowning

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo