Results 1 to 7 of 7

Thread: Accept cracked players

  1. #1
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts

    Accept cracked players

    In the code below it intercepts the deny message that kicks cracked players and replaces it with accept.

    PHP Code:
    void hook_ServerCommandnetadr_t frommsg_t *msg )
    {
            if (
    strncmp (msg->data,"˙˙˙˙ipAuthorize"15) == 0)
        {
            if(
    strstr (msg->data"deny") != NULL)
            {
                
    char d[100];
                
    char pch strtok (msg->data" ");
            
                while(
    pch != NULL)
                {
                    if(
    strcmp (pch"deny") == 0)
                        
    strcpy (pch"accept");

                    
    strcat (dpch);
                    
    pch strtok (NULL" ");

                    if(
    pch != NULL)
                        
    strcat (d" ");
                }

                
    msg->data d;
                
    printf("Data: %s\n"msg->data);
            }
        }

        
    void (*SV_ConnectionlessPacket)( netadr_t frommsg_t msg );
        (*(
    int *)&SV_ConnectionlessPacket) = 0x0809594E;
        return 
    SV_ConnectionlessPacket(frommsg);
    }

    cracking_hook_call(0x08096126, (int)hook_ServerCommand); 
    (the code above works only for 1.3, other patches can be easily added)

  2. The Following 3 Users Say Thank You to Mitch For This Useful Post:

    guiismiti (12th December 2013),kung foo man (3rd December 2013),YuriJurek (4th December 2013)

  3. #2
    Private First Class YuriJurek's Avatar
    Join Date
    Jun 2013
    Posts
    219
    Thanks
    152
    Thanked 88 Times in 47 Posts
    Hello there Mitch,

    Just a few questions:
    Does it allow cracked players to connect to the server but still have their normal guid?
    How Do I compile the code?
    And finally how Do I use it in practice?

  4. #3
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by YuriJurek View Post
    Hello there Mitch,

    Just a few questions:
    Does it allow cracked players to connect to the server but still have their normal guid?
    How Do I compile the code?
    And finally how Do I use it in practice?
    You can find the code to compile here:
    https://github.com/M-itch/libcod (my fork of libcod)

    It works the same way as libcod, it needs to be preloaded. Normal players still have their guids, because my patch doesn't do anything to those players. For cracked players: they will have guid 0, but it is possible they will have a pb guid.

    (Note: you do not need to modify your binary for the join timeout, but it is useful to have when the master server is down )

  5. The Following 2 Users Say Thank You to Mitch For This Useful Post:

    kung foo man (4th December 2013),YuriJurek (6th December 2013)

  6. #4
    Private First Class YuriJurek's Avatar
    Join Date
    Jun 2013
    Posts
    219
    Thanks
    152
    Thanked 88 Times in 47 Posts
    Ok thank you for your answers, the last question was crap, I just wasn't thinking when I wrote that.

    And one final thing, can you think of any possible way that would allow cracked and normal players to play with their normal guid but the cracked player would not get kicked?
    Last edited by YuriJurek; 4th December 2013 at 18:27.

  7. #5
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    My latest version is available at: http://znation.nl/libcod

    Changes:
    https://github.com/M-itch/libcod/com...2f2b1b3a82c552
    https://github.com/M-itch/libcod/com...080559c30b74ed
    https://github.com/M-itch/libcod/com...4d959ed35ee6dc

    But i am not sure if my latest modification fixes the bad command byte warning. I only tested it a little bit.

    Edit: this version gives bad command byte. So it isn't recommended to use.
    Last edited by Mitch; 9th January 2014 at 08:48.

  8. #6
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    I am currently trying this:
    PHP Code:
    void hook_ServerCommandnetadr_t frommsg_t *msg )
    {
        if (
    strncmp (msg->data,"\xff\xff\xff\xffipAuthorize"15) == 0)
        {
            
    char pch strstr (msg->data"deny");

            if(
    pch != NULL)
            {
                
    strncpy (pch,"demo",4); // replace 'deny' with 'demo' (now you need to set fs_restrict in cod to allow the deny players)
                
    printf("%s\n"msg->data);
            }
        }

        
    void (*SV_ConnectionlessPacket)( netadr_t frommsg_t msg );
        (*(
    int *)&SV_ConnectionlessPacket) = hook_ConnectionlessPacket;
        return 
    SV_ConnectionlessPacket(frommsg);

    https://github.com/M-itch/libcod/com...975ae48d8d4db8

    From quake source code:
    PHP Code:
        if ( !Q_stricmps"demo" ) ) {
            if ( 
    Cvar_VariableValue"fs_restrict" ) ) {
                
    // a demo client connecting to a demo server
                
    NET_OutOfBandPrintNS_SERVERsvs.challenges[i].adr
                    
    "challengeResponse %i"svs.challenges[i].challenge );
                return;
            }
            
    // they are a demo client trying to connect to a real server
            
    NET_OutOfBandPrintNS_SERVERsvs.challenges[i].adr"print\nServer is not a demo server\n" );
            
    // clear the challenge record so it won't timeout and let them through
            
    Com_Memset( &svs.challenges[i], 0sizeofsvs.challenges[i] ) );
            return;
        }
        if ( !
    Q_stricmps"accept" ) ) {
            
    NET_OutOfBandPrintNS_SERVERsvs.challenges[i].adr
                
    "challengeResponse %i"svs.challenges[i].challenge );
            return;
        } 
    With fs_restrict 0


    Now it replaces 'fs_restrict' with 'sv_cracked'.

    https://github.com/M-itch/libcod/com...c7fb772f22acab

    PHP Code:
    char cracked = (char *)"sv_cracked";
    memcpy((void *)(fsrestrict_ServerCommand+3), &cracked4); 
    Check in the hook if sv_cracked is 1 and then replace deny with demo. (works in latest commit)

    https://github.com/M-itch/libcod/com...b63807eaca66bf
    (included support for 1.0 and 1.2)

    New binaries are available at: http://znation.nl/libcod/
    Last edited by Mitch; 9th January 2014 at 17:27. Reason: tested, replaced 'fs_restrict' with 'sv_cracked'

  9. #7
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Since a while libcod just returns accept when sv_cracked is 1. (i am hooking the call where it reads the state)

    PHP Code:
    set sv_cracked "1" 
    PHP Code:
    char hook_AuthorizeStateint arg )
    {
        
    char Cmd_Argv(arg);

        if ((
    CvarVariableValue == NULL || CvarVariableValue("sv_cracked") == 1) && strcmp (s"deny") == 0)
            return 
    "accept";

        return 
    s;
    }

    #if COD_VERSION == COD2_1_0 || COD_VERSION == COD2_1_2 || COD_VERSION == COD2_1_3
        
    cracking_hook_call(hook_AuthorizeState_call, (int)hook_AuthorizeState);
    #endif 
    This is the safest and best way.

  10. The Following 2 Users Say Thank You to Mitch For This Useful Post:

    kung foo man (29th March 2014),RobsoN (29th March 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •