DllMain failing ?

Hey . I have problem with simple dll when i inject it with example cheat engine i got error "Failed to inject DLL " . I don't know why .

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <Windows.h>


float SpeedPtr = (float)(0x0102DB38);
float fSpeedPtr = *(float*)SpeedPtr;


void WINAPI Hack()
{
   *(float*)(fSpeedPtr + 0xC2DB38) = 500;
}

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
	switch (fdwReason)
	{
	case DLL_PROCESS_ATTACH:
		Hack();//CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Hack, NULL, NULL, NULL);
		break;
	}

	return TRUE;
}
Last edited on
Topic archived. No new replies allowed.