Evo. G Tech Team Forum
Welcome to Evo. G Tech Team Forum. We have moved to a new website : www.evogtechteam.com

Thanks you.

by Evo. G Tech Team Management.

Join the forum, it's quick and easy

Evo. G Tech Team Forum
Welcome to Evo. G Tech Team Forum. We have moved to a new website : www.evogtechteam.com

Thanks you.

by Evo. G Tech Team Management.
Evo. G Tech Team Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

C++编写的灌水机源代码(不要在本论坛乱用)

Go down

C++编写的灌水机源代码(不要在本论坛乱用) Empty C++编写的灌水机源代码(不要在本论坛乱用)

Post by cyjian December 13th 2014, 09:55

#include
#include
#include

main(int argc,char *argv[]){
  char                 buff[4096];
  SOCKET               sock;
  SOCKADDR_IN          addr;
  WSADATA              wsa;
  WORD                 wVersionRequested;
  struct hostent       *hs;
  int                  count, len;
  char        *url="[You must be registered and logged in to see this link.]";

if (argc!=4) {printf("Error!\n"); return -1; }
len=(strlen(argv[1])+strlen(argv[2])+strlen(argv[3])+49);

  wVersionRequested = MAKEWORD( 2, 0 );
  if (WSAStartup(wVersionRequested , &wsa)!=0){
    printf("Winsock Initialization failed.\n"); return -1;
  }

  if ((sock=socket(AF_INET,SOCK_STREAM,0))==INVALID_SOCKET){
    printf("Can not create socket.\n"); return -1;
  }

  addr.sin_family     = AF_INET;
  addr.sin_port       = ht(80);
  _snprintf(buff, 4096, "POST /cgi-bin/forum.cgi HTTP/1.1\r\n"
                        "Host: %s\r\n"
                        "Content-Type: application/x-www-form-urlencoded\r\n"
                        "Content-Length: %d\r\n"
                        "\r\n"
                        "action=add&Title=%s&URL=http://%s&yuzi=1&Description=%s\r\n",
                        url,
                        len,
                        argv[1],
                        argv[2],
                        argv[3]);
  if ((addr.sin_addr.s_addr=inet_addr(url))==-1){
    if ((hs=gethostbyname(url))==NULL){
      printf("Can not resolve specified host.\n"); return -1;
    }

    addr.sin_family = hs->h_addrtype;
    memcpy((void *)&addr.sin_addr.s_addr,hs->h_addr,hs->h_length);
  }

  if (connect(sock,(LPSOCKADDR)&addr,sizeof(addr))==SOCKET_ERROR){
    printf("Can not connect to specified host.\n"); return -1;
  }

    send(sock,buff,strlen(buff),0);
    recv(sock,buff,sizeof(buff),0);
    closesocket(sock);
  }
  return 0;
}

cyjian
Spammer
Spammer

Posts : 211
Points : 72975
Reputation : 0
Join date : 2014-06-18

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum