hacking contest

hacking exploits security forum
hacking
compliance articles
upgrade backup exec
information security consultant

Full Version: Socket Help
agathos
hi my question is whats wrong
btw what i fogot??

CODE

#include "stdafx.h"
#include <stdio.h>
#include <winsock2.h>
#include <windows.h>
#include <process.h>
#include <string.h>
#include <winbase.h>
#pragma comment(lib,"ws2_32")

int main(int argc, char *argv[])
{
struct sockaddr_in addr_in;
struct hostent *host;
int pid;

pid = getpid();

printf("\n======================================\n");
printf("         IRC BOT Win32\n");
printf("======================================\n");

printf("[+] Getting PID %d\n",pid);
printf("[+] Trying connect to %s:%s\n",argv[1],argv[2]);

addr_in.sin_port = htons(atoi(argv[2]));
addr_in.sin_family = AF_INET;
addr_in.sin_addr.S_un.S_addr=inet_addr(argv[1]);

host = gethostbyname( argv[1] );

 if((host = gethostbyname(argv[1]))==0)
{
 perror("[-] Error");
 return 0;
}



   printf("[+] Connect to %s:6667 success.\n", argv[1]);

}


EDIT: here is my complete code
i dont know why it doesnt open the socket
CloudyOne
what language is this?

if its csharp i just made myself a irc client which connects just find so i might be able to help you a bit ;o
agathos
i code this in C++
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.