AlliedModders (
-   General (
-   -   Preventing Vscript from using "SendToServerConsole"? (

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);



Not tested the sigs but i think windows is correct.

Why not just use this 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.