summaryrefslogtreecommitdiff
path: root/cheat/gmod/identity.cpp
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2018-11-28 16:00:02 +1300
committerboris <wzn@moneybot.cc>2018-11-28 16:00:02 +1300
commit3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch)
tree26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /cheat/gmod/identity.cpp
parente4729e4393d90271a3814c7a79950a660c48325a (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 'cheat/gmod/identity.cpp')
-rw-r--r--cheat/gmod/identity.cpp98
1 files changed, 98 insertions, 0 deletions
diff --git a/cheat/gmod/identity.cpp b/cheat/gmod/identity.cpp
new file mode 100644
index 0000000..de047cf
--- /dev/null
+++ b/cheat/gmod/identity.cpp
@@ -0,0 +1,98 @@
+#include "identity.hpp"
+#include "settings.hpp"
+#include "interface.hpp"
+#include "pattern.hpp"
+
+namespace features
+{
+ void c_identity::clantag_changer( ) {
+ static auto fn_offset = pattern::first_code_match( g_csgo.m_engine.dll( ), xors( "53 56 57 8B DA 8B F9 FF 15" ) );
+ static auto fn = reinterpret_cast< void( __fastcall* )( const char*, const char* ) >( fn_offset );
+ static bool was_enabled = false;
+
+ if ( !g_settings.misc.clantag_changer( ) ) {
+ if ( was_enabled ) {
+ fn( "", " " );
+ static cvar_t* cl_clanid = g_csgo.m_cvar( )->FindVar( xors( "cl_clanid" ) );
+ auto backup_val = cl_clanid->get_int( );
+ cl_clanid->set_value( 0 );
+ cl_clanid->set_value( backup_val );
+ was_enabled = false;
+ }
+
+ return;
+ }
+
+ was_enabled = true;
+
+ //fn( xors( "#freeshkreli $" ), xors( "#freeshkreli $" ) );
+
+ //basically make it completely fade out
+ static const std::string moneybot_string = xors( "moneybot " );
+ static std::string clantag_str = moneybot_string;
+
+ static auto next_settime = g_csgo.m_globals->m_realtime;
+ auto curtime = g_csgo.m_globals->m_realtime;
+
+ if ( curtime > next_settime ) {
+ const int length = clantag_str.length( );
+ clantag_str.insert( 0, 1, clantag_str[ length - 2 ] );
+ clantag_str.erase( length - 1, 1 );
+
+ std::string set = clantag_str;
+ set.resize( 15 );
+ set[ 14 ] = '$';
+
+ auto is_full = set.find( xors( "moneybot" ) ) != std::string::npos;
+
+ next_settime = curtime + ( is_full ? 0.85f : 0.4f );
+ fn( set.c_str( ), set.c_str( ) );
+ }
+ }
+
+ void c_identity::name_changer( ) {
+ static auto cvar = g_csgo.m_cvar( )->FindVar( xors( "name" ) );
+ auto set_name = [ ]( const char* name ) {
+ *( int* )( uintptr_t( &cvar->m_change_callback ) + 0xc ) = 0;
+ cvar->set_value( name );
+ };
+
+ static bool activated = false;
+ static char original_name[ 100 ]{ };
+
+ if( !g_settings.misc.name_changer ) {
+ if( activated ) {
+ set_name( original_name );
+ }
+
+ activated = false;
+ return;
+ }
+
+ if( !activated ) {
+ strcpy( original_name, cvar->get_string( ) );
+ if( g_settings.misc.name_changer == 1 ) {
+ char new_name[ 128 ];
+ memset( new_name, '$', sizeof( new_name ) );
+ set_name( new_name );
+ }
+ if( g_settings.misc.name_changer == 2 ) {
+ set_name( xors( "moneybot.cc" ) );
+ }
+ if( g_settings.misc.name_changer == 101 ) {
+ set_name( "ญญญ\n\xAD\xAD\xAD" );
+ }
+ }
+ else if( g_settings.misc.name_changer == 101 ) {
+ char new_name[ 15 ];
+ for( size_t i{ }; i < 15; ++i ) {
+ auto is_upper = !( math::random_number( 0, 256 ) & 1 );
+ new_name[ i ] = is_upper ? math::random_number( 65, 90 ) : math::random_number( 97, 122 );
+ }
+
+ set_name( new_name );
+ }
+
+ activated = true;
+ }
+} \ No newline at end of file