[Tutorial] Complete source for warrock hack!
I get annoyed when I see simple memory writing made this complex... You can easily change the value of a pointer without defining any variables but the base addy and the offset. It is a waste of time to declare other ints and floats when you can write to a value with a single line of code. I'll just use stamina as an example and make up random addresses. Here is an example of how to do this the efficient way. I will also add the hotkeys and show how to make an efficient loop to keep the hack running:
Please excuse any errors, I just wrote this from memory. The basic idea is actually this line:
The float at the beginning is showing that the type of the value is float, the DWORD is just showing that it is 4 byte (which an offset always is) and the 100 is just the value to set it to.
Code:
#define Playerpointer 0x12345678
#define StaminaOffset 0x284
bool staminaon = false;
void Stamina()
{
while(1)
{
if(staminaon == true)
{
*(float*)(*(*DWORD*)Playerpointer + StaminaOffset) = 100;
Sleep(100); //Avoid lag
}
}
}
void Hotkeys()
{
while(1)
{
if(GetAsyncKeyState(VK_NUMPAD1))
{
if(staminaon == false)
{
staminaon = true;
MessageBox(0, "Stamina Activated", "DLL Hack", MB_OK);
}
else
{
staminaon = false;
MessageBox(0, "Stamina Deactivated", "DLL Hack", MB_OK);
}
}
Sleep(100); //Avoid lag
}
}
BOOL APIENTRY DllMain(HINSTANCE hDll, DWORD callReason, LPVOID lpReserved)
{
DisableThreadLibraryCalls(hDll);
switch(callReason)
{
case(DLL_PROCESS_ATTACH):
{
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&Stamina, 0, 0, 0);
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&Hotkeys, 0, 0, 0);
}
case(DLL_PROCESS_DETACH):
{
FreeLibrary(hDll);
break;
}
}
return 1;
}
Code:
*(float*)(*(DWORD*)Playerpointer + StaminaOffset) = 100;
ok lets get started:
Originally Posted by Destrod16
Originally Posted by Destrod16
efficient? no...
complex? yes...
so you do the exact same thing ^^
Originally Posted by Destrod16
You could write a whole program in 1 line. as long as you dont use newlines and make sure the brackets are ok.
so 1 line doesnt say anything about the efficienty of the code. but then again, you would use defines to make a struct, so what do you know about efficienty ^^
Originally Posted by Destrod16
FYI 100 is an int
100.0f is a float if you wish to do it correctly.
Originally Posted by Destrod16
Hmm... thats new to me, could someone explain since when offsets are 4 bytes?
Oh wait...
Offsets are not always 4 bytes
ever heard of unsigned char? thats right, 1 whole byte
and you can even use it in structs and classes(OH NO A 1 BYTE OFFSET)
Thanks for making my day
complex? yes...
so you do the exact same thing ^^
so 1 line doesnt say anything about the efficienty of the code. but then again, you would use defines to make a struct, so what do you know about efficienty ^^
100.0f is a float if you wish to do it correctly.
Oh wait...
Offsets are not always 4 bytes
ever heard of unsigned char? thats right, 1 whole byte
and you can even use it in structs and classes(OH NO A 1 BYTE OFFSET)Thanks for making my day

@hell_demon: Wouldn't the #define be more efficient? Because instead of allocating tons of memory to variables you are just saying the address manually each time. If you have tons of addresses to work with, allocating that many would be quite problamatic, and define doesn't take any resources from the compiled program, unlike having tons of variables. Though i may be wrong, since i'm pretty much a beginner.
And everything you said besides that is just nit-picking :/
Using 100 instead of 100.0f doesn't really matter that much, it was a quick example.
And everything you said besides that is just nit-picking :/
Using 100 instead of 100.0f doesn't really matter that much, it was a quick example.
compiler takes care of converting 100 to 100.0f, but its still cleaner to write 100.0f
Him saying he hates it when people do easy memory editing so complex while he himself uses 150 defines for something which can be done in a small loop pisses me off :P
you could have 1 byte(using unsigned chars) or 8 bytes(using double) which according to him would not excist because all offsets must be 4 bytes.
/agree that i was nitpicking, but he was trying to be a mr. know-it-all while there can only be one! ME!

posting your source isnt a tutorial at all, nice youre banned (sorry:P)
This thread is closed for replies.
Similar Threads
Visual Basic ProgrammingTutorial - How to use Visual Basics 6 (vb6) for WarRock hacks
17 Gunz GeneralTrading gunz hacks for Warrock hacks
5 C++/C Programming[REQUEST]Need a Bypass source for warrock hack
5 WarRock - International Hacksgive me .net(code) for warrock hacks 7 WarRock - International HacksWarrock Hack - Tutorial
667

