diff options
| author | navewindre <boneyaard@gmail.com> | 2018-09-02 00:10:54 +0200 |
|---|---|---|
| committer | navewindre <boneyaard@gmail.com> | 2018-09-02 00:10:54 +0200 |
| commit | a2712607137b820e4f4a875636b04e32b59a53c9 (patch) | |
| tree | 18eb47286b33baf93629f6a8f939bde5f01e85f5 | |
| parent | 25ecefe33613fb1d12e005efa73f92dc16090624 (diff) | |
a
| -rw-r--r-- | internal_rewrite/directx.cpp | 6 | ||||
| -rw-r--r-- | internal_rewrite/simple_settings.hpp | 37 | ||||
| -rw-r--r-- | internal_rewrite/ui.h | 10 |
3 files changed, 49 insertions, 4 deletions
diff --git a/internal_rewrite/directx.cpp b/internal_rewrite/directx.cpp index be708b9..fa40fb3 100644 --- a/internal_rewrite/directx.cpp +++ b/internal_rewrite/directx.cpp @@ -193,6 +193,7 @@ long __stdcall hooks::d3d::present( IDirect3DDevice9* device, RECT* source, RECT static std::string date;
std::string str;
+#ifdef _DEBUG
static bool transformed = false;
if( !transformed ) {
date += __DATE__;
@@ -201,6 +202,7 @@ long __stdcall hooks::d3d::present( IDirect3DDevice9* device, RECT* source, RECT transformed = true;
}
+#endif
str = xors( "moneybot | " );
auto nci = g_csgo.m_engine( )->GetNetChannelInfo( );
@@ -213,7 +215,11 @@ long __stdcall hooks::d3d::present( IDirect3DDevice9* device, RECT* source, RECT str += xors( "unconnected | " );
}
+#ifdef _DEBUG
str += date;
+#else
+ str += g_header.username;
+#endif
g_d3d.draw_text< ALIGN_RIGHT >( ::d3d::fonts.f_menu,
ui::ui_get_text_col( ), g_d3d.m_width - 10, 8,
diff --git a/internal_rewrite/simple_settings.hpp b/internal_rewrite/simple_settings.hpp index 31701cd..74b4d43 100644 --- a/internal_rewrite/simple_settings.hpp +++ b/internal_rewrite/simple_settings.hpp @@ -3,10 +3,13 @@ #include <memory> #include <vector> #include <string> +#include <Shlwapi.h> #include "util.hpp" #include "fnv.hpp" +#pragma comment( lib, "Shlwapi.lib" ) + //nama stuff extern void simple_save( const char* path, const char* name, const void* src, size_t size, const char* filename ); extern void simple_load( const char* path, const char* name, void* dest, size_t size, const char* filename ); @@ -91,10 +94,24 @@ public: }; __declspec( noinline ) void load( const char* path, const char* file ) override { + static char str[ MAX_PATH ]; + + GetModuleFileNameA( nullptr, str, MAX_PATH - 1 ); + PathRemoveFileSpecA( str ); + strcat_s< MAX_PATH >( str, path ); + strcat_s< MAX_PATH >( str, "\\" ); + GetPrivateProfileStringA( path, std::to_string( m_name ).c_str( ), "", m_value, L, file ); } __declspec( noinline ) void save( const char* path, const char* file ) const override { + static char str[ MAX_PATH ]; + + GetModuleFileNameA( nullptr, str, MAX_PATH - 1 ); + PathRemoveFileSpecA( str ); + strcat_s< MAX_PATH >( str, path ); + strcat_s< MAX_PATH >( str, "\\" ); + WritePrivateProfileStringA( path, std::to_string( m_name ).c_str( ), m_value, file ); } @@ -124,9 +141,25 @@ public: holder_ptr->register_( this ); } - __declspec( noinline ) void load( const char* path, const char* file ) override { simple_load( path, std::to_string( name_ ).c_str( ), &value_, sizeof( value_ ), file ); } + __declspec( noinline ) void load( const char* path, const char* file ) override { + static char str[ MAX_PATH ]; + + GetModuleFileNameA( nullptr, str, MAX_PATH - 1 ); + PathRemoveFileSpecA( str ); + strcat_s< MAX_PATH >( str, "\\" ); + + simple_load( str, std::to_string( name_ ).c_str( ), &value_, sizeof( value_ ), file ); + } + + __declspec( noinline ) void save( const char* path, const char* file ) const override { + static char str[ MAX_PATH ]; - __declspec( noinline ) void save( const char* path, const char* file ) const override { simple_save( path, std::to_string( name_ ).c_str( ), &value_, sizeof( value_ ), file ); } + GetModuleFileNameA( nullptr, str, MAX_PATH - 1 ); + PathRemoveFileSpecA( str ); + strcat_s< MAX_PATH >( str, "\\" ); + + simple_save( str, std::to_string( name_ ).c_str( ), &value_, sizeof( value_ ), file ); + } __forceinline operator T&( ) { return value_; } __forceinline T* operator &( ) { return &value_; } diff --git a/internal_rewrite/ui.h b/internal_rewrite/ui.h index 4d1ec8e..3dfb551 100644 --- a/internal_rewrite/ui.h +++ b/internal_rewrite/ui.h @@ -17,13 +17,15 @@ #include "settings.hpp"
#include "base_cheat.hpp"
+#include "modules.hpp"
+
namespace ui
{
int current_category = 0;
static std::string date_str = __DATE__;
auto menu = std::make_shared< ui::c_menu >( 10, 10, 580, 470, xors( "quebot" ),
- __DATE__ );
+ "" );
static void render( ) {
static bool was_setup = false;
@@ -35,8 +37,12 @@ namespace ui menu.reset( );
#ifndef _DEBUG
+ date_str = g_header.username;
+
+
menu = std::make_shared< ui::c_menu >( 10, 10, 580, 470, xors( "hit p hook" ),
- date_str.c_str( ) );
+ //don't ask
+ date_str.c_str( ) );
#else
menu = std::make_shared< ui::c_menu >( 10, 10, 580, 470, xors( "moneybot (cooler edition)" ),
date_str.c_str( ) );
|
