AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   Preventing Vscript from using "SendToServerConsole"? (https://forums.alliedmods.net/showthread.php?t=318532)

Xanaguy 09-05-2019 15:03

Preventing Vscript from using "SendToServerConsole"?
 
Is there any way for a Sourcemod plugin to disable or block that one function from ever executing on a Vscript? I ask here following ProdigySim's advise amidst a critical issue with a hostile workshop addon.

Edit: Any other method may also be an applicable answer.

Lux 09-05-2019 16:39

Re: Preventing Vscript from using "SendToServerConsole"?
 
You could detour the function and just feed it empty string with dhooks.

PHP Code:

int __cdecl SendToServerConsole(const char *a1)
{
  
int (__cdecl *v1)(CBaseEntity *, int); // ebx
  
int v2// eax

  
v1 = *(int (__cdecl **)(CBaseEntity *, int))(*(_DWORD *)engine 148);
  
v2 UTIL_VarArgs(off_BF2604a1);
  return 
v1(enginev2);


Sigs
Linux:
Code:

_ZL19SendToServerConsolePKc
Windows:
Code:

\x55\x8B\xEC\x8B\x4D\x08\xA1\x2A\x2A\x2A\x2A\x2A\x8B
Not tested the sigs but i think windows is correct.

Why not just use this
https://forums.alliedmods.net/showthread.php?p=2662706 can do the job also.

Xanaguy 09-05-2019 17:08

Re: Preventing Vscript from using "SendToServerConsole"?
 
Well, I'm searching for all available options to prevent that function from activating. Preferably those that works for everyone instead of only servers that run sourcemod.

Prodigy did provide one other alternate solution which I will test when I get the time. Once I confirm, I will request that the thread be locked (preferably deleted).


All times are GMT -4. The time now is 16:34.

Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.