Results 1 to 4 of 4
  1. #1
    CyanRed3's Avatar
    Join Date
    Feb 2016
    Gender
    male
    Location
    cfitsio.dll
    Posts
    79
    Reputation
    10
    Thanks
    425
    My Mood
    Cheerful

    Question Ways to hook on to source engine?

    As the title says, I dont know to many ways to hook on to the source engine to create hacks internally. Also, how would I write to the console when I would inject into it. Im not to great with internal, so pls no flame.

  2. #2
    rwby's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Location
    client.dll
    Posts
    1,631
    Reputation
    142
    Thanks
    6,724
    Theres actually plenty of sources on this site that do this very thing that you are looking for take a look around the forum and see if you can find something.

  3. #3
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    The easiest way is to duplicate the VTable of an interface, exchange the function pointer of a function you want to hook with a function pointer to your own function and exchange the VTable pointer of the interface.

    To write in the console of the game, you can do it through VTable functions or just get the exported functions in tier0.dll.
    Tier0.dll has multiple functions to write to the console, for example Warning, DevWarning etc..

    To output a usual white text ( same as the echo command ) use the exported function ConMsg. In order to get the exported function via GetProcAddress, you have to take the mangled name.

    Code:
    Globals::Functions::ConMsg = reinterpret_cast< Globals::Prototypes::ConMsg_ >( GetProcAddress( GetModuleHandle( "tier0.dll" ), "?ConMsg@@YAXPBDZZ" ) );
    does the job.

    ConMsg_ is a prototype:

    Code:
    typedef void* ( *ConMsg_ )( char*, ... );
    You can use this function just like printf.

    Code:
    Globals::Functions::ConMsg( "IBaseClientDll: %X\n", Globals::Interfaces::BaseClientDll );
    Globals::Functions::ConMsg( "IClientEntityList: %X\n", Globals::Interfaces::EntityList );
    Globals::Functions::ConMsg( "IClientMode: %X\n", Globals::Interfaces::ClientMode );
    Globals::Functions::ConMsg( "IVEngineClient: %X\n", Globals::Interfaces::EngineClient );
    You don't need the mangled name for the exported function Warning.

    Code:
    Globals::Functions::Warning = reinterpret_cast< Globals::Warning_ >( GetProcAddress( GetModuleHandle( "tier0.dll" ), "Warning" ) );
    Code:
    typedef void* ( *Warning_ )( char*, ... );
    Code:
    Globals::Functions::Warning( "MA SUPER COPY PASTA\n" );
    To know whether you need the mangled name or not you can just click on the exported function in IDA and see if the mangled name is present.

    https://img.marcel-kirchhoff.de/2016-04-24_12-55-53.png

    https://img.marcel-kirchhoff.de/2016-04-24_12-56-18.png
    Last edited by WasserEsser; 04-24-2016 at 04:20 PM.

  4. The Following 2 Users Say Thank You to WasserEsser For This Useful Post:

    CyanRed3 (04-24-2016),Hunter (04-25-2016)

  5. #4
    rwby's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Location
    client.dll
    Posts
    1,631
    Reputation
    142
    Thanks
    6,724
    //Solved & Closed

Similar Threads

  1. [Tutorial] Convert Source Engine models to Lithtech! (For CAPS and CA)
    By supercarz1991 in forum Combat Arms Mod Tutorials
    Replies: 26
    Last Post: 04-27-2012, 03:37 AM
  2. [Help] client hook [source engine]
    By bluedog9 in forum C++/C Programming
    Replies: 0
    Last Post: 07-19-2011, 01:04 PM
  3. VGUI Panels in Source Engine
    By lilneo in forum C++/C Programming
    Replies: 2
    Last Post: 04-14-2011, 12:29 PM
  4. [GUIDE]Hooking the source engine.
    By Hell_Demon in forum C++/C Programming
    Replies: 15
    Last Post: 02-23-2010, 04:33 PM
  5. is there any way to play counter strike source steam again when u get banned?
    By yaowings in forum CounterStrike (CS) 1.6 Hacks / Counter Strike: Source (CSS) Hacks
    Replies: 2
    Last Post: 03-15-2009, 02:55 PM