Loop it *post too short*
Hi everyone
First of all I hope this isn't double posting, because I posted the same question somewhere else before but didn't get any replies let alone an answer to my question
I admit that I didn't wait very long ( 1.5 days) before posting this the reason for that is that I'm stuck in the process of making my hack and I really, really, really want to move on
So here it goes:
I have an addy which I want to use for testing and developing further hacks
0x377502E8 << Credits go to: vingadormaster, for finding this addy (I think, at least he posted it first)
So now I Made a test dll, to see if it injects properly, which it did
then I made the part that changed the value:
I have tested this, and it stil inects properly but nothing happens, (this code should turn the killcam on or off on my computer)Code:#define ADR_KILLCAMCAEU 0x377502E8 BOOL t = 0; void patch(){ HANDLE ca = GetCurrentProcess(); if(GetAsyncKeyState(VK_INSERT)) { Sleep(500); t = !t; int s = sizeof(t); if( WriteProcessMemory(ca, (LPVOID*)(DWORD) ADR_KILLCAMCAEU ,(void*) t, s, NULL) == 0) Sleep(500); }
What am I doing wrong? similar code worked on an other game with no protection or whatsoever so do I need a bypas or something like that or is my code just wrong?
if it is, can somone please show me my mistakes and point me in the right derection?
-SCHiM
Loop it *post too short*
Ah we-a blaze the fyah, make it bun dem!
Void (05-30-2010)
With that method of implementing a hotkey, you have less than a second to press it.
Put it in a loop ^^
[php]
while(true)
{
if(GetAsyncKeyState(VK_INSERT))
{
//code
}
}
[/php]
You'd have to be holding the key while you inject and even then there'd be a chance it wouldnt trigger :P
void patch()
{
while(1)
{
...code here...
}
}
Ah we-a blaze the fyah, make it bun dem!
Thanks for the quick responses, I think it's a good thing I'm no rocket scientist
But I don't think it is working, the game freezes when I inject my DLL and it's probably the loop causing this...
Last edited by schim; 05-30-2010 at 11:35 AM.
could be that. try a while(1) loop
Ok, so now I have changed my code many times, did a lot of debug messages and was able to pinpoint why my game freezes:
The injector works by creating a remote thread (CreateRemoteThread)
I don't know why but it waits for my dll to end it's execution before closing the thread. But because of the while loop in my dll this won't happen of course other hacks do work with this injector
I have tried to return a value, my game (and my injector) would unfreeze but it would end the execution of my dll
So how can I solve this?
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)patch, 0, 0, 0); instead of patch(); in your DllMain
Ah we-a blaze the fyah, make it bun dem!
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
Superb! It works now, thank you!!
At least, the patch function works, but the outcome doesn't differ from when I first started this thread, the killcam isn't turned on or off, so if you guys are sure the code itself is right I can go searching for a way to make my hack actually work![]()
Last edited by schim; 05-30-2010 at 01:13 PM.
Are you pressing the button once killcam is running? I think it just sets the killcam timer to 0.
Ah we-a blaze the fyah, make it bun dem!
i think you should get the playerpointer and begin the loop when it is !=0.... maybe it won't freeze ur game
EDIT: i read all the post xD the problem was solved... anyway, maybe the addy need the offset, you don't have the pointer, only the addy i think...
Last edited by Sixx93; 05-30-2010 at 02:09 PM.
@sixx93
yes this is only the addres, what should I add to it then?
@Hell_Demon
Even if that is the case there's still no imput, I have put the actual write part inside a loop to, so once activated it's writing 0 to the address continuously, but there's still nothing happening![]()
post the code you're currently using ;P
Ah we-a blaze the fyah, make it bun dem!