Results 1 to 3 of 3

Thread: Changing bot pings.

  1. #1
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts

    Changing bot pings.

    Credits to IzNoGoD for walking me through this <3

    Put these functions in libcod.cpp
    PHP Code:
    int gsc_libcod_getAddressType(int id) {
        
    extern int playerinfo_base;
        
    extern int playerinfo_size;
        
        
    #if COD_VERSION == COD2_1_0
            
    int info_addresstype_offset 0x6E5C4;
        
    #elif COD_VERSION == COD2_1_2
            
    int info_addresstype_offset 0x6E6D4;
        
    #elif COD_VERSION == COD2_1_3
            
    int info_addresstype_offset 0x6E6D4;
        
    #else
            #warning getAddressType() got no working addresses
            
    int info_addresstype_offset 0x0;
        
    #endif
        
        
    int addrtype = *(int*)(*(int*)playerinfo_base id playerinfo_size info_addresstype_offset);
    }

    cHook *hook_set_bot_pings;
    void set_bot_pings()
    {
        
    hook_set_bot_pings->unhook();
        
    int (*sig)();
        *(
    int *)&sig hook_set_bot_pings->from;
        
    int ret sig();
        
    hook_set_bot_pings->hook();
        
        
    extern int playerinfo_base;
        
    extern int playerinfo_size;
        
    int addrtype;
        
    int i;
        
        
    #if COD_VERSION == COD2_1_0
            
    int offset 0x0848B1CC;
            
    int p 113001;
        
    #elif COD_VERSION == COD2_1_2
            
    int offset 0x0849E6CC;
            
    int p 113069;
        
    #elif COD_VERSION == COD2_1_3
            
    int offset 0x0849F74C;
            
    int p 113069;
        
    #else
            #warning set_bot_pings() got no working addresses
            
    int offset 0x0;
            
    int p 0;
        
    #endif
        
        
    for (0< *(int*)(*(int*)(offset) + 8); i++)
        {
            if(*(
    int*)(*(int*)playerinfo_base playerinfo_size) == 4)
            {
                
    addrtype gsc_libcod_getAddressType(i);
                if(
    addrtype == 0)
                    *(
    int*)(*(int*)playerinfo_base playerinfo_size + (p*4)) = 0;
            }
        }

    Then search for
    PHP Code:
    cracking_hook_function(0x08092D5C, (int)SV_AddServerCommand); 
    in libcod.cpp and add the following to your versions;
    PHP Code:
    #if COD_VERSION == COD2_1_0
        
    hook_set_bot_pings = new cHook(0x0809443E, (int)set_bot_pings);
        
    hook_set_bot_pings->hook();
    #elif COD_VERSION == COD2_1_2
        
    hook_set_bot_pings = new cHook(0x0809630E, (int)set_bot_pings);
        
    hook_set_bot_pings->hook();
    #elif COD_VERSION == COD2_1_3
        
    hook_set_bot_pings = new cHook(0x080963C8, (int)set_bot_pings);
        
    hook_set_bot_pings->hook(); 

    This will change bot pings from 999 to 0 or whatever you set
    PHP Code:
    *(int*)(*(int*)playerinfo_base playerinfo_size + (p*4)) = 0
    to.

    Click image for larger version. 

Name:	bot_ping_0.jpg 
Views:	83 
Size:	57.3 KB 
ID:	857
    Last edited by kung foo man; 1st June 2015 at 03:23. Reason: image as attachment (dead link protection)

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

    kung foo man (1st June 2015),Ni3ls (1st June 2015)

  3. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Nice work
    timescale 0.01

  4. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Some background info on this:
    This script basically hooks the setpings() method and afterwards loops through all slots, checks if there's a connected player (status 4) in said slot, and sets its ping to 0 if its a bot. Normal players and not-fully-connected bots remain unaffected.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  5. The Following User Says Thank You to IzNoGoD For This Useful Post:

    kung foo man (1st June 2015)

Posting Permissions

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