D3D Hook

Posts 1–3 of 3 · Page 1 of 1
D3D Hook
Hey guys my menu shows up, works fine, i just need a hook

i found this on the Net:

Code:
DWORD dwES_HOOK = 0x57341E;
DWORD dwES_RESTORE = dwES_HOOK+0x5;

DWORD dwRES_HOOK = 0x570E4E;
DWORD dwRES_RESTORE = dwRES_HOOK+0x7; 

DWORD dwPRES_HOOK = 0x65B316;
DWORD dwPRES_RESTORE = dwPRES_HOOK+0x5;

__declspec( naked ) void Present_Hook( )
{
	_asm
	{
		MOV ECX, DWORD PTR DS:[EAX]
		MOV EDX, DWORD PTR DS:[ECX+0x44]
		PUSHAD
	}

	//call your shit here

	_asm
	{
		POPAD
		JMP[ dwPRES_RESTORE ]
	}
}

_declspec( naked ) void Reset_Hook( )
{
	_asm
	{
		MOV ECX, DWORD PTR DS:[EAX]
		MOV EDX, DWORD PTR DS:[ECX+0x40]
		PUSHAD
	}

	main->OnLostDevice( );

	_asm 
	{
		POPAD 
		CALL EDX
		PUSHAD
	}

	main->OnResetDevice( ); 

	_asm
	{
		POPAD
		JMP[ dwRES_RESTORE ]
	}
}
i am learning D3D soo calm down if i am not right....


see the red text? are addys of the game, but where can i find it...?
And... the hook should be in anothere .h file and include to my menu base? or how?

(could you answear to all my questions ? )
This part is more c++ than d3d.

1 - Look in OllyDbg for patterns.

2 - Normally functions are in .cpp files.
Create a .h file and write the prototypes of the functions into it.
Then create a .cpp file with the same name. Copy the full functions into it. Put the includes into the .cpp file.
Put #include "<Name of header>.h" at the top of your main .cpp file.
The address of DIP and other functions can change..
So this is useless.

@derh.acker you don't need to do that... Let him first practice..
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us