[Help]whats wrong with my code?

Posts 1–9 of 9 · Page 1 of 1
[Help]whats wrong with my code?
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;
}
[php]
pAmmoValue = (pAddyAmmo + 0x7C8);//trying to put value of pAddyAmmo into pAmmoValue

[/php]

You didn't point to anything here.

[php]
pAmmoValue = *(pAddyAmmo + 0x7C8);//trying to put value of pAddyAmmo into pAmmoValue

[/php]
Quote Originally Posted by Void View Post
[php]
pAmmoValue = (pAddyAmmo + 0x7C8);//trying to put value of pAddyAmmo into pAmmoValue

[/php]

You didn't point to anything here.

[php]
pAmmoValue = *(pAddyAmmo + 0x7C8);//trying to put value of pAddyAmmo into pAmmoValue

[/php]
viod I have to say ur helping everyone in here wanna code hacks?
thanks for all the help you have given me Void it helped me learn alot.
i shall try that when i get back in 1/2 hr.
I'm just helping people with their problems. \:
only 1 problem.. i get an error when i change it 2 what u said Void.
did u see that the pAmmoValue is a DWORD pointer?
[php]
pAmmoValue = *(DWORD**)(pAddyAmmo + 0x7C8);//trying to put value of pAddyAmmo into pAmmoValue
[/php]
take a look @ my new code and try to help me out still crashing or not working
oh and im pretty sure that GetModuleHandle() crashed the game.
it is a steam game, so it might have protection from that.
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?