Hooking Help

Posts 1–15 of 18 · Page 1 of 2
Hooking Help
I found out that Hell_Demon post this a long time ago:

Code:
IDirect3DDevice9 *pDevice = (IDirect3DDevice9*)0xaddy;
DWORD *D3DVTable = *(DWORD**)pDevice;

oEndScene = (typecast)DetourFunction((PBYTE)D3DVTable[42], (PBYTE)xEndScene);
How do I find this
Code:
IDirect3DDevice9 *pDevice = (IDirect3DDevice9*)0xaddy;
and this
Code:
DWORD *D3DVTable = *(DWORD**)pDevice;
Would I use Ollydbg and search for intermodular Calls?

EDIT............Forgot we aint using same game
But i search D3D Error and scroll up to the first DWORD( in Ida ) But thats just combat arms

Quote Originally Posted by whit View Post

EDIT............Forgot we aint using same game
But i search D3D Error and scroll up to the first DWORD( in Ida ) But thats just combat arms

Which game would you recommend I start with?
Try this Bro
It finds the device for you

[Highlight=c++]

DWORD * FindDevice(VOID)
{
DWORD Base = (DWORD)LoadLibraryW(L"d3d9.dll");

for(DWORD i = 0; i < 0x128000; i++ )
{
if ( (*(BYTE *)(Base+i+0x00))==0xC7
&& (*(BYTE *)(Base+i+0x01))==0x06
&& (*(BYTE *)(Base+i+0x06))==0x89
&& (*(BYTE *)(Base+i+0x07))==0x86
&& (*(BYTE *)(Base+i+0x0C))==0x89
&& (*(BYTE *)(Base+i+0x0D))==0x86 )
return (DWORD *)(Base + i + 2);
}
return NULL;
}

void d3dxhook(void)
{
DWORD * VtablePtr = FindDevice();
DWORD* devicePtr = ***(DWORD****)VtablePtr;

DWORD * VTable ;
*(DWORD *)&VTable = *(DWORD *)VtablePtr;

pEndscene = ( oEndscene )DetourCreate(( BYTE* )VTable[42], ( BYTE* )myEndscene,5);
}

[/Highlight]


Quote Originally Posted by aanthonyz View Post
Which game would you recommend I start with?
I would Try it on OPERATION7 , WarRock or Combat arms as most other Games the anti cheat will detect it
Ahh...I see...Touche sir.

You have just mind fucked me. Thank you.


I kinda get this(not really). I would need to put this into a DLL and inject it right? Thats what it looks like to me. It it is so, then what do I do to view it? Open this DLL in Ollydbg?

Sorry for my noob questions.
Quote Originally Posted by aanthonyz View Post
Ahh...I see...Touche sir.

You have just mind fucked me. Thank you.


I kinda get this(not really). I would need to put this into a DLL and inject it right? Thats what it looks like to me. It it is so, then what do I do to view it? Open this DLL in Ollydbg?

Sorry for my noob questions.
Yes sir....
Quote Originally Posted by whit View Post


Yes sir....
Yes sir....to turning this into a DLL?
Quote Originally Posted by aanthonyz View Post
Yes sir....to turning this into a DLL?
Yesum......
You don't need to open it in olly if you use that code. It finds the device pointer at runtime(so no need for a static device pointer), meaning it'll work across all versions of the game.
How would I view it then?

Would I log the results?
No need to view it, it'll hook on runtime(no need for any adresses) just inject and it's hooking.

just set up a myEndscene function that looks the same as it does in the headers(HRESULT __stdcall myEndScene(params and stuff)) and it'll execute whenever endscene is called.
Ohh thank you. Wont this be detected though, sooner or later?
If so, what would be the actual steps at making my own hook?
well, I saw this post and I think that that I should make this question....
If I do:
Code:
IDirect3DDevice9 pDevice = *(IDirect3DDevice9*)0xaddy;
Will it gets the Drevice of mw2? Cause I'm on mw2...Well I'm new at this, but I think it's called 'pointer', right?
Quote Originally Posted by user590177 View Post
well, I saw this post and I think that that I should make this question....
If I do:
Code:
IDirect3DDevice9 pDevice = *(IDirect3DDevice9*)0xaddy;
Will it gets the Drevice of mw2? Cause I'm on mw2...Well I'm new at this, but I think it's called 'pointer', right?
That exactly wont get you the address. I dont know exactly how but I know its not that easy.
Quote Originally Posted by aanthonyz View Post
That exactly wont get you the address. I dont know exactly how but I know its not that easy.
no no no, I don't want to get any addie, I just want to get a pointer, that itself holds the current data for the ID3DDrevice9 of modern warfare 2...(Yea baby, I did some researches on google, on: "What is a pointer" )
Posts 1–15 of 18 · Page 1 of 2

Post a Reply

Tags for this Thread

None

Talk with us