Woah, hold up. So you are replacing the virtual function with your own function? I understand what you're doing, but doesn't this mean that the real virtual function such as dip and es won't ever be called?
Originally Posted by 258456
Woah, hold up. So you are replacing the virtual function with your own function? I understand what you're doing, but doesn't this mean that the real virtual function such as dip and es won't ever be called?
No, just redirect flow back into the original function when you're done
Originally Posted by ~FALLEN~
No, just redirect flow back into the original function when you're done
Hmm... Well, this is a lot more simple than what i have been doing. I would think that this would be easily detected by xtrap since changing the address of a vtable function in directx is a pretty major adjustment. Well, i guess you learn new things everyday. Good job @~FALLEN~ on your method. Simple is the way to go, lol. This is definitely going to change my hooking methods, hehe.
Originally Posted by 258456
Woah, hold up. So you are replacing the virtual function with your own function? I understand what you're doing, but doesn't this mean that the real virtual function such as dip and es won't ever be called?
it is really easy just declare your function like the original one
first you define the original function like this:
Code:
typedef HRESULT (WINAPI* oEndScene) (IDIRECT3DCREATE9 pDevice);
oEndScene pEndScene; //pointer to original function
then your function:
Code:
HRESULT WINAPI myEndScene(LPDIRECT3DDEVICE9 pDevice) //WINAPI like the original function ; )
{
return pEndScene(pDevice);
}
ofc you should backup the original pointer to pEndScne before replacing it with your own..
Originally Posted by giniyat101
it is really easy just declare your function like the original one
first you define the original function like this:
Code:
typedef HRESULT (WINAPI* oEndScene) (IDIRECT3DCREATE9 pDevice);
oEndScene pEndScene; //pointer to original function
then your function:
Code:
HRESULT WINAPI myEndScene(LPDIRECT3DDEVICE9 pDevice) //WINAPI like the original function ; )
{
return pEndScene(pDevice);
}
ofc you should backup the original pointer to pEndScne before replacing it with your own..
Ya i know that gini, but what fallen was suggesting is changing the address of the endscene function in the vtable to your own. Usually I hook into the function itself i never even dared to change the address of the function.
Originally Posted by giniyat101
it is really easy just declare your function like the original one
first you define the original function like this:
Code:
typedef HRESULT (WINAPI* oEndScene) (IDIRECT3DCREATE9 pDevice);
oEndScene pEndScene; //pointer to original function
then your function:
Code:
HRESULT WINAPI myEndScene(LPDIRECT3DDEVICE9 pDevice) //WINAPI like the original function ; )
{
return pEndScene(pDevice);
}
ofc you should backup the original pointer to pEndScne before replacing it with your own..