(adsbygoogle = window.adsbygoogle || []).push({});
How to use PS3Lib in an RTE Tool
By: Zero
Introduction:
Hey guys, Zero here with my first basic Visual Studio tutorial. I know a lot of you here on the site are learning/wanting to learn how to code CoD tools and other games, so here is a tutorial on how to use the Ps3Lib.dll and how to make a basic code for it. This is currently only for DEX, I will update soon for CEX (CCAPI).
What is Ps3lib.dll?
Ps3lib is a dll (Dynamic Link Library) used for many things, including connecting and attaching. If you have ever heard of ps3tmapi.dll, it is essentially a better and easier version of it.
Things you need:
-Visual Studio
-Common sense
-Ps3lib.dll:
You must login or register to view this content.
-Call of Duty Ghosts (Can use other Call of Duty games, its just that I am using this one for the SetMemory function later on in the tutorial.
Step 1: Setting up Ps3lib
1.)Ok, first off, open up your Visual Studio and in the top-left corner click New>Project and click Visual C# and choose Windows Form Application, and at the bottom of that popup you can change the name to whatever (default is usually WindowsFormApplication)
Picture:
[img]
https://puu.sh_6C92i.png[/img]
2.)Now when you have your new project open, you will be looking at your blank form1. Go to your toolbox and drag a button to your form. (If you cannot see your toolbox, go to View at the top of the program and go down until you see toolbox, click that.) Tip: Using the search bar in your toolbox will save you time when trying to find things. Go to the properties on the right side of the screen and scroll until you see something that says Text. Change the text to Connect and Attach. Make sure you have the button highlighted (You can do this by just clicking on the button once.)
Picture:
[img]
https://puu.sh_6CbhC.png[/img]
3.)Now to add the Ps3lib to your references. After you've downloaded Ps3lib.dll, make a new folder in your documents on your computer called References. You do not have to do this, but its the easiest way to keep all your references in one place. Now go back to your Visual Studio and go to the top of it and click Project>Add Reference... and go to the directory where your Ps3lib.dll is located, and make sure you check the box next to Ps3lib.dll in the references. Click Ok.
Picture:
[img]
https://puu.sh_6C9TN.png[/img]
4.)Now that you've added the Ps3lib to your project, go to your form1 and double click it.
You should see a few lines of code, but we are looking for all the using lines up near the top. Underneath the last using, add using PS3Lib;
This adds full functionality of the Ps3lib DLL to your tool.
Picture:
[img]
https://puu.sh_6Cafz.png[/img]
Step 2: Using Ps3lib to Connect and Attach Your PS3
5.)Now to add the public class that defines how you will be connecting your PS3. In the code right under the bracket that is below InitializeComponent();, add this code in:
public static PS3API PS3 = new PS3API(SelectAPI.TargetManager);
What does this do?
This code represents the connection panel you will be using for your connecting and attaching. At SelectAPI.TargetManager: TargetManager is the DEX way of connecting to your PS3 through your computer. If you were to change TargetManager to ControlConsole, it would make it CCAPI compatible, however you would need a few other things for CEX compatibility that I will add to this tutorial later on.
Picture:
[img]
https://puu.sh_6CaVm.png[/img]
6.)Remember that button we created earlier that said Connect and Attach on it? Go back to the designer of your form (You can do this by clicking the Designer tab on your work area right above your coding. If it does not show up, right click in the coding area and click Show Designer) and double click the button. This should take you back to the coding area, and it should look like this:
Inside the brackets, type this:
try {
PS3.ConnectTarget();
PS3.AttachProcess();
MessageBox.Show("Connected and Attached Succesfully!");
}
catch {
MessageBox.Show("Something went wrong ");
}
What does this do?
When you click your button, the Ps3 will attempt to connect your Ps3 to Target Manager and Attach the game process. The try means that the program will try what is inside of that before it resorts to the catch, which is where it will display the error message.
Step 3: Creating a Ps3lib SetMemory Function to add Mods
7.)You are done adding all of the boring stuff! Now to add a mod for your game. Go back to your form1 Designer and create a new button, name it No Recoil. We are going to add a No Recoil mod for Call Of Duty: Ghosts, but this function can be used for any game. After you've added your button, open it and in the brackets, type this:
PS3.SetMemory(0x0060EBDC, new byte[] {0x60, 0x00, 0x00, 0x00});
In this spoiler, 0x0060EBDC is the offset for No Recoil on Ghosts update 1.06, and 0x60, 0x00, 0x00, 0x00 are the byte changes necessary to activate this mod.
What does this do?
This sets a certain part of the memory using an offset and changes that byte at that offset. An offset is the location of the mod, and the bytes is what sets the mod at that offset.
8.)There you go! You have successfully learned how to: Set up PS3lib in a program, add buttons, Add functions to the button, and how to connect and attach using a button all in Visual Studio! This step is something extra: If you would like to make an off button for your Mod, then go back to the button you created before, add ON to the name, and create a new button called No Recoil OFF. Inside this button, add this:
PS3.SetMemory(0x0060EBDC, new byte[] {0x4B, 0xB0, 0xC7, 0x4D});
What does this do?
This, just like the No Recoil ON function, changes the bytes at the offset to turn off the mod.
Well guys, hope you enjoyed the tutorial, I tried my best to make it nice and easy for beginners. I will be posting more tutorials on things like this, and how to broaden your coding into other things like Name changing, Stat setting with different objects from the toolbox, etc. Have a good day everyone, and happy coding!
~Zero~
[/CENTER]