diff options
| author | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
| commit | 3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch) | |
| tree | 26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /legacy/loader/http.h | |
| parent | e4729e4393d90271a3814c7a79950a660c48325a (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 'legacy/loader/http.h')
| -rw-r--r-- | legacy/loader/http.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/legacy/loader/http.h b/legacy/loader/http.h new file mode 100644 index 0000000..a965dfe --- /dev/null +++ b/legacy/loader/http.h @@ -0,0 +1,70 @@ +#include <WinInet.h>
+#include <Windows.h>
+#include <sstream>
+#include <thread>
+#include <vector>
+#include "strings.hpp"
+
+#pragma comment( lib, "wininet.lib" )
+
+//very innovative PROTECTED !!! loader
+// do NOT LEAK
+
+using namespace std::chrono_literals;
+using ulong_t = unsigned long;
+
+namespace http {
+ class inethandle_t {
+ public:
+ operator HINTERNET( ) { return m_handle; }
+ inethandle_t( HINTERNET handle ) : m_handle( handle ) { };
+ inethandle_t( ) : m_handle( nullptr ) { };
+ ~inethandle_t( ) {
+ InternetCloseHandle( m_handle );
+ }
+
+ private:
+ HINTERNET m_handle;
+ };
+
+ auto send_request( char* uname, ulong_t hwid, int appid ) {
+ std::vector< uint8_t > response{ };
+ inethandle_t intern = InternetOpenA( "none", INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0 );
+ inethandle_t addr = InternetConnectA( intern, xors( "moneybot.cc" ), INTERNET_DEFAULT_HTTPS_PORT, xors( "HakNtBNxed" ), xors( "PYfBKRduQUdl3oR" ), INTERNET_SERVICE_HTTP, 0, 0 );
+ if( !addr ) {
+ MessageBoxA( 0, xors( "error" ), xors( "server error" ), MB_OK );
+ exit( 0 );
+ }
+
+ inethandle_t req = HttpOpenRequestA( addr, xors( "POST" ), xors( "iakSZFzfST/money.php" ), 0, 0, 0, INTERNET_FLAG_SECURE | INTERNET_FLAG_KEEP_CONNECTION, 0 );
+
+ auto headers = xors( "Content-Type: application/json\r\n" );
+ const char* POST_FORMAT = xors( R"(
+{
+ "user": "%s",
+ "hwid": "%08x",
+ "app_id": "%d"
+}
+)" );
+
+ char send_data[ 300 ];
+ sprintf_s( send_data, 300, POST_FORMAT, uname, hwid, appid );
+
+ auto sent = HttpSendRequestA( req, headers, strlen( headers ), ( void* )send_data, strlen( send_data ) );
+ if( sent ) {
+ ulong_t blocksize = 4096;
+ ulong_t size{ };
+ uint8_t* block = ( uint8_t* )malloc( blocksize );
+
+ while( InternetReadFile( req, block, blocksize, &size ) && size ) {
+ for( size_t i{ }; i < std::min< ulong_t >( blocksize, size ); ++i ) {
+ response.push_back( block[ i ] );
+ }
+ }
+
+ free( block );
+ }
+
+ return response;
+ }
+}
\ No newline at end of file |
