1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
void postInfo(HWND window)
{
char usertmp[65], hwidtmp[65], postfinal[130];
/* Add user to postfinal */
strcpy(postfinal, "user=");
GetWindowTextA(window, usertmp, sizeof(usertmp));
if (strcmp(usertmp, "") == 0 || strstr(usertmp, " "))
{
infoBox("Invalid entry!");
return;
}
strcat(postfinal, usertmp);
strcat(postfinal, "&");
/* Add HWID to postfinal */
char szFileSys[255],
szVolNameBuff[255];
DWORD dwSerial;
DWORD dwMFL;
DWORD dwSysFlags;
int error = 0;
GetVolumeInformationA("C:\\", szVolNameBuff,
255, &dwSerial,
&dwMFL, &dwSysFlags,
szFileSys,
255);
snprintf(hwidtmp, sizeof(hwidtmp), "%lu", dwSerial);
strcat(postfinal, "hwid=");
strcat(postfinal, hwidtmp);
strcat(postfinal, "\0");
/* postfinal is now the string to set to post for cUrl */
CURL *cUrl;
CURLcode cCode;
curl_global_init(CURL_GLOBAL_ALL);
if (cUrl)
{
curl_easy_setopt(cUrl, CURLOPT_URL, "http://jimmyonhentai.x10host.com/script.php");
curl_easy_setopt(cUrl, CURLOPT_POSTFIELDS, postfinal);
curl_easy_setopt(cUrl, CURLOPT_WRITEFUNCTION, append_to_string); // set the write callback function
curl_easy_setopt(cUrl, CURLOPT_WRITEDATA, ptr_string); // to which this pointer is to be passed as the last argument
cCode = curl_easy_perform(cUrl);
if (cCode != CURLE_OK)
printf("Whoops! Failed to perform! %s\n", curl_easy_strerror(cCode));
curl_easy_cleanup(cUrl);
}
curl_global_cleanup();
if (strcmp(recd_string.c_str(), "Accepted"))
{
infoBox("correct");
}
else
{
errBox("Failed");
}
return;
}
|