Raised This Month: $32 Target: $400
 8% 

Preventing Vscript from using "SendToServerConsole"?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xanaguy
Senior Member
Join Date: Jan 2017
Old 09-05-2019 , 14:03   Preventing Vscript from using "SendToServerConsole"?
Reply With Quote #1

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.

Last edited by Xanaguy; 09-05-2019 at 14:08.
Xanaguy is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 09-05-2019 , 15:39   Re: Preventing Vscript from using "SendToServerConsole"?
Reply With Quote #2

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.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Xanaguy
Senior Member
Join Date: Jan 2017
Old 09-05-2019 , 16:08   Re: Preventing Vscript from using "SendToServerConsole"?
Reply With Quote #3

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

Last edited by Xanaguy; 09-05-2019 at 16:09.
Xanaguy is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode