Results 1 to 3 of 3
  1. #1

    SendCommandToConsole

    I need some help.
    I am trying to send a command to the console in Cod5,

    1. This Code is causing my game to crash.
    2. What is the Offset of Cod5 patch 1.7?

    Code:
    void cEngine_t::SendCommandToConsole(char* command)
    {
    __asm
    {
    push command
    push 0
    push 0
    mov esi, 0x004F9AB0//<- Is causing game crash due to its a cod4 offset, but I need the Cod5 1.7 patch offset.
    call esi
    add esp, 0x0C
    }
    }
    
    void cEngine_t::Spam( )
    {
            Sleep ( 60000 );
    	SendCommandToConsole("say *************************");
    	SendCommandToConsole("say *************************");
    }
    Last edited by x33x; October 21st, 2012 at 06:30.

  2. #2
    Coders
    Join Date
    Nov 2009
    Location
    Belgium
    Posts
    990

    Re: SendCommandToConsole

    Ofcourse the game will crash when using an outdate or a different offset from another game.

    Code:
    void ( *CL_Cmd )( int a1,int a2, char* cmd ) = ( void ( __cdecl* ) ( int, int, char* ) ) 0x0055CC50;
    
    void CSupport::WriteToConsole( char* cmd, ... ) {
        va_list args;
        char buf[64];
        vsprintf( buf, cmd, args );
        CL_Cmd( 1, 1, buf );
    }
    Last edited by mowl; October 21st, 2012 at 13:05.

  3. #3
    Semi-Coder
    Join Date
    Aug 2011
    Posts
    181

    Re: SendCommandToConsole

    Just search for it, search cl_packetdup its the call underneath.

    mOwl already wrote it actually its like this:
    Code:
    void ( *SendCommand)( int a1,int a2, char* cmd ) = ( void ( __cdecl* ) ( int, int, char* ) ) 0x0055CC50;
    But yeah its the call underneath the cvars its pretty simple to find.

Bookmarks

Posting Permissions

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