It can work for every COD if you change the offsets
I hope i can help anyone with my idea.
If you have problams with this:
-test if you have the actuel offsets
-test the code, it can be that i forgot anything
Code:
DWORD WINAPI GetMagicNumberAddress()
{
while (!IsModuleReady()) Sleep(50);
DWORD *MagicNumber = (DWORD*)*(DWORD*)(FindPattern((DWORD)GetModuleHandleA("iw5mp.exe"), 0xFFFFFFFF, (BYTE*)MAGIC_NUMBER_PATTERN, MAGIC_NUMBER_MASK) + 1);
return *MagicNumber;
}
typedef int(*__cdecl SendCmdToCon_0x4EB8F0)(int, int, char*);
SendCmdToCon_0x4EB8F0 SendCmd = (SendCmdToCon_0x4EB8F0)0x4EB8F0;
#define MAGIC_NUMBER_PATTERN "\xa1\x00\x00\x00\x00\x8d\x94\x24\x04\x08\x00\x00\x52\x56\x50\x68\x00\x00\x00\x00\xe8\x00\x00\x00\x00\x8b\x8c\x24\x18\x0c\x00\x00\x50\x51\xe8\x00\x00\x00\x00\x83\xc4\x18"
#define MAGIC_NUMBER_MASK "x????xxxxxxxxxxx????x????xxxxxxxxxx????xxx" // +1
DWORD FindPattern(DWORD baseAddress, DWORD sizeOfModule, BYTE *bMask, char* szMask)
{
for (DWORD i = 0; i < sizeOfModule; i++)
if (bDataCompare((BYTE*)(baseAddress + i), bMask, szMask))
return (DWORD)(baseAddress + i);
return NULL;
}
int Spamm;
int killscreen;
int myname;
int count = 0;
int spre = 0;
int spreupdate;
void Spammer()
{
spreupdate = *(BYTE*)0xA03DCC;//Killstreak
myname = *(char*)0x05A7B1B4; //your name
killscreen = *(char*)0x058C379E; //name of the guy that you killed, it can bug
if (GetAsyncKeyState(VK_F7))//Spamm ON/OFF
{
Spamm = !Spamm;
}
if (Spamm == 0)
{
if (spreupdate == 0)
{
spre = 0;
}
else if (spreupdate > spre)
{
char s[85];
sprintf_s(s, "say ^1%s ^5Get ^1O^2W^3N^4E^5D by ^2%s", killscreen, myname);
SendCmd(0, 0, s);
spre = spreupdate;
}
}
}