HelpSource Code For Hotkey - Would This Work?

Posts 115 of 20 · Page 1 of 2
Source Code For Hotkey - Would This Work?
Hi, I was wondering if something like this would work. And if it wouldn't, what would prevent it from working:
Code:
#include <Windows.h>
#include <iostream>
#include <d3d9.h>

#define FlyHack				0x379377B8
#define GameStatus			0x3796392C

bool Fly = false;
DWORD * GameStatusAddy = (DWORD *) GameStatus;

void TheHackLoop(){
	while(true){
		if(*(BYTE *) GameStatusAddy == 1){
			DWORD * P = (DWORD *) FlyHack;
			
			// Check for toggle request
			if(GetAsyncKeyState(VK_CONTROL) && GetAsyncKeyState(0X4D)){ // Control and M
				Fly = !Fly;
				if(Fly){ // fly turned on
					Beep((DWORD) 528, (DWORD)500);
					Sleep(75);
					Beep((DWORD) 528, (DWORD)500);
				}else{ // fly turned off
					Beep((DWORD) 350, (DWORD)500);
					*(float *) P = -800.00;
				}
			}

			// check for fly request
			if(Fly){
				// check for up or down
				long PreviousGravity = (LONG) P;
				if(Fly && GetAsyncKeyState(VK_ADD)){ // up. Gravity += 50;
					long NewGravity =  PreviousGravity + 50;
					*(float *) P = (FLOAT) NewGravity;
				}else if(Fly && GetAsyncKeyState(VK_SUBTRACT)){ // Down. Gravity -= 50;
					long NewGravity =  PreviousGravity - 50;
					*(float *) P = (FLOAT) NewGravity;
				}
			}
		}
		Sleep(75);
	}
}

void LoadUp(){
	while(true){
		if(IsGameReady()){
			break;	
		}
		Sleep(150);
	}
	TheHackLoop();
}

BOOL IsGameReady(){
	DWORD YeahOrNah = (DWORD)GetModuleHandleA("cshell.dll");
	if(YeahOrNah){ // Loaded
		return TRUE;
	}else{
		return FALSE;
	}
}


INT WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
	DisableThreadLibraryCalls(hModule);

	if(dwReason == DLL_PROCESS_ATTACH)
	{
      CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)LoadUp,NULL,NULL,NULL);
	}
	return 1;
}
Thank you in advance.

Obviously the addresses need updated, but I wrote that about a week ago.
Yes it will work, but it will be extremely glitchy and likely to crash after a short amount of time.
Quote Originally Posted by Skaterforeva1 View Post
Yes it will work, but it will be extremely glitchy and likely to crash after a short amount of time.
May I ask why?

Additional Information: I asked flengo and he said no because it would require a detour. I asked fenix and he said hacks like this do not require detours.
Quote Originally Posted by lilghost8631 View Post
May I ask why?

Additional Information: I asked flengo and he said no because it would require a detour. I asked fenix and he said hacks like this do not require detours.
@Flengo come on. You out of all people should know this will work. I tested it after reading this and it worked. It was very glitchy and i was instantly teleported way into the sky but it worked.
Quote Originally Posted by Skaterforeva1 View Post
@Flengo come on. You out of all people should know this will work. I tested it after reading this and it worked. It was very glitchy and i was instantly teleported way into the sky but it worked.
It shouldn't work. It'll last for a very short time if anything. Telling from testing from long time.
The old PTC method required a hooked function because they had a really simple _ReturnAddress() Check in the function to prevent calling from other modules..
This should work without a hook because your cahnging the variable directly
Quote Originally Posted by Ch40zz-C0d3r View Post
The old PTC method required a hooked function because they had a really simple _ReturnAddress() Check in the function to prevent calling from other modules..
This should work without a hook because your cahnging the variable directly
First of all I just watched the video you posted of your game so far. That looks pretty awesome.
Second I found some interesting stuff about SkelModelStencil, but I would love some help making sense of it. Would you be able to help by chance?

Anywho, thank you for the clarification.
is that fly hack ??
Quote Originally Posted by Ticherhaz View Post
is that fly hack ??
yeah just an adjustable speed version that uses beep to notify the user when it's on or off. The fly hack is not my goal. I'm trying to find information for knockback and chams.
Quote Originally Posted by lilghost8631 View Post
yeah just an adjustable speed version that uses beep to notify the user when it's on or off. The fly hack is not my goal. I'm trying to find information for knockback and chams.
wow.. how long its take to completely understand C++??
Quote Originally Posted by Ticherhaz View Post


wow.. how long its take to completely understand C++??
5 minutes?
I know Java, PHP, VB.net, a little LUA, a little C#, I've done a little with PERL, SQL, I know scheme lisp, batch, python and c++. So honestly since c++ is my most recent language, learning it was just learning a little bit of new syntax.
Quote Originally Posted by lilghost8631 View Post
5 minutes?
I know Java, PHP, VB.net, a little LUA, a little C#, I've done a little with PERL, SQL, I know scheme lisp, batch, python and c++. So honestly since c++ is my most recent language, learning it was just learning a little bit of new syntax.
what?!
5 minutes?! how?
Quote Originally Posted by Ticherhaz View Post


what?!
5 minutes?! how?
I just explained. Once you know several languages, learning a new language like c++ is just learning new syntax.
The fly was just a concept. The real goal here is chams which I think I just found the sig scan/pattern for (that was truly a hike). So, since I now (hopefully) have the pointer to the satellite chams, i should be able to just set the value to 1.0 and cham away.


@Skaterforeva1 off topic: since you have bud in your sig, did you ever get any of that trainwreck strain that was making its way through manassas, gainesville and bristow?
Quote Originally Posted by lilghost8631 View Post
The fly was just a concept. The real goal here is chams which I think I just found the sig scan/pattern for (that was truly a hike). So, since I now (hopefully) have the pointer to the satellite chams, i should be able to just set the value to 1.0 and cham away.


@Skaterforeva1 off topic: since you have bud in your sig, did you ever get any of that trainwreck strain that was making its way through manassas, gainesville and bristow?
It will most likely crash shortely after time, you will need to detour and hook it for it to last a while.

/off topic
Nah I have been smoking some plants that my friend grows locally. I have around two pounds of sour d so I havent been buy any lately. I have been selling a lot though.
Posts 115 of 20 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?