Results 11 to 15 of 15

Thread: Libcod CoD2 1.0

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #12
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,018
    Thanks
    2,110
    Thanked 1,086 Times in 753 Posts
    E.g. take a look at the function gsc_player_button_right() in gsc_player.cpp:

    https://github.com/kungfooman/libcod...gsc_player.cpp
    PHP Code:
            #if COD2_VERSION == COD2_VERSION_1_2 || COD2_VERSION == COD2_VERSION_1_3
                    
    unsigned char *aim_address = (unsigned char *)(PLAYERSTATE(playerid) + 0x26FD);
            
    #elif COD_VERSION == COD4_1_7
                    
    unsigned char *aim_address = (unsigned char *)(PLAYERSTATE(playerid) + 0x2FA7);
            
    #else
                    #warning unsigned char *aim_address = (unsigned char *)(NULL);
                    
    unsigned char *aim_address = (unsigned char *)(NULL);
            
    #endif 
    This will support CoD2 1.2, 1.3 and CoD4 1.7

    Since 1.2 and 1.3 got the same address, it might be also the same for 1.0, but I don't do much with 1.0 to check that.

    The code is dependent on the CoD version, because every binary is always recompiled, thus changing the hardcoded addresses.

    Since the code is open source: you are young and intelligent, add those addresses and make libcod more portable. You only need IDA Pro 5.5 with Decompiler (F5), and the memory viewer http://dbg.killtube.org/libcod/memoryshell.zip
    timescale 0.01

  2. The Following User Says Thank You to kung foo man For This Useful Post:

    YuriJurek (16th November 2013)

Posting Permissions

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