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