Dhooks passing int reference to detour
Hi,
It seems to me you cannot pass argument types to functions with dhooks that are passed by reference unless they are virtual. Well problem is this function CServerGameClients::GetPlayerLimits I wouldn't know how to make this one virtual as you need to pass an instance of CServerGameClients which you don't have in the normal API. So i set this up as detour but with this commit here I cannot tell dhooks that the parameters are to be passed as reference. If I just specify them as int I obviously just get garbage. So what would be the right approach to do this? |
Re: Dhooks passing int reference to detour
There's a global instance g_ServerGameClients (gameinterface.cpp) if you're on linux you can simply use the symbol name.
By the way the 'garbage' value is actually the underlying int * nothing is stopping you from simply using LoadFromAddress/StoreToAddress on it :) |
Re: Dhooks passing int reference to detour
Well, LoadFromAddress requires the address and param.GetAddress from dhooks only works on ptr param types.
So how would I get the address? |
Re: Dhooks passing int reference to detour
PHP Code:
|
All times are GMT -4. The time now is 21:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.