C
C#2y ago
j0d

✅ Adding functionality to a call of duty mw2 (2009) steam tool

Hello, I have a tool which creates clean mw2 lobbies (free from mods etc). It has a kick feature which i use to kick players who are modding, but it does not ban them. To ban them i have to take their XUID from the tool and put it into a notepad file, but unfortunately my tool doesn't specify which XUID links to which players steam name. I have code which gets the steam name and i have code which grabs the XUID but i am struggling to put them together. Here is the code for getting the players steam name using hexadecimal memory address within cod mw2.
char * getPlayerName(int client)
{
return (char*)(0x9978EC + (client * 0x52C));
}
char * getPlayerName(int client)
{
return (char*)(0x9978EC + (client * 0x52C));
}
Here is the code it uses to kick players, the lobby size is 18.
if (ImGui::Button(getPlayerName(0), ImVec2(150, 25)))
{
SV_GameSendServerCommand(0, 0, "t EXE_DISCONNECTED");

}
if (ImGui::Button(getPlayerName(0), ImVec2(150, 25)))
{
SV_GameSendServerCommand(0, 0, "t EXE_DISCONNECTED");

}
I will post below the code which gets the XUID:
9 Replies
j0d
j0dOP2y ago
Here is the part of the code code which grabs the players XUID. It seems to use the cmd_argv function and then filters with NA_IP to get the XUID.
inline char* Cmd_Argv(int arg)
{
if ((unsigned)arg >= cmd_argc[*cmd_id]) {
return "";
}
return (char*)(cmd_argv[*cmd_id][arg]);
}
bool IsBanned(string xuid)
{
std::ifstream file("xuidbans.txt");
std::string str;
while (std::getline(file, str))
{

if (str.find(xuid) != string::npos)
{
return true;
}

}
return false;
}
void hk_PartyHost_HandleJoinPartyRequest(PartyData_s* party, int localControllerIndex, netadr_t from, msg_t* msg)
{

char ip = ("%i.%i.%i.%i\n", from.ip[0], from.ip[1], from.ip[2], from.ip[3]);
char v1[1024]; // [esp+Ch] [ebp-40Ch] BYREF


if (from.type == NA_IP) {
auto xuid = Cmd_Argv(2);

bool rce = msg->cursize > 55;
std::string xuidstr(xuid);

std::transform(xuidstr.begin(), xuidstr.end(), xuidstr.begin(), ::toupper);
printf("Received Join Party request from IP: %i.%i.%i.%i:%i | XUID: %s\n", from.ip[0], from.ip[1], from.ip[2], from.ip[3], from.port, xuidstr);
inline char* Cmd_Argv(int arg)
{
if ((unsigned)arg >= cmd_argc[*cmd_id]) {
return "";
}
return (char*)(cmd_argv[*cmd_id][arg]);
}
bool IsBanned(string xuid)
{
std::ifstream file("xuidbans.txt");
std::string str;
while (std::getline(file, str))
{

if (str.find(xuid) != string::npos)
{
return true;
}

}
return false;
}
void hk_PartyHost_HandleJoinPartyRequest(PartyData_s* party, int localControllerIndex, netadr_t from, msg_t* msg)
{

char ip = ("%i.%i.%i.%i\n", from.ip[0], from.ip[1], from.ip[2], from.ip[3]);
char v1[1024]; // [esp+Ch] [ebp-40Ch] BYREF


if (from.type == NA_IP) {
auto xuid = Cmd_Argv(2);

bool rce = msg->cursize > 55;
std::string xuidstr(xuid);

std::transform(xuidstr.begin(), xuidstr.end(), xuidstr.begin(), ::toupper);
printf("Received Join Party request from IP: %i.%i.%i.%i:%i | XUID: %s\n", from.ip[0], from.ip[1], from.ip[2], from.ip[3], from.port, xuidstr);
Buddy
Buddy2y ago
This is a C# discord, and we will not help you create a cheat.
j0d
j0dOP2y ago
It is written in c# but yes ok i will delete
Buddy
Buddy2y ago
That is not C# syntax
Thinker
Thinker2y ago
that is C++
j0d
j0dOP2y ago
Apologies! It is used to combat cheaters if that helps at all
Thinker
Thinker2y ago
$cpp but again please don't write cheats
MODiX
MODiX2y ago
We're partnered with Together C & C++, check them out here: https://discord.gg/vnyVmAE
j0d
j0dOP2y ago
I literally fight against the cheaters, the game is swamped with people modding and doing nefarious stuff. I use this to create clean experiences for people
Want results from more Discord servers?
Add your server