From bdb6ac5f940008bcd836e3c5f0a708f4b8f04865 Mon Sep 17 00:00:00 2001 From: boris Date: Sat, 29 Dec 2018 20:59:57 +1300 Subject: protection shit --- .../UserExperience/MoneybotShared/math.hpp | 2 +- .../UserExperience/MoneybotShared/window.cpp | 20 +++++++++++++------- .../csgo-client/UserExperience/UserInterface.hpp | 13 +++++++------ 3 files changed, 21 insertions(+), 14 deletions(-) (limited to 'csgo-loader/csgo-client/UserExperience') diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/math.hpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/math.hpp index bebe7d5..1b26e31 100644 --- a/csgo-loader/csgo-client/UserExperience/MoneybotShared/math.hpp +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/math.hpp @@ -12,7 +12,7 @@ __forceinline float DEG2RAD( float x ) { return( ( float )( x ) * ( float )( M_P namespace { //make a random generator and seed it with a p random number static std::random_device rd; - static std::mt19937 gen( rd( ) ); + static std::mt19937 gen{ rd() }; } NAMESPACE_REGION( math ) diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/window.cpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/window.cpp index a05cba6..fc1892b 100644 --- a/csgo-loader/csgo-client/UserExperience/MoneybotShared/window.cpp +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/window.cpp @@ -2,6 +2,7 @@ #include "window.hpp" #include "d3d.hpp" #include "math.hpp" +#include d3d::c_window g_window; @@ -16,8 +17,12 @@ namespace d3d "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"; + // math::random_number was NOT random + // so fuck you and your use of STL + srand((uint32_t)time(0)); + int i = 0; - for(; i < math::random_number(16, 31); ++i) { + for(; i < ((rand()%31)+16); ++i) { m_window_name[i] = alphanum[rand() % (sizeof(alphanum) - 1)]; } @@ -131,12 +136,13 @@ namespace d3d } if( m_d3d_device ) { - auto device_state = m_d3d_device->TestCooperativeLevel( ); - if( device_state != D3D_OK ) { - g_d3d.on_device_lost( ); - m_d3d_device->Reset( &m_present_params ); - g_d3d.on_device_reset( ); - } + // Caused crashing when UAC prompt appeared. + //auto device_state = m_d3d_device->TestCooperativeLevel( ); + //if( device_state != D3D_OK ) { + // g_d3d.on_device_lost( ); + // m_d3d_device->Reset( &m_present_params ); + // g_d3d.on_device_reset( ); + //} if( m_d3d_device->BeginScene( ) >= 0 ) { diff --git a/csgo-loader/csgo-client/UserExperience/UserInterface.hpp b/csgo-loader/csgo-client/UserExperience/UserInterface.hpp index e905b3b..d4a3dc4 100644 --- a/csgo-loader/csgo-client/UserExperience/UserInterface.hpp +++ b/csgo-loader/csgo-client/UserExperience/UserInterface.hpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace UserExperience { @@ -38,17 +39,17 @@ namespace UserExperience ExecutionState m_ExecutionState = EXECUTION_WAITING; // Holds the username/password combo entered in the UI. - char m_Username[128]; - char m_Password[128]; + char m_Username[128]; + char m_Password[128]; // Does the user have special access? - bool m_SpecialAccess = false; + bool m_SpecialAccess = false; // Holds the selected game. - uint16_t m_SelectedGame = GAME_CSGO; + uint16_t m_SelectedGame = GAME_CSGO; // Holds the current error message. - ErrorReason m_Error = ERROR_GENERIC_ERROR; + ErrorReason m_Error = ERROR_GENERIC_ERROR; }; // User experience handler. @@ -72,4 +73,4 @@ extern UserExperience::UserInterfacePtr UserInterface; // Sick macros, retard. #define ERROR_ASSERT(Error, ...) { char Buffer[1024 * 16]; sprintf_s(Buffer, sizeof Buffer, Error, __VA_ARGS__); MessageBoxA(0, Buffer, "", MB_ICONERROR); ExitProcess(0); } -#define INFO_ASSERT(Error, ...) { char Buffer[1024 * 16]; sprintf_s(Buffer, sizeof Buffer, Error, __VA_ARGS__); MessageBoxA(0, Buffer, "", MB_OK); ExitProcess(0); } +#define INFO_ASSERT(Error, ...) { char Buffer[1024 * 16]; sprintf_s(Buffer, sizeof Buffer, Error, __VA_ARGS__); MessageBoxA(0, Buffer, "", MB_OK); ExitProcess(0); } -- cgit v1.2.3