Pushok icon

BlahBlah

Pushok | PRO | 05/20/12 02:27:42 PM UTC | 0 ⭐ | 432 👁️ | Never ⏰ | []
C++ |

1.6 KB

|

None

|

0 👍

/

0 👎

#include "Hack.h"
 
Hack::CListener g_Listener;
 
SH_DECL_HOOK0( IVEngineClient, IsDrawingLoadingImage, SH_NOATTRIB, false, bool );
 
namespace Hack
{
    DWORD LoadPlugin( )
    {
        CFactory factory;
 
        try
        {
            Globals::g_pClientDLL =         factory.GetFactory< IBaseClientDLL >( "client.dll", "VClient016" );
            Globals::g_pClientEngine =      factory.GetFactory< IVEngineClient >( "engine.dll", VENGINE_CLIENT_INTERFACE_VERSION );
            Globals::g_pClientEntityList =  factory.GetFactory< IClientEntityList >( "client.dll", VCLIENTENTITYLIST_INTERFACE_VERSION );
            Globals::g_pEventManager =      factory.GetFactory< IGameEventManager2 >( "engine.dll", INTERFACEVERSION_GAMEEVENTSMANAGER2 );
            Globals::g_pDebugOverlay =      factory.GetFactory< IVDebugOverlay >( "engine.dll", VDEBUG_OVERLAY_INTERFACE_VERSION );
            Globals::g_pCvar =              factory.GetFactory< ICvar >( "vstdlib.dll", CVAR_INTERFACE_VERSION );
 
            SH_ADD_HOOK( IVEngineClient, IsDrawingLoadingImage, Globals::g_pClientEngine, SH_STATIC( Hack::IsDrawingLoadingImage ), false );
 
            if( Globals::AllLoaded( ) )
            {
                Globals::g_pEventManager->AddListener( &g_Listener, "player_death", false );
 
                ConCommand* ComInfo = new ConCommand( "print_info_hk", CommandHandlers::InfoCommandHandler );
 
                Globals::g_pCvar->RegisterConCommand( ComInfo );
            }
        }
        catch( std::exception &ex )
        {
            MessageBox( nullptr, ex.what( ), "Error", MB_OK );
 
            return 1;
        }
 
        return 0;
    }
 
    void UnloadPlugin( )
    {
 
    }
 
    bool IsDrawingLoadingImage( )
    {
        // Handler
 
        return false;
    }
 
    void CListener::FireGameEvent( IGameEvent *event )
    {
 
    }
}

Comments