Code:
VOID MemHack()
{
DWORD dwCShell = (DWORD)GetModuleHandleA(EncCShell);
DWORD pWeaponMgr = *(DWORD*)(dwCShell + WeaponMgr);
if(pWeaponMgr != NULL)
{
if (noreload)
{
Beep(520,100);
for(int i = 0; i < maxweploop; i++)
if((*(DWORD*)(pWeaponMgr+(4*i))) != NULL)
*(float*)((*(DWORD*)(pWeaponMgr+(4*i))) + NoReload) = 100.0f;
else
{
Sleep(10);
if((*(DWORD*)(pWeaponMgr+(4*i))) != NULL)
*(float*)((*(DWORD*)(pWeaponMgr+(4*i))) + NoReload) = 100.0f;
}
}
}
else
{
Sleep(10);
MemHack();
}
}
Without the sleeps, the hacks wouldn't work. But the flaw with this code is that it will take more loading time.
Is there any other way to code it?