void Inject()
{
while(1)
{
if(GetAsyncKeyState(VK_DELETE))
{
LPTSTR strDLLPath1 = new TCHAR[_MAX_PATH];// get dll directory
::GetModuleFileName((HINSTANCE)&__ImageBase, strDLLPath1, _MAX_PATH);
strDLLPath1[strrchr(strDLLPath1, '\\') - strDLLPath1 + 1] = '\0';
strcat(strDLLPath1,"Something.dll");
HINSTANCE load = LoadLibrary(strDLLPath1);
}
}
}
BOOL WINAPI DllMain(HINSTANCE hinstModule, DWORD dwReason, LPVOID lpvReserved)
{
DisableThreadLibraryCalls(hinstModule);
if(dwReason == DLL_PROCESS_ATTACH)
{
Inject();
return true;
}
return false;
}
void Inject()
{
while(1)
{
if(GetAsyncKeyState(VK_DELETE))
{
LPTSTR strDLLPath1 = new TCHAR[_MAX_PATH];// get dll directory
::GetModuleFileName((HINSTANCE)&__ImageBase, strDLLPath1, _MAX_PATH);
strDLLPath1[strrchr(strDLLPath1, '\\') - strDLLPath1 + 1] = '\0';
strcat(strDLLPath1,"Something.dll");
HINSTANCE load = LoadLibrary(strDLLPath1);
break; // exit the loop
}
}
//will break to here;
}

DWORD WINAPI Inject(LPVOID parblock)
{
while(1)
{
if(GetAsyncKeyState(VK_DELETE))
{
LPTSTR strDLLPath1 = new TCHAR[_MAX_PATH];// get dll directory
::GetModuleFileName((HINSTANCE)&__ImageBase, strDLLPath1, _MAX_PATH);
strDLLPath1[strrchr(strDLLPath1, '\\') - strDLLPath1 + 1] = '\0';
strcat(strDLLPath1,"Something.dll");
HINSTANCE load = LoadLibrary(strDLLPath1);
if(load != NULL)
break;
}
Sleep(15); // The sleep is not needed, but I recommend it so you don't get 100% CPU usage
}
ExitThread(0); //safely end the thread
return 0; //and really end it just in case
}
BOOL WINAPI DllMain(HINSTANCE hinstModule, DWORD dwReason, LPVOID lpvReserved)
{
DisableThreadLibraryCalls(hinstModule);
if(dwReason == DLL_PROCESS_ATTACH)
{
CreateThread(NULL,4096,Inject,NULL,0,NULL);
return true;
}
return false;
}
