Mai jos vă voi lăsa un plugin bazat pe Orpheu(Click pentru a descărca ultima versiune, în caz că nu aveți deja Orpheu), dar și Funcțiile Orpheu necesare. Acesta este plugin care blochează orice tip de Flood(de ex, flood prin script python, de pe un vps)

 

SMA

Spoiler

#include <amxmodx>
#include <orpheu>
 
new OrpheuFunction:HandleFuncNETQueuePacket;
new OrpheuFunction:HandleFuncConPrintf;
 
new OrpheuHook:HandleHookConPrintf;
 
public plugin_init()
{
    register_plugin( "Ban NET Packet Spammer", "1.0.1", "Arkshine" );
    
    HandleFuncNETQueuePacket = OrpheuGetFunction( "NET_QueuePacket" );
    HandleFuncConPrintf      = OrpheuGetFunction( "Con_Printf" );
    
    OrpheuRegisterHook( HandleFuncNETQueuePacket, "NET_QueuePacket_Pre", OrpheuHookPre );
    OrpheuRegisterHook( HandleFuncNETQueuePacket, "NET_QueuePacket_Post", OrpheuHookPost );
}   
 
public NET_QueuePacket_Pre()
{
    HandleHookConPrintf = OrpheuRegisterHook( HandleFuncConPrintf, "Con_Printf" );
}
 
public Con_Printf( const fmt[], const arg[] )
{
    static const message[] = "Oversize packet from ";
    
    if( contain( fmt, message ) >= 0 )
    {
        new ip[ 16 ], i, c;
        
        while( i < charsmax( ip ) && ( c = fmt[ i + charsmax( message ) ] ) && c != ':' ) 
        { 
            ip[ i++ ] = c; 
        }   
        
        ip[ i ] = EOS;
 
        log_to_file( "NET_Packet_Spammer.log", "Blocking %s", ip );
        
        server_cmd( "addip 0 ^"%s^"", ip );
        server_exec();
    }
}
 
public NET_QueuePacket_Post()
{
    OrpheuUnregisterHook( HandleHookConPrintf );
}

 

Funcția „Con_Printf” (v1)

Spoiler

{
    "name"      : "Con_Printf",
    "library"   : "engine",
    "arguments" : 
    [
        {
            "type" : "char *" 
        },
        {
            "type" : "char *" 
        }
    ],
    "identifiers" : 
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : [0x55,0x8B,0xEC,0xB8,"*","*","*","*",0xE8,"*","*","*","*",0x8B,"*","*",0x8D,"*","*",0x50,0x51,0x8D,0x95,"*","*","*","*",0x68,"*","*","*","*",0x52,0xE8,"*","*","*","*",0x8D,0x85,"*","*","*","*",0x50]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "Con_Printf"
        } 
    ]
}

 

Funcția „Con_Printf” (v2)

Spoiler

{
    "name"      : "Con_Printf",
    "library"   : "engine",
    "arguments" : 
    [
        {
            "type" : "char *" 
        },
        {
            "type" : "char *" 
        }
    ],
    "identifiers" : 
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : [0x55,0x8B,"*",0x81,"*","*","*","*","*",0x53,0x56,0x57,0xB9,"*","*","*","*",0xBE]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "Con_Printf"
        } 
    ]
}

 

 

Funcția „NET_QueuePacket”

Spoiler

{
    "name"      : "NET_QueuePacket",
    "library"   : "engine",
    "arguments" : 
    [
        {
            "type" : "int" 
        }
    ],
    "identifiers" : 
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : [0x55,0x8B,0xEC,0x81,0xEC,"*","*","*","*",0x53,0x8B,"*","*",0x56,0x57,0x33,0xFF,0x89,"*","*",0x85,0xFF]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "NET_QueuePacket"
        } 
    ]
}