Results 1 to 10 of 25

Thread: [COD4]How to make cracked server show in master list?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    I think this should do the trick:

    PHP Code:
    int hook_StateCompare(char statechar base)
    {
        if ((
    CvarVariableValue == NULL || CvarVariableValue("sv_cracked") == 1) && strcmp (state"deny") == 0// when sv_cracked 1 and deny state
        
    {
            if(
    strcmp(base"accept") == 0// when compare value is accept return true
                
    return 0;
            else
                return 
    1// when compare to value is deny return false
        
    }

        return 
    strcmp(statebase);
    }

    #if COD_VERSION == COD4_1_7
        
    cracking_hook_call(0x0816FF42, (int)hook_StateCompare);
        
    cracking_hook_call(0x081701D6, (int)hook_StateCompare);
    #endif 
    Basically it changes the compare function to returning false (1) when it compares deny to deny. And it returns true (0) when it compares deny to accept.
    Last edited by Mitch; 10th May 2014 at 23:47.

  2. #2
    ... connecting
    Join Date
    Jun 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Mitch View Post
    I think this should do the trick:

    PHP Code:
    int hook_StateCompare(char statechar base)
    {
        if ((
    CvarVariableValue == NULL || CvarVariableValue("sv_cracked") == 1) && strcmp (state"deny") == 0// when sv_cracked 1 and deny state
        
    {
            if(
    strcmp(base"accept") == 0// when compare value is accept return true
                
    return 0;
            else
                return 
    1// when compare to value is deny return false
        
    }

        return 
    strcmp(statebase);
    }

    #if COD_VERSION == COD4_1_7
        
    cracking_hook_call(0x0816FF42, (int)hook_StateCompare);
        
    cracking_hook_call(0x081701D6, (int)hook_StateCompare);
    #endif 
    Basically it changes the compare function to returning false (1) when it compares deny to deny. And it returns true (0) when it compares deny to accept.
    Hey Mitch, i look for a way for a long time to run a cod4 cracked server and never found anything in internet!! Sorry for my noob question, but how do u use this php codes u just gave here??

    Thanks for your help,
    ps: sorry for my bad english, i'm french
    Kill3ill

  3. #3
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by kill3ill View Post
    Hey Mitch, i look for a way for a long time to run a cod4 cracked server and never found anything in internet!! Sorry for my noob question, but how do u use this php codes u just gave here??

    Thanks for your help,
    ps: sorry for my bad english, i'm french
    Kill3ill
    The code is supposed to be adding to libcod. See https://github.com/kungfooman/libcod. (you will need to be able to edit your start up line for this to work. Also linux only)
    But i never got around to test that code.

    In https://github.com/kungfooman/libcod...er/libcod.cpp:

    Add after 'char * hook_AuthorizeState( int arg ) { **** }' (line 1446)
    PHP Code:
    int hook_StateCompare(char statechar base

        if ((
    CvarVariableValue == NULL || CvarVariableValue("sv_cracked") == 1) && strcmp (state"deny") == 0// when sv_cracked 1 and deny state 
        

            if(
    strcmp(base"accept") == 0// when compare value is accept return true 
                
    return 0
            else 
                return 
    1// when compare to value is deny return false 
        


        return 
    strcmp(statebase); 

    Add this before #ifdef IS_JAVA_ENABLED (line 2022)
    PHP Code:
    #if COD_VERSION == COD4_1_7 
        
    cracking_hook_call(0x0816FF42, (int)hook_StateCompare); 
        
    cracking_hook_call(0x081701D6, (int)hook_StateCompare); 
    #endif 
    Note: This code hasn't be tested so it might be that it could crash your game server. (cod4_lnxded)

    Edit: try this binary at http://znation.nl/libcod/
    Last edited by Mitch; 11th June 2014 at 18:51.

Posting Permissions

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