// PLU Gamble v0.01
// Author: Logicstorm
// Date: 2012-10-30
// Reference: HttpGet.c from http://homepage2.nifty.com/igat/igapyon/diary/2002/ig021126.html
// Please keep the above message if you want to use, copy, modify, publish, distribute, and/or sell copies of the Software.
#include "stdafx.h"
#include <windows.h>
#include <wininet.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h> #define TRYNUM 128
#define STARTCREDIT 1
#define BUFSIZE 400000
int _tmain(int argc, _TCHAR* argv[])
{
HINTERNET hsession = 0;
HINTERNET hconnect = 0;
HINTERNET hrequest = 0;
char szBuf;
DWORD dwSize = 0;
char hdrs[] = "Content-Type: application/x-www-form-urlencoded";
char frmdata[1024];
LPCSTR accept[2]={"*/*", NULL};
int credit, winnum, lostnum, bet, randnum, oldcredit, trynum;
time_t rawtime;
struct tm * timeinfo;
int i,j,k;
credit = 0;
oldcredit = 0;
winnum = 0;
lostnum = 0;
trynum = 0;
while (trynum < TRYNUM) {
hsession = InternetOpen("MyAgent", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (hsession == NULL) {
printf("hsession==NULL");
return -1;
}
hconnect = InternetConnect(hsession, "bet.plu.cn", 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 1);
if (hconnect == NULL) {
printf("hconnect==NULL");
return -1;
}
hrequest = HttpOpenRequest(hconnect, "POST", "/chipmain.php", NULL, NULL, accept, 0, 1);
if (hrequest == NULL) {
printf("hrequest==NULL");
return -1;
}
srand( (unsigned int)time(NULL) );
randnum = rand() % 2;
bet = STARTCREDIT << lostnum;
if (credit > 0) {
if (bet > credit)
bet = credit;
}
time ( &rawtime );
timeinfo = localtime ( &rawtime );
if (randnum == 0)
sprintf(frmdata, "big=%%E5%%A4%%A7&tbig=%d&tsmall=&t4=&t5=&t6=&t7=&t8=&t9=&t10=&t11=&t12=&t13=&t14=&t15=&t16=&t17=&hidd=%04d-%02d-%02d+%02d%%3A%02d%%3A%02d", bet, timeinfo->tm_year+1900, timeinfo->tm_mon+1, timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
else
sprintf(frmdata, "tbig=&small=%%E5%%B0%%8F&tsmall=%d&t4=&t5=&t6=&t7=&t8=&t9=&t10=&t11=&t12=&t13=&t14=&t15=&t16=&t17=&hidd=%04d-%02d-%02d+%02d%%3A%02d%%3A%02d", bet, timeinfo->tm_year+1900, timeinfo->tm_mon+1, timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
printf("%d %4d-%02d-%02d %02d:%02d:%02d | Random=%d; Lost=%d; Win=%d; Bet=%d | Credit=%d\n", trynum, timeinfo->tm_year+1900, timeinfo->tm_mon+1, timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec, randnum, lostnum, winnum, bet, credit);
//printf(" %s\n", frmdata);
if (HttpSendRequest(hrequest, hdrs, (DWORD)strlen(hdrs), frmdata, (DWORD)strlen(frmdata)) == FALSE) {
printf("HttpSendRequest() failed\n");
return -1;
}
szBuf[0] = 0;
dwSize = BUFSIZE;
if (HttpQueryInfo(hrequest, HTTP_QUERY_CONTENT_LENGTH, szBuf, &dwSize, 0)) {
szBuf[dwSize] = 0;
printf(" Length [%s]; ", szBuf);
}
dwSize = BUFSIZE;
if (HttpQueryInfo(hrequest, HTTP_QUERY_STATUS_CODE, szBuf, &dwSize, 0)) {
szBuf[dwSize] = 0;
printf(" Status [%s]; ", szBuf);
}
dwSize = BUFSIZE;
if (HttpQueryInfo(hrequest, HTTP_QUERY_STATUS_TEXT, szBuf, &dwSize, 0)) {
szBuf[dwSize] = 0;
printf(" String status [%s];\n", szBuf);
}
credit = 0;
for (;;) {
dwSize = BUFSIZE;
if (InternetReadFile(hrequest, szBuf, dwSize, &dwSize) == FALSE) {
break;
}
if (dwSize <= 0) {
break;
}
szBuf[dwSize] = 0;
//printf("%s\n", szBuf);
// find patter ":xxx U"
if (credit == 0) {
for (i=0; i<dwSize; i++) {
if (szBuf[i]==' ' && szBuf[i+1]=='U') {
for (j=i-1; j>0; j--) {
if (szBuf[j] == ':') {
for (k=j+1; k<i; k++) {
frmdata[k-j-1] = szBuf[k];
} // for k
frmdata[i-j-1] = 0;
break;
} // if :
} // for j
credit = atoi(frmdata);
//printf(" read credit: %d %d\n", credit, strlen(frmdata));
break;
} // if " U"
} // for i
} // if credit
} // for ;; InternetCloseHandle(hrequest);
InternetCloseHandle(hconnect);
InternetCloseHandle(hsession);
if (credit == 0)
return -1;
if (credit > oldcredit) {
winnum++;
lostnum = 0;
}
else {
winnum = 0;
lostnum++;
}
oldcredit = credit;
trynu***eep(200);
}
return 0;
}
// Author: Logicstorm
// Date: 2012-10-30
// Reference: HttpGet.c from http://homepage2.nifty.com/igat/igapyon/diary/2002/ig021126.html
// Please keep the above message if you want to use, copy, modify, publish, distribute, and/or sell copies of the Software.
#include "stdafx.h"
#include <windows.h>
#include <wininet.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h> #define TRYNUM 128
#define STARTCREDIT 1
#define BUFSIZE 400000
int _tmain(int argc, _TCHAR* argv[])
{
HINTERNET hsession = 0;
HINTERNET hconnect = 0;
HINTERNET hrequest = 0;
char szBuf;
DWORD dwSize = 0;
char hdrs[] = "Content-Type: application/x-www-form-urlencoded";
char frmdata[1024];
LPCSTR accept[2]={"*/*", NULL};
int credit, winnum, lostnum, bet, randnum, oldcredit, trynum;
time_t rawtime;
struct tm * timeinfo;
int i,j,k;
credit = 0;
oldcredit = 0;
winnum = 0;
lostnum = 0;
trynum = 0;
while (trynum < TRYNUM) {
hsession = InternetOpen("MyAgent", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (hsession == NULL) {
printf("hsession==NULL");
return -1;
}
hconnect = InternetConnect(hsession, "bet.plu.cn", 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 1);
if (hconnect == NULL) {
printf("hconnect==NULL");
return -1;
}
hrequest = HttpOpenRequest(hconnect, "POST", "/chipmain.php", NULL, NULL, accept, 0, 1);
if (hrequest == NULL) {
printf("hrequest==NULL");
return -1;
}
srand( (unsigned int)time(NULL) );
randnum = rand() % 2;
bet = STARTCREDIT << lostnum;
if (credit > 0) {
if (bet > credit)
bet = credit;
}
time ( &rawtime );
timeinfo = localtime ( &rawtime );
if (randnum == 0)
sprintf(frmdata, "big=%%E5%%A4%%A7&tbig=%d&tsmall=&t4=&t5=&t6=&t7=&t8=&t9=&t10=&t11=&t12=&t13=&t14=&t15=&t16=&t17=&hidd=%04d-%02d-%02d+%02d%%3A%02d%%3A%02d", bet, timeinfo->tm_year+1900, timeinfo->tm_mon+1, timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
else
sprintf(frmdata, "tbig=&small=%%E5%%B0%%8F&tsmall=%d&t4=&t5=&t6=&t7=&t8=&t9=&t10=&t11=&t12=&t13=&t14=&t15=&t16=&t17=&hidd=%04d-%02d-%02d+%02d%%3A%02d%%3A%02d", bet, timeinfo->tm_year+1900, timeinfo->tm_mon+1, timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
printf("%d %4d-%02d-%02d %02d:%02d:%02d | Random=%d; Lost=%d; Win=%d; Bet=%d | Credit=%d\n", trynum, timeinfo->tm_year+1900, timeinfo->tm_mon+1, timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec, randnum, lostnum, winnum, bet, credit);
//printf(" %s\n", frmdata);
if (HttpSendRequest(hrequest, hdrs, (DWORD)strlen(hdrs), frmdata, (DWORD)strlen(frmdata)) == FALSE) {
printf("HttpSendRequest() failed\n");
return -1;
}
szBuf[0] = 0;
dwSize = BUFSIZE;
if (HttpQueryInfo(hrequest, HTTP_QUERY_CONTENT_LENGTH, szBuf, &dwSize, 0)) {
szBuf[dwSize] = 0;
printf(" Length [%s]; ", szBuf);
}
dwSize = BUFSIZE;
if (HttpQueryInfo(hrequest, HTTP_QUERY_STATUS_CODE, szBuf, &dwSize, 0)) {
szBuf[dwSize] = 0;
printf(" Status [%s]; ", szBuf);
}
dwSize = BUFSIZE;
if (HttpQueryInfo(hrequest, HTTP_QUERY_STATUS_TEXT, szBuf, &dwSize, 0)) {
szBuf[dwSize] = 0;
printf(" String status [%s];\n", szBuf);
}
credit = 0;
for (;;) {
dwSize = BUFSIZE;
if (InternetReadFile(hrequest, szBuf, dwSize, &dwSize) == FALSE) {
break;
}
if (dwSize <= 0) {
break;
}
szBuf[dwSize] = 0;
//printf("%s\n", szBuf);
// find patter ":xxx U"
if (credit == 0) {
for (i=0; i<dwSize; i++) {
if (szBuf[i]==' ' && szBuf[i+1]=='U') {
for (j=i-1; j>0; j--) {
if (szBuf[j] == ':') {
for (k=j+1; k<i; k++) {
frmdata[k-j-1] = szBuf[k];
} // for k
frmdata[i-j-1] = 0;
break;
} // if :
} // for j
credit = atoi(frmdata);
//printf(" read credit: %d %d\n", credit, strlen(frmdata));
break;
} // if " U"
} // for i
} // if credit
} // for ;; InternetCloseHandle(hrequest);
InternetCloseHandle(hconnect);
InternetCloseHandle(hsession);
if (credit == 0)
return -1;
if (credit > oldcredit) {
winnum++;
lostnum = 0;
}
else {
winnum = 0;
lostnum++;
}
oldcredit = credit;
trynu***eep(200);
}
return 0;
}