From 3d412a4b30a9f7c7f51ea6562e694315948bd3da Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 28 Nov 2018 16:00:02 +1300 Subject: 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 --- tf2/KeyValues.cpp | 62 ------------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 tf2/KeyValues.cpp (limited to 'tf2/KeyValues.cpp') diff --git a/tf2/KeyValues.cpp b/tf2/KeyValues.cpp deleted file mode 100644 index 16ccf6e..0000000 --- a/tf2/KeyValues.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "KeyValues.h" -#include "pattern.hpp" -#include "interfaces.h" - -void* KeyValues::key_values_ptr; - -void IKeyValuesSystem::FreeKeyValuesMemory( void* memory ) { - return util::get_vfunc< 2, void >( this, memory ); -} - -int IKeyValuesSystem::GetSymbolForString( const char* str, bool create ) { - static auto offset = pattern::first_code_match( GetModuleHandleA( xors( "client.dll" ) ), xors( "FF 15 ? ? ? ? 83 C4 08 89 06 8B C6" ) ); - using fn = int( __thiscall* )( void*, const char*, bool ); - - int symbol = ( ( fn )( offset ) )( this, str, create ); - return symbol; -} - -const char* IKeyValuesSystem::GetStringForSymbol( int symbol ) { - static auto offset = pattern::first_code_match( GetModuleHandleA( xors( "client.dll" ) ), xors( "55 8B EC 8B 55 08 83 FA FF" ) ); - using fn = const char*( __thiscall* )( void*, int ); - - auto result = ( ( fn )( offset ) )( this, symbol ); - printf( "%d: %d\n", symbol, *( int* )( &result ) ); - - return result; -} - -//honestly keyvalues can suck my fucking cock while i force feeds that fucking whores ass rats to live in its cum infested shithole - - -KeyValues::KeyValues( const char* name ) { - static std::string fun_pattern = "E8 ? ? ? ? 80 7D 84 00"; - static uintptr_t function_offset = pattern::first_code_match( cl.m_chl.dll( ), fun_pattern ) + 0x13C; - static auto function = reinterpret_cast< void( __thiscall* )( void*, const char* ) >( function_offset ); - if( function ) function( this, name ); -} - -bool KeyValues::LoadFromBuffer( const char* resource_name, const char* buffer, void* file_system, const char* path_id ) { - static std::string fun_pattern = "55 8B EC 83 E4 F8 83 EC 34 53 8B 5D 0C 89 4C 24 04"; - static auto function = pattern::first_code_match< bool( __thiscall* )( void*, const char*, const char*, void*, const char*, void* ) >( cl.m_chl.dll( ), fun_pattern ); - if( function ) return function( this, resource_name, buffer, file_system, path_id, 0 ); - return false; -} - -void* KeyValues::operator new( size_t alloc_size ) { - if( !KeyValues::key_values_ptr ) { - static auto get_key_values = reinterpret_cast< void*( __cdecl* )( ) >( GetProcAddress( GetModuleHandleA( "vstdlib.dll" ), "KeyValuesSystem" ) ); - KeyValues::key_values_ptr = get_key_values( ); - } - - return call_vfunc< void*( __thiscall* )( void*, size_t ) >( KeyValues::key_values_ptr, 1 )( KeyValues::key_values_ptr, 32 ); -} - -void KeyValues::operator delete( void* mem ) { - if( !KeyValues::key_values_ptr ) { - static auto get_key_values = reinterpret_cast< void*( __cdecl* )( ) >( GetProcAddress( GetModuleHandleA( "vstdlib.dll" ), "KeyValuesSystem" ) ); - KeyValues::key_values_ptr = get_key_values( ); - } - - call_vfunc< void( __thiscall* )( void*, void* ) >( KeyValues::key_values_ptr, 2 )( KeyValues::key_values_ptr, mem ); -} -- cgit v1.2.3