for(int ClientAmount = 0; ClientAmount < MAXPLAYERS; ClientAmount++) {
ReadProcessMemory(ModernWarfare3_Handle, (LPCVOID)(CLIENTINFO+ClientAmount*0x52C+0x000C), &(player[ClientAmount].Name), 16, NULL);
}
for(int ClientAmount2 = 0; ClientAmount2 < MAXPLAYERS; ClientAmount2++) {
cout << player[ClientAmount].Name << "\n";
}
#include <string>
for(int i = 0; i < MAXPLAYERS; i++)
{
char temp = NULL;
if(!(ReadProcessMemory(ModernWarfare3_Handle, (void*)(BASE + CLIENTINFO + (i * 0x33c)), &temp, sizeof(temp), NULL))) continue; //First char in the name
else
{
if(temp == NULL) Playername[i].clear();
else Get_playername(i);
}
}
bool Get_playername(int ClientNum)
{
Playername[ClientNum].clear(); // std::string
char Cake = NULL;
unsigned int Address = BASE + CLIENTINFO + (ClientNum * 0x33c);
for(int c = 0; c < 20; c++)
{
if(!(ReadProcessMemory(ModernWarfare3_Handle, (void*)Address, &Cake, sizeof(Cake), NULL))) return 0;
Address++;
if(isalnum(Cake) || Cake == '[' || Cake == ']' || Cake == '{' || Cake == '}' || Cake == '~' || Cake == ' ' || Cake == '_' || Cake == '^' || Cake == '|')
{
size_t sz;
sz=Playername[ClientNum].size();
Playername[ClientNum].resize (sz+1,Cake);
}
else break;
}
return 1;
}