PDA

View Full Version : HELP - Need C++ Functions



SteeL
02-19-2008, 07:19 AM
hi, i make hacks VB6, just trying to jump in C++.

I saw Dxt-Cobra's tut.

in that he stated this function for Writelong


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);
}


But what to write for for functions such as : Readlong ??

:D

wr194t
02-19-2008, 07:24 AM
void Readlong(long addy, read value)
{
memory();
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &value, sizeof(value), NULL);

}

SteeL
02-19-2008, 08:11 AM
Thanks for reply

just renaming it will tell it to read ?

does this same goes for GetAsyncKeyState ?

wr194t
02-19-2008, 08:14 AM
Thanks for reply

just renaming it will tell it to read ?

does this same goes for GetAsyncKeyState ?You need to rename the function name, and the value. GetAsyncKeyState doesn't use a function.

sailerboy
02-19-2008, 10:42 AM
void Readlong(long addy, read value)
{
memory();
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &value, sizeof(value), NULL);

}


Auctually, that will get you a syntax error. You want something like this



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

}



How to use


long watever
watever = Readlong(0xFFFFFF);
if (watever == something)do something
else do something else
or for super jump, use

ong watever;
watever = Readlong(0xFFFFFF);
watever = watever + 2000;
Writelong(0xFFFFFF, watever);
Your welcome

SteeL
02-19-2008, 11:20 PM
Thankx Scott & sailerboy.

I will do as u guided me, hopefully i will release my C++ trainer :P