Post: C# Client List/DataGridView Coding Tutorial!
03-28-2014, 02:25 AM #1
RatchetBooty
Former Staff
(adsbygoogle = window.adsbygoogle || []).push({});
Hey guys, today I will be teaching you how to code a client list; Also know as a Data Grid View! I will also be teaching you how to add a context menu strip and how to code in mods for all clients. Before we start, if you haven't already I really recommend reading my other tutorial: You must login or register to view this content. It will help you out a lot if you don't know how to code or you're just starting. This client list will work for CEX & DEX users.

First make sure that you've got a project opened, it could be one you've already been working on or one that you've just made. So now simply add a connect and attach button if you don't already have one (I'm not going to teach how to code a connect and attach button as it was in my other tutorial :p).

Now you want to go into your toolbox and type in "datagridview" and drag it into your tool.


You must login or register to view this content.


Now just adjust the dimensions, I put mine like this, but you can put it how ever you want

You must login or register to view this content.


What you want to do now is click on the datagridview and on the top right of the datagridview you should see a little arrow pointing to the right, click on it and click "Add Columns"


You must login or register to view this content.


Once you've got the add columns page opened, we're now going to add 2 columns. One for the client number and the other one for the client name. So for the first column set the "Header Text" to "Client #", or you can set the header text to whatever you want. And then click "Add"


You must login or register to view this content.


Now add another column and name the "Header Text", "Client Name", then simply click "Close".

You must login or register to view this content.


Your form should look like this now:


You must login or register to view this content.


Now we want to have a function that updates the client list's rows and adds the client numbers. So we want to make a new button named "Get Client Names" or whatever you would like it to be named and add this code into the button:

    
if (dataGridView1.RowCount == 1)
{
dataGridView1.Rows.Add(11);
}

for(uint i = 0; i < 12; i++)
{
dataGridView1[0, Convert.ToInt32(i)].Value = i;
}


What this code is doing is it's first checking if the datagrid's row count is 1, in this case it is 1. And if it is it will add 11 more rows. We need 12 rows in total because the maximum amount of clients in a game are 12. Then the next code is a "for loop" I'm not really going to go in depth on how it works but basically what it's doing is it starts off with an unidentified integer named "i" that's value is 0, and if i is less than 12 it will increment it by 1. And in the curly brackets "0" is the column, which is "Client #" and it updates it so every row in that column will have a number going from 0 to 11. So Column 1 row 1 will be "0", Column 1 row 2 will be "1" and so on.

Now we will be coding the actual function that gets the clients names, so put this code somewhere in your code:
    
public static string ClientNames(uint client)
{
string getnames = PS3.Extension.ReadString(0x00F4701C + client * 0x3700);
return getnames;
}


Basically what this function is doing is creating a public string named ClientNames with the parameter "uint client".
In the curly brackets ( { } ) there is a string named "getnames", what that string does is uses PS3Lib's extensions to read the string from the name address for each client. Then it returns the client names. "0xF46B9C" is the ghosts names address, if you're coding a datagridview for other cods find the client name offset for the game.

So now once you've got that in your code go back to the "Get Client Names" button and double click it. Right under the "dataGridView1[0, Convert.ToInt32(i)].Value = i;" code put this code:
    
dataGridView1[1, Convert.ToInt32(i)].Value = ClientNames(i);


"1" is the column, which in this case is "Client Names" and each row in column 1 ("Client Names") will contain each clients name. So Column 2 Row 1 will contain client 0's name, Column 2 row 2 will contain client 1's name and so on.

Now what we want to do is go back to the toolbox and type in "ContextMenuStrip" and drag it onto our form.


You must login or register to view this content.


Now go back to the datagridview and click on it and go to it's properties, scroll down to "ConextMenuStrip" and select "contextmenuStrip1", it should look like this:


You must login or register to view this content.


What this does is set the datagridview contextmenustrip to the one you just created, so whenever someone right clicks on the datagridview the contextmenustrip will show up.

To add functions or options to the contextmenustrip simply click on the contextmenustrip and you should see a little drop down pop up like this:


You must login or register to view this content.


Now type in anything you want, it can be "God Mode" or "Infinite Ammo" or whatever mods you want to put in, you can even have different options leading to the mods, like lets say you have God Mode, you can hover over it and have the options "On" and "Off" like so:


You must login or register to view this content.


To actually code the function, double click on the mod you put in on the contextmenustrip, and it should open up its code. Put the following code in:

    
PS3.SetMemory((0xE03CAA + (uint)dataGridView1.CurrentRow.Index * 0x3700), new byte[] { 0xFF, 0xFF });


or this code:

    
byte[] godmode = new byte[] { 0xFF, 0xFF };
PS3.SetMemory((0xE03CAA + (uint)dataGridView1.CurrentRow.Index * 0x3700), godmode);


They both do the same thing. Replace "0xE03CAA" with whatever offset you want and 0x280 with the client interval for that offset, and the bytes with whatever bytes you want it to be. What the code does is basically it declares a byte named godmode, and that byte contains "0xFF, 0xFF" and then you're setting the memory to the offset "0xE03CAA" or whatever offset you want. What it's doing with the datagridview1.currentrow.index * 0x280 is it takes the client number you've selected and adds + 0x280 as many times to the offset "0xE03CAA" until it reaches the client you've selected.

Well that's it for this tutorial, if you guys have any questions or suggestions please comment down below!

Open Source: You must login or register to view this content.
Part 1 Tutorial: You must login or register to view this content.
Last edited by RatchetBooty ; 04-29-2014 at 09:28 PM.

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

/SneakerStreet/, Hammy, One, Eddie Mac, aburezk, Asian, Bichote, CodJumper:, Dan Dactyl, Deversi, Dro, DS, Father Luckeyy, Frank Ryan, HackersForHire, Harry, Hori_By_Nature, ImAzazel, iNDMx, Jared, JIewka, KareraHekku, KevinWinterX, Kieron, M-alShammary, Mango_Knife, mattyjkilledme, mbradley672, Murderlikedj, NotALegitPlayer, OmegleModz, Otaku Modder, Phreaker, Pianist Prodigy, ResistTheMoon, SC58, Dacoco, Slinky, SnaY, Jon Snow, The★A1★HAXO_oR, WhyMoDz, Xcesar1911X, Fatality, xKrazy SicknesS, xSlinkeyy, Xx-GIPPI-xX, zMarcusHD
03-28-2014, 02:31 AM #2
Dan
I'm a god.
Originally posted by RatchetBooty View Post
Hey guys, today I will be teaching you how to code a client list; Also know as a Data Grid View! I will also be teaching you how to add a context menu strip and how to code in mods for all clients. Before we start, if you haven't already I really recommend reading my other tutorial: You must login or register to view this content. It will help you out a lot if you don't know how to code or you're just starting. This client list will work for CEX & DEX users.

First make sure that you've got a project opened, it could be one you've already been working on or one that you've just made. So now simply add a connect and attach button if you don't already have one (I'm not going to teach how to code a connect and attach button as it was in my other tutorial :p).

Now you want to go into your toolbox and type in "datagridview" and drag it into your tool.


You must login or register to view this content.


Now just adjust the dimensions, I put mine like this, but you can put it how ever you want

You must login or register to view this content.


What you want to do now is click on the datagridview and on the top right of the datagridview you should see a little arrow pointing to the right, click on it and click "Add Columns"


You must login or register to view this content.


Once you've got the add columns page opened, we're now going to add 2 columns. One for the client number and the other one for the client name. So for the first column set the "Header Text" to "Client #", or you can set the header text to whatever you want. And then click "Add"


You must login or register to view this content.


Now add another column and name the "Header Text", "Client Name", then simply click "Close".

You must login or register to view this content.


Your form should look like this now:


You must login or register to view this content.


Now we want to have a function that updates the client list's rows and adds the client numbers. So we want to make a new button named "Get Client Names" or whatever you would like it to be named and add this code into the button:

    
if (dataGridView1.RowCount == 1)
{
dataGridView1.Rows.Add(11);
}

for(uint i = 0; i < 12; i++)
{
dataGridView1[0, Convert.ToInt32(i)].Value = i;
}


What this code is doing is it's first checking if the datagrid's row count is 1, in this case it is 1. And if it is it will add 11 more rows. We need 12 rows in total because the maximum amount of clients in a game are 12. Then the next code is a "for loop" I'm not really going to go in depth on how it works but basically what it's doing is it starts off with an unidentified integer named "i" that's value is 0, and if i is less than 12 it will increment it by 1. And in the curly brackets "0" is the column, which is "Client #" and it updates it so every row in that column will have a number going from 0 to 11. So Column 1 row 1 will be "0", Column 1 row 2 will be "1" and so on.

Now we will be coding the actual function that gets the clients names, so put this code somewhere in your code:
    
public static string ClientNames(uint client)
{
string getnames = PS3.Extension.ReadString(0xF46B9C + client * 0x3700);
return getnames;
}


Basically what this function is doing is creating a public string named ClientNames with the parameter "uint client".
In the curly brackets ( { } ) there is a string named "getnames", what that string does is uses PS3Lib's extensions to read the string from the name address for each client. Then it returns the client names. "0xF46B9C" is the ghosts names address, if you're coding a datagridview for other cods find the client name offset for the game.

So now once you've got that in your code go back to the "Get Client Names" button and double click it. Right under the "dataGridView1[0, Convert.ToInt32(i)].Value = i;" code put this code:
    
dataGridView1[1, Convert.ToInt32(i)].Value = ClientNames(i);


"1" is the column, which in this case is "Client Names" and each row in column 1 ("Client Names") will contain each clients name. So Column 2 Row 1 will contain client 0's name, Column 2 row 2 will contain client 1's name and so on.

Now what we want to do is go back to the toolbox and type in "ContextMenuStrip" and drag it onto our form.


You must login or register to view this content.


Now go back to the datagridview and click on it and go to it's properties, scroll down to "ConextMenuStrip" and select "contextmenuStrip1", it should look like this:


You must login or register to view this content.


What this does is set the datagridview contextmenustrip to the one you just created, so whenever someone right clicks on the datagridview the contextmenustrip will show up.

To add functions or options to the contextmenustrip simply click on the contextmenustrip and you should see a little drop down pop up like this:


You must login or register to view this content.


Now type in anything you want, it can be "God Mode" or "Infinite Ammo" or whatever mods you want to put in, you can even have different options leading to the mods, like lets say you have God Mode, you can hover over it and have the options "On" and "Off" like so:


You must login or register to view this content.


To actually code the function, double click on the mod you put in on the contextmenustrip, and it should open up its code. Put the following code in:

    
PS3.SetMemory((0xE03CAA + (uint)dataGridView1.CurrentRow.Index * 0x3700), new byte[] { 0xFF, 0xFF });


or this code:

    
byte[] godmode = new byte[] { 0xFF, 0xFF };
PS3.SetMemory((0xE03CAA + (uint)dataGridView1.CurrentRow.Index * 0x3700), godmode);


They both do the same thing. Replace "0xE03CAA" with whatever offset you want and 0x280 with the client interval for that offset, and the bytes with whatever bytes you want it to be. What the code does is basically it declares a byte named godmode, and that byte contains "0xFF, 0xFF" and then you're setting the memory to the offset "0xE03CAA" or whatever offset you want. What it's doing with the datagridview1.currentrow.index * 0x280 is it takes the client number you've selected and adds + 0x280 as many times to the offset "0xE03CAA" until it reaches the client you've selected.

Well that's it for this tutorial, if you guys have any questions or suggestions please comment down below!

Open Source: You must login or register to view this content.
Part 1 Tutorial: You must login or register to view this content.


Very nice detailed tutorial! Hope to see more in the near future. Winky Winky
03-28-2014, 12:20 PM #3
Citadel
Samurai Poster
Originally posted by RatchetBooty View Post
Hey guys, today I will be teaching you how to code a client list; Also know as a Data Grid View! I will also be teaching you how to add a context menu strip and how to code in mods for all clients. Before we start, if you haven't already I really recommend reading my other tutorial: You must login or register to view this content. It will help you out a lot if you don't know how to code or you're just starting. This client list will work for CEX & DEX users.

First make sure that you've got a project opened, it could be one you've already been working on or one that you've just made. So now simply add a connect and attach button if you don't already have one (I'm not going to teach how to code a connect and attach button as it was in my other tutorial :p).

Now you want to go into your toolbox and type in "datagridview" and drag it into your tool.


You must login or register to view this content.


Now just adjust the dimensions, I put mine like this, but you can put it how ever you want

You must login or register to view this content.


What you want to do now is click on the datagridview and on the top right of the datagridview you should see a little arrow pointing to the right, click on it and click "Add Columns"


You must login or register to view this content.


Once you've got the add columns page opened, we're now going to add 2 columns. One for the client number and the other one for the client name. So for the first column set the "Header Text" to "Client #", or you can set the header text to whatever you want. And then click "Add"


You must login or register to view this content.


Now add another column and name the "Header Text", "Client Name", then simply click "Close".

You must login or register to view this content.


Your form should look like this now:


You must login or register to view this content.


Now we want to have a function that updates the client list's rows and adds the client numbers. So we want to make a new button named "Get Client Names" or whatever you would like it to be named and add this code into the button:

    
if (dataGridView1.RowCount == 1)
{
dataGridView1.Rows.Add(11);
}

for(uint i = 0; i < 12; i++)
{
dataGridView1[0, Convert.ToInt32(i)].Value = i;
}


What this code is doing is it's first checking if the datagrid's row count is 1, in this case it is 1. And if it is it will add 11 more rows. We need 12 rows in total because the maximum amount of clients in a game are 12. Then the next code is a "for loop" I'm not really going to go in depth on how it works but basically what it's doing is it starts off with an unidentified integer named "i" that's value is 0, and if i is less than 12 it will increment it by 1. And in the curly brackets "0" is the column, which is "Client #" and it updates it so every row in that column will have a number going from 0 to 11. So Column 1 row 1 will be "0", Column 1 row 2 will be "1" and so on.

Now we will be coding the actual function that gets the clients names, so put this code somewhere in your code:
    
public static string ClientNames(uint client)
{
string getnames = PS3.Extension.ReadString(0xF46B9C + client * 0x3700);
return getnames;
}


Basically what this function is doing is creating a public string named ClientNames with the parameter "uint client".
In the curly brackets ( { } ) there is a string named "getnames", what that string does is uses PS3Lib's extensions to read the string from the name address for each client. Then it returns the client names. "0xF46B9C" is the ghosts names address, if you're coding a datagridview for other cods find the client name offset for the game.

So now once you've got that in your code go back to the "Get Client Names" button and double click it. Right under the "dataGridView1[0, Convert.ToInt32(i)].Value = i;" code put this code:
    
dataGridView1[1, Convert.ToInt32(i)].Value = ClientNames(i);


"1" is the column, which in this case is "Client Names" and each row in column 1 ("Client Names") will contain each clients name. So Column 2 Row 1 will contain client 0's name, Column 2 row 2 will contain client 1's name and so on.

Now what we want to do is go back to the toolbox and type in "ContextMenuStrip" and drag it onto our form.


You must login or register to view this content.


Now go back to the datagridview and click on it and go to it's properties, scroll down to "ConextMenuStrip" and select "contextmenuStrip1", it should look like this:


You must login or register to view this content.


What this does is set the datagridview contextmenustrip to the one you just created, so whenever someone right clicks on the datagridview the contextmenustrip will show up.

To add functions or options to the contextmenustrip simply click on the contextmenustrip and you should see a little drop down pop up like this:


You must login or register to view this content.


Now type in anything you want, it can be "God Mode" or "Infinite Ammo" or whatever mods you want to put in, you can even have different options leading to the mods, like lets say you have God Mode, you can hover over it and have the options "On" and "Off" like so:


You must login or register to view this content.


To actually code the function, double click on the mod you put in on the contextmenustrip, and it should open up its code. Put the following code in:

    
PS3.SetMemory((0xE03CAA + (uint)dataGridView1.CurrentRow.Index * 0x3700), new byte[] { 0xFF, 0xFF });


or this code:

    
byte[] godmode = new byte[] { 0xFF, 0xFF };
PS3.SetMemory((0xE03CAA + (uint)dataGridView1.CurrentRow.Index * 0x3700), godmode);


They both do the same thing. Replace "0xE03CAA" with whatever offset you want and 0x280 with the client interval for that offset, and the bytes with whatever bytes you want it to be. What the code does is basically it declares a byte named godmode, and that byte contains "0xFF, 0xFF" and then you're setting the memory to the offset "0xE03CAA" or whatever offset you want. What it's doing with the datagridview1.currentrow.index * 0x280 is it takes the client number you've selected and adds + 0x280 as many times to the offset "0xE03CAA" until it reaches the client you've selected.

Well that's it for this tutorial, if you guys have any questions or suggestions please comment down below!

Open Source: You must login or register to view this content.
Part 1 Tutorial: You must login or register to view this content.




Perfect Tut. Going to start linking them f4gs now. Hopefully people who google "how to make client list" in google sees this post first.

You should do a video tut if you have time, if not I'll do it for you Smile

Edit1: you should add that "client * 0x3700" can differ for each game
Last edited by Citadel ; 03-28-2014 at 12:33 PM.
03-28-2014, 07:10 PM #4
Leal
Pepe #1 Fan
Good job Ratchet. Its useless to me but good job :fa:
03-28-2014, 08:27 PM #5
Mango_Knife
In my man cave
Nice tutorial
Many people asked me how to code dataGridView, next time someone is asking me, il link him this thread Winky Winky
03-28-2014, 08:59 PM #6
ResistTheMoon
< ^ > < ^ >
Nice one m8 even though you helped me before. Happy
03-29-2014, 12:17 AM #7
RatchetBooty
Former Staff
Originally posted by Knife View Post
Nice tutorial
Many people asked me how to code dataGridView, next time someone is asking me, il link him this thread Winky Winky


aha thanks Winky Winky If anyone has any suggestions or questions just ask me :p
03-29-2014, 12:20 AM #8
HackersForHire
Climbing up the ladder
now im 1337. Thanks Smile
03-29-2014, 05:48 AM #9
Winter
Purple God
Why is this tutorial so long?

spot the fail

public static string ClientNames(uint client)
{
string getnames = PS3.Extension.ReadString(0xF46B9C + client * 0x3700);
return getnames;
}
Last edited by Winter ; 03-29-2014 at 05:52 AM.

The following user thanked Winter for this useful post:

Shark
03-29-2014, 05:54 AM #10
Shark
Retired.
Originally posted by Winter View Post
Why is this tutorial so long?

spot the fail

public static string ClientNames(uint client)
{
string getnames = PS3.Extension.ReadString(0xF46B9C + client * 0x3700);
return getnames;
}


el b00ty dun fukd up
string getnames = PS3.Extension.ReadString(0xF46B9C + client * 0x3700); - so lets say the client = 1, then that means your adding 0x01 to the original offset ( 0xF46B9C ), then your multiplying it by 0x3700 therefore fucking the whole thing up, this is why you must use brackets.

Correct coding would be
string getnames = PS3.Extension.ReadString(0xF46B9C + (client * 0x3700)); - so now your adding 0x3700 multiplied by the client to it, so now if the client = 1 it will be doing 1 * 0x3700 and adding that to the original offset :y:

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

WhyMoDz, Winter

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo