Valid iwd: test/gob_aim.iwd
clientDownload: 0 : begining "test/gob_aim.iwd"
clientDownload: 0 : file "test/gob_aim.iwd" completed
Not a valid iwd: test/server.cfg
PHP Code:
void SV_BeginDownload_f( int a1 ) {
char * file = Cmd_Argv(1);
int len;
if((len = strlen(file)) > 3 && !strcmp(file + len - 4, ".iwd"))
{
printf("Valid iwd: %s\n", file);
typedef int (*SV_BeginDownload_f_t)(int a1);
SV_BeginDownload_f_t SV_BeginDownload_f = (SV_BeginDownload_f_t)0x0808E508;
SV_BeginDownload_f(a1);
}
else
printf("Not a valid iwd: %s\n", file);
}
#if COD_VERSION == COD2_1_0
int * addressToDownloadPointer = (int *)0x0815D584;
*addressToDownloadPointer = (int)SV_BeginDownload_f;
#endif
PHP Code:
typedef char * (*Cmd_Argv_t)(int arg);
#if COD_VERSION == COD2_1_0
static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)0x0806001C;
#elif COD_VERSION == COD2_1_2
static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)0x08060228;
#elif COD_VERSION == COD2_1_3
static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)0x08060220;
#else
#warning static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)NULL;
static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)NULL;
#endif
https://github.com/M-itch/libcod/com...9ef0a8cb70d2c1
http://znation.nl/libcod