need help with c++ timer

Posts 1–3 of 3 · Page 1 of 1
need help with c++ timer
I need help making a working timer in c++ for stamina, and all the things that need to be freezed, here is what I got, see if you can help me out.

Code:
void memory()
{
HWND hWnd = FindWindow(0, "WarRock");
GetWindowThreadProcessId(hWnd, &proc_id);
hProcess = OpenProcess(PROCESS_ALL_ACCESS|PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, proc_id);
}

void CMyTrainer1Dlg::OnTimer(UINT nIDEvent) 
{
if (stamina == true)
{
	long staddy = 0x12F06C0;
	short stoffset = 288;
	float stvalue = 1120403456;
	long stmaddy;
	long stsaddy;
	memory();
	ReadProcessMemory(hProcess, (LPVOID*)(DWORD) staddy, &stmaddy, sizeof(stmaddy), NULL);
	stsaddy = stmaddy + stoffset;
	WriteProcessMemory(hProcess, (LPVOID*)(DWORD) stsaddy, &stvalue, sizeof(stvalue), NULL);
}	
	CDialog::OnTimer(nIDEvent);
}

void CMyTrainer1Dlg::OnStamOn() 
{
stamina = true;
}

void CMyTrainer1Dlg::OnStamOff() 
{
stamina = false;
}
paste the whole code
Quote Originally Posted by vescovo View Post
paste the whole code
i added everything thats involved with the stamina timer, besides "bool stamina"
Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us