Hallo ich bin neu in C++ bei meinen DLL Versuch habe ich ein problem Source:
Das problem ist ven ich die DLL Injecte der process benutzt meinen CPU %90 - %100 ohne die Dll %1 - %5 mit der Dll %90 - %100 warum ?wie kan ich es fixxen
Code:
// MyFirstDllExp.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
BOOL Messages()
{
MessageBoxA(0,"Message^^","Caption =)",0);
return 1;
}
void Loop()
{
while(1)
{
if(GetKeyState(VK_F11) < 0)
{
MessageBoxA(0,"Well Done You Pressed F11\n Now You will get a Second MsgBox.","Done !",0);
Sleep(1);
Messages();
}
}
}
DWORD WINAPI dwHoThread(LPVOID)
{
Loop();
return NULL;
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
DisableThreadLibraryCalls(hModule);
if(dwReason == DLL_PROCESS_ATTACH) {
MessageBoxA(0, "--> Injected", "Caption<--", MB_OK);
CreateThread(NULL, NULL, &dwHoThread, NULL, NULL, NULL);
}
return TRUE;
}