|
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
|

07-02-2012
, 11:18
Re: [Orpheu] SV_ClientConnect & Con_Printf
|
#5
|
Well, I tried your code but now I have other problem.
I'm trying to fix a new hlfill exploit... When I tried the first time it works, but not now... is it something wrong?
Here is full code:
PHP Code:
#include <amxmodx> #include <orpheu>
#define PLUGIN "Anti Fake Bot" #define VERSION "1.0" #define AUTHOR "kanagava"
new ip_old[ 256 ], ip_warn[ 256 ], Msg[ 256 ];
new OrpheuHook:handlePrintf
new time_last_conn, warn, old_time, registered;
public plugin_init( ) { register_plugin( PLUGIN, VERSION, AUTHOR ); OrpheuRegisterHook( OrpheuGetFunction( "SV_ConnectClient" ),"OnSV_ConnectClientPre", OrpheuHookPre ); OrpheuRegisterHook( OrpheuGetFunction( "SV_ConnectClient" ),"OnSV_ConnectClientPost", OrpheuHookPost ); }
public OrpheuHookReturn:OnSV_ConnectClientPre( ) { registered = 0; if( get_systime( ) - old_time <= 2 ) { handlePrintf = OrpheuRegisterHook( OrpheuGetFunction( "Con_Printf" ), "Con_Printf" , OrpheuHookPre ); registered = 1; } old_time = get_systime( ); return OrpheuIgnored; }
public OrpheuHookReturn:OnSV_ConnectClientPost( ) { if( registered ) OrpheuUnregisterHook( handlePrintf );
return OrpheuIgnored; }
public OrpheuHookReturn:Con_Printf( const a[ ], const message[ ] ) { registered = 1;
if( containi( message,"^" connected, address ^"" ) != -1 ) { new len = 255; new temp_right[ 256 ], temp_left[ 256 ], conn_ip[ 256 ]; formatex( Msg,charsmax( Msg ),"%s", message ); split( Msg, temp_left, len, temp_right, len, "^" connected, address ^"" ); strtok( temp_right, conn_ip, len, temp_right, len, ':' ); if( equal( conn_ip,ip_old ) && !equal( conn_ip,"" ) && ( ( get_systime( ) - time_last_conn ) < 2 ) ) { warn = warn + 1; if( warn > 1 && equal( conn_ip, ip_warn ) ) { /*static id; id = find_player( "d", ip_old ); static szName[ 32 ], szSteamID[ 64 ]; get_user_name( id, szName, charsmax( szName ) ); get_user_authid( id,szSteamID, charsmax( szSteamID ) );*/ log_to_file( "orpheu_bot_block.txt", "[Fake Bot Flood] Flood stopped from: %s - Name: \ - SteamID: - Tipo: ", ip_old/*, szName, szSteamID, is_user_bot( id ) ? "BOT" : "PLAYER"*/ ); server_cmd( "addip 120.0 %s", ip_old ); } ip_warn = conn_ip; } else warn = 0; ip_old = conn_ip; time_last_conn = get_systime( ); } return OrpheuIgnored; }
HTML Code:
{
"name" : "SV_ConnectClient",
"library" : "engine",
"identifiers" :
[
{
"os" : "windows",
"value" : [0x55,0x8B,0xEC,0x81,"*","*","*","*","*",0x53,0x56,0x57,0xB9,0x05,0x00,0x00,0x00,0xBE,"*","*","*","*",0x8D,"*","*",0x33,0xDB,0x68,"*","*","*","*"]
},
{
"os" : "linux",
"value" : "SV_ConnectClient"
}
]
}
HTML Code:
{
"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"
}
]
}
__________________
Last edited by Neeeeeeeeeel.-; 07-02-2012 at 11:21.
|
|