- How long you been coding/hacking?
- 5 years
This is a simple D3D9 EndScene Hook Template, you can hit compile and inject it into any Direct3D9 game and it will show a red box on the screen.
Credits to @Broihon @0xDEC0DE @Solaire their code was instrumental in creating this little template.
This template gets the D3D9 Device Pointer and EndScene address using:
https://guidedhacking.com/threads/get-direct3d9-and-direct3d11-devices-dummy-device-method.11867/
Then we do a Trampoline Hook after getting the address of EndScene from the vTable. This is not VMT hooking.
Here is what main.cpp looks like:
If you know nothing about Direct3D, do this guide:
https://guidedhacking.com/threads/how-to-get-started-with-directx-9-make-your-menu-hacks.10402
Stay tuned for a more thorough release and a bone ESP using this source code also.
Credits to @Broihon @0xDEC0DE @Solaire their code was instrumental in creating this little template.
This template gets the D3D9 Device Pointer and EndScene address using:
https://guidedhacking.com/threads/get-direct3d9-and-direct3d11-devices-dummy-device-method.11867/
Then we do a Trampoline Hook after getting the address of EndScene from the vTable. This is not VMT hooking.
Here is what main.cpp looks like:
C++:
bool bInit = false;
tEndScene oEndScene = nullptr;
LPDIRECT3DDEVICE9 pD3DDevice = nullptr;
void* d3d9Device[119];
HRESULT APIENTRY hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
if (bInit == false)
{
pD3DDevice = pDevice;
bInit = true;
}
//draw stuff here like so:
DrawFilledRect(200, 200, 200, 200, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);
return oEndScene(pDevice);
}
DWORD WINAPI Init(HMODULE hModule)
{
if (GetD3D9Device(d3d9Device, sizeof(d3d9Device)))
{
oEndScene = (tEndScene)TrampHook((char*)d3d9Device[42], (char*)hkEndScene, 7);
}
return 0;
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)Init, hModule, 0, nullptr));
}
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
https://guidedhacking.com/threads/how-to-get-started-with-directx-9-make-your-menu-hacks.10402
Stay tuned for a more thorough release and a bone ESP using this source code also.
Attachments
You can download 0 Attachments
-
28.5 KB Views: 696