I need help :D
i made a dll that gets injected as soon as a game starts, and then hooks the Direct3DCreate9 function from the import library with apihook, but seems not working :S
here the code:
void myDirect3DCreate9(int version)
{
fprintf(file,"myDirect3DCreate9(%d) called\r\n",version);
}
DllMain:
bool APIENTRY DllMain( HMODULE hModule, DWORD fdwReason, LPVOID lpvReserved )
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
hDll=hModule;
file=fopen("debug.txt","w");
fprintf(file,"Dll attached\r\n");
hThread=CreateThread(0,0,(LPTHREAD_START_ROUTINE)hack,0,0,0);
InitColors(); //change some cool colors :D
//removeSplashScreen();
//hook
DisableThreadLibraryCalls( hModule );
HookAPICalls( &D3DHook );
//
break;
case DLL_PROCESS_DETACH:
fprintf(file,"Dll detached\r\n");
if(TerminateThread(hThread,0)&&file)
fprintf(file,"Thread terminated\r\n");
fclose(file);
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}
this should work!!!! :-(
EDIT: Please remember 'source' tags in future!
[Edited by - jollyjeffers on August 12, 2007 1:28:21 PM]