Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <cstring>
- #include <cstdio>
- enum {
- HAUKIO = 1,
- HENQ = 6
- };
- int main(int argc, const char * argv[])
- {
- char buf[2048];
- int id = HENQ;
- for (int iter = 0; iter < 1000000; iter++)
- {
- sprintf (buf,"curl 'https://interactive.hs.fi/arkku/public/generated/9223VnJFJQT/aanestys.php' -H 'Cookie: __glmrid=1f3f59ae-9114-4301-b329-3525b682d3e8' -H 'Origin: https://interactive.hs.fi' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.8,fi;q=0.6,sv;q=0.4' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: */*' -H 'Referer: https://interactive.hs.fi/arkku/public/generated/9223VnJFJQT/' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'valinta=%d' --silent --compressed > foobar.txt", id);
- system(buf);
- FILE* f = fopen("foobar.txt", "rt");
- char tmp[1024];
- fgets (tmp,1024, f);
- fclose (f);
- const char* t = strstr(tmp,":6,") + 15;
- int henq = atoi(t);
- id = (henq < 69) ? HENQ : HAUKIO;
- printf ("Iter %d, voting %s\n", iter, (id == HENQ) ? "henq" : "haukio");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement