OldSchoolHack

Registrieren / Anmelden Deutsch

External Overlay Interface

not available
  • Kategorie: Sourcecode
  • Entwickler:
  • Hochgeladen von: System
  • Hinzugefügt am:
  • System: Windows
Download (11.56 KB)

VirusTotal Ergebnis: 0/56

virustotal

Beschreibung

To use this overlay you need Visual Studio 2013 or higher or another IDE which supports C++ 11/15.

Supported overlay functions:
  • interface based
  • directX 9 overlay
  • render function callback



Supported surface functions:
  • bordered box
  • outlined bordered box
  • rect angle
  • outlined rect angle
  • line
  • string



All you need is in your thread/main one pointer to the overlay. With that pointer we will prepare our fonts, register callback functions, calling the render thread and release everything at the end.

CPP Code:
  1. auto &pOverlay = Overlay::IOverlay::GetInstance( );
  2. pOverlay = std::make_shared< Overlay::CD3D9Overlay >( );
  3.  
  4. // Since we have a pointer to the overlay we can now prepare some fonts which
  5. // we wanna use later in our project
  6. pOverlay->GetSurface( )->PrepareFont( "Default", "Arial", 14, FW_BOLD, 0, 0, FALSE );
  7.  
  8. // After we prepared our fonts, we're going to create the overlay. All we need here is
  9. // the target window title. The overlay window title/class gets randomized
  10. if( pOverlay->Create( "Counter-Strike: Global Offensive" ) )
  11. {
  12.    // before we start our render procedure we register our needed callback function(s)
  13.    // which the overlay draws only when the game is the current foreground window
  14. }
Now we have to options to add some functions in our callback. The first one is create a new function and pass it. The function need the following parameters:
CPP Code:
  1. void TestCallbackFunction( Overlay::IOverlay *thisptr, std::shared_ptr< Overlay::ISurface > pSurface )
  2. {
  3.    g_pGui->Render( );
  4.    pSurface->String( 5, 5, "Default", 0xFFFFFFFF, "Hello from test callback" );
  5. }
Last but not least: call the render function while the function returns true. After that, shutdown the overlay and exit your application.
CPP Code:
  1. auto &pOverlay = Overlay::IOverlay::GetInstance( );
  2. pOverlay = std::make_shared< Overlay::CD3D9Overlay >( );
  3.  
  4. // Since we have a pointer to the overlay we can now prepare some fonts which
  5. // we wanna use later in our project
  6. pOverlay->GetSurface( )->PrepareFont( "Default", "Arial", 14, FW_BOLD, 0, 0, FALSE );
  7.  
  8. // After we prepared our fonts, we're going to create the overlay. All we need here is
  9. // the target window title. The overlay window title/class gets randomized
  10. if( pOverlay->Create( "Counter-Strike: Global Offensive" ) )
  11. {
  12.    // before we start our render procedure we register our needed callback function(s)
  13.    // which the overlay draws only when the game is the current foreground window
  14.  
  15.    pOverlay->AddToCallback( TestCallbackFunction );
  16.  
  17.    // Lambda method
  18.    auto LambdaCallbackFunction = []( Overlay::IOverlay *thisptr, std::shared_ptr< Overlay::ISurface > pSurface )
  19.    {
  20.        pSurface->String( 5, 20, Overlay::Color( 255, 255, 255 ), "Hello from lambda callback" );
  21.    };
  22.  
  23.    pOverlay->AddToCallback( LambdaCallbackFunction );
  24.  
  25.    while( pOverlay->Render( ) )
  26.        std::this_thread::sleep_for( std::chrono::milliseconds( 1 ) );
  27.  
  28.    pOverlay->Shutdown( );
  29. }
In your gui/esp you can draw via the IOverlay::GetInstance( )->GetSurface( ) function if you setuped the overlay as I wrote it in the tutorial above this sentence.

Download External Overlay Interface