diff options
| author | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
| commit | 3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch) | |
| tree | 26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /tf2/console.hpp | |
| parent | e4729e4393d90271a3814c7a79950a660c48325a (diff) | |
cleaned up
in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever.
i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64
Diffstat (limited to 'tf2/console.hpp')
| -rw-r--r-- | tf2/console.hpp | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/tf2/console.hpp b/tf2/console.hpp deleted file mode 100644 index a16ad0f..0000000 --- a/tf2/console.hpp +++ /dev/null @@ -1,125 +0,0 @@ -#pragma once
-#include <memory>
-#include <Windows.h>
-#include <vector>
-#include <functional>
-
-#include "con_fn.hpp"
-#include "con_alias.hpp"
-#include "input_system.hpp"
-#include "math.h"
-
-#pragma warning(disable: 4996)
-
-class console {
-public:
- console( ) {
- m_input = std::make_shared< util::c_input_manager >( );
- }
-
- static constexpr size_t TOP_HEIGHT = 22;
- static constexpr size_t WIDTH = 400;
- static constexpr size_t HEIGHT = 450;
-
- bool m_consuming_input{ };
- bool m_active{ };
- bool m_open{ };
-
- struct con_log {
- float m_time;
- char m_msg[ 128 ];
- };
-
- void draw_text( int x, int y, bool greyed, const char* msg, ... );
- void draw_text( int x, int y, const char* msg, ... );
- void draw_rect( int x, int y, int w, int h, clr_t col );
- void register_fn( con_fn_base* fn ) { m_functions.push_back( fn ); }
-
- void input( );
- void draw( );
-
- auto& get_input( ) {
- return m_input;
- }
-
- void log( const char* fmt, ... ) {
- va_list args;
- char buf[ 128 ];
-
- __crt_va_start( args, fmt );
- vsprintf_s< 128 >( buf, fmt, args );
- __crt_va_end( args );
-
- con_log log;
- log.m_time = ( float )GetTickCount( ) * 0.001f;
- memcpy( log.m_msg, buf, 128 );
-
- print( "%s\n", buf );
-
- m_logs.push_back( log );
- }
-
- void print( const char* fmt, ... ) {
- va_list args;
- va_start( args, fmt );
- vprintf_s( fmt, args );
- va_end( args );
- }
-
- void create( ) {
-#ifdef _DEBUG
- AllocConsole( );
- freopen( xors( "CONOUT$" ), "w", stdout );
- const char* hack_names[ ] = {
- xors( "dunk hack" ),
- xors( "dweeb dumpster" ),
- xors( "nova killER" ),
- xors( "moms credit card" ),
- xors( "dad hook" ),
- xors( "retard remover" ),
- xors( "slam hook" ),
- xors( "swoosh" ),
- xors( "retard remover" ),
- xors( "shotgun hack" ),
- };
-
- SetConsoleTitleA( hack_names[ math::random_number( 0, 9 ) ] );
-#endif
- game_console_print = reinterpret_cast< msg_t >( GetProcAddress( GetModuleHandleA( "tier0.dll" ), "Msg" ) );
- }
-
- void destroy( ) {
-#ifdef _DEBUG
- FreeConsole( );
- fclose( stdout );
-#endif
- }
-
- std::vector< con_log > m_logs;
- std::vector< con_fn_base* > m_functions;
- std::vector< std::shared_ptr< ISetting > > m_aliases;
-
- void register_alias( std::shared_ptr< ISetting >& alias );
-
- using msg_t = void( __cdecl* )( const char*, ... );
- msg_t game_console_print;
-
-private:
- ISetting * find_var( hash_t name );
- ISetting* find_alias( hash_t name );
-
- std::string impl_alias_str( std::string str );
-
- con_fn_base* find_fn( hash_t name );
- void capture_command( );
- void execute_command( const char* cmd );
-
- int m_x{ 100 }, m_y{ 100 };
-
- char m_cur_cmd[ 200 ]{ };
- uint8_t m_key_states[ 256 ]{ };
- float m_last_key_input[ 256 ]{ };
- std::shared_ptr< util::c_input_manager > m_input;
-};
-
-extern std::shared_ptr< console > g_con;
\ No newline at end of file |
