PDA

View Full Version : C++ HELP - my stamina Code



SteeL
02-21-2008, 01:20 AM
Is it correct !! >>



void Writelong(long addy, long value)
{
memory();
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &value, sizeof(value), NULL);

}

void WritePointerFloat(long addy, short offset, float value)
{
long maddy;
long saddy;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);
}


void ReadPointerFloat(long addy, short offset)
{
long maddy;
long saddy;
float value=NULL;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);

}

void Readlong(long addy, long value)
{
memory();
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &value, sizeof(value), NULL);

}




void CWrhak1stDlg::OnStaminaOn()
{
SetTimer(FIRSTTIMER, 1, NULL);
}

void CWrhak1stDlg::OnStaminaOff()
{
KillTimer(FIRSTTIMER);
}





void CWrhak1stDlg::OnTimer(UINT nIDEvent)
{
switch(nIDEvent)
{
case FIRSTTIMER:
{
//stamina

long ST1;
long ST2;
Readlong (0x1332A20, ST1);
ST2 = ST1 + 648;
Writelong(ST2, 1120403456);
}
break;
}

CDialog::OnTimer(nIDEvent);
}


I just utilized my VB6 code n edited some line.. i'm new in C++ :eek:

i get this ERROR :

C:\Program Files\Microsoft Visual Studio\MyProjects\wrhak1st\wrhak1stDlg.cpp(246) : warning C4700: local variable 'ST1' used without having been initialized

*************
also just need help in Hotkeys.

wht goes in that Hex value after suppose >
if (GetKeyState(VK_VK_DELETE) &2E)

but & is something related to Pointer i guess ! cus & operator will give address of 2E but there is nothing declared to be 2E ? m i correct ! :confused:

relatwister
02-21-2008, 08:06 AM
its not good
the timer must come before the buttons that use the timers and the stamina code is not good.
the timer must be

case FIRSTTIMER://unlim stamina
}
WritePointerFloat (0xadresss, 0xoffset, value);//just fill in the adresses by your self
}
break;
the button was good

btw srry for my bad english iam dutch
warrock is updated !!!!!

SteeL
02-21-2008, 08:49 AM
Got ZERO Errors.. now only thing remains is

Hotkeys & new Addresses for 21st Feb 2008 :)

relatwister
02-21-2008, 09:21 AM
the hotkey i use is

case SECONDTIMER://winchest hotkey
{
if (GetKeyState(VK_LCONTROL) &1)
{
WritePointerFloat (0xaddress, 0xoffset, value);
}
hope i helped you and the adresses you can find here:
http://www.dxth4x.com/forums/showthread.php?t=3026

SteeL
02-21-2008, 10:21 AM
thankx


How do i Auto enable a Timer ?
where do i put this
SetTimer(SECONDTIMER, 1, NULL);

to get a timer Autoenabled for a Hotkey. !

---------------
I found Solution :
Just added This Line : SetTimer(FIRSTTIMER,1,NULL);


UNDER THIS :


// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

DJBloodHunter
02-21-2008, 01:36 PM
You code in what software?