this is my code for a nomenu hack for a fps game with DMA.
why is this code not working?
i want it to...
1. find address of server.dll + 716A34
2. put the addy above into a variable called pAddy
3. add offsett 7c8 to pAddy to get the static pointer's addy
3. put the contents of pAddy into pAmmoAddy(pAddyAmmo's contents are a addess and pAmmoValue would result in an addy)
4. change the contents of pAmmoAddy to 40 via int pointer Ammo
EDIT: NEW SOURCE CODE BELOW.
Code:
#include <stdio.h>
#include <windows.h>
DWORD *pAddy;
DWORD AmmoAddy;
DWORD GetAddress(DWORD addie, LPCSTR module)
{
if(GetModuleHandle(module)!=NULL)
{
DWORD addie1=(DWORD)GetModuleHandle(module);
DWORD addie2=addie;
DWORD address = addie1+addie2;
return (address);
}
else
return NULL;
}
void ammo()
{
pAddy = (DWORD*)GetAddress(0x716A34,"server.dll");
if(pAddy = 0)
{
pAddy = (DWORD*)GetAddress(0x716274,"server.dll");
}
AmmoAddy = (*pAddy + 0x7c8);//AmmoAddy is contents of pAddy + offsett
int *Ammo = (int*)(AmmoAddy);//Ammo is now the contents of AmmoAddy
for(;;)
{
*Ammo = 40;
Sleep(20);
}
}
void thread()
{
for(;;)
{
if(GetAsyncKeyState(VK_NUMPAD1)&1)
{
ammo();
}
Sleep(50);
}
}
BOOL WINAPI DllMain(HINSTANCE module, DWORD dwReason, LPVOID lpvReserved)
{
if(dwReason == DLL_PROCESS_ATTACH)
{
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)thread, NULL, NULL, NULL);
}
return TRUE;
}