Raised This Month: $ Target: $400
 0% 

Autobuy exploit fixer


Post New Thread Reply   
 
Thread Tools Display Modes
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-07-2012 , 11:27   Re: Autobuy exploit fixer
Reply With Quote #21

Quote:
Originally Posted by SPT1 View Post
so which one i will use?
There is one (i believe written by xPaw) that does it by heuristics. Actually pretty neat. But you can do it many different ways. Still haven't read this thread's code so i can't really tell you what i think about his way.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
isotonic
AlliedModders Donor
Join Date: Jun 2011
Location: Moscow, Russia
Old 09-09-2012 , 21:21   Re: Autobuy exploit fixer
Reply With Quote #22

You don't set initial value for last.
__________________
isotonic is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 09-10-2012 , 04:37   Re: Autobuy exploit fixer
Reply With Quote #23

Quote:
Originally Posted by isotonic View Post
You don't set initial value for last.
fixed
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 09-11-2012 at 08:11.
Owyn is offline
Send a message via ICQ to Owyn
hasn111
New Member
Join Date: Sep 2012
Old 09-23-2012 , 12:55   Re: Autobuy exploit fixer
Reply With Quote #24

i use this one it works.

but i need one small update. Can somebody tell me how to post the user who tried to exploit in ingame chat? Something like "user XY with ID XY tried to use the autobuy bug".

Quote:
#include <amxmodx>

#define PLUGIN_NAME "Fix AutoBuy Exploit"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Owyn"

public plugin_init( )
{
register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
register_clcmd( "cl_setautobuy", "cmd_check" );
register_clcmd( "cl_setrebuy", "cmd_check" );
}

#define MAX_LEN 30

public cmd_check( id )
{
static arg[512];
read_args(arg, sizeof(arg)-1);
remove_quotes(arg);

// CHECK start
static len, i, last, bool:bad;
len = strlen(arg);
bad = false;
last = 0;
i = 0;
while(i < len)
{
if(arg[i] == ' ') // space symbol
{
if(i-last > MAX_LEN)
{
bad = true;
break;
}
last = i+1;
}
i++;
}
if(i-last > MAX_LEN)
{
bad = true;
}
// CHECK end

if(!bad)
{
//log_to_file("autobuy.log", "%d: %s", id, arg) // log all autobuys
return PLUGIN_CONTINUE;
}
// else
new name[32];
get_user_name( id, name, charsmax( name ) ) ;
log_to_file("autobuy_crash.log", "%s: arg at %d of %s", name, i ,arg);
client_print(id,print_chat,"Bad autobuy! Fix it and come back!")
return PLUGIN_HANDLED;
}
hasn111 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-23-2012 , 14:01   Re: Autobuy exploit fixer
Reply With Quote #25

Quote:
Originally Posted by hasn111 View Post
i use this one it works.

but i need one small update. Can somebody tell me how to post the user who tried to exploit in ingame chat? Something like "user XY with ID XY tried to use the autobuy bug".
PHP Code:
new szName[32], szAuthID[32]
get_user_name(idszNamecharsmax(szName) )
get_user_authid(idszAuthIDcharsmax(szAuthID) )

// and then print it all 
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
hasn111
New Member
Join Date: Sep 2012
Old 09-23-2012 , 16:18   Re: Autobuy exploit fixer
Reply With Quote #26

thank you 4 the respond. But it does not work to me, in addition i changed to another script, because this script returns the steam id in logfile. But this script does not printing anything in ingame chat.

So how can i add this again? " Steam id, Name, tried to use autobuy ".


Code:
#include <amxmodx>
/*
#define MAX_AUTOBUY_ITEM_LENGTH 11
#define MAX_REBUY_ITEM_LENGTH 15
*/
enum {
    AutoBuy,
    Rebuy
}

new Trie:g_tAutoBuy
new Trie:g_tReBuy

public plugin_init()
{
    register_plugin("Anti Auto/Rebuy Crash","0.0.3","ConnorMcLeod")

    g_tAutoBuy = TrieCreate()
    g_tReBuy = TrieCreate()

    new i

    new szAutoBuy[][] = {
        "galil", "defender", "ak47", "cv47", "scout", 
        "sg552", "krieg552", "awp", "magnum", "g3sg1", 
        "d3au1", "famas", "clarion", "m4a1", "aug", 
        "bullpup", "sg550", "krieg550", "usp", "km45", 
        "p228", "228compact", "deagle", "nighthawk", "elites", 
        "fn57", "fiveseven", "m3", "12gauge", "xm1014", 
        "autoshotgun", "mac10", "tmp", "mp", "mp5", 
        "smg", "ump45", "p90", "c90", "m249",
        "primammo", "secammo", "vest", "vesthelm", "flash",
        "hegren", "sgren", "nvgs", "defuser", "shield"
    }
    for(i=0; i<sizeof(szAutoBuy); i++)
    {
        strtolower(szAutoBuy[i])
        TrieSetCell(g_tAutoBuy, szAutoBuy[i], 1)
    }

    new szReBuy[][] = {
        "PrimaryWeapon", "PrimaryAmmo", "SecondaryWeapon", "SecondaryAmmo", "Defuser",
        "Armor", "HEGrenade", "Flashbang", "SmokeGrenade", "NightVision"
    }
    for(i=0; i<sizeof(szReBuy); i++)
    {
        strtolower(szReBuy[i])
        TrieSetCell(g_tReBuy, szReBuy[i], 1)
    }

    register_clcmd("cl_setautobuy", "CheckStringLength", AutoBuy)
    register_clcmd("cl_setrebuy", "CheckStringLength", Rebuy)
}

public CheckStringLength(id, iType)
{
    static szArgs[1024], szItem[64]
    read_args(szArgs, charsmax(szArgs))

    remove_quotes(szArgs)
    trim(szArgs)

    new Trie:tCheck = iType ? g_tReBuy : g_tAutoBuy
    while( strlen(szArgs) && strtok(szArgs, szItem, charsmax(szItem),szArgs, charsmax(szArgs), ' ') )
    {
        if( szItem[0] == '^"' )
        {
            if(! IsArgValid(id, szItem[1], tCheck) )
            {
                return PLUGIN_HANDLED
            }
        }
        else if( !IsArgValid(id, szItem, tCheck) )
        {
            return PLUGIN_HANDLED
        }
    }
    if( szArgs[0] )
    {
        if( !IsArgValid(id, szArgs, tCheck) )
        {
            return PLUGIN_HANDLED
        }
    }
    return PLUGIN_CONTINUE
}

IsArgValid(id, szArg[], Trie:trie)
{
    strtolower(szArg)
    if( !TrieKeyExists(trie, szArg) )
    {
        new szAuth[32], szName[32], szCmd[32], szArgs[1024]
        read_argv(0, szCmd, charsmax(szCmd))
        get_user_name(id, szName, charsmax(szName))
        get_user_authid(id, szAuth, charsmax(szAuth))
        read_args(szArgs, charsmax(szArgs))
        remove_quotes(szArgs)
        
        log_to_file("AutoBuy.log", "<%d><%s><%s><%s><%s><%s>", id, szName, szAuth, szCmd, szArg, szArgs)
        return 0
    }
    return 1
}
it nearly done. i did this

Code:
client_print(id,print_chat,"Jemand hat versucht den Server zu crashen, seine Steam ID wurde gespeichert. Das gibt PPS junge!")
but how can i ad the User Name ?

Code:
client_print(id,print_chat,szName."Jemand hat versucht den Server zu crashen, seine Steam ID wurde gespeichert. Das gibt PPS junge!")
i tried this but this does not work

Last edited by hasn111; 09-23-2012 at 16:41. Reason: new idea
hasn111 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-23-2012 , 16:45   Re: Autobuy exploit fixer
Reply With Quote #27

search.
These are basic things you're asking.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 09-23-2012 , 17:24   Re: Autobuy exploit fixer
Reply With Quote #28

Sorry for going off-topic but there are lots of servers that automatically bind your autobuy key so that it crashes other servers. If you ban these people you are banning innocent users. Why don't you simply update your server?
This plugin makes no sense...
__________________
mabaclu is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 09-24-2012 , 04:52   Re: Autobuy exploit fixer
Reply With Quote #29

Quote:
Why don't you simply update your server?
Because there is no update? Or if you mean updating it with this scripts then yes, that'd work.
If you write about it inchat then it gonna flood your server to hell, it already logs and prints it to exploiter.
logging for steam id, IP, userid and anything else wasn't made cuz it's assumed you got logs enabled and if you know name and time it's easy for you to see who entered withs this name and with which steam id. Probably logging should be removed at all, it's a fix first of all not a show off its activity tool.
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 09-24-2012 , 08:43   Re: Autobuy exploit fixer
Reply With Quote #30

Update with -beta hlbeta in the command line.
__________________
mabaclu 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 20:12.


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