bypass client error bool isReady = false;
typedef struct
{
BYTE Data[0x3000];
} WeaponMgrCopy;
WeaponMgrCopy* Weapons[670];
void backup(DWORD cshell,DWORD WeaponMgr)
{
DWORD pWeaponMgr = *(DWORD*)(cshell+WeaponMgr );
for(int i=0;i<=999;i++)
{
DWORD Weapon = (*(DWORD*)(pWeaponMgr + (4*i)));
if (Weapon != NULL)
{
Weapons[i] = new WeaponMgrCopy;
memcpy(Weapons[i], (void*)(Weapon), 0x1400);
}
}
}
WeaponMgrCopy* bypass (int GunIndexNR)
{
return Weapons[GunIndexNR];
}
void MakeCall(BYTE* paddress, DWORD yourfunction, DWORD dwlen)
{
DWORD dwOldProtect, dwBkup, dwRelAddr;
VirtualProtect(paddress, dwlen, PAGE_EXECUTE_READWRITE, &dwOldProtect);
dwRelAddr = (DWORD) (yourfunction - (DWORD) paddress) - 5;
*paddress = 0xE8;
*((DWORD*) (paddress + 0x1)) = dwRelAddr;
for(DWORD x = 0x5; x < dwlen; x++) *(paddress + x) = 0x90;
VirtualProtect(paddress, dwlen, dwOldProtect, &dwBkup);
return;
}
//put this under this
void Hack (void)
{
while (1)
{
if (isReady == false)
{
backup(dw_Cshell,weaponMgr);
if (*(BYTE*)(dw_Cshell+0x2B5C75)) // string : Crossfire
{
MakeCall((BYTE*)(dw_Cshell+0x2B5C75), (DWORD)bypass, 5);
isReady = true;
}
else continue;
}
}
}