Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

DirectX 9 hooking.

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 farmdve   Members   

194
Like
0Likes
Like

Posted 23 November 2012 - 05:06 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();

Edited by farmdve, 23 November 2012 - 05:29 AM.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.