View Single Post
PlayBoy31
Senior Member
Join Date: May 2011
Location: into the void
Old 11-19-2020 , 05:17   Re: Metamod Query Cache
Reply With Quote #77

Some one have this metamod plugin working?

tested to compil it against last MM version for CSS, it crash on meta load

Code:
0 	0x9fca1c9
1 	libtier0_srv.so!VCR_Hook_recvfrom(int, char*, int, int, sockaddr*, int*) + 0x50
2 	engine_srv.so!NET_ReceiveDatagram(int, netpacket_s*) + 0x1e7
The load seems ok, QCachePlugin::Load with

Code:
	bOkay &=  recvfrom_detour.HookFunction((void*)recvfrom, (void*)recvfrom_hook_RM);
	
	bOkay &= sendto_detour.HookFunction((void*)sendto, (void*)sendto_hook);
return ok, sounds good but when recvfrom_hook_RM is called, it crash,

I have setup some traces, here the result

Code:
int _FPREFIX recvfrom_hook_RM(SOCKET s, char *buf, int len, int flags, struct sockaddr *from, int *fromlen)
{
	META_CONPRINTF("[QCache] recvfrom_hook_RM start.\n");
	
	META_CONPRINTF("[QCache] recvfrom_hook_RM recvfrom_Original.\n");
	
	recvfrom_f recvfrom_Original = (recvfrom_f)recvfrom_detour.OriginalPointer();
	
	META_CONPRINTF("[QCache] recvfrom_hook_RM sendto_Original.\n");
	
	sendto_f sendto_Original = (sendto_f)sendto_detour.OriginalPointer();
	
	META_CONPRINTF("[QCache] recvfrom_hook_RM Result.\n");
	
	int Result = recvfrom_Original(s, buf, len, flags, from, fromlen);
	
	
	META_CONPRINTF("[QCache] recvfrom_hook_RM end.\n");

	return Result;
}
console traces:

Code:
118 	187.694495 	[QCache] Hooking recvfrom - SUCCESS.
119 	187.694568 	[QCache] Hooking sendto - SUCCESS.
120 	187.694735 	Plugin "Sample Plugin" loaded with id 7.
121 	187.694812 	[QCache] recvfrom_hook_RM start.
122 	187.694858 	[QCache] recvfrom_hook_RM recvfrom_Original.
123 	187.694912 	[QCache] recvfrom_hook_RM sendto_Original.
124 	187.694943 	[QCache] recvfrom_hook_RM Result.
CRASH!!!!!!!
[QCache] recvfrom_hook_RM end is never called before the return it crash on the called of recvfrom_Original

any idea?

Last edited by PlayBoy31; 11-19-2020 at 05:21.
PlayBoy31 is offline