DLL Injection
Okay so I'm not new to hacking or anything but as of now I just want to inject a dll that will allow me to minimize LoL without having to open task manager and shit. That way I can use CE and things like that. Now I know all stuff is server sided but I want to give some things a try anyway, but what happens is every time I inject my DLL the game crashes. Now I know for a fact it's not the injected because I have been using it for years and it's always worked. Here is my code:
Very basic, all I want to do is have a thread that checks for f12 to minimize the game. I found that the CreateThread is causing the crash but I don't see anything wrong with it. Can anyone help me with whatever I am doing wrong?
~lilneo
Code:
#include <windows.h>
#define game "League of Legends (TM) Client"
#define game2 "PVP.net Client"
HWND hWnd;
HANDLE HndThread;
int Thread()
{
hWnd = FindWindow(NULL,game2);
while(1)
{
if(GetAsyncKeyState(VK_F12)&1)
{
ShowWindow(hWnd,SW_MINIMIZE);
}
if(GetAsyncKeyState(VK_F10)&1)
{
return 0;
}
Sleep(1);
}
}
BOOL APIENTRY DllMain( HMODULE hModule,DWORD reason,LPVOID lpReserved)
{
if(reason == DLL_PROCESS_ATTACH)
{
hWnd = FindWindow(NULL,game2);
if(hWnd == NULL)
{
MessageBox(hWnd,"Could not find window.","Not Found",0);
return 0;
}
else
{
MessageBox(hWnd,"Injected and Thread Created","Finished",0);
HndThread = CreateThread(0,0,(LPTHREAD_START_ROUTINE)&Thread,0,0,0);
}
}
return 0;
}
~lilneo
