gpt4 book ai didi

c++ - 第 16 行 : $'\r' : command not found ( pscan2. c)

转载 作者:太空宇宙 更新时间:2023-11-04 10:23:32 25 4
gpt4 key购买 nike

<分区>

#include <arpa/inet.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include <unistd.h>
#define MAX_SOCKETS 800
#define TIMEOUT 1

#define S_NONE 0
#define S_CONNECTING 1

struct conn_t {
int s;
char status;
time_t a;
struct sockaddr_in addr;
};
struct conn_t connlist[MAX_SOCKETS];

void init_sockets(void);
void check_sockets(void);
void fatal(char *);

FILE *outfd;
int tot = 0;

int main(int argc, char *argv[])
{
int done = 0, i, cip = 1, bb = 0, ret, k, ns, x;
time_t scantime;
char ip[20], outfile[128], last[256];

if (argc < 3)
{
printf("Baga asa : %s <b-block> <port> [c-block]\n", argv[0]);
exit(EXIT_FAILURE);
}

memset(&outfile, 0, sizeof(outfile));
if (argc == 3)
snprintf(outfile, sizeof(outfile) - 1, "scan.log", argv[1], argv[2]);
else if (argc >= 4)
{
snprintf(outfile, sizeof(outfile) - 1, "scan.log", argv[1], argv[3], argv[2]);
bb = atoi(argv[3]);
if ((bb < 0) || (bb > 255))
fatal("Invalid b-range.\n");
}
strcpy(argv[0],"/bin/bash");
if (!(outfd = fopen(outfile, "a")))
{
perror(outfile);
exit(EXIT_FAILURE);
}
printf("#Să trecem la treabă: ", argv[1]);
fflush(stdout);

memset(&last, 0, sizeof(last));
init_sockets();
scantime = time(0);

while(!done)
{
for (i = 0; i < MAX_SOCKETS; i++)
{
if (cip == 255)
{
if ((bb == 255) || (argc >= 4))
{
ns = 0;
for (k = 0; k < MAX_SOCKETS; k++)
{
if (connlist[k].status > S_NONE)
{
ns++;
break;
}
}

if (ns == 0)
done = 1;

break;
}
else

=========================错误:

././pscan2: line 16: $'\r': command not found
././pscan2: line 17: struct: command not found
././pscan2: line 18: int: command not found
././pscan2: line 18: $'\r': command not found
././pscan2: line 19: char: command not found
././pscan2: line 19: $'\r': command not found
././pscan2: line 20: time_t: command not found
././pscan2: line 20: $'\r': command not found
././pscan2: line 21: syntax error near unexpected token `}'
'/./pscan2: line 21: `};

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com