I've been trying to figure this out for about 2 days. Sorry if this is an easy one to solve, but I just can't work it out.
Okay, so here is my code:
Code:
while(true) // Loops so the memory keeps rewriting itself if it's changed.
{
if (GetAsyncKeyState(VK_F1)&1) // If the "F1" hotkey is pressed then it will write the new data to the memory address.
{
WriteProcessMemory(trollpr0c3zz, (LPVOID)ammo_addr, &troll, umgh4x0rz, NULL);
}
if (GetAsyncKeyState(VK_F2)&1) // If the "F2" hotkey is pressed then it will write the new data to the memory address.
{
WriteProcessMemory(trollpr0c3zz, (LPVOID)round_addr, &troll, umgh4x0rz, NULL);
}
} // End of loop.
Basically, I'm trying to get my program to modify the memory when I press a hotkey; which works fine. However, I want it to make it loop so it continously modifies the memory since it changes when the value is changed. I have to hold the hotkey down for it to continously write the new memory. I want to be able to press my hotkeys once and it continously writes the memory over and over again so it's in a sort of 'freeze' state.
Thanks a lot guys .