Results 1 to 10 of 14

Thread: Can't run libcod

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    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
    The actual crash happens here:

    PHP Code:
            #if COD_VERSION == COD2_1_0
                
    int addressToDownloadPointer = (int *)0x0815D584;
            
    #elif COD_VERSION == COD2_1_2
                
    int addressToDownloadPointer = (int *)0x0817C9E4;
            
    #elif COD_VERSION == COD2_1_3
                
    int addressToDownloadPointer = (int *)0x0817DA04;
            
    #else
                #warning int *addressToDownloadPointer = NULL;
                
    int *addressToDownloadPointer NULL;
            
    #endif

            
    printf("> [INFO] value of download=%.8x\n", *addressToDownloadPointer);
            
    SV_BeginDownload_f = (SV_BeginDownload_f_t)*addressToDownloadPointer;
            *
    addressToDownloadPointer = (int)hook_SV_BeginDownload_f
    It needs an #if-case like:

    PHP Code:
            #if COD_VERSION == COD2_1_0 || COD_VERSION == COD2_1_2 || COD_VERSION == COD2_1_3
                
    printf("> [INFO] value of download=%.8x\n", *addressToDownloadPointer);
                
    SV_BeginDownload_f = (SV_BeginDownload_f_t)*addressToDownloadPointer;
                *
    addressToDownloadPointer = (int)hook_SV_BeginDownload_f;
            
    #endif 
    I guess nobody saw it because most people just work with CoD2 here.

    In past libcod got restructured alot and since CoD4 was out of view, nobody cared about it. Hence CoD4 would require the closer()-hack, though that "dirt" got cleaned up.

    So most important to support CoD4 again is this:

    PHP Code:
    #if COD_VERSION == COD2_1_0
        
    Scr_GetFunction_t Scr_GetFunction = (Scr_GetFunction_t)0x8115824;
        
    Scr_GetMethod_t Scr_GetMethod = (Scr_GetMethod_t)0x811595C;
    #elif COD_VERSION == COD2_1_2
        
    Scr_GetFunction_t Scr_GetFunction = (Scr_GetFunction_t)0x8117B56;
        
    Scr_GetMethod_t Scr_GetMethod = (Scr_GetMethod_t)0x8117C8E;
    #elif COD_VERSION == COD2_1_3
        
    Scr_GetFunction_t Scr_GetFunction = (Scr_GetFunction_t)0x8117CB2;
        
    Scr_GetMethod_t Scr_GetMethod = (Scr_GetMethod_t)0x8117DEA;
    #else
        #warning Scr_GetFunction_t Scr_GetFunction = (Scr_GetFunction_t)NULL;
        #warning Scr_GetMethod_t Scr_GetMethod = (Scr_GetMethod_t)NULL;
        
    Scr_GetFunction_t Scr_GetFunction = (Scr_GetFunction_t)NULL;
        
    Scr_GetMethod_t Scr_GetMethod = (Scr_GetMethod_t)NULL;
    #endif 
    I would be glad if somebody would provide those 2 addresses.

    Since we use git, you could also checkout an old version. Or use the old precompiled CoD4 binary: http://killtube.org/downloads/libcod/

    Old is bad, but might work for your purpose till somebody searched Scr_GetFunction/Scr_GetMethod for CoD4.


    BTW, all these warnings (not errors) happen because the developers of gcc seem to lack real problems or just want to nit-pick on available code... they started to add more and more compile-warnings for code that worked for centuries by each new version of gcc. *slow clap*

    Well, welcome on board
    timescale 0.01

  2. The Following 2 Users Say Thank You to kung foo man For This Useful Post:

    Mitch (18th April 2014),PureTryOut (19th April 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
  •