Your C++ programming is absolutely horrible.
Anyway, try to change the first strcat in each block to strcpy. The strcat concatenates strings so it will search for the first NULL character in your uninitialized strings.
Hello, theoretically this stats hack coded in C++ should work, but when toggled on it crashes SC. Any ideas?
PHP Code:void StatsHack()
{
int Player1Minerals[24];
int Player2Minerals[24];
int Player3Minerals[24];
int Player4Minerals[24];
int Player5Minerals[24];
int Player6Minerals[24];
int Player7Minerals[24];
int Player8Minerals[24];
int Player1Gas[24];
int Player2Gas[24];
int Player3Gas[24];
int Player4Gas[24];
int Player5Gas[24];
int Player6Gas[24];
int Player7Gas[24];
int Player8Gas[24];
char Player1Name[24];
char Player2Name[24];
char Player3Name[24];
char Player4Name[24];
char Player5Name[24];
char Player6Name[24];
char Player7Name[24];
char Player8Name[24];
char Combine1[100];
char Combine2[100];
char Combine3[100];
char Combine4[100];
char Combine5[100];
char Combine6[100];
char Combine7[100];
char Combine8[100];
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F0D8,&Player1Minerals,24,NULL); //get data
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F108,&Player1Gas,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57EEEB,&Player1Name,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F0DC,&Player2Minerals,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F10C,&Player2Gas,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57EF0F,&Player2Name,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F0E0,&Player3Minerals,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F110,&Player3Gas,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57EF33,&Player3Name,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F0E4,&Player4Minerals,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F114,&Player4Gas,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57EF57,&Player4Name,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F0E8,&Player5Minerals,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F118,&Player5Gas,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57EF7B,&Player5Name,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F0EC,&Player6Minerals,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F11C,&Player6Gas,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57EF9F,&Player6Name,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F0F0,&Player7Minerals,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F120,&Player7Gas,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57EFC3,&Player7Name,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F0F4,&Player8Minerals,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57F124,&Player8Gas,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x57EFE7,&Player8Name,24,NULL);
char P1MinsChar = (char) Player1Minerals; //convert to char
char P1GasChar = (char) Player1Gas;
char P2MinsChar = (char) Player2Minerals;
char P2GasChar = (char) Player2Gas;
char P3MinsChar = (char) Player3Minerals;
char P3GasChar = (char) Player3Gas;
char P4MinsChar = (char) Player4Minerals;
char P4GasChar = (char) Player4Gas;
char P5MinsChar = (char) Player5Minerals;
char P5GasChar = (char) Player5Gas;
char P6MinsChar = (char) Player6Minerals;
char P6GasChar = (char) Player6Gas;
char P7MinsChar = (char) Player7Minerals;
char P7GasChar = (char) Player7Gas;
char P8MinsChar = (char) Player8Minerals;
char P8GasChar = (char) Player8Gas;
strcat(Combine1, Player1Name); //combine + color
strcat(Combine1, " \x0E");
strcat(Combine1, &P1MinsChar);
strcat(Combine1, " \x0F");
strcat(Combine1, &P1GasChar);
strcat(Combine2, Player2Name);
strcat(Combine2, " \x0E");
strcat(Combine2, &P2MinsChar);
strcat(Combine2, " \x0F");
strcat(Combine2, &P2GasChar);
strcat(Combine3, Player3Name);
strcat(Combine3, " \x0E");
strcat(Combine3, &P3MinsChar);
strcat(Combine3, " \x0F");
strcat(Combine3, &P3GasChar);
strcat(Combine4, Player4Name);
strcat(Combine4, " \x0E");
strcat(Combine4, &P4MinsChar);
strcat(Combine4, " \x0F");
strcat(Combine4, &P4GasChar);
strcat(Combine5, Player5Name);
strcat(Combine5, " \x0E");
strcat(Combine5, &P5MinsChar);
strcat(Combine5, " \x0F");
strcat(Combine5, &P5GasChar);
strcat(Combine6, Player6Name);
strcat(Combine6, " \x0E");
strcat(Combine6, &P6MinsChar);
strcat(Combine6, " \x0F");
strcat(Combine6, &P6GasChar);
strcat(Combine7, Player7Name);
strcat(Combine7, " \x0E");
strcat(Combine7, &P7MinsChar);
strcat(Combine7, " \x0F");
strcat(Combine7, &P7GasChar);
strcat(Combine8, Player8Name);
strcat(Combine8, " \x0E");
strcat(Combine8, &P8MinsChar);
strcat(Combine8, " \x0F");
strcat(Combine8, &P8GasChar);
messaging::BWPrintToScreen(Combine1, false); //print to screen
messaging::BWPrintToScreen(Combine2, false);
messaging::BWPrintToScreen(Combine3, false);
messaging::BWPrintToScreen(Combine4, false);
messaging::BWPrintToScreen(Combine5, false);
messaging::BWPrintToScreen(Combine6, false);
messaging::BWPrintToScreen(Combine7, false);
messaging::BWPrintToScreen(Combine8, false);
}
Redneck to the core
"Put a boot in your ass, 'cuz thats the American way"
Your C++ programming is absolutely horrible.
Anyway, try to change the first strcat in each block to strcpy. The strcat concatenates strings so it will search for the first NULL character in your uninitialized strings.
ty
Redneck to the core
"Put a boot in your ass, 'cuz thats the American way"
By the way, converting numbers to a character string does not work with a type cast. Get yourself a C++ book before you try to make hacks.
meh. Ive already got one, several actually![]()
Redneck to the core
"Put a boot in your ass, 'cuz thats the American way"


Man, ever heard of loops?
How about 2d arrays?
lol, I decompressed it to be more understandable at first glance. Here is the compressed version:
PHP Code:void StatsHack()
{
int PlayerStatData[2][8];
char PlayerName[24][8];
int StatOffsets[3][8] =
{
{ 0x57F0D8, 0x57F0DC, 0x57F0E0, 0x57F0E4, 0x57F0E8, 0x57F0EC, 0x57F0F0, 0x57F0F4}, //minerals
{ 0x57F108, 0x57F10C, 0x57F110, 0x57F114, 0x57F118, 0x57F11C, 0x57F120, 0x57F124}, //gas
{ 0x57EEEB, 0x57EF0F, 0x57EF33, 0x57EF57, 0x57EF7B, 0x57EF9F, 0x57EFC3, 0x57EFE7}, //names
};
for (int i = 1; i < 9; ++i)
{
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)&StatOffsets[1][i],&PlayerStatData[1][i],24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)&StatOffsets[2][i],&PlayerStatData[2][i],24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)&StatOffsets[3][i],&PlayerName[i],24,NULL);
}
}
Redneck to the core
"Put a boot in your ass, 'cuz thats the American way"


Eh, notice the addresses are all x bytes apart? Utilize it. You don't need that many addresses.


I believe this is what Zephyrix was trying to get at for you.PHP Code:struct PlayerInfo
{
char PlayerName[24];
int Minerals;
int Gas;
};
void StatsHack()
{
PlayerInfo pInfo[8];
int StatOffset = 0x57EEEB;
for (int i = 0; i < 8; i++)
{
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)&StatOffset,&pInfo[i].PlayerName,24,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)&StatOffset + 0x1ED,&pInfo[i].Minerals,2,NULL);
ReadProcessMemory(GetCurrentProcess(),(LPCVOID)&StatOffset + 0x21D,&pInfo[i].Gas,2,NULL);
StatOffset += 0x24;
}
/*
Print to Screen Code
*/
}
This enable you to just need one offset and the rest would be ready instead of finding every single offset to use.
The structure is there for easier access to the day and code friendly.
Don't ever use multidimensional arrays, they take too long to figure out where each data goes and can get complicate very fast.
There are currently 1 users browsing this thread. (0 members and 1 guests)