Thanks for being the only one not flaming, you could move i could care less. Some people on this site are retarded.
Code:
DWORD dwWait()
{
DWORD Base = NULL;
for (;Base == NULL;Sleep(100))
Base = (DWORD)GetModuleHandle("Engine.exe//Watever the app is");
for(;pGameDevice == NULL; Sleep(10000))
{
DWORD dwProtect;
VirtualProtect((void*)(0x7D0840), 4, PAGE_EXECUTE_READWRITE, &dwProtect);
memcpy(&pGameDevice, (void*)(0x7D0840), 4);
VirtualProtect((void*)(0x7D0840), 4, dwProtect, NULL);
}
You could use it like this then end it like this
Code:
DWORD* pdwNewDevice = (DWORD*)pGameDevice;
pdwNewDevice = (DWORD*)pdwNewDevice[0];
pBeginScene = (oBeginScene)DetourFunction((PBYTE)pdwNewDevice[], (PBYTE)myBeginScene);
pEndScene = (oEndScene)DetourFunction((PBYTE)pdwNewDevice[], (PBYTE)myEndScene);
pDrawIndexedPrimitive = (oDrawIndexedPrimitive)DetourFunction((PBYTE)pdwNewDevice[], (PBYTE)myDrawIndexedPrimitive);
pSetStreamSource = (oSetStreamSource)DetourFunction((PBYTE)pdwNewDevice[], (PBYTE)mySetStreamSource);
pSetViewport=(oSetViewport)DetourFunction((PBYTE)pdwNewDevice[],(PBYTE)mySetViewport);
return 0;
}
It's generally a hook. It could help some begginners out. Also, for you noobs dont expect a great hack to always be in a .dll or a app.
inside the [] goes the array for Endscene,SSS,Dip. Just count downwards in d3d8.h. Right?
Correct me if im wrong.
Of course hacks work on vista, for a reason.
A vtable hook + detours or Hooking CreateDevice. Whatever, this is just to explain/show another method. The General Base comes from Strife kudos to him.