Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#Actualfarmdve

Posted 23 November 2012 - 05:29 AM

I used this code right here https://github.com/t...e/D3D-Hook-Test to hook Directx's EndScene method.

The code is hooking properly, but the new EndScene method is just never called...at all.

This is the new function

HRESULT WINAPI D3DEndScene_hook(IDirect3DDevice9* device)
{
__asm pushad;
MessageBoxA(NULL, "DX", "DX", MB_ICONEXCLAMATION);
__asm popad;
return D3DEndScene_orig(device);
}

Basically a popup should appear every time EndScene is called, but it isn't. I am not sure where I am wrong.

Since the game uses LoadLibraryA to load d3d9.dll, I also used code from http://www.rohitab.c...ion-and-vtable/ to get the address of the loaded d3d9.dll and patch that.

EDIT:Fixed the problem, the code on github called device->Release();

#2farmdve

Posted 23 November 2012 - 05:08 AM

I used this code right here https://github.com/t...e/D3D-Hook-Test to hook Directx's EndScene method.

The code is hooking properly, but the new EndScene method is just never called...at all.

This is the new function

HRESULT WINAPI D3DEndScene_hook(IDirect3DDevice9* device)
{
__asm pushad;
MessageBoxA(NULL, "DX", "DX", MB_ICONEXCLAMATION);
__asm popad;
return D3DEndScene_orig(device);
}

Basically a popup should appear every time EndScene is called, but it isn't. I am not sure where I am wrong.

Since the game uses LoadLibraryA to load d3d9.dll, I also used code from http://www.rohitab.com/discuss/topic/34411-run-time-directx-hooking-using-code-injection-and-vtable/ to get the address of the loaded d3d9.dll and patch that.

#1farmdve

Posted 23 November 2012 - 05:06 AM

I used this code right here https://github.com/tgascoigne/D3D-Hook-Test to hook Directx's EndScene method.

The code is hooking properly, but the new EndScene method is just never called...at all.

This is the new function

HRESULT WINAPI D3DEndScene_hook(IDirect3DDevice9* device)
{
__asm pushad;
MessageBoxA(NULL, "DX", "DX", MB_ICONEXCLAMATION);
__asm popad;
return D3DEndScene_orig(device);
}

Basically a popup should appear every time EndScene is called, but it isn't. I am not sure where I am wrong.

PARTNERS