[E] ReHLDS & HLDS - BLOCK CLIENT OVERFLOW

person L E V I N
schedule Sep 22, 2017
forum 1
visibility 37
Sep 22, 2017 at 6:52 PM
Original Post
#1
Member

Plugin pentru reHLDS & HLDS , care blochează OVER-FLOW-ul la jucători!

 

 

 

Pentru HLDS , veți avea nevoie de Orpheu(în caz că nu aveți deja) - Click (nu contează versiunea), dar și de Funcția „SV_DropClient”(se pune în folderul  „functions”  din folderul  „oprheu”  din folderul  „configs”  din folderul  „amxmodx”

 

V1 SMA + Funcția sa „SV_DropClient”

Spoiler

#include <amxmodx>

#define RETRY_ON_KICK // Çŕńňŕâčňü čăđîęŕ ďĺđĺďîäęëţ÷čňüń˙ ďĺđĺä ęčęîě
//#define ReAPI // Çŕęîěěĺíňčđîâŕňü, ĺńëč íĺň ReAPI

#if defined ReAPI
	#include <reapi>
	#define IGNORE_CALL HC_CONTINUE
	#define BLOCK_CALL HC_BREAK
#else
	#include <fakemeta>
	#include <orpheu>
	#define IGNORE_CALL _:OrpheuIgnored
	#define BLOCK_CALL _:OrpheuSupercede
#endif


#if !defined ReAPI
new g_ClientPtr;
new g_ElementSize;
new g_EntityOffset;
#endif
new g_PlayerWarns[33];

enum CVAR
{
	CVAR_MAX_WARNS,
	CVAR_RESET_TIME
};

new g_Cvars[CVAR] = {0, };

#if !defined ReAPI
new g_DisconnectForward;
#endif

#pragma semicolon 1

public plugin_init()
{
#if defined ReAPI
	register_plugin("[ReAPI] Anti overflow", "3.1", "mazdan & Inline, WPMGPRoSToTeMa");
#else
	register_plugin("Anti overflow", "3.1", "mazdan & Inline, WPMGPRoSToTeMa");
#endif	

	g_Cvars[CVAR_MAX_WARNS] = register_cvar("antir_max_warns", "5");
	g_Cvars[CVAR_RESET_TIME] = register_cvar("antir_reset_time", "10");

#if defined ReAPI
	RegisterHookChain(RH_SV_DropClient, "SV_DropClient", false); 
#else
	OrpheuRegisterHook( OrpheuGetFunction("SV_DropClient"), "SV_DropClient",OrpheuHookPre);	
	g_DisconnectForward = register_forward(FM_ClientDisconnect, "ClientDisconnect");
#endif	


}
#if defined ReAPI
public SV_DropClient( id , crash , const message[] )
#else
public OrpheuHookReturn:SV_DropClient( clientPtr , crash , const message[] ) 
#endif
{	
	new ret = IGNORE_CALL;
#if !defined ReAPI	
	if(g_ElementSize && g_EntityOffset)
#endif
	{

		if(containi(message, "Reliable channel overflowed") != -1)
		{
#if !defined ReAPI
			new id = (clientPtr - g_EntityOffset) / g_ElementSize;
#endif
			if(g_PlayerWarns[id]++ < get_pcvar_num(g_Cvars[CVAR_MAX_WARNS]))
			{
				if(task_exists(id))
					remove_task(id);
					
				set_task(get_pcvar_float(g_Cvars[CVAR_RESET_TIME]), "Task_ResetWarns", id);
				
				ret = BLOCK_CALL;
			}
			else
			{
#if defined RETRY_ON_KICK
				client_cmd(id, "retry");
#endif
				ret = IGNORE_CALL;
			}
		}
	}
#if !defined ReAPI		
	else
	{
		if(containi(message, "Reliable channel overflowed") != -1)
		{
			ret = BLOCK_CALL;
		}
		g_ClientPtr = clientPtr;
	}
#endif

#if defined ReAPI	
	return ret;
#else
	return OrpheuHookReturn:ret;
#endif
}

public Task_ResetWarns(id)
	g_PlayerWarns[id] = 0;

public client_connect(id)
	g_PlayerWarns[id] = 0;

#if !defined ReAPI	
public ClientDisconnect(id) // After SV_DropClient
{
	static entityId = 0, lastPointer = 0;
	
	if(g_ClientPtr)
	{
		if(entityId && entityId != id)
		{
			g_ElementSize = abs( (g_ClientPtr - lastPointer) / (id - entityId) );
			g_EntityOffset = abs( g_ClientPtr - (id * g_ElementSize) );
			
			unregister_forward(FM_ClientDisconnect, g_DisconnectForward);
		}
		else
		{
			lastPointer = g_ClientPtr;
			entityId = id;
		}
	}
}
#endif

 

Spoiler

{
    "name" : "SV_DropClient",
    "library" : "engine",
    "arguments" :
    [
        {
            "type" : "int"
        },
        {
            "type" : "int"
        },
        {
            "type" : "char *"
        }
    ],
    "identifiers":
    [
        {
            "os" : "windows",
            "mod" : "cstrike",
            "value" : [0x55,0x8B,"?",0x81,"?","?","?","?","?",0x8B,0x4D,"?","?",0x56,0x8D,"?","?",0x57,0x50,0x51,0x8D]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "SV_DropClient"
        }
    ]
}

 

 

V2 + Funcția sa „SV_DropClient”

Spoiler

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <orpheu>

#define PLUGIN "HLDS-Project"
#define VERSION "1.0.5"
#define AUTHOR "SkillartzHD"


public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   OrpheuRegisterHook(OrpheuGetFunction("SV_DropClient"), "sv_dropclient_f")
   
   // Add your code here...
}

public OrpheuHookReturn:sv_dropclient_f(a[],b[],c[])
{
   /*
   bCleanDecals= dword pentru -638h // a[]
   count= dword pentru -634h // b[]
   argptr= dword pentru -630h // c[]
   */
   
   if(containi(c,"Reliable channel overflowed")!=-0x01)
   {
      return OrpheuSupercede;
   }
   
   return OrpheuIgnored;
}

 

Spoiler

{
    "name" : "SV_DropClient",
    "library" : "engine",
    "arguments" :
    [
        {
            "type" : "int"
        },
        {
            "type" : "int"
        },
        {
            "type" : "char *"
        }
    ],
    "identifiers":
    [
        {
            "os" : "windows",
            "mod" : "cstrike",
            "value" : [0x55,0x8B,"*",0x81,"*","*","*","*","*",0x8B,0x4D,"*",0x53,0x56,0x8D,0x45,"*",0x57,0x50,0x51,0x8D,0x95]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "SV_DropClient"
        }
    ]
}

 

 

V3 + luați a 2-a versiunea pt. „SV_DropClient”

 

Spoiler

// corrected by Safety1st

#include <amxmodx>
#include <orpheu>

new g_offset
new size
new offset
new g_maxwarns
new p[33]

public plugin_init()
{
	register_plugin("Anti overflow", "2.0", "mazdan")
	register_cvar("anti_reliable_warns", "5")
	set_cvar_string("anti_reliable_time", "10")
} 

public plugin_cfg()
{
	OrpheuRegisterHook( OrpheuGetFunction("SV_DropClient"), "SV_DropClient",OrpheuHookPre);
	set_task(get_cvar_float("anti_reliable_time"),"r",0,_,_,"b")
	g_maxwarns=get_cvar_num("anti_reliable_warns")
}

public OrpheuHookReturn:SV_DropClient( a , b , const szMessage[] )
{	
	
	
	new OrpheuHookReturn:ret=OrpheuIgnored
	if(size && offset)
	{
		if(containi(szMessage,"Reliable channel overflowed")!=-1)
		{
			ret = (p[(a-offset)/size]++<g_maxwarns)?OrpheuSupercede:OrpheuIgnored;
		}
	}
	else
	{
		if(containi(szMessage,"Reliable channel overflowed")!=-1)
		{
			ret = OrpheuSupercede
		}
		g_offset=a
	}
	return ret
}

public r() arrayset(p,0,33)

public client_disconnect(id)
{
	p[id]=0
	static bool:zdes_byl_ya
	static uid, l_o
	if(!zdes_byl_ya && g_offset)
	{
		if(uid)
		{
			if(uid!=id)
			{
				size=(g_offset-l_o)/(id-uid)
				offset=g_offset-id*size
				zdes_byl_ya=true;
			}
		}
		else
		{
			l_o=g_offset
			uid=id
		}
	}
}

 

 

V4 + luați tot a 2-a funcție „SV_DropClient”

Spoiler

#include <amxmodx>
#include <orpheu>
 
public plugin_init()
{
   register_plugin("Anti overflow", "2.0", "mazdan")
} 
 
public plugin_cfg()
{
   OrpheuRegisterHook( OrpheuGetFunction("SV_DropClient"), "SV_DropClient",OrpheuHookPre);
}
 
public OrpheuHookReturn:SV_DropClient( a , b , const szMessage[] )
{   
   return containi(szMessage,"Reliable channel overflowed")==-1?OrpheuIgnored:OrpheuSupercede
}

 

 

 

 

 

 

Pentru reHLDS , aveți nevoie de reAPI - Click

 

Spoiler

#include <amxmodx>

#define RETRY_ON_KICK // Çŕńňŕâčňü čăđîęŕ ďĺđĺďîäęëţ÷čňüń˙ ďĺđĺä ęčęîě
#define ReAPI // Çŕęîěěĺíňčđîâŕňü, ĺńëč íĺň ReAPI

#if defined ReAPI
	#include <reapi>
	#define IGNORE_CALL HC_CONTINUE
	#define BLOCK_CALL HC_BREAK
#else
	#include <fakemeta>
	#include <orpheu>
	#define IGNORE_CALL _:OrpheuIgnored
	#define BLOCK_CALL _:OrpheuSupercede
#endif


#if !defined ReAPI
new g_ClientPtr;
new g_ElementSize;
new g_EntityOffset;
#endif
new g_PlayerWarns[33];

enum CVAR
{
	CVAR_MAX_WARNS,
	CVAR_RESET_TIME
};

new g_Cvars[CVAR] = {0, };

#if !defined ReAPI
new g_DisconnectForward;
#endif

#pragma semicolon 1

public plugin_init()
{
#if defined ReAPI
	register_plugin("[ReAPI] Anti overflow", "3.1", "mazdan & Inline, WPMGPRoSToTeMa");
#else
	register_plugin("Anti overflow", "3.1", "mazdan & Inline, WPMGPRoSToTeMa");
#endif	

	g_Cvars[CVAR_MAX_WARNS] = register_cvar("antir_max_warns", "5");
	g_Cvars[CVAR_RESET_TIME] = register_cvar("antir_reset_time", "10");

#if defined ReAPI
	RegisterHookChain(RH_SV_DropClient, "SV_DropClient", false); 
#else
	OrpheuRegisterHook( OrpheuGetFunction("SV_DropClient"), "SV_DropClient",OrpheuHookPre);	
	g_DisconnectForward = register_forward(FM_ClientDisconnect, "ClientDisconnect");
#endif	


}
#if defined ReAPI
public SV_DropClient( id , crash , const message[] )
#else
public OrpheuHookReturn:SV_DropClient( clientPtr , crash , const message[] ) 
#endif
{	
	new ret = IGNORE_CALL;
#if !defined ReAPI	
	if(g_ElementSize && g_EntityOffset)
#endif
	{

		if(containi(message, "Reliable channel overflowed") != -1)
		{
#if !defined ReAPI
			new id = (clientPtr - g_EntityOffset) / g_ElementSize;
#endif
			if(g_PlayerWarns[id]++ < get_pcvar_num(g_Cvars[CVAR_MAX_WARNS]))
			{
				if(task_exists(id))
					remove_task(id);
					
				set_task(get_pcvar_float(g_Cvars[CVAR_RESET_TIME]), "Task_ResetWarns", id);
				
				ret = BLOCK_CALL;
			}
			else
			{
#if defined RETRY_ON_KICK
				client_cmd(id, "retry");
#endif
				ret = IGNORE_CALL;
			}
		}
	}
#if !defined ReAPI		
	else
	{
		if(containi(message, "Reliable channel overflowed") != -1)
		{
			ret = BLOCK_CALL;
		}
		g_ClientPtr = clientPtr;
	}
#endif

#if defined ReAPI	
	return ret;
#else
	return OrpheuHookReturn:ret;
#endif
}

public Task_ResetWarns(id)
	g_PlayerWarns[id] = 0;

public client_connect(id)
	g_PlayerWarns[id] = 0;

#if !defined ReAPI	
public ClientDisconnect(id) // After SV_DropClient
{
	static entityId = 0, lastPointer = 0;
	
	if(g_ClientPtr)
	{
		if(entityId && entityId != id)
		{
			g_ElementSize = abs( (g_ClientPtr - lastPointer) / (id - entityId) );
			g_EntityOffset = abs( g_ClientPtr - (id * g_ElementSize) );
			
			unregister_forward(FM_ClientDisconnect, g_DisconnectForward);
		}
		else
		{
			lastPointer = g_ClientPtr;
			entityId = id;
		}
	}
}
#endif

 

 

 

ȘI NIȘTE SETĂRI PENTRU SERVER.CFG


//RCON Protection
rcon_password ""
sv_rcon_banpenalty "100"
sv_rcon_maxfailures "1"
sv_rcon_minfailures "1"
sv_rcon_minfailuretime "1"

// Set Rates
sv_instancebaselines "1"
sv_lan "0"
sv_unlag "1"
sv_unlagmax "0.5"
sv_maxunlag "0.1"
sv_unlagsamples "1"
sv_unlagpush "0"
sys_ticrate "666"
host_framerate "0"
edgefriction "2"
fps_max "666"


sv_minrate "100000"
sv_maxrate "25000"
sv_minupdaterate "30"
sv_maxupdaterate "60"
sv_allowupload "0" // daca vreti spray-uri customizate, pe riscul dvs., setati pe 1
sv_allowdownload "0" // daca aveti probleme cu dwd url..setati 1 pe riscul dvs.
max_queries_sec_global "0"
max_queries_sec "0"
decalfrequency "100"
hpk_maxsize "0.1"
sv_consistency "0"
mp_consistency "1" //setati pe 0 daca nu aveti reHLDS
sv_pure "1"
sv_stats "1"
sv_allow_dlfile "0"
sv_timeout "90"
Jan 25, 2018 at 6:12 PM
#2
Member

V5 HLDS cu Orpheu

 

Spoiler

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <orpheu>

#define PLUGIN "HLDS-Project"
#define VERSION "1.0.5"
#define AUTHOR "SkillartzHD"


public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   OrpheuRegisterHook(OrpheuGetFunction("SV_DropClient"), "sv_dropclient_f")
   
   // Add your code here...
}

public OrpheuHookReturn:sv_dropclient_f(a[],b[],c[])
{
   /*
   bCleanDecals= dword pentru -638h // a[]
   count= dword pentru -634h // b[]
   argptr= dword pentru -630h // c[]
   */
   
   if(containi(c,"Reliable channel overflowed")!=-0x01)
   {
      return OrpheuSupercede;
   }
   
   return OrpheuIgnored;
} 

Join the Discussion

You need to be logged in to post a reply.

loginLogin to Reply