PDA

View Full Version : Basic HotKey C++ Hook Base



TechX
March 30th, 2015, 02:39 AM
I figured I'd start releasing my findings. My backgrounds are C++ based and D3D, so all this C# stuff is making me nuts :P



#include <windows.h>
bool IsGameReadyForHook()
{
if( GetModuleHandle( "eldorado.exe" ) != NULL )
return true;


return false;
}
void main()
{
while (!IsGameReadyForHook()){
Sleep(20);
}
bool test = false;
bool panic = false;
while(true){
if(GetAsyncKeyState(VK_NUMPAD1)<0){
if(test){

test = false;
} else {
MessageBox(NULL, NULL, NULL, NULL);
test = true;
}
}
if(GetAsyncKeyState(VK_END)<0) {
if(panic){
panic = false;
} else {
exit(0);
panic = true;
}
}
Sleep(200);
}
}
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&main, NULL, 0,NULL);
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}


I'll have some actual stuff out soon

t3h m00kz
April 16th, 2015, 01:01 AM
christ I have no context. nvm