typedef void (*xcommand_t)( ); typedef struct sCommand { sCommand * pNext; const char * szName; DWORD dwUnknown[2]; xcommand_t function; //Better be safe than sorry, since the structure might be bigger DWORD dwIMightNotBeNeeded[10]; } tCommand; //crap DWORD dwCrap[10]; // int (*orig_Cmd_AddCommand)( const char * name, xcommand_t function ); int Cmd_AddCommand( const char * name, xcommand_t function ) { BOOL bSuccess = FALSE; tCommand *pCommand = NULL; //* bSuccess = Cmd_AddCommand( name, function ); _asm mov esi, name _asm mov eax, 4F99F0h _asm call eax ;Cmd_AddCommand _asm mov bSuccess, eax if( bSuccess ) { pCommand = new tCommand; pCommand->pNext = *(tCommand**)0x14108BC; pCommand->szName = name; pCommand->function = function; *(tCommand**)0x14108BC = pCommand; //add the new command to the list return (int)pCommand; //Typecast } return NULL; } VOID AimOn_f( ) { if ( !Mom_Aim->value ) Mom_Aim->value = 1; } VOID AimOff_f( ) { Mom_Aim->value = 0; } tCommand cmdTable[] = { { NULL, "+aim", 0, &AimOn_f, dwCrap }, { NULL, "-aim", 0, &AimOff_f, dwCrap }, { NULL, NULL, 0, NULL, dwCrap } };