diff options
| author | Unknown <azeem@live.ru> | 2018-11-26 21:49:09 +0000 |
|---|---|---|
| committer | Unknown <azeem@live.ru> | 2018-11-26 21:49:09 +0000 |
| commit | f0424e31f233776a93d13caa98a4422385aedcd0 (patch) | |
| tree | 45a06a71c40ea8c5ec1b38076729c8d81ebbbd06 /client | |
| parent | 1bb1688f58bee00f37f28c2c747dac2bdca7264e (diff) | |
fuck niggas
Diffstat (limited to 'client')
| -rw-r--r-- | client/client.vcxproj | 9 | ||||
| -rw-r--r-- | client/client_windows.cpp | 73 | ||||
| -rw-r--r-- | client/connect.hpp | 60 | ||||
| -rw-r--r-- | client/strings.hpp | 2 |
4 files changed, 130 insertions, 14 deletions
diff --git a/client/client.vcxproj b/client/client.vcxproj index 209390e..5fd04ba 100644 --- a/client/client.vcxproj +++ b/client/client.vcxproj @@ -31,7 +31,7 @@ <ProjectGuid>{E877E475-A428-4FBC-AF71-378AFB92B706}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>client</RootNamespace>
- <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -46,6 +46,7 @@ <PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
+ <SpectreMitigation>false</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='pHit|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
@@ -66,6 +67,7 @@ <PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
+ <SpectreMitigation>false</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='pHit|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
@@ -150,7 +152,7 @@ <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions> _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
@@ -186,8 +188,9 @@ <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
- <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
+ <LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
diff --git a/client/client_windows.cpp b/client/client_windows.cpp index 76bd776..77fb949 100644 --- a/client/client_windows.cpp +++ b/client/client_windows.cpp @@ -3,15 +3,44 @@ #include <stdlib.h>
#include <string.h>
#include <iostream>
+#include <winternl.h>
#pragma comment( lib, "ws2_32.lib" )
#include "connect.hpp"
+/*
+ 1. Connect
+ 2. Send hello message
+ 3. Receive hello message from server,
+ 4. Enter and send username
+ 5. Enter and send password
+ 6. Send and let server check hardware id.
+ 7. Recieve list of games.
+ 8. Select game and send to server
+ 9. Receive space of dll.
+ 10. Allocate space for dll.
+ 11. Send base address of dll.
+ 12. Server does relocations.
+ 13. Server sends dll
+ 14. Client Manual maps dll
+ 15. Send game module list and possibly PE headers
+ 16. Server sends back needed module base addresses and possibly size.
+ 17. Call DLLMain with correct parameters (Included Base Addresses)
+ 18. In cheat DLLMain set up base addresses and do cheat stuff.
+*/
+
+
+
+
+// note below is just pseudo unprotected code...
+// will make not retarded soon.
int main( ) {
- std::string ip;
- std::cin >> ip;
+ // TEMPORARY, WE NEED TO ENCRYPT IP STRING SO WE DON'T HAVE DDOS NOOBS.
+ std::string ip = "192.168.0.8";
+ // std::cin >> ip;
+ // START.
client::c_connect c( ip.c_str( ) );
if( !c.setup( ) )
return 1;
@@ -19,7 +48,42 @@ int main( ) { if( !c.connect( ) )
return 2;
+ c.send_msg( "hello" );
+
+ auto msg = c.get_string( );
+ if ( msg != xors( "hello" ) ) {
+ std::cout << "connection failed." << std::endl;
+ return 0;
+ }
+
+ std::string username{ }, password{ };
+ std::cout << "Enter your username" << std::endl << "> ";
+ std::cin >> username;
+
+ c.send_msg( username.c_str( ) );
+ msg = c.get_string( );
+ if ( msg != xors( "correct username" ) ) {
+ std::cout << "incorrect username" << std::endl;
+ return 0; // remember to close connection on server when bad values were sent.
+ }
+
+ std::cout << "Enter your password" << std::endl << "> ";
+ std::cin >> password;
+ c.send_msg( password.c_str( ) );
+ if ( c.get_string( ) != xors( "correct password" ) ) {
+ std::cout << "incorrect password";
+ return 0; // remember to close connection on server when bad values were sent.
+ }
+
+
+
+
+
+
+
+
+ /*
const char* yes = "hello server";
char buf[ 255 ];
memcpy( buf, yes, strlen( yes ) );
@@ -39,8 +103,11 @@ int main( ) { printf( "\n" );
c.send_msg( ( uint8_t* )( buf ), strlen( yes ) );
+ */
+
+ // c.~c_connect( );
+
- c.~c_connect( );
system( "pause" );
return 0;
}
diff --git a/client/connect.hpp b/client/connect.hpp index 8b36687..5720d4f 100644 --- a/client/connect.hpp +++ b/client/connect.hpp @@ -80,6 +80,31 @@ namespace client buf[ i ] ^= key; } + std::string get_string( ) { + std::string ret{ }; + char buffer[ BUFFER_SIZE ]; + + + while ( true ) { + int received = recv( m_socket, buffer, BUFFER_SIZE, 0 ); + if ( received < 0 ) + break; + + for ( int i{ }; i < received; ++i ) + ret.push_back( buffer[ i ] ); + + if ( received < BUFFER_SIZE ) + break; + } + + if ( ret.size( ) ) { + decode_buffer( ( uint8_t* )ret.data( ), ret.size( ) ); + ret.erase( ret.begin( ) ); + } + + return ret; + } + std::vector< uint8_t > get_msg( ) { std::vector< uint8_t > ret; char buffer[ BUFFER_SIZE ]; @@ -105,21 +130,42 @@ namespace client } void send_msg( const uint8_t* msg, size_t length ) { - auto new_buffer = ( uint8_t* )( malloc( length + 1 ) ); + auto buffer = std::make_unique< uint8_t[ ] >( length + 1 ); auto key = util::random_number( 0, 255 ) & 0xff; - new_buffer[ 0 ] = key; - memcpy( new_buffer + 1, + buffer[ 0 ] = key; + memcpy( buffer.get( ) + 1, msg, length ); - for( size_t i = 1; i < length + 1; ++i ) { - new_buffer[ i ] ^= key; + for( size_t i = 1; i <= length; ++i ) { + buffer[ i ] ^= key; } - send( m_socket, ( char* )new_buffer, length + 1, 0 ); + int ret = send( m_socket, ( char* )buffer.get( ), length + 1, 0 ); + if ( ret == SOCKET_ERROR ) { + printf( xors( "error sending message error code: %d" ), WSAGetLastError( ) ); + } + } + + void send_msg( const char* msg ) { + auto length = strlen( msg ); + auto buffer = std::make_unique< uint8_t[ ] >( length + 1 ); + auto key = util::random_number( 0, 255 ) & 0xff; - free( new_buffer ); + buffer[ 0 ] = key; + memcpy( buffer.get( ) + 1, + msg, + length ); + + for ( size_t i = 1; i <= length; ++i ) { + buffer[ i ] ^= key; + } + + int ret = send( m_socket, ( char* )buffer.get( ), length + 1, 0 ); + if ( ret == SOCKET_ERROR ) { + printf( xors( "error sending message error code: %d" ), WSAGetLastError( ) ); + } } private: diff --git a/client/strings.hpp b/client/strings.hpp index 382ddb2..b5dba75 100644 --- a/client/strings.hpp +++ b/client/strings.hpp @@ -152,7 +152,7 @@ constexpr size_t strlen_ct( const char* const str ) { return out;
}
-#if 0
+#if TRUE
#define xors_raw( s ) ( strenc::XorString< strenc::strlen_ct( s ), __COUNTER__ >( s, std::make_index_sequence< sizeof( s ) - 1>() ) )
#define xors( s ) ( strenc::XorString< strenc::strlen_ct( s ), __COUNTER__ >( s, std::make_index_sequence< sizeof( s ) - 1>() ).decrypt() )
#else
|
